Skip to content

fix(sidebar): the settled shelf closes once you move on - #695

Merged
incognitojam merged 1 commit into
mainfrom
styal/settled-thread-list-auto-close
Oct 9, 2026
Merged

incognitojam merged 1 commit into
mainfrom
styal/settled-thread-list-auto-close

Conversation

@incognitojam

Copy link
Copy Markdown
Owner

Once expanded, the sidebar's Settled shelf stayed open indefinitely on web, desktop, and mobile. The only way to close it was the header toggle, and the expanded state is persisted, so a shelf opened once to find old work kept crowding the list long after.

The shelf now collapses when you move on from it:

  • You open a thread outside the shelf. This is derived from the open thread rather than wired to individual buttons, so sidebar clicks, the command palette, keybindings, new threads, notifications, and the auto-advance after settling all count.
  • A new user message arrives in the open thread. Derived from the thread's latestUserMessageAt, so every send path counts, including sending to a settled thread, which un-settles it.

It stays open while you open settled threads from the shelf, while you un-settle threads (including several in a row), when you leave for Settings and return to the same thread, and across reloads.

The rule is one pure function shared by both clients (advanceSettledShelfFocus in packages/client-runtime/src/state/threadSettled.ts). Web runs it in the sidebar. Mobile runs it from a render-nothing component in the thread screen, keeping the previous thread at module scope because phone thread screens remount per thread. Upstream persists the shelf state the same way (#5136, #5152) and has no auto-collapse, so this adds a fork ledger entry. The thread sidebar guide gains one sentence describing the behavior.

Validation

On web, against a styal drive serve scenario with four settled threads (provider reactors disabled, so sending a message starts no agent):

  • Expanded the shelf and opened two settled threads: it stayed open.
  • Un-settled the open thread, then another from its row: it stayed open.
  • Clicked an active thread: it collapsed (aria-expanded="false", stored value false).
  • Expanded it, opened a settled thread, and sent a message: the thread un-settled and the shelf collapsed.
  • Expanded it, went to Settings, and returned to the same thread: it stayed open.

Unit tests cover the rule's transitions, including that a shell loading for the open thread is not mistaken for a sent message. Mobile typechecks but was not exercised on a device or simulator. The shelf looks the same as before; only when it closes has changed, so there are no before/after images.


Written by an agent (Claude Code, claude-opus-5-5).

An expanded settled shelf stayed open indefinitely. It now collapses when
you open a thread outside it or a new message arrives in the open thread,
on web, desktop, and mobile. Browsing and un-settling threads, including
several in a row, keep it open.
@incognitojam incognitojam added the preview:web Deploy a hosted-web preview to Cloudflare Workers for this PR on every push. label Oct 9, 2026
@github-actions github-actions Bot added the size:L label Oct 9, 2026
@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Web preview

The preview was removed because this PR closed or the preview label was removed.

@incognitojam
incognitojam marked this pull request as draft October 9, 2026 17:08
@incognitojam
incognitojam marked this pull request as ready for review October 9, 2026 17:14
@incognitojam
incognitojam merged commit 5a4df64 into main Oct 9, 2026
31 checks passed
@incognitojam
incognitojam deleted the styal/settled-thread-list-auto-close branch October 9, 2026 19:32

This branch was successfully deployed

1 active deployment
web-preview — 639e5d04 Deployed Oct 9, 2026 by incognitojam via Remove web preview #465
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview:web Deploy a hosted-web preview to Cloudflare Workers for this PR on every push. size:L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant