Repository navigation
Studio: Add rename to project chat rows - #7005
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces inline renaming for chat items in the ProjectLanding component, allowing users to edit chat titles in place with Enter/Escape/blur handling and an optimistic UI update. A critical bug was identified where the skipRenameBlurRef.current flag is not reset when opening a new rename session, which can cause subsequent blur-commit events to be silently ignored if the previous session was closed via Enter or Escape.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| const openRename = useCallback((item: SidebarItem) => { | ||
| setRenameDraft(item.title); | ||
| setRenamingId(item.id); | ||
| }, []); |
There was a problem hiding this comment.
If a user finishes a previous rename session by pressing Enter or Escape, skipRenameBlurRef.current is set to true and the input is unmounted. Because unmounting a focused element in React does not reliably trigger the synthetic onBlur event, skipRenameBlurRef.current remains true indefinitely.
When the user later attempts to rename another chat row, the next blur event (clicking outside) will be silently ignored because the ref is still true. To fix this, reset skipRenameBlurRef.current to false whenever a new rename session is opened.
| const openRename = useCallback((item: SidebarItem) => { | |
| setRenameDraft(item.title); | |
| setRenamingId(item.id); | |
| }, []); | |
| const openRename = useCallback((item: SidebarItem) => { | |
| skipRenameBlurRef.current = false; | |
| setRenameDraft(item.title); | |
| setRenamingId(item.id); | |
| }, []); |
There was a problem hiding this comment.
Fixed in 9db0125: reset skipRenameBlurRef.current in openRename.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e3d210d0ae
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const openRename = useCallback((item: SidebarItem) => { | ||
| setRenameDraft(item.title); | ||
| setRenamingId(item.id); | ||
| }, []); |
There was a problem hiding this comment.
Reset blur suppression for each rename
If a previous inline rename was closed with Enter or Escape, the input can be unmounted before its onBlur handler runs, leaving skipRenameBlurRef.current set to true. The next time the user renames a project chat and commits by clicking away, that first blur is ignored and the edited title is silently discarded; reset this ref when opening a new rename session.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 9db0125: reset skipRenameBlurRef.current in openRename.
| if (event.key === "Enter") { | ||
| event.preventDefault(); | ||
| skipRenameBlurRef.current = true; | ||
| void commitRename(item); |
There was a problem hiding this comment.
Respect IME composition before submitting
When a user renames a project chat with an IME (for example Chinese, Japanese, or Korean input), Enter is used to confirm the current composition, but this handler treats every Enter keydown as a finished rename. That can close the editor and persist an incomplete title before the composed text is committed; skip submit while event.nativeEvent.isComposing is true.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 9db0125: skip the Enter commit while event.nativeEvent.isComposing (or keyCode 229).
| type="button" | ||
| onClick={(event) => event.stopPropagation()} | ||
| aria-label="Chat options" | ||
| className="absolute right-3 top-1/2 inline-flex size-8 -translate-y-1/2 cursor-pointer items-center justify-center rounded-full text-muted-foreground opacity-0 pointer-events-none outline-none transition-opacity hover:bg-foreground/10 focus-visible:opacity-100 focus-visible:pointer-events-auto group-hover:opacity-100 group-hover:pointer-events-auto data-[state=open]:opacity-100 data-[state=open]:pointer-events-auto" |
There was a problem hiding this comment.
Keep chat options reachable on touch
On touch-only devices there is no hover state and this trigger starts as both invisible and pointer-events-none, so tapping the kebab area hits the underlying row button and opens the chat instead of the menu. That leaves project chats without any usable rename affordance in those environments; expose the trigger without relying solely on hover/focus.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 9db0125: kebab trigger now hides/disables only at md: and up, matching the sidebar's showOnHover pattern, so it stays visible and tappable on touch.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9db0125c18
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| type="button" | ||
| onClick={(event) => event.stopPropagation()} | ||
| aria-label="Chat options" | ||
| className="absolute right-3 top-1/2 inline-flex size-8 -translate-y-1/2 cursor-pointer items-center justify-center rounded-full text-muted-foreground outline-none transition-opacity hover:bg-foreground/10 md:opacity-0 md:pointer-events-none focus-visible:opacity-100 focus-visible:pointer-events-auto group-hover:opacity-100 group-hover:pointer-events-auto data-[state=open]:opacity-100 data-[state=open]:pointer-events-auto" |
There was a problem hiding this comment.
Prevent the mobile menu from covering the date
On <md touch layouts this trigger is visible by default because the opacity/pointer-events hiding only applies at md, but the date span above is only faded on hover/open. Since the trigger is absolutely positioned at right-3, project chat rows show the kebab on top of the date until the menu opens, obscuring the right-edge date text for mobile users; reserve space or hide the date whenever the always-visible mobile trigger is shown.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in da540a2: date now fades on <md too (max-md:opacity-0), so it no longer sits under the persistent mobile kebab.
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
There was no way to rename a chat once it lived inside a project. The ProjectLanding view rendered each project chat as a bare button with no menu, and the sidebar's rename filters out project chats (
!item.projectId), so those threads were stuck with the truncated first-prompt title. Reported on Discord.Fix
Added a hover kebab menu with a Rename item to each project chat row, mirroring the recent-row rename in
app-sidebar.tsx. Rename edits the title in place, committing on Enter or blur and cancelling on Escape. It reuses the existingrenameChatItem, which is projectId-agnostic and handles both single and compare threads, so persistence matches the sidebar and the new title survives a reload. An optimistic title bridges the debounced history refresh so the old name does not flash back.Scope is the rename affordance only. Auto-title behavior and its default are untouched (tracked separately in #6542).
Verification
tsc -bandvite buildclean. I also traced the persistence path.renameChatItemwrites via the same PATCH the sidebar uses, which stores the title verbatim and fires the history refresh that re-drives the project list, so the new title sticks across a reload. The PATCH omitsupdatedAt, so the row does not reorder under the user. Live browser click-through still pending.