Skip to content

fix(client): persist manual session order across refreshes - #169

Merged
gbasin merged 1 commit into
masterfrom
fix/persist-manual-session-order
Jul 24, 2026
Merged

fix(client): persist manual session order across refreshes#169
gbasin merged 1 commit into
masterfrom
fix/persist-manual-session-order

Conversation

@gbasin

@gbasin gbasin commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Fixes #157.

What

Dragging a session row flips sessionSortMode to 'manual' — which is persisted — but the order array itself was stripped from persistence by a partialize in the settings store ("session-only state"). Net effect: every refresh reverted the list to an empty manual order, exactly as reported.

Removes the partialize exclusion so manualSessionOrder persists to localStorage alongside the mode. Stale ids in a persisted order are harmless: sortSessions sends unknown keys to the end (sorted by createdAt), and kill-time pruning of the order array already exists.

Replication (before this change)

Playwright against an isolated instance: drag changed DOM order (gamma,beta,alpha → alpha,gamma,beta), reload reverted it; localStorage showed sessionSortMode: "manual" persisted while manualSessionOrder was absent.

Tests

  • setManualSessionOrder writes the order into persisted settings (fails on master)
  • persisted order + manual mode rehydrate into the store

bun run lint && bun run typecheck && bun run test green.

Dragging a session row switched sessionSortMode to 'manual' (persisted)
but the order itself was stripped from persistence, so every refresh
reverted the list while leaving the user stuck in manual mode with an
empty order. Persist manualSessionOrder alongside the mode; stale ids
are already pruned on session kill and ignored by sortSessions.

Fixes #157
@gbasin
gbasin merged commit 6b23415 into master Jul 24, 2026
6 checks passed
@gbasin
gbasin deleted the fix/persist-manual-session-order branch July 24, 2026 01:27
@gbasin gbasin mentioned this pull request Jul 24, 2026
gbasin added a commit that referenced this pull request Jul 24, 2026
Bumps version to 0.4.5. Included since 0.4.4:

- fix(terminal): read pty client identity via list-clients instead of
display-message -c (#165) — fixes #161 and the tmux 3.2a failure in #156
- fix(terminal): paste into the session the pty client is attached to
(#166)
- feat(settings): runtime toggle for prefer-window-name (#167)
- fix(client): persist manual session order across refreshes (#169) —
fixes #157
- fix(client): snap session rows on auto-resort instead of animating
(#170) — fixes #159

Merging triggers the tag + release workflow.
dsfaccini pushed a commit to dsfaccini/agentboard that referenced this pull request Jul 27, 2026
Fixes gbasin#157.

Dragging a session row flips `sessionSortMode` to `'manual'` — which
**is** persisted — but the order array itself was stripped from
persistence by a `partialize` in the settings store ("session-only
state"). Net effect: every refresh reverted the list to an empty manual
order, exactly as reported.

Removes the `partialize` exclusion so `manualSessionOrder` persists to
localStorage alongside the mode. Stale ids in a persisted order are
harmless: `sortSessions` sends unknown keys to the end (sorted by
createdAt), and kill-time pruning of the order array already exists.

Playwright against an isolated instance: drag changed DOM order
(gamma,beta,alpha → alpha,gamma,beta), reload reverted it; localStorage
showed `sessionSortMode: "manual"` persisted while `manualSessionOrder`
was absent.

- `setManualSessionOrder` writes the order into persisted settings
(fails on master)
- persisted order + manual mode rehydrate into the store

`bun run lint && bun run typecheck && bun run test` green.
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.

Ordering of chats can be re-arranged, but reverts back on refresh (0.3.3)

1 participant