Wire per-row Rename in chat history overflow menu#8599
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
c7dff14 to
2ebe300
Compare
2ebe300 to
b7d6e93
Compare
fc2d91c to
23c4ac2
Compare
8207298 to
cd1d1b5
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit cd1d1b5. Configure here.
malmstein
left a comment
There was a problem hiding this comment.
Did not install or smoke-test the APK. The rename flow is well-scoped and well-tested across the three layers (store, repository, ViewModel). Two questions worth resolving before merge: rename doesn't bump lastEdit (so the relabelled row stays in place rather than surfacing to the top) and rename has no sync hook while deletes do — likely intentional but worth confirming with design and sync teams. The runCatching in RenameChatViewModel swallows CancellationException and the check { ... } in the repository uses exceptions for control flow; both minor.
cd1d1b5 to
f7b5cd6
Compare
23ad28e to
3f58bc3
Compare
malmstein
left a comment
There was a problem hiding this comment.
Did not install or smoke-test the APK — the debug-apk workflow doesn't run on PRs targeting non-develop branches, and this one is stacked on feature/gerard/chat-history-native-fire. The wiring looks clean — channel-backed navigation events, FragmentScope VM with the standard @ContributesViewModel, ADS components in the layout, @AppCoroutineScope matches the established pattern for saves that should survive widget detach, and tests cover repository, view model and store paths including the malformed-JSON case.
runCatching catches Throwable, so the previous shape silently absorbed CancellationException and surfaced it as a RenameResult.Error. That breaks structured concurrency: a cancelled scope should propagate upwards, not be reported as a rename failure. Swap to a try/catch that rethrows CancellationException and only converts Exception into the user-visible error state.
ChatHistoryRepository.renameChat now returns a Boolean: true when the
store applied the rename, false when it could not (chat missing, JSON
malformed). The ViewModel branches on that flag and emits the same
Error outcome for both the false path and any thrown exception — the
fragment shows one generic snackbar either way. Drops the check{}
that turned a soft failure into IllegalStateException and removes the
unused throwable field on RenameResult.Error.
f7b5cd6 to
65337eb
Compare
The confirm action read its visible label from a string named
..._content_description, which lied about the resource's role. Split
into ..._confirm_title ("Save") for android:title and keep
..._confirm_content_description ("Save chat title") for the new
android:contentDescription binding, so each string is wired to the
attribute its name implies.
65337eb to
c62b930
Compare


Task/Issue URL: https://app.asana.com/1/137249556945/task/1214820120386822
Description
Wires the Rename action on the Duck.ai chat history screen so it actually edits a conversation's title.
Steps to test this PR
Note
Prerequisites:
duckAiChatHistory(self,historyScreen) is ON andduckChat → useNativeStorageChatDatais ON.Happy path
Guards
UI changes
Note
Medium Risk
Adds a new rename flow that updates persisted chat JSON via the native store and introduces new navigation/event plumbing; mistakes could lead to failed updates or incorrect chat metadata updates. Scope is contained to chat history UI and storage layer with good test coverage.
Overview
Enables the Rename action in chat history: selecting rename now emits a
NavigationEventfromChatHistoryViewModelthatChatHistoryFragmenthandles by pushing a newRenameChatFragment.Adds a dedicated rename UI (toolbar + single-line title input with Save enabled only when non-blank and changed) backed by
RenameChatViewModel, which trims input, callsChatHistoryRepository.renameChat, and shows an error snackbar on failure.Plumbs rename through persistence by adding
renameChattoChatHistoryRepositoryand implementing it inRealDuckAiChatStoreto update only thetitlefield in the stored chat JSON; adds strings, menu/layout resources, and unit tests covering navigation events and rename success/failure/malformed JSON cases.Reviewed by Cursor Bugbot for commit c62b930. Bugbot is set up for automated code reviews on this repo. Configure here.