Files
coder/site
Jaayden HalkoandCursor 0901b3b017 feat(site/src): reorder pinned projects by drag (#32042)
Pinned project folders can now be dragged to reorder them, with the
pointer or the keyboard, separately from pinned chats.

- A drop sends the pinned project IDs in their new order to `PUT
/api/experimental/chats/projects/pins/order`. `reorderChatProjectPins`
cancels in-flight summaries fetches and writes the new order to the
cache first, and restores the old order if the request fails, so a
refetch can't snap folders back mid-drag.
- Pinned chats and pinned projects share the pin-order helpers in
`projectDrag.ts`.
- The drag announcer reads out project drags for screen readers.
- A pinned chat that belongs to a project shows a folder icon left of
its time, labeled with the project name (and its organization when
another project has the same name), since it is listed in Pinned instead
of its folder. This and the `PinnedChatsAndProjects` story moved here
from #32041 to keep that PR under the size limit, along with #32041's
drop-on-own-folder regression test.

<details>
<summary>Verification</summary>

`pnpm check`, `pnpm lint` and the touched unit and story tests pass,
including a test that reorders pinned projects apart from pinned chats
and one for the optimistic cache write and its rollback. Dogfood checked
that the order persists after reload and matches `pin_order` from the
summaries endpoint. That run sent a position on the pin call; it was not
repeated after the drop switched to the reorder call, which the unit
tests cover.

</details>

> [!NOTE]
> Most of this PR was written by AI agents (Xum, with UAT run through
Coder Agents). The verification above is from those runs.

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-12-04 11:05:09 +07:00
..
…
…
…