Skip to content

feat(workspace-details): add Change Editor to workspace Overview tab - #1663

Open
olexii4 wants to merge 10 commits into
mainfrom
che-23935
Open

feat(workspace-details): add Change Editor to workspace Overview tab#1663
olexii4 wants to merge 10 commits into
mainfrom
che-23935

Conversation

@olexii4

@olexii4 olexii4 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds a Change Editor form group to the Workspace Details → Overview tab, following the same UX pattern as "Change AI Tools".

When a workspace is stopped, a pencil button opens a modal with radio buttons listing all available editors (grouped by display name). Each editor group with multiple versions shows an inline version picker (EllipsisV dropdown), matching the existing EditorSelector gallery in Create Workspace. On confirm, the dashboard:

  1. Creates a new DevWorkspaceTemplate for the selected editor (reusing DevWorkspaceClient.createDevWorkspaceTemplate, which sets ownerReferences and injects cluster env vars).
  2. Patches the workspace — updates che.eclipse.org/che-editor, the devfile-source factory params, and spec.contributions[0].kubernetes.name in one atomic PATCH.
  3. Deletes the old DevWorkspaceTemplate (the backend DELETE route already existed; a deleteTemplate frontend wrapper is added to devWorkspaceTemplateApi.ts).

The button is disabled when the workspace is not STOPPED or FAILED, using the same isReadonly guard already in place for Name, Storage Type, and AI Tool.

Screenshot/screencast of this PR

Знімок екрана 2026-09-04 о 18 24 45 Знімок екрана 2026-09-04 о 18 24 32

What issues does this PR fix or reference?

fixes eclipse-che/che#23935

Is it tested? How?

  1. Deploy Eclipse Che with the dashboard image from this PR.
  2. Create a workspace (any sample, any editor).
  3. Stop the workspace, then navigate to Workspace Details → Overview.
  4. Verify the Editor row shows the current editor name and version with a pencil icon.
  5. Click the pencil — the Change Editor modal opens with radio buttons for each available editor and an EllipsisV version picker for editors with multiple versions.
  6. Select a different editor, optionally pick a non-default version, and click Save.
  7. Verify the Overview tab updates to show the new editor.
  8. Start the workspace — confirm it opens in the newly selected editor.

Without this PR: no way to change the editor on an existing stopped workspace without recreating it.

Release Notes

Added "Change Editor" option to the workspace Overview tab, allowing users to switch the IDE of a stopped workspace without recreating it.

Docs PR

N/A

@openshift-ci

openshift-ci Bot commented Sep 3, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: olexii4

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@che-bot

che-bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Click here to review and test in web IDE: Contribute

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1663 (linux/amd64, linux/arm64, linux/s390x)

kubectl patch command
kubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1663", name: che-dashboard}]}}]"

@codecov

codecov Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.54839% with 34 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.46%. Comparing base (c38b9fc) to head (a320a72).

Files with missing lines Patch % Lines
...kspaceDetails/OverviewTab/Editor/SelectorModal.tsx 96.08% 9 Missing ⚠️
...services/backend-client/devWorkspaceTemplateApi.ts 18.18% 9 Missing ⚠️
...es/actions/actionCreators/changeWorkspaceEditor.ts 93.70% 9 Missing ⚠️
.../dashboard-frontend/src/services/helpers/editor.ts 90.47% 3 Missing and 1 partial ⚠️
...ages/WorkspaceDetails/OverviewTab/Editor/index.tsx 96.96% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main    #1663    +/-   ##
========================================
  Coverage   92.45%   92.46%            
========================================
  Files         609      612     +3     
  Lines       63850    64377   +527     
  Branches     5011     5058    +47     
========================================
+ Hits        59031    59524   +493     
- Misses       4754     4786    +32     
- Partials       65       67     +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1663 (linux/amd64, linux/arm64, linux/s390x)

kubectl patch command
kubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1663", name: che-dashboard}]}}]"

2 similar comments
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1663 (linux/amd64, linux/arm64, linux/s390x)

kubectl patch command
kubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1663", name: che-dashboard}]}}]"

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1663 (linux/amd64, linux/arm64, linux/s390x)

kubectl patch command
kubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1663", name: che-dashboard}]}}]"

Creates new DevWorkspaceTemplate, patches workspace annotations and
spec.contributions, then deletes the old template. Reuses
createDevWorkspaceTemplate and patchWorkspace from existing code.

Assisted-by: Claude Sonnet 4.6
Signed-off-by: Oleksii Orel <oorel@redhat.com>
Assisted-by: Claude Haiku 4.5
Signed-off-by: Oleksii Orel <oorel@redhat.com>
Assisted-by: Claude Sonnet 4.6
Signed-off-by: Oleksii Orel <oorel@redhat.com>
Assisted-by: Claude Sonnet 4.6
Signed-off-by: Oleksii Orel <oorel@redhat.com>
Assisted-by: Claude Sonnet 4.6
Signed-off-by: Oleksii Orel <oorel@redhat.com>
The DELETE /namespace/:ns/devworkspacetemplates/:name route was wrapped
in isLocalRun(), making it unavailable in production deployments. The
changeWorkspaceEditor action creator calls deleteTemplate() after
switching the editor, so the orphaned old template was never cleaned up
on a real cluster.

Assisted-by: Claude Sonnet 4.6
Signed-off-by: Oleksii Orel <oorel@redhat.com>
- Overview tab: remove version from editor label; hide pencil button
  (not just disable) when workspace is not stopped/failed; add tooltip
  icon (Popover + FormGroupLabelHelp) matching AI Tool row alignment
- Change Editor modal: fixed header (title + filter) does not scroll
  with the list; filter now searches display name, all versions, and
  all descriptions; filter placeholder shortened to "Filter by"; filter
  input capped at max-width 30%; version labels shown on all rows, not
  just the selected one; checkbox style (type=checkbox) instead of
  radio; versionLabel style matches AI Tool (height, margin-left,
  no min-width); custom editor shown as informational item when current
  editor ID is unknown to the registry
- After confirming an editor change, show "Workspace has been updated"
  success alert or a danger alert with the error message, matching the
  AI Tool behaviour (uses AppAlerts via lazyInject)

Assisted-by: Claude Sonnet 4.6
Signed-off-by: Oleksii Orel <oorel@redhat.com>
Assisted-by: Claude Sonnet 4.6
Signed-off-by: Oleksii Orel <oorel@redhat.com>
Assisted-by: Claude Sonnet 4.6
Signed-off-by: Oleksii Orel <oorel@redhat.com>
- devWorkspaceTemplateApi: add deleteTemplate success + error tests
- changeWorkspaceEditor: add error-path and same-name-skip tests
- editor helpers: add displayName/name fallback tests
- SelectorModal: add filter-reset-on-close test
- EditorFormGroup: add architecture-filter test

Assisted-by: Claude Sonnet 4.6
Signed-off-by: Oleksii Orel <oorel@redhat.com>
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1663 (linux/amd64, linux/arm64, linux/s390x)

kubectl patch command
kubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1663", name: che-dashboard}]}}]"

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1663 (linux/amd64, linux/arm64, linux/s390x)

kubectl patch command
kubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1663", name: che-dashboard}]}}]"

@openshift-ci

openshift-ci Bot commented Sep 4, 2026

Copy link
Copy Markdown

@olexii4: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/v19-dashboard-happy-path 2b372ae link true /test v19-dashboard-happy-path

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Dashboard] Ide Switch

2 participants