Skip to content

Wire per-row Pin/Unpin in chat history overflow menu#8604

Open
GerardPaligot wants to merge 2 commits into
feature/gerard/chat-history-renamefrom
feature/gerard/chat-history-pin
Open

Wire per-row Pin/Unpin in chat history overflow menu#8604
GerardPaligot wants to merge 2 commits into
feature/gerard/chat-history-renamefrom
feature/gerard/chat-history-pin

Conversation

@GerardPaligot
Copy link
Copy Markdown
Contributor

@GerardPaligot GerardPaligot commented May 18, 2026

Task/Issue URL: https://app.asana.com/1/137249556945/project/72649045549333/task/1214820120386824?focus=true

Description

Wires the Pin / Unpin action on the Duck.ai chat history screen so a chat actually moves between the Pinned and Recent sections. The toggle fires immediately with no confirmation; a snackbar with Undo appears so a mistap is recoverable. State is persisted via the native chat store so the same Pinned/Recent split shows on next open and on Duck.ai itself.

Steps to test this PR

Note

Prerequisites:

  • Install Internal Debug.
  • In Settings → Developer Settings → Feature Flags, confirm duckAiChatHistory (self, historyScreen) is ON and duckChat → useNativeStorageChatData is ON.
  • Create at least 2 chats in Duck.ai so there's something to pin.

Happy path

  • Open the Chats screen → tap the 3-dot on a Recent row → tap Pin → confirm the row moves to a Pinned section above Recent and a "Chat pinned" snackbar appears with an Undo action.
  • Tap the 3-dot on a Pinned row → tap Unpin → confirm the row moves back to Recent and a "Chat unpinned" snackbar appears with Undo.
  • Trigger a pin → tap Undo before the snackbar auto-dismisses → confirm the row returns to its original section.
  • Trigger an unpin → tap Undo → confirm the row returns to the Pinned section.

Persistence

  • Pin a chat, close and reopen the Chats screen → confirm the chat is still in the Pinned section.
  • Pin a chat on Android, then open the same chat on Duck.ai web → confirm it shows as pinned there too (and vice versa).

UI changes

Before After
image image
image image
N/A image

Note

Medium Risk
Adds new pin/unpin write path that mutates stored chat JSON and updates UI ordering; mistakes could cause incorrect pinned state or lost updates across sessions.

Overview
Enables Pin/Unpin from the chat history row overflow menu: the action now toggles a chat between Pinned and Recent and shows a snackbar with Undo.

This adds a setPinned persistence API through ChatHistoryRepository into DuckAiChatStore (writing the pinned flag into the stored JSON), introduces a MessageEvent.PinToggled stream for snackbar messaging, and adds new strings plus unit tests covering toggle/undo and store JSON updates.

Reviewed by Cursor Bugbot for commit 23dda12. Bugbot is set up for automated code reviews on this repo. Configure here.

Surfaces a snackbar after the per-row Pin/Unpin overflow action so the
user can recover from a mistap. The toggle still fires immediately; the
snackbar is purely informational + an Undo affordance that re-issues
setPinned with the previous value.

Also fixes a pre-existing build break in RecordingRenameRepository,
which was missing the setPinned override added in b3157b9.
Copy link
Copy Markdown
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

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