Repository navigation
feat(site/src/pages/AgentsPage/components/ChatsSidebar): make Pinned a top-level sidebar section - #31064
Draft
tracyjohnsonux wants to merge 3 commits into
Draft
feat(site/src/pages/AgentsPage/components/ChatsSidebar): make Pinned a top-level sidebar section#31064tracyjohnsonux wants to merge 3 commits into
tracyjohnsonux wants to merge 3 commits into
Conversation
…a top-level sidebar section
…for Pinned above Projects
…ts section collapsible
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
Tests: updated the section-order test and the
SectionHeadersCollapsestory, added a test that Pinned renders above Projects and Chats, and addedPinnedAboveProjectsandChatsSectionCollapsedstories.