Skip to content

feat(site/src/pages/AgentsPage/components/ChatsSidebar): make Pinned a top-level sidebar section - #31064

Draft
tracyjohnsonux wants to merge 3 commits into
mainfrom
pinned-top-level-section
Draft

tracyjohnsonux wants to merge 3 commits into
mainfrom
pinned-top-level-section

Conversation

@tracyjohnsonux

@tracyjohnsonux tracyjohnsonux commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Moves Pinned out of the Chats list and makes it a top-level sidebar section, using the same collapsible header as Projects and Chats. It sits above both, so the sidebar order is Pinned, Projects, Chats. The Chats header also gains the same collapse chevron as the other two sections. This applies to the current sidebar layout and is independent of the simplified layout work.

  • The Chats header now always scrolls with the list. Before, it stayed fixed above the list when the projects experiment was off; with Pinned above it, a fixed header would sit on top of the pinned rows.
  • Collapsing Chats hides its list and its load-more trigger; the filter button stays in the header. Like Pinned, the collapsed state lasts for the page session.
  • The Chats empty state no longer counts pinned chats, which matches how it already ignores chats filed in projects.
  • Pin reordering by drag and keyboard is unchanged.

Tests: updated the section-order test and the SectionHeadersCollapse story, added a test that Pinned renders above Projects and Chats, and added PinnedAboveProjects and ChatsSectionCollapsed stories.

Generated by Coder Agents on behalf of @tracyjohnsonux.

@linear-code

linear-code Bot commented Oct 21, 2026

Copy link
Copy Markdown

CODAGT-1111

@github-actions github-actions Bot added the stale This issue is like stale bread. label Nov 22, 2026
chrifro pushed a commit that referenced this pull request Nov 24, 2026
… the agents sidebar (#32670)

The agents sidebar had two interactions that needed a drag, with no
single-pointer alternative (WCAG 2.5.7 Dragging Movements). This PR adds
one for each and leaves the drags as they are:

- **Resizing the sidebar.** Right-clicking (or long-pressing) the resize
handle opens a "Sidebar width" menu with Decrease width, Increase width
(64px steps), and Reset width. A step is disabled when the width is
already at that limit. Widths use the same clamp-and-persist path as
dragging and the keyboard arrows.
- **Reordering pinned chats.** A pinned chat's actions menu (the "…"
button and the right-click menu) now has Move up and Move down. The
first pin has no Move up and the last pin has no Move down. Both items
call the existing `reorderPinnedChat` mutation through the handler the
drop path now shares, so the optimistic order and the error toast behave
the same as for a drag. The items are hidden while filters disable
reordering, as dragging already is.

Closes DEQ-147

| Ticket | UI surface | Screenshots |
|---|---|---|
| DEQ-147 (element 1) | `ResizableChatsSidebarFrame`: resize separator
of the agents sidebar |
[before/after](https://linear.app/codercom/issue/DEQ-147/functionality-requires-a-dragging-movement-with-no-alternative#comment-d5c646e8)
|
| DEQ-147 (element 2) | `ChatActionsMenuItems` / `SortableChatTreeNode`:
Pinned section of the agents sidebar |
[before/after](https://linear.app/codercom/issue/DEQ-147/functionality-requires-a-dragging-movement-with-no-alternative#comment-d5c646e8)
|

**Open UX question (the ticket is labeled `ux-input-needed`).** The
resize menu works and meets 2.5.7, but nothing on screen tells users it
exists: it only opens with a right-click or long-press on a 4px handle.
If design would rather have a visible control, for example width presets
in a sidebar menu, that can replace this menu.

Tests: Vitest covers Move up and Move down sending the right
`pin_order`, and each resize menu item persisting the new width. New
`ReorderPinMenu` and `ResizableSidebarContextMenu` stories capture the
open menus, including Decrease width disabled at the minimum width.

**Dropped review findings**
- DF2 (nit): add a mutation `scope` to `reorderPinnedChat` so
overlapping reorders run in order. Dropped because the menu closes after
each move, and fast keyboard drags already send absolute orders through
the same unscoped mutation. It is a separate change to shared query
code.

<details>
<summary>Grouping and decision log</summary>

- **Prior work:** checked before starting. DEQ-147 had no PRs, comments,
or attachments, and had stayed in Open since it was created. Tracy's
open sidebar PRs (#31064 moves the Pinned section, #31394 fixes focus
scroll) do not touch either drag. Moving chats into projects already has
a menu alternative (#30895), so it is out of scope.
- **Grouping:** one PR. Both elements are the same rule on the same
sidebar, and the change is about 125 non-test lines, well under the
300-line gate. Shipping them together lets the ticket close in one PR.
- **Pin reorder alternative:** menu items rather than visible up/down
buttons. The row already has an actions menu, so this adds no UI to
every row, and it follows the "Move to project" alternative used for the
project drag.
- **Resize alternative:** options were (a) a plain click on the handle
that steps or toggles the width, (b) a context menu on the handle, (c)
handing the ticket to design, and (d) a width setting. (a) has no
direction and conflicts with drag detection, and (d) is a new preference
surface, which is a product decision. (b) uses the shared `ContextMenu`
primitive and adds no permanent UI, so I chose it and raised
discoverability above as the open UX question.
- **Step size:** 64px, so the menu covers the 240px to 660px range in a
few clicks. The 16px keyboard step would take about 26.
- **Accessibility audit (axe 4.11 in Storybook, open-menu states):** no
violations introduced. These are already present on `main` and appear on
both base and branch: `color-contrast` on the faded relative timestamp
in chat rows, and `aria-hidden-focus` on `#storybook-root` whenever any
Radix context menu is open, including the existing chat-row context
menu.
- **Touch and pen (round 2):** pointerdown calls `preventDefault` only
for mouse. Calling it for touch and pen cancelled Radix's long-press
timer, and the handle is already `touch-none`. Opening the menu ends any
drag in progress, so a press that is held and then moved does not keep
resizing under the menu.
- **Review nits (round 2):** moved the menu step to `sidebarWidth.ts`
(`LEFT_SIDEBAR_MENU_RESIZE_STEP`), restored the prop docs on
`ChatTreeNode`, and switched the story wait to `screen.findByRole`. I
kept different conventions at the limits on purpose. The width menu
always has the same three items, so a disabled step tells the user it
has reached a limit. The pin menu hides Move up and Move down, the same
way it already hides Pin or Unpin when they don't apply.

</details>

🤖 Generated by Coder Agents on behalf of @bartekgatzcoder.

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

stale This issue is like stale bread.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant