Skip to content

Studio: Add rename to project chat rows - #7005

Merged
oobabooga merged 7 commits into
unslothai:mainfrom
oobabooga:chat-rename-in-projects
Jul 13, 2026
Merged

oobabooga merged 7 commits into
unslothai:mainfrom
oobabooga:chat-rename-in-projects

Conversation

@oobabooga

Copy link
Copy Markdown
Member

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 existing renameChatItem, 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 -b and vite build clean. I also traced the persistence path. renameChatItem writes 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 omits updatedAt, so the row does not reorder under the user. Live browser click-through still pending.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment on lines +943 to +946
const openRename = useCallback((item: SidebarItem) => {
setRenameDraft(item.title);
setRenamingId(item.id);
}, []);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

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.

Suggested change
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);
}, []);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 9db0125: reset skipRenameBlurRef.current in openRename.

@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: 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".

Comment on lines +943 to +946
const openRename = useCallback((item: SidebarItem) => {
setRenameDraft(item.title);
setRenamingId(item.id);
}, []);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 9db0125: reset skipRenameBlurRef.current in openRename.

Comment on lines +1113 to +1116
if (event.key === "Enter") {
event.preventDefault();
skipRenameBlurRef.current = true;
void commitRename(item);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

@oobabooga

Copy link
Copy Markdown
Member 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: 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"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in da540a2: date now fades on <md too (max-md:opacity-0), so it no longer sits under the persistent mobile kebab.

@oobabooga

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: da540a2b1d

ℹ️ 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".

@oobabooga

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 02f7cad9ab

ℹ️ 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".

@oobabooga
oobabooga merged commit a5eb10a into unslothai:main Jul 13, 2026
36 checks passed
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.

1 participant