Skip to content

fix: restore toolbar default items #15878

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 26, 2025

Conversation

ndoschek
Copy link
Contributor

@ndoschek ndoschek commented Jun 24, 2025

What it does

  • properly restore the toolbar items in the storage provider from the default factory and ensure to write to the config file
  • ensure the defaults are restored on startup in case there is no config file yet
  • in case the config file was corrupted, allow the user to restore the default toolbar items via an action in the error message popup
  • chore: remove unused injections in ToolbarCommandContribution

Fixes #15231

How to test

  • Use the "Restore Toolbar Defaults" command from the toolbar context menu and verify that:
    • The toolbar resets to the correct default items.
    • The toolbar.json config file reflects the default configuration (open via "Customize Toolbar (Open JSON)" command in the context menu
  • Customize the toolbar by adding/removing items via the context menu and directly via the toolbar.json config file
  • Save a corrupted toolbar config (like an empty file) and verify the correct error message is shown and allows to directly trigger the "Restore Toolbar Defaults" command
  • Edit: If there is no or an empty config file on startup, the defaults should be restored automatically without the user error prompt

Follow-ups

x

Breaking changes

  • This PR introduces breaking changes and requires careful review. If yes, the breaking changes section in the changelog has been updated.

Attribution

Review checklist

Reminder for reviewers

Copy link
Contributor

@sgraband sgraband left a comment

Choose a reason for hiding this comment

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

Thank you for this contribution! LGTM and works great! 👍

Especially nice that you now get notified, when the config does not work!

@github-project-automation github-project-automation bot moved this from Waiting on reviewers to Needs merge in PR Backlog Jun 25, 2025
- properly restore the toolbar items in the storage provider from the default factory and ensure to write to the config file
- ensure the defaults are restored on startup in case there is no config file yet
- in case the config file was corrupted, allow the user to restore the default toolbar items via an action in the error message popup
- chore: remove unused injections in ToolbarCommandContribution

Fixes eclipse-theia#15231
@ndoschek ndoschek requested a review from sgraband June 25, 2025 14:49
@sgraband sgraband merged commit 83036ad into eclipse-theia:master Jun 26, 2025
17 of 18 checks passed
@github-project-automation github-project-automation bot moved this from Needs merge to Done in PR Backlog Jun 26, 2025
@github-actions github-actions bot added this to the 1.63.0 milestone Jun 26, 2025
@ndoschek ndoschek deleted the issues/15231 branch June 26, 2025 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Adding/Removing Command to Toolbar does not work
2 participants