Persist DM screen splitter sizes across reloads#339
Open
HarmlessHarm wants to merge 2 commits into
Open
Conversation
Sizes for the campaign DM screen's wide-layout splitters (left/mid/right columns and the two inner vertical splits) are now saved to localStorage on drag release and restored on reload, preserving DMs' preferred layout between sessions. Stored as percentages so they remain layout-relative across screen resolutions. Async hk-pane is overridden with a sync local registration in this view so all Splitpanes children mount synchronously, avoiding splitpanes' equalize-on-add cascade that would otherwise overwrite the saved sizes with redistributed defaults.
|
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.



Summary
localStorageon drag release and restore them on reload, preserving DMs' preferred layout between sessions.hk-paneregistration with a sync local import inRunCampaign.vueso allSplitpaneschildren mount synchronously — async children caused splitpanes' equalize-on-add cascade to overwrite saved sizes with redistributed defaults on every reload.resizedevents that don't originate from a real user drag (defends against thecampaign.privatetoggle adding/removing the Share pane and triggering a runtime equalize).Test plan
lg; drag each of the 5 splitters, reload, confirm sizes are restoredleft-topdoesn't get overwritten with an equalized valuelocalStorage["dm-screen-panes-v1"]to invalid JSON / out-of-range value / unknown key; reload and confirm graceful fallback to defaultslegacy_campaign_layoutenabled both still render with their existing hardcoded sizes and write nothing to storage