The picker names a volume the way the browser does

Two fixes from driving Copy to… and Move to… on the phone.

The dialog was nested inside the conflict-prompt block, so it could only appear when a conflict was already on screen - which is never. Nothing in the unit tests could see that: they test the view model, and the view model was right.

And the picker named internal storage by the platform's own name for it, 0: as the volume row, and in the trail above it (0 / AADst). The roots screen has always shown Internal storage there; the picker now follows the same rule, through a label resource on PickerFolder rather than a second copy of the string logic. A test pins the label on both the row and the crumb.

On the device: copy leaves the source and the selection in place, move empties the source, clears the selection and says Moved 1 item. Recorded in EDGE_CASE_TESTING.md.
This commit is contained in:
2026-10-17 22:44:53 +02:00
parent f3abef6c44
commit 1ec71381a0
8 changed files with 94 additions and 35 deletions
+7 -6
View File
@@ -2,7 +2,7 @@
Generated from the source by `tools/make-code-map.py` - do not edit by hand. Regenerate it after a change (`python3 tools/make-code-map.py`); `--check` exits non-zero when this file is stale.
79 source files, 13369 lines - 35 test files, 403 tests. The behaviour index at the end lists every test name, and in this project a test name is a sentence about what the app does, so it doubles as the specification.
79 source files, 13393 lines - 35 test files, 404 tests. The behaviour index at the end lists every test name, and in this project a test name is a sentence about what the app does, so it doubles as the specification.
Start at `AGENTS.md`. What is done, and why: `docs/ROADMAP.md` and `CHANGELOG.md`. What was verified by hand rather than by a test: `docs/EDGE_CASE_TESTING.md`.
@@ -98,12 +98,12 @@ The browser screen: view model, state, list and grid, dialogs, selection bar
| `BrowserComponents.kt` | 317 | The thumbnail an entry's leading visual gets in a list row. ListThumbnailSize, GridThumbnailSize, GridCellMinSize, EntryIcon(), FileEntry(), FileEntry(), VIDEO_FRAME_MILLIS, iconFor(), iconFor(), EntryRow(), EntryGridCell(), FileEntry() | - |
| `BrowserContent.kt` | 463 | Everything below the app bar: the permission prompt, the roots, or a directory. WIDE_LAYOUT_MIN_WIDTH, MasterPaneWidth, BrowserContent(), LazyListScope(), LIBRARY_SECTION_KEY, LazyListScope(), BOOKMARK_SECTION_KEY, DirectoryView(), FileEntry(), IndexStatusRow(), FileEntry() | - |
| `BrowserDetailPane.kt` | 131 | The second pane of the wide layout: what is inside the folder the user picked, or a preview and the details of the file they picked. DetailPane(), FolderPreview(), ImagePreview() | - |
| `BrowserDialogs.kt` | 381 | The Copy to… / Move to… picker. TransferToDialog(), titleFor(), hereFor(), BatchRenameDialog(), PREVIEW_NAMES, batchRenameNote(), NameDialog(), ConfirmDialog(), ConflictDialog() | `BrowserDialogsTest` (5) |
| `BrowserDialogs.kt` | 385 | The Copy to… / Move to… picker. TransferToDialog(), titleFor(), hereFor(), BatchRenameDialog(), PREVIEW_NAMES, batchRenameNote(), NameDialog(), ConfirmDialog(), ConflictDialog() | `BrowserDialogsTest` (5) |
| `BrowserRoots.kt` | 270 | A row on the root screen: a volume, with its free space when the platform reports it. RootRow(), itemCountLabel(), EmptyState(), LibrarySectionHeader(), BookmarkSectionHeader(), SectionHeader(), BookmarkRow(), LibraryRow(), Breadcrumbs() | `BrowserRootsTest` (4) |
| `BrowserScreen.kt` | 604 | BrowserScreen() | - |
| `BrowserScreen.kt` | 603 | BrowserScreen() | - |
| `BrowserTopBar.kt` | 238 | The browser's app bar: title, up, the favourite star, and the search / sort / overflow actions. BrowserTopBar(), SEARCH_FIELD_WIDTH | `BrowserTopBarTest` (4) |
| `BrowserUiState.kt` | 343 | One immutable description of everything the browser shows. ViewMode, SearchScope, Clipboard, PickerFolder, TransferPicker, UiMessage, ConflictPrompt, RootItem, Bookmark, DetailFocus, Undo, UndoMove, Overlay, BrowserUiState | - |
| `BrowserViewModel.kt` | 2376 | Drives the browser screen. BrowserViewModel, ArchivePreview | `BrowserViewModelTest` (96) |
| `BrowserUiState.kt` | 348 | One immutable description of everything the browser shows. ViewMode, SearchScope, Clipboard, PickerFolder, TransferPicker, UiMessage, ConflictPrompt, RootItem, Bookmark, DetailFocus, Undo, UndoMove, Overlay, BrowserUiState | - |
| `BrowserViewModel.kt` | 2392 | Drives the browser screen. BrowserViewModel, ArchivePreview | `BrowserViewModelTest` (97) |
| `DetailsSheet.kt` | 109 | Name, location, size, type and modified date for one entry. DetailsSheet(), DetailLines(), DetailLine() | - |
| `EntryIntents.kt` | 58 | Wraps an entry's path in a content:// URI another app may read. contentUriFor(), viewIntent(), shareIntent() | - |
| `IncomingBar.kt` | 60 | The bar shown while another app is waiting on this one. IncomingBar() | - |
@@ -581,7 +581,7 @@ Every test name in the suite, by file: the fastest way to see whether something
- a library or the root list has nothing to star
- the star gives way to the search field
### `ui/browser/BrowserViewModelTest.kt` (96)
### `ui/browser/BrowserViewModelTest.kt` (97)
- starts on the root list
- opening a folder lists it with directories first and natural order
@@ -592,6 +592,7 @@ Every test name in the suite, by file: the fastest way to see whether something
- copy to a chosen folder leaves the user where they are and keeps the selection
- move to a chosen folder takes the rows with it
- the picker offers folders and nothing else
- the picker names a volume the way the browser does
- the picker walks up to the volumes and back down
- a conflicting destination asks before overwriting, naming that folder
- cancelling the picker copies nothing
+16
View File
@@ -287,6 +287,22 @@ What the pass did change, before it was run:
cache — a disk cache would hold a second copy of pictures that are already on the device, and survive
the file changing.
## The copy-to session (M16)
Driven on the phone through the real UI (`adb` taps on `uiautomator` dumps), with `/sdcard/AASrc`,
`/sdcard/AADst` and `/sdcard/AAMv` standing in for two user folders.
- **Copy** into a picked folder: one file selected in `AASrc`, overflow → *Copy to…*, *Internal
storage* → `AADst` → *Copy here*. The file appeared in `AADst`, **stayed** in `AASrc`, the browser
came back to `AASrc`, and the bar still read *1 item* — the selection really does survive a copy.
- **Move** into a picked folder: the same walk into `AAMv`. `AASrc` ended up empty, `AAMv` held the
file, the snackbar said *Moved 1 item*, the listing said *This folder is empty*, and the selection bar
was gone.
- **The trail and the volume row.** Both first read the platform's own name for internal storage —
`0 / AADst` and a row labelled `0` — which is correct as a path and useless as a label. Fixed by
giving the picker the same label rule as the roots screen; the second pass reads *Internal storage /
AADst*. This is the kind of thing only a device shows: the JVM tests use paths, not labels.
## Not verified, and why
- **Long-press multi-select via adb: it works, but not every time.** `input swipe x y x y 900`
+3 -2
View File
@@ -86,8 +86,9 @@ release should not go out without.
picked folder without leaving the current one. The selection survives a copy so a second destination is
two taps; a move clears it. Conflicts ask the same question as a paste, naming the picked folder. Seven
tests cover the verbs, the picker's walk, folders-only listing, the conflict target, cancellation, and
the selection rule. **Not done**: the "copied to X — Show" message with a jump to the destination; the
copy reports itself the way a paste does.
the selection rule. Driven on the phone for both verbs (see `EDGE_CASE_TESTING.md`), which is what caught
the picker naming internal storage by its raw name `0`. **Not done**: the "copied to X — Show" message
with a jump to the destination; the copy reports itself the way a paste does.
5. **A CI run of the benchmarks on an emulator** — removes the phone from the loop and reports
`frameDurationCpuMs`, which this device cannot.