feat(mobile): rename a thread from the thread list menu - #8074
feat(mobile): rename a thread from the thread list menu#8074spiky02plateau wants to merge 1 commit into
Conversation
Mobile could only ask the server to regenerate a thread title; there was no way to set one by hand. Web has had this since thread.meta.update gained an optional title field, but the mobile row menus never sent it. Adds a Rename item beside Regenerate title in both thread list row variants. It opens a prefilled text prompt and writes the trimmed title through the existing updateMetadata mutation, reusing web's commit rule: reject empty, skip the write when nothing changed. Rename is not capability-gated, unlike regeneration. ConfirmDialogHost grows a showPromptDialog variant to carry the field, since Alert.prompt is iOS-only and mobile had no text prompt at all.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This adds a new cross-platform thread-renaming workflow, including a shared prompt-dialog variant and persisted metadata writes wired through both mobile thread-list variants and Home/iPad sidebar surfaces. Despite reusing the existing command contract, the new user-facing behavior and shared UI change warrant human review. You can add or adjust custom eligibility rules. Learn more. |
Renaming a thread to a chosen title works on web (sidebar row menu and chat header) but is unreachable on mobile, where the row menu only offers automatic title regeneration. The command side needs nothing:
thread.meta.updatealready accepts a manualtitle(not capability-gated, unlikeregenerateTitle), the decider already cancels an in-flight regeneration when a manual title arrives, and mobile already instantiates the exactupdateMetadatamutation for regeneration. The gap is UI only.This follows #5648, which proposed the same thing and was closed as already added. I went looking for where it landed before writing this and could not find it: on current main,
git grep -i rename apps/mobile/srcmatches only file-diff rename notices, the v1 row menu composes Archive / Regenerate title / Delete, the v2 menus compose their settle/snooze/pin/archive/delete sets plus Regenerate title, and neither the thread settings sheet nor the thread header offers a title edit. If it did land somewhere I missed, happy to close this too.The change mirrors the regenerate-title pattern: a
renameThreadaction inuseThreadListActions(the prompt lives in the hook, same asuseConfirmDeleteThread, so the rows stay dumb), a "Rename" item in both the v1 and v2 row menus next to Regenerate title, on both the Home list and the iPad sidebar. Since the codebase has no text-prompt primitive (Alert.promptis iOS-only and unused),ConfirmDialogHostgains a prompt variant: same imperative style, same theming, field prefilled with the current title, confirm disabled while the field trims to empty. Committing an unchanged title is a no-op; the commit rules (trim, reject empty) are ported from web'sresolveRenameCommit.Verification
tsgo --noEmitinapps/mobile: error output identical to the origin/main baseline (all pre-existing react-navigation typing noise; zero errors in touched files, verified by diffing against a stashed baseline run)vp lintandvp fmt --checkon all seven touched files: cleanvp test run src/features/threads/thread-title-regeneration-menu.test.ts: 3 passed, as a no-regression check on the adjacent menu logicScreenshots
I could not produce simulator captures for this one (no iOS or Android toolchain on this machine); describing the two states instead. Long-pressing a thread row shows the existing context menu with "Rename" between the pin/archive items and "Regenerate title". Selecting it opens a modal titled "Rename thread" with the current title prefilled and selected, Cancel and Rename buttons, Rename disabled while the field is empty. The dialog is the same custom in-app modal on both platforms, styled by the existing
ConfirmDialogHost. I can add real captures if wanted.Change made by Claude Opus via Claude Code.
Note
Low Risk
UI-only thread metadata update via an existing mutation; no auth or new backend surface. Dialog host is a small shared primitive with empty-title guards.
Overview
Lets users rename a thread from the Home and iPad sidebar row menus (v1 and v2), matching web’s manual title edit.
A Rename item sits next to regenerate-title. It opens a new cross-platform
showPromptDialogonConfirmDialogHost(keyboard-aware, prefilled/selected title, confirm disabled when blank). Commit uses existingupdateMetadatawith web’s trim / empty / no-op rules; failures surface viaAlert. Rename is not capability-gated.Reviewed by Cursor Bugbot for commit 0e1bed6. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add
Renameaction to mobile thread list menuspresentDialogdispatcher andDialogRequestunion type.renameThreadto useThreadListActions.ts to open a prompt, trim the input, ignore no-ops, and callupdateMetadatawith the new title.onRenameThreadthrough HomeScreen.tsx and the v1/v2 thread list row components to surface theRENAME_MENU_ACTION.ConfirmDialogHostreplaces thepresentRequestsingleton withpresentDialog, wraps content inKeyboardAvoidingView, and disables the confirm button when prompt input is empty.📊 Macroscope summarized 0e1bed6. 7 files reviewed, 1 issue evaluated, 1 issue filtered, 0 comments posted
🗂️ Filtered Issues
apps/mobile/src/features/home/HomeScreen.tsx — 0 comments posted, 1 evaluated, 1 filtered
props.onRenameThreadis missing from the dependency arrays of bothrenderV2ItemandrenderItem. If the parent supplies a new rename callback (for example after one of that callback's hook dependencies changes), these memoized renderers continue passing the old callback to rows, so Rename can execute against stale mutation/dialog state until some other listed dependency changes. Addprops.onRenameThreadto both callback dependency arrays. [ Out of scope (post-validation triage) ]