A copy into a picked folder says where it went, and Show takes you there

The last acceptance criterion M16 had left open. After Copy to..., the snackbar reads 'Copied to AADst' with a Show button; after a move to a picked folder it keeps the undoable message instead, because the sources are gone and Show would lead nowhere.

Two things needed care rather than a string. The action button was hard-wired to undo() - the label was a parameter beside it, which let the two disagree - so UiMessage now carries a MessageAction, and the label follows from it: Undo for an undo, Show for a jump. And a message cannot name a folder from the path alone: a volume root has no name of its own, and internal storage's is 0. The message carries the picked PickerFolder, and the screen resolves its label the way breadcrumbs do - so copying into the root reads 'Copied to Internal storage', which is the case a plain path.name would have got wrong.

Four tests: the message names the destination and offers Show; Show opens it; a paste into the folder on screen still names nothing and offers nothing (its destination is the screen); a move to a picked folder offers Undo. All four driven through the view model, and both snackbar variants checked on the phone, including the volume-root one.

detekt's SpreadOperator baseline entries moved with the expression, so the message building is now a small helper with a deliberate suppression and a reason, and the baseline was regenerated: three obsolete entries removed, none added.
This commit is contained in:
2026-10-17 23:17:03 +02:00
parent 747a6f7784
commit 17078bf613
10 changed files with 219 additions and 26 deletions
+8
View File
@@ -125,6 +125,8 @@
<string name="browser_action_select_all">Select all</string>
<string name="browser_action_clear_selection">Clear selection</string>
<string name="browser_action_undo">Undo</string>
<!-- The action on a "copied to X" message: go to the folder it was copied into. -->
<string name="browser_action_show">Show</string>
<!-- ===== Browser: files another app has handed over ===== -->
<plurals name="incoming_save_here">
@@ -238,6 +240,12 @@
<string name="message_folder_created">Folder created</string>
<string name="message_renamed">Renamed</string>
<string name="message_name_in_use">That name is already in use</string>
<!-- %1$s is the destination folder; a copy that went somewhere the user chose says where. -->
<plurals name="message_copied_to">
<item quantity="one">Copied to %1$s</item>
<item quantity="other">Copied %2$d items to %1$s</item>
</plurals>
<plurals name="message_copied">
<item quantity="one">Copied %1$d item</item>
<item quantity="other">Copied %1$d items</item>