Skip to content

Persist DM screen splitter sizes across reloads#339

Merged
HarmlessHarm merged 2 commits into
developfrom
feature/persist-dm-panel-sizes
Jun 26, 2026
Merged

Persist DM screen splitter sizes across reloads#339
HarmlessHarm merged 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.
@HarmlessHarm HarmlessHarm added the improvement Improvement to existing feature label Jun 26, 2026
@HarmlessHarm HarmlessHarm merged commit 8a94cc7 into develop Jun 26, 2026
5 checks passed
@sonarqubecloud

Copy link
Copy Markdown

HarmlessHarm pushed a commit that referenced this pull request Jul 7, 2026
Brings in NPC groups, campaign view refactor (#341), DM screen splitter
persistence (#339), Set Initiative NPC button (#344), and monster filter
changes (#345), re-expressed in Vue 3 syntax where main's code still
used Vue 2 patterns:

- slot="x" attributes -> v-slot templates (NpcGroupManager, BasicInfo,
  Npcs, Entities dialogs)
- $set/$delete/Vue.set/Vue.delete -> direct assignment (npcGroups and
  npcs store modules, hk-filter, Entities, BasicInfo)
- vue-snotify -> Quasar notify utils (NpcGroupManager, Entities, Npcs)
- vee-validate v3 slot props -> v4 errorMessage API (BasicInfo)
- QTable :data -> :rows; () => import() -> defineAsyncComponent
- process.browser -> typeof window guard in browserDetect (app failed
  to boot server- and client-side otherwise)
- adopted main's boot/prototypes.js (server-enabled for SSR)

Additionally fixes a latent Quasar v2 event-contract gap the merge
review surfaced: 101 @input handlers and 43 :value bindings on Quasar
form components renamed to @update:model-value / :model-value (Quasar
v2 components no longer emit input or read value; the handlers were
dead and several bindings one-way only).

Verified: SPA + SSR builds pass; headless audit of 10 routes renders
with zero Vue warnings.

https://claude.ai/code/session_013pNZHMppjJ2iGVjxjHKkpQ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improvement to existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants