Skip to content

fix(desktop): keep pinned sidebar rows in user order - #72514

Merged
OutThisLife merged 1 commit into
mainfrom
bb/desktop-pinned-session-order
Jul 27, 2026
Merged

fix(desktop): keep pinned sidebar rows in user order#72514
OutThisLife merged 1 commit into
mainfrom
bb/desktop-pinned-session-order

Conversation

@OutThisLife

@OutThisLife OutThisLife commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Pinned sidebar rows were jumping to most-recent-completion order even after drag-reorder, because flattenSessionsWithBranches re-sorted roots by last_active on every paint.
  • Add preserveOrder so pins (and other non-date-grouped manual lists) keep the caller's order; default recents still sort by recency so date buckets stay honest.
  • Cover the "important chat above hot background task" case in unit tests.

Test plan

  • npm test -- --run src/lib/session-branch-tree.test.ts (5/5)
  • Drag pins into a fixed ranking, complete a turn on a lower pin, confirm order stays put
  • Unpin / re-pin still appends at the end of the pin list
  • Default Recents still bubble by activity under date dividers

flattenSessionsWithBranches always re-sorted roots by last_active, so a
turn finishing floated background tasks over the hand-picked Pinned list
even though $pinnedSessionIds already stored drag order. preserveOrder
skips that sort for pins (and other non-date-grouped manual lists); default
recents stay recency-sorted for truthful date buckets.
@OutThisLife
OutThisLife enabled auto-merge July 27, 2026 06:39
@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

૮ >ﻌ< ა ci review

ran on 9c28771

ℹ️ Info

Desktop E2E visual evidence · View test artifacts · View job

1 visual diff.

inline evidence is publishing...

@OutThisLife
OutThisLife merged commit 9f0e62c into main Jul 27, 2026
31 checks passed
@OutThisLife
OutThisLife deleted the bb/desktop-pinned-session-order branch July 27, 2026 06:45
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/desktop Electron desktop app (apps/desktop/*) area/sessions Session lifecycle, resume, persistence, history needs-decision Awaiting maintainer decision before any implementation sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state labels Jul 27, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Related to #66051. Both preserve pinned ordering, but this patch retains flattened branch structure while #66051 also repairs durable-pin persistence; maintainers should choose or consolidate the intended behavior.

randlee pushed a commit to randlee/hermes-agent that referenced this pull request Aug 11, 2026
…nned-session-order

fix(desktop): keep pinned sidebar rows in user order
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/sessions Session lifecycle, resume, persistence, history comp/desktop Electron desktop app (apps/desktop/*) needs-decision Awaiting maintainer decision before any implementation P3 Low — cosmetic, nice to have sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants