Skip to content

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

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

olexii4 wants to merge 16 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 https://redhat.atlassian.net/browse/CRW-10647

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

eclipse-che/che-docs#3192

@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}]}}]"

3 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}]}}]"

@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}]}}]"

@olexii4

olexii4 commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

/retest

- Use findIndex to locate the editor contribution by name instead of
  hard-coding index 0; fixes incorrect patch when other contributions
  (e.g. AI tool) precede the editor entry
- Wrap old-template deletion in its own try/catch so a stale-resource
  error does not surface as a failed editor change after the workspace
  is already patched
- Guard devfile-source regex replacement — only run it when the
  annotation actually contains che-editor=, leaving unrelated sources
  unchanged
- Replace Checkbox with Radio in EditorSelectorModal so screen readers
  correctly announce single-selection semantics

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

github-actions Bot commented Sep 7, 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}]}}]"

@olexii4
olexii4 requested a review from svor September 7, 2026 14:09
@eclipse-che eclipse-che deleted a comment from codecov Bot Sep 7, 2026
@olexii4

olexii4 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

/retest

@codecov

codecov Bot commented Sep 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.59659% with 31 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.47%. Comparing base (e9aa836) to head (c96a05d).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
.../dashboard-frontend/src/services/helpers/editor.ts 83.75% 13 Missing ⚠️
...es/actions/actionCreators/changeWorkspaceEditor.ts 93.67% 9 Missing and 1 partial ⚠️
...kspaceDetails/OverviewTab/Editor/SelectorModal.tsx 98.00% 6 Missing ⚠️
...ages/WorkspaceDetails/OverviewTab/Editor/index.tsx 98.50% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1663      +/-   ##
==========================================
+ Coverage   92.45%   92.47%   +0.02%     
==========================================
  Files         609      612       +3     
  Lines       63850    64556     +706     
  Branches     5011     5107      +96     
==========================================
+ Hits        59031    59698     +667     
- Misses       4754     4791      +37     
- 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.

@batleforc

batleforc commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

@olexii4 I did just deploy it and had some problems:

  • i was on vscode latest but when i chose another ide it set the vscode to insider

And that's the bug I had for the past 20 min of test (except for chemuxer that refuse to boot but that's another subject)

When switching editor groups the modal always reset the version to
group.versions[0].version. If the first version in the list did not
match the current editor's version (e.g. insiders before latest), going
back to the original editor showed the wrong version.

Replace selectedVersion: string with versionsByGroup: Record<string, string>
so each group independently tracks its selected version for the duration
of the modal session. State is reset on modal open so a previous session's
choices never persist across Cancel/reopen.

Adds three regression tests covering the reported scenario.

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

github-actions Bot commented Sep 7, 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}]}}]"

@olexii4

olexii4 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

@batleforc thanks for catching this.

Fixed in efa10707: replaced the single selectedVersion field with a versionsByGroup map (Record<string, string>) so each editor group independently remembers its version within the modal session.

Could you test it after the changes?

@batleforc

Copy link
Copy Markdown
Contributor

@olexii4 Looks good to me. The IDE Switch works perfectly for me.

@svor svor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Screen.Recording.2026-09-09.at.17.28.01.mov

@openshift-ci openshift-ci Bot added the lgtm label Sep 9, 2026

@ibuziuk ibuziuk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job 👍

@openshift-ci

openshift-ci Bot commented Sep 10, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ibuziuk, olexii4, svor

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

@svor
svor requested a review from dmytro-ndp September 10, 2026 11:21
@dmytro-ndp

dmytro-ndp commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

@olexii4: hello,
thanks for the great UX improvement!

I have a suggesting about how to slightly improve selection of editor in the Change Editor dialog.

IMHO it's not so convenient to locate editor by scrolling the page:
image

It would be more convenient for usage if we could get rid of vertical scroll bar, which should be possible to do by increasing the dialog window height and removal the second line with editor description from the list, like JetBrains CLion for Eclipse Che - latest, and decrease line margins:
image

Also, the latest and next labels to the right of the editor name color scheme looks a little bit odd in the Dark theme, IMHO.

Another possible improvement is displaying the list of editors in the same order as on the Editor Selector section in Create Workspace page:
image

It would be appreciated if you could take a look.

Move editor description from inline text to hover tooltip, sort
editors the same way as the Create Workspace editor gallery (che-code
first, versions by priority, deprecated last), and adopt the shared
TagLabel component for version/tag badges.

Assisted-by: Claude Opus 4.6
Signed-off-by: Oleksii Orel <oorel@redhat.com>
@openshift-ci openshift-ci Bot removed the lgtm label Sep 15, 2026
@openshift-ci

openshift-ci Bot commented Sep 15, 2026

Copy link
Copy Markdown

New changes are detected. LGTM label has been removed.

@github-actions

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}]}}]"

Remove dotted underline from editor names, collapse margins between
editor list items, and increase list max-height from 18rem to 20rem.

Assisted-by: Claude Opus 4.6
Signed-off-by: Oleksii Orel <oorel@redhat.com>
@olexii4

olexii4 commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

@olexii4: hello, thanks for the great UX improvement!

I have a suggesting about how to slightly improve selection of editor in the Change Editor dialog.
...

@dmytro-ndp I have fixed:
Знімок екрана 2026-09-15 о 17 42 17

The PatternFly Content h6 elements added large block margins that
could not be overridden by a CSS module selector. Removing the
wrapper eliminates the spacing issue.

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

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}]}}]"

1 similar comment
@github-actions

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}]}}]"

@svor

svor commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

/retest

@olexii4
olexii4 marked this pull request as draft September 16, 2026 13:01
@olexii4
olexii4 marked this pull request as ready for review September 16, 2026 13:01
@dmytro-ndp

Copy link
Copy Markdown
Contributor

@olexii4 : thank you for handling PR review feedback.

While the Change Editor dialog looks more concise after your changes, there is still room for improvement: rewrite or get rid of editor line hints with the Editor description, which overlap the lines above significantly::

Screenshot From 2026-09-16 19-59-34 Screenshot From 2026-09-16 20-00-18

I have also successfully tested switching between the web IDE and VS Code SSH IDEs, as mentioned as a common case in the fixed issue https://redhat.atlassian.net/browse/CRW-10647.

At the same time, there was an issue where if you leave the Visual Studio Code (desktop) (SSH) landing page after workspace startup, the User Dashboard redirects to this opened page regardless of whether the workspace editor was changed to VS Code Editor later:
Screencast From 2026-09-16 20-32-32.webm

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

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}]}}]"

@olexii4

olexii4 commented Sep 21, 2026

Copy link
Copy Markdown
Contributor Author

@dmytro-ndp I have fixed it. Could you recheck it?

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.

6 participants