Wire per-row Download in chat history overflow menu#8610
Draft
GerardPaligot wants to merge 5 commits into
Draft
Conversation
9 tasks
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced May 19, 2026
13f65fe to
7814890
Compare
c9c0069 to
3ade15f
Compare
7814890 to
8ccddb3
Compare
c1b6b95 to
d95ddfc
Compare
0bdc467 to
f77064b
Compare
44f76c2 to
c1a8944
Compare
f77064b to
6530893
Compare
6530893 to
65337eb
Compare
c1a8944 to
160544c
Compare
160544c to
50b6ef6
Compare
65337eb to
c62b930
Compare
50b6ef6 to
aeaf1b7
Compare
Surfaces "Download complete for <filename>" with a Show action that opens the Downloads screen, matching the design. The ViewModel already emits the filename via ShowDownloadComplete — only the Fragment copy and string format needed updating. Also removes a duplicate setPinned override accidentally added to RecordingRenameRepository, which was breaking compileDebugUnitTestKotlin.
- spotlessApply on three :app files to keep DownloadsScreenNoParams alphabetically after AppScope / DI imports. - Add an instruction attribute to duck_ai_chat_history_download_complete so the MissingInstruction lint rule passes for the %1$s filename arg. - Drop the now-stale setPinned override in RecordingRenameRepository; setPinned is no longer on ChatHistoryRepository after the rebase.
Brings Android's chat-history export in line with the macOS/Windows reference for every chat type. ChatExporter branches by ChatType and returns a sealed ExportResult so the writer can produce either a `.txt` (discussion/voice) or a `.zip` (image-generation, bundling chat.txt with a UTF-8 BOM and the resolved image bytes). Filename pattern switches from the sanitized chat title to the cross-platform `duck.ai_yyyy-MM-dd_HH-mm-ss.<txt|zip>` shape. Turns are now separated with the reference's `--------------------` divider. Voice turns with no model response omit the assistant block entirely. DuckAiChatStore gains openFileRef(uuid) so the impl module can stream image bytes for the zip without leaking the chat-files dir; the same path-traversal guard used by deleteChat applies. Positional fileRef ↔ turn association is a documented known assumption pending confirmation on the FE message schema for image-generation chats.
The on-disk file at <chat-files-dir>/<uuid> is a JSON envelope written by the FE bridge via writeText(params.toString()), with the image bytes base64-encoded inside a "data" field — not raw image bytes. Reading the file as a stream gave back JSON, which is why the image-N.jpeg entries exported for image-generation chats were unreadable. Replace openFileRef(uuid): InputStream? with readFileRef(uuid): FileRefContent? which parses the envelope, decodes the base64 data, and exposes the FE-provided fileName + mimeType. Tests cover plain base64, the data:<mime>;base64,<payload> URL prefix path, missing data field, malformed JSON, and the path-traversal guard. Use java.util.Base64 instead of android.util.Base64 — it's available from Java 8 / API 26, which matches the project's minSdk, and works in pure-JVM unit tests without a Robolectric runner.
3f4fae7 to
936406b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Task/Issue URL: https://app.asana.com/1/137249556945/task/1214820120386826?focus=true
Description
Wires the Download action on the Duck.ai chat history screen so a chat is exported as a plain-text
.txtfile saved to the device's Downloads folder and registered with the in-app Downloads screen. A snackbar confirms the save with the resulting filename and offers a Show action that opens the Downloads screen.Steps to test this PR
Note
Prerequisites:
duckAiChatHistory(self,historyScreen) is ON andduckChat → useNativeStorageChatDatais ON.Happy path
.txtfile listed.Guards
<title>-1.txt, not an overwrite.UI changes