Skip to content
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

fix: retain dock order when lifecycle conditions are triggered #676

Merged
merged 1 commit into from
Jan 31, 2024

Conversation

camc314
Copy link
Contributor

@camc314 camc314 commented Jan 29, 2024

Let me know if you can think of a better way todo this.

But... when you launch a platform. Reorder the dock entries then toggle the scheme (e.g. light -> dark) this causes the dock to be "refreshed":

themeChangedSubscriptionId = subscribeLifecycleEvent("theme-changed", async () => refreshDock());

which uses dockProviderOptions here:

const entries = Array.isArray(dockProviderOptions.entries) ? [...dockProviderOptions.entries] : [];

this is not updated when the dock is reordered (it's only set when the dock is initially registered)

Hence, when we call updateDockProviderConfig, the order is then incorrect.

This PR fixes this behavious, by when saveConfig is called, it updates the dockProviderOptions.entries variable to reflect the new order.

@camc314 camc314 requested a review from johnman January 29, 2024 11:26
@camc314
Copy link
Contributor Author

camc314 commented Jan 30, 2024

tested cases:
Test case A:

  1. launch platform, register dock
  2. change layout of dock
  3. close platform and relaunch
  4. assets that the current dock layout is the same as before the platform is closed

^^ works as expected

@camc314 camc314 changed the base branch from workspace/vnext to workspace/v17.0.0 January 30, 2024 11:11
@camc314 camc314 force-pushed the dev/cam/dock-order-lifecycle branch from 6f4acc3 to 9da1398 Compare January 30, 2024 11:12
@camc314 camc314 force-pushed the dev/cam/dock-order-lifecycle branch from 9da1398 to 2973f7d Compare January 30, 2024 11:15
@camc314 camc314 merged commit 2462a93 into workspace/v17.0.0 Jan 31, 2024
5 checks passed
@camc314 camc314 deleted the dev/cam/dock-order-lifecycle branch January 31, 2024 13:20
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.

2 participants