Skip to content

fix(web): pinned threads stay at the top while they work - #99

Merged
nullStack65 merged 1 commit into
release/native-0.1.10from
fix/pinned-threads-stay-on-top
Nov 19, 2026
Merged

nullStack65 merged 1 commit into
release/native-0.1.10from
fix/pinned-threads-stay-on-top

Conversation

@nullStack65

@nullStack65 nullStack65 commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

A pinned thread moved into the Working shelf while it ran or waited, so a pin did not keep a thread at the top. resolveSidebarShelf now moves only unpinned active threads into Working. A pinned thread stays in Pinned in its pinned order whatever its status (running, waiting on its own agents, needs approval, needs input, failed, idle) and its row still shows its status in place. Unpinned threads use the Working shelf as before.

Tests: the old "pinned thread … under Working" case is replaced by its inverse over each status. A new drag case checks that a pinned thread reorders within Pinned, unpins onto Active and cannot drop on a Working row. It sits in Sidebar.logic.test.ts because that is where resolveSidebarDropTarget is tested. Both sidebar test files pass (130 of 130) and web typecheck passes.

Filters (decision): the inbox, environment and "from" filters run on every thread before the Pinned/Active/Working split. A pinned thread is hidden only when the user's own filter excludes it, and its status never changes that. I left that as is rather than exempting pins from filters, which would widen scope.

Checks: check:changed knip fails on the upstream unused files already on the base branch; none are in files this PR touches.

Deploy: fleet

🤖 Generated with Claude Code

A pinned thread moved into the Working shelf while it ran or waited.
Only unpinned active threads go to Working now; a pinned thread keeps its
place and shows its status in place.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@nullStack65

Copy link
Copy Markdown
Owner Author

Independent bot review (Claude Sonnet 5.5): reviewed head 80fc97f against base release/native-0.1.10. Read-only; I could not run the tests (vp is not installed in the review worktree), so the test conclusions below come from reading the code.

Verdict: no blocking findings. One non-blocking behavior note.

Findings

  1. Non-blocking, apps/web/src/components/Sidebar.tsx:696-701 (optimistic drop) with Sidebar.logic.ts:322 (resolveSidebarDropVerb). A pinned thread that is working can now be dragged, because its drag section is "pinned" rather than "working", which used to force a context-only drag. If it is dropped on the Active section, the drag preview and the drop verb say "unpin" into Active. The optimistic path then runs inbox(projected, true), which calls isThreadWorking(projected). Unless staysActiveWhileWorking applies, the thread lands in the Working shelf, not Active. isOptimisticDropReleased (Sidebar.tsx:824-850) still releases correctly, because membership differs, so nothing sticks. The result is consistent with "unpinned working threads live in Working", and I would accept it. The new drag test only covers pinned→pinned, pinned→active and pinned→working in the pure logic (Sidebar.logic.test.ts ~1174-1195), and none of them exercises the landing shelf. If you want it covered, add one partitionSidebarThreads case. I would not hold the PR for it.

Checked with no problem found

  • Other places that move or hide a pinned thread because it is working: the only caller of resolveSidebarShelf is partitionSidebarThreads (Sidebar.tsx:707). The Working shelf's collapsed state (routeThreadOnly, Sidebar.tsx:560) no longer hides a pinned route thread. Counts, orderedThreads (pinned first), sectionByThreadKey, searchableThreads, keyboard navigation order and isCard rendering (Sidebar.tsx:3475) all key off the list a thread is in, so they follow automatically. Boring/folder mode already disables the shelf, so it is unchanged. No other client imports resolveSidebarShelf.
  • Drag boundary and projection: Sidebar.drag.ts (createSidebarSortingStrategy, collision boundary) only treats the working-header as the shelf start. Pinned rows are above pinned-divider, so reordering a working pinned row is the same as any pinned row. Dropping on the Working shelf still returns null (resolveSidebarDropTarget).
  • Pinned-then-working precedence of snoozed and settled is unchanged (resolveSidebarThreadSection). Settled and snoozed still win over working.
  • Tests: the running and waiting-on-own-agents rows would fail on the old code, which returned "working" for them when pinned. The approval, input, failed and idle rows pass before and after the change, because isThreadWorking is already false for them (packages/client-runtime/src/state/threadInbox.ts:17-20). They are useful as regression guards but do not discriminate. They match isSidebarThreadWorking's existing unit test. Settled and snoozed are covered by the two existing resolveSidebarShelf assertions, not with a pinned thread.
  • Complexity: the change is a single condition, which is the smallest sufficient change. inboxObservation.isWorking is still evaluated for pinned threads and discarded, which is negligible.

@nullStack65
nullStack65 merged commit e68995e into release/native-0.1.10 Nov 19, 2026
3 of 4 checks passed
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