Skip to content

feat(site/src): move chats between projects from the chat menu - #30895

Open
ibetitsmike wants to merge 3 commits into
mike/move-chats-apifrom
mike/move-chats-menu
Open

ibetitsmike wants to merge 3 commits into
mike/move-chats-apifrom
mike/move-chats-menu

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

The chat menu in the sidebar, the top bar and the project page gets a Move to project submenu. It lists the projects of the chat's organization, marks the current one with a check mark and aria-current, and ends with Remove from project.

Stack (moving chats between projects, bottom first):

  1. feat: move a chat family between projects in chatd #30893: the move in chatd
  2. feat: move chats between projects through the chat update API #30894: the chat update API takes project_id
  3. This PR: Move to project in the chat menu
  4. feat(site/src/pages/AgentsPage/components): drag chats onto project folders in the sidebar #30795: drag a chat onto a project folder in the sidebar

Why: this is the first way for a user to move a chat, through the API from #30894.

  • The submenu shows only for the owner of a root chat that is not archived, with the chat-projects experiment. While the chat or a subagent runs, it looks disabled and does not open, as the API would return 409. It stays keyboard focusable, so keyboard and screen reader users reach the Archive agent hint it names.
  • moveChatToProject updates the cached lists and the chat entity at once. Its rollback restores only project_id, so it keeps the fields that watch events wrote while the request ran. A refused move shows the server message in a toast, even after the menu closes.
  • Other tabs follow the project_change watch event. A move keeps updated_at, so project_id comes only from that event, and the open chat refetches so the last event cannot win over the committed project. First list fetches that started before the move restart.
  • The project page hides a chat that moved away. The composer's project picker no longer says "Can't move to a project later".

What to scrutinize: the project_change branch in AgentsPageLayout.tsx and mergeWatchedChatSummary() in api/queries/chats.ts.

Move to project submenu Move is off while the chat runs Project page after the move
The Move to project submenu shows the current project Launch with a check mark, then Billing and Remove from project Move to project and Archive agent are disabled, with the hint to interrupt or wait for the agent The Billing project page lists the moved chat

Pixel: new ChatTopBar submenu stories, ProjectPage ChatMovedToAnotherProject, and the ChatsSidebar menus without Move to project (archived, shared, subagent) and MoveToProjectOffWhileSubagentRuns, which focuses the blocked item. The open CompactProjectSelector stories lose the hint.

Testing

  • make pre-commit passes. Vitest passes on the 5 touched specs (437 tests), and the Storybook tests of the 4 touched story files pass (134).
  • The open chat in AgentsPageLayout.test.tsx ends on the older project when two moves arrive in reverse order and it does not refetch. The resetUnloadedChatLists tests fail when the project list family or the unloaded-only check is removed.
  • A blocked Move to project takes keyboard focus, has the hint as its description and does not open. The test fails when the trigger is disabled or the open guard is removed.
  • Untested: aria-current on the current project, which site/AGENTS.md leaves to the stories.
  • Codex: the keyboard reach of a blocked Move to project is fixed. Seven other findings are declined in their threads: client race and cache sync hardening, and story and doc nits on patterns or text this PR keeps from main.

Xum opened this PR on behalf of @ibetitsmike.

The chat menu (sidebar, top bar, project page) gets a Move to project
submenu with the projects of the chat's organization, a check mark and
aria-current on the current one, and Remove from project. It shows only
for the owner of a root chat that is not archived, with the
chat-projects experiment, and it is off with the Archive agent hint
while the chat or a subagent runs.

moveChatToProject updates the cached chat lists and the chat entity
optimistically, and its rollback restores only project_id. Other tabs
follow project_change watch events: a move keeps updated_at, so
project_id is taken only from that kind, and the open chat refetches.
The project page drops a chat that moved away. The composer's project
picker no longer says "Can't move to a project later".
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T21:26:14.839491Z 96bcfd3 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eab509f362

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread site/src/pages/AgentsPage/components/MoveToProjectMenuItems.tsx Outdated
Comment thread site/src/pages/AgentsPage/AgentsPageLayout.tsx
@pr-queue-manager
pr-queue-manager Bot requested a review from jaaydenh October 16, 2026 14:24
…ject item keyboard reachable

Radix keeps disabled menu items out of keyboard focus, so while the chat
or a subagent ran, keyboard and screen reader users could not reach
"Move to project" or the hint its aria-describedby names. The trigger now
only looks disabled and its submenu refuses to open while blocked.
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 96bcfd3375

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread site/src/pages/AgentsPage/components/MoveToProjectMenuItems.tsx
Comment thread site/src/api/queries/chats.ts
Comment thread site/src/api/queries/chats.ts
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 96bcfd3375

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread site/src/api/queries/chatProjects.ts Outdated
…oject menu

The menu reads one organization's projects, so a filter in the
component replaces the grouping selector and its lodash import.
@ibetitsmike
ibetitsmike requested a review from jaaydenh October 18, 2026 15:19

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants