Skip to content

feat(sidebar): pinned threads fold away behind a Pinned header - #36030

Open
dawid-niedzwiecki wants to merge 1 commit into
pingdotgg:mainfrom
dawid-niedzwiecki:feat/collapsible-pinned-section
Open

dawid-niedzwiecki wants to merge 1 commit into
pingdotgg:mainfrom
dawid-niedzwiecki:feat/collapsible-pinned-section

Conversation

@dawid-niedzwiecki

Copy link
Copy Markdown

Problem

Pinned threads always take the top of the thread list. Working, Snoozed and Settled can be folded away, but there is no way to put pins out of sight while working on something else.

Change

The pinned section gets the same collapsible header as the other shelves, on web, desktop and mobile.

  • It is open by default and each device remembers its choice.
  • While it is folded, the open thread stays listed, search still finds hidden pins, and hidden pins leave the keyboard, jump and selection order. These are the rules the other shelves already follow.
  • With no pins nothing changes: the drag-only Pinned label still appears while dragging.
  • Dropping a thread onto the folded section pins it. Its order key is planned against the rows that are visible, and hidden pins keep their keys. This is the path the project filter already takes for pins it hides, so the thread does not get a chosen position among hidden pins.
  • Web: the header reuses the existing pinned-header list marker, so the drag projection now uses the header's real height instead of opening label clearance above the pins.
  • Mobile: a v2-pinned-shelf list item sits ahead of the pinned rows in the phone list and the tablet sidebar, with its state stored in mobile preferences.
  • docs/user/thread-sidebar.md describes the header and the drop onto a folded section.

Web and mobile are in one PR because they are the same behavior on each client.

Scope

This is a feature, not a bug fix, so it is outside what CONTRIBUTING.md accepts by default.

I am opening it because #19690 proposed the same thing for web, was taken over by a maintainer, and was then closed for age with "If the change still matters, open a fresh PR from current main." This is a fresh implementation on current main, with mobile included. The request is also in Ideas: #33372.

If this is not wanted, closing it is fine.

Verification

Web

  • Sidebar.drag.test.ts: a new case gives the Pinned header a real row height. Without the projection change it fails, because pins under the header are shifted up by the label height when a drag starts.
  • Sidebar.browser.test.tsx: folding hides pins except the open thread, and unfolding brings them back.
  • Ran the full app in headless Chromium through the app render harness (real app, fake socket): folded and unfolded the section, then dragged an active thread onto the folded header. The app dispatched one thread.pin command with an order key and the count went up. Picking up the only visible pin in a folded section and putting it back dispatched nothing.

Mobile

  • threadListV2.test.ts: a folded pinned shelf keeps only the selected thread, and the shelf item precedes the pinned rows.
  • Ran the dev client on an iPhone 17 simulator (iOS 26.4) against an isolated dev server: pinned two threads from the row menu, folded and unfolded the section, relaunched the app and the folded state was kept.

vp run check:changed passes.

Not checked: Android on a device or emulator, the tablet sidebar, a packaged desktop build, and the Boring sidebar by hand (it renders pins through the same path).

Before After
Web before expanded
Web, folded folded
Web, dropping onto the folded section drop
Mobile before expanded
Mobile, folded folded

Claude Fable 5.2, through the Claude Code harness in T3 Code.

Pinned threads always took the top of the thread list, with no way to put
them out of sight while working on something else.

The pinned section now has the same collapsible header as Working, Snoozed
and Settled on web, desktop and mobile. It is open by default, each device
remembers its choice, and the open thread stays listed while the section is
folded. Dropping a thread onto the folded section pins it.
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Nov 13, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at dce61f0

Macroscope's review found this PR approvable — Adds a device-local Pinned collapse control on web and mobile while keeping pins expanded initially and the open thread visible. The change is limited to sidebar presentation and associated drag behavior, with no obvious material risk requiring human judgment.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The mobile and web sidebars now include an expandable pinned shelf. The change adds pinned-shelf state and list handling, connects the shelf header to expansion controls, and updates persistence, drag behavior, tests, and user documentation.

Changes: Pinned shelf expansion

