fix(shell): propagate immediate barConfig upon plugin settings update - #11888
Open
szaidi-code wants to merge 1 commit into
Open
szaidi-code wants to merge 1 commit into
szaidi-code wants to merge 1 commit into
Conversation
Fixes omacom#11852 When a plugin updates its own settings with updateEntryInline(), persistShellConfig() assigns shellConfig and immediately emits onShellConfigChanged -> pluginsChanged() -> syncPluginApis(). Because QML change handlers run before dependent property bindings re-evaluate, publicBarConfig() was reading the stale barConfig property binding from before the write, leaving the plugin with stale settings indefinitely. 1. Evaluate publicBarConfig() and barConfigFor() directly from the current shellConfig rather than the delayed barConfig binding. 2. In onBarConfigChanged, trigger shell.syncPluginApis() to guarantee all injected plugin APIs stay synchronized whenever barConfig updates. 3. In updateEntryInline(), allow unlisted top-level plugins to persist cleanly into shellConfig.plugins, and document that returning false indicates a no-op (identical settings already present). 4. Add test/shell.d/plugin-settings-sync-test.sh covering structural checks and immediate settings synchronization.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a shell plugin updates its inline settings via
updateEntryInline(),persistShellConfig()writes the updated configuration toshellConfig. BecauseonShellConfigChangedfires immediately and synchronously prior to dependent property bindings (such asbarConfig) re-evaluating,publicBarConfig()andbarConfigFor()were returning stale configuration data from before the update. Consequently, plugins attempting to inspect or react to their updated settings received outdated state until an unrelated config change forced a re-render.Additionally:
onBarConfigChangedupdated internal bar state but failed to invokeshell.syncPluginApis().updateEntryInline()were dropped if they had not yet been registered inshellConfig.plugins.Fixes #11852
Solution
publicBarConfig()andbarConfigFor()to resolve directly fromshellConfig.bar(falling back tobuiltinShellConfig.bar), mirroring the direct property evaluation used elsewhere inshellRoot.onBarConfigChangedtoshell.syncPluginApis()so all loaded plugins immediately receive updated configuration state whenever the bar configuration shifts.updateEntryInline()to append tocopy.pluginswhen absent from the layout, and clearly documented the boolean return contract.test/shell.d/plugin-settings-sync-test.shvalidating structural AST hooks, immediate synchronized reads afterupdateEntryInline(), and no-op return semantics.Verification
./test/shell.d/plugin-settings-sync-test.sh(8/8 pass)../test/shell.d/bar-test.sh(80+/80+ pass)../test/shell.d/plugins-test.sh(all pass)../test/cli(100% pass).