Skip to content

Persist DM screen splitter sizes across reloads#339

Open
HarmlessHarm wants to merge 2 commits into
developfrom
feature/persist-dm-panel-sizes
Open

Persist DM screen splitter sizes across reloads#339
HarmlessHarm wants to merge 2 commits into
developfrom
feature/persist-dm-panel-sizes

Conversation

@HarmlessHarm

Copy link
Copy Markdown
Collaborator

Summary

  • Save the campaign DM screen's wide-layout splitter sizes (outer left/mid/right + the two inner vertical splits) to localStorage on drag release and restore them on reload, preserving DMs' preferred layout between sessions.
  • Sizes are stored as percentages so they remain layout-relative across screen resolutions.
  • Override the async hk-pane registration with a sync local import in RunCampaign.vue so all Splitpanes children mount synchronously — async children caused splitpanes' equalize-on-add cascade to overwrite saved sizes with redistributed defaults on every reload.
  • Drag-flag guard skips saves on resized events that don't originate from a real user drag (defends against the campaign.private toggle adding/removing the Share pane and triggering a runtime equalize).

Test plan

  • Open a campaign at viewport width >= lg; drag each of the 5 splitters, reload, confirm sizes are restored
  • Resize browser window to a different width and reload; confirm proportions (not pixels) are preserved
  • Toggle the campaign's privacy while on the DM screen; confirm left-top doesn't get overwritten with an equalized value
  • In DevTools, set localStorage["dm-screen-panes-v1"] to invalid JSON / out-of-range value / unknown key; reload and confirm graceful fallback to defaults
  • Confirm mobile (narrow viewport) and legacy_campaign_layout enabled both still render with their existing hardcoded sizes and write nothing to storage

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.
@sonarqubecloud

Copy link
Copy Markdown

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.

1 participant