Layer / File(s) Summary
Mobile preference and pinned-list model
apps/mobile/src/persistence/mobile-preferences.ts, apps/mobile/src/features/threads/use-thread-list-v2-shelf-preferences.ts, apps/mobile/src/features/threads/threadListV2.ts, apps/mobile/src/features/threads/threadListV2.test.ts
Mobile preferences include the pinned-shelf expansion setting. The V2 list reports the pinned count, adds a shelf row, and includes only the selected pinned thread when collapsed. Tests cover collapsed visibility and list ordering.
Mobile shelf wiring and rendering
apps/mobile/src/features/threads/useThreadListV2.ts, apps/mobile/src/features/threads/thread-list-v2-items.tsx, apps/mobile/src/features/home/HomeScreen.tsx, apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx, apps/mobile/src/features/threads/useThreadListV2.test.tsx
The mobile list hook receives the expansion setting. Home and thread navigation render the pinned shelf header with its count, state, and toggle callback.
Web shelf state, rendering, and validation
apps/web/src/components/Sidebar.tsx, apps/web/src/components/sidebar/SidebarListMarkers.tsx, apps/web/src/components/Sidebar.drag.ts, apps/web/src/components/Sidebar.browser.test.tsx, apps/web/src/components/Sidebar.drag.test.ts, docs/user/thread-sidebar.md
The web sidebar persists expansion state and uses the visible pinned rows for ordering and rendering. The header, marker mapping, drag geometry, tests, and sidebar documentation cover the pinned shelf.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant Sidebar
  participant LocalStorage
  participant PinnedThreadRows
  User->>Sidebar: Toggle pinned shelf
  Sidebar->>LocalStorage: Save expansion state
  Sidebar->>PinnedThreadRows: Render rows from visible pinned set
Loading

Suggested reviewers: maria-rcks, juliusmarminge, pixpmusic

Merge Risk: Minimal · up to dce61

The change adds a foldable Pinned section to the web and mobile sidebars. No actionable merge-blocking risk was found; Android, tablet and packaged desktop were not manually checked, which is normal validation uncertainty.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "feat(sidebar): pinned threads fold away behind a Pinned header" matches the main change in the changeset. The diff adds a collapsible Pinned shelf header on web, desktop, and mobile, with t…
Description check Passed The description follows the repository template. It has Problem, Change, Scope, and Verification sections, and it fills each one. The Problem section states the issue. The Change section explains the …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "feat(sidebar): pinned threads fold away behind a Pinned header" matches the main change in the changeset. The diff adds a collapsible Pinned shelf header on web, desktop, and mobile, with the open thread kept visible while folded, persisted per-device state, and a pinned-shelf list item on mobile. The title is short, single-sentence, and specific, and it follows conventional commit style.

Full details: Description check

Explanation

The description follows the repository template. It has Problem, Change, Scope, and Verification sections, and it fills each one. The Problem section states the issue. The Change section explains the fold behavior on web and mobile and the drop-onto-folded-section rule. The Scope section admits the PR is a feature, which the template says the project does not accept by default, and it links the prior proposal and the Ideas discussion. The Verification section lists focused tests, manual checks on web and an iPhone simulator, and items not checked. It also includes before/after screenshots for web and mobile, as the template requires for UI changes. The description has a minor gap: the template asks for a link to a bug issue, and this PR is a feature with no bug issue. The author discloses this openly, so the check still passes.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between c29c26a and dce61f0.

Files selected for processing: 15

  • apps/mobile/src/features/home/HomeScreen.tsx
  • apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx
  • apps/mobile/src/features/threads/thread-list-v2-items.tsx
  • apps/mobile/src/features/threads/threadListV2.test.ts
  • apps/mobile/src/features/threads/threadListV2.ts
  • apps/mobile/src/features/threads/use-thread-list-v2-shelf-preferences.ts
  • apps/mobile/src/features/threads/useThreadListV2.test.tsx
  • apps/mobile/src/features/threads/useThreadListV2.ts
  • apps/mobile/src/persistence/mobile-preferences.ts
  • apps/web/src/components/Sidebar.browser.test.tsx
  • apps/web/src/components/Sidebar.drag.test.ts
  • apps/web/src/components/Sidebar.drag.ts
  • apps/web/src/components/Sidebar.tsx
  • apps/web/src/components/sidebar/SidebarListMarkers.tsx
  • docs/user/thread-sidebar.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant