diff --git a/CHANGELOG.md b/CHANGELOG.md
index cf8f6ad..d2b82ec 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,24 @@ upload needs a **higher `versionCode`** than every previous upload.
### Added
+- **A dot marks what an operation just produced.** Copy something, extract an archive, rename a file or make a
+ folder, and the rows it created carry a small dot until you open that folder again — so "what did that 4 GB
+ copy do?" has an answer, including when the copy went to a folder you were not looking at. The mark lives in
+ memory and is spent by the next read of the folder: no timer, no watcher, nothing to switch off. It carries a
+ content description, so TalkBack says it too.
+- **Compressing asks two things: the name, and whether to compress.** The second one is for the case the
+ survey's most enthusiastic review describes — moving a whole collection to a computer: off stores the files
+ as they are, so the archive is built in one pass instead of being squeezed first. It is still an ordinary
+ zip, and it still extracts to the same bytes.
+- **The trash says how long it keeps things, and empties on request.** The screen now states the window
+ ("Deleted files are kept for 24 hours") instead of leaving it to be discovered, **Empty trash** does what it
+ says after one question, and opening the trash sweeps what has expired — the 24-hour window used to run only
+ when you deleted something else, so an old batch could sit on the card indefinitely.
+- **Long-press the app icon: Images, Recent, Trash.** Three shortcuts to the views that are otherwise two or
+ three taps deep, with no permission and no dynamic state. Favourites is deliberately not one: it is a
+ section of the home screen rather than a view, so a shortcut to it would promise something that may not be
+ there.
+
- **Copy to… and Move to… chose a destination instead of making you go there.** The selection bar's
overflow now offers both verbs: a folder picker opens — the volumes first, then folders one level at a
time, with the trail above and Up beside it — and confirming starts the copy (or the move) into that
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index bc4319f..24ee493 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -74,6 +74,11 @@
+
+
+
+ Compress
+ Archive name
+ Compress contents
+ Off stores the files as they are: faster to build, and ready to copy off the phone.
+ Compress
+ Cancel
Copy to…
Move to…
@@ -125,6 +132,15 @@
Select all
Clear selection
Undo
+
+ Images
+ Open the Images library
+ Recent
+ Open the files you changed last
+ Trash
+ Open the trash
+
+ New
Show
@@ -139,6 +155,15 @@
Trash
+
+ - Deleted files are kept for %1$d hour
+ - Deleted files are kept for %1$d hours
+
+ Empty trash
+ Empty the trash?
+ Everything in the trash is deleted for good. This cannot be undone.
+ Delete for good
+ Trash emptied
Nothing in the trash
Restore
Restore all
diff --git a/app/src/main/res/xml/shortcuts.xml b/app/src/main/res/xml/shortcuts.xml
new file mode 100644
index 0000000..683b0f4
--- /dev/null
+++ b/app/src/main/res/xml/shortcuts.xml
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/test/java/de/softwareapp_hb/filemanager/core/ShortcutRouteTest.kt b/app/src/test/java/de/softwareapp_hb/filemanager/core/ShortcutRouteTest.kt
new file mode 100644
index 0000000..0223ea0
--- /dev/null
+++ b/app/src/test/java/de/softwareapp_hb/filemanager/core/ShortcutRouteTest.kt
@@ -0,0 +1,30 @@
+package de.softwareapp_hb.filemanager.core
+
+import org.junit.Assert.assertEquals
+import org.junit.Assert.assertNull
+import org.junit.Test
+
+/**
+ * The mapping between a launcher shortcut and a view.
+ *
+ * The interesting case is the one that is *not* a shortcut: a value written by an older build, or a typo in
+ * `shortcuts.xml`, must be ignored rather than thrown, because the app is being opened by the launcher at that
+ * moment and has nowhere to show an error.
+ */
+class ShortcutRouteTest {
+
+ @Test
+ fun `each shortcut key maps to its route`() {
+ assertEquals(ShortcutRoute.IMAGES, ShortcutRoute.from("images"))
+ assertEquals(ShortcutRoute.RECENT, ShortcutRoute.from("recent"))
+ assertEquals(ShortcutRoute.TRASH, ShortcutRoute.from("trash"))
+ }
+
+ @Test
+ fun `anything else is ignored rather than thrown`() {
+ assertNull(ShortcutRoute.from(null))
+ assertNull(ShortcutRoute.from(""))
+ assertNull(ShortcutRoute.from("favourites"))
+ assertNull(ShortcutRoute.from("IMAGES"))
+ }
+}
diff --git a/app/src/test/java/de/softwareapp_hb/filemanager/domain/ArchiveEngineTest.kt b/app/src/test/java/de/softwareapp_hb/filemanager/domain/ArchiveEngineTest.kt
index 4f34980..a82ca3e 100644
--- a/app/src/test/java/de/softwareapp_hb/filemanager/domain/ArchiveEngineTest.kt
+++ b/app/src/test/java/de/softwareapp_hb/filemanager/domain/ArchiveEngineTest.kt
@@ -52,6 +52,29 @@ class ArchiveEngineTest {
assertEquals(2, extracted.completed)
}
+ @Test
+ fun `an uncompressed zip round-trips and is larger than a squeezed one`() = runBlocking {
+ val storage = storage()
+ // Very compressible on purpose: what the two archives differ by is then the compression itself,
+ // not the few bytes of header each entry carries.
+ storage.addFile(src.child("big.txt"), "a".repeat(4000))
+ val engine = ArchiveEngine(storage)
+ val stored = StoragePath.of("/src/stored.zip")
+ val squeezed = StoragePath.of("/src/squeezed.zip")
+
+ assertTrue(engine.createZip(listOf(src.child("big.txt")), stored, compress = false).succeeded)
+ assertTrue(engine.createZip(listOf(src.child("big.txt")), squeezed, compress = true).succeeded)
+
+ val storedBytes = storage.stat(stored)!!.sizeBytes
+ val squeezedBytes = storage.stat(squeezed)!!.sizeBytes
+ assertTrue("stored=$storedBytes", storedBytes > 4000)
+ assertTrue("squeezed=$squeezedBytes", squeezedBytes < 500)
+
+ // Storing is a choice about cost, not about format: it is still a zip, and still the same bytes.
+ assertTrue(engine.extract(stored, out).succeeded)
+ assertEquals("a".repeat(4000), storage.contentOf(out.child("big.txt")))
+ }
+
@Test
fun `createZip reports progress over the files it will write`() = runBlocking {
val storage = storage()
diff --git a/app/src/test/java/de/softwareapp_hb/filemanager/domain/TrashTest.kt b/app/src/test/java/de/softwareapp_hb/filemanager/domain/TrashTest.kt
index 4496ca7..fb7a735 100644
--- a/app/src/test/java/de/softwareapp_hb/filemanager/domain/TrashTest.kt
+++ b/app/src/test/java/de/softwareapp_hb/filemanager/domain/TrashTest.kt
@@ -36,6 +36,22 @@ class TrashTest {
index: TrashIndex = TrashIndex.None,
) = Trash(source, volume, index, clock = { at })
+ @Test
+ fun `emptying removes every batch and leaves what is not one`() = runBlocking {
+ val storage = storage()
+ trash(storage, at = TRASHED_AT).stage(listOf(notes))
+ trash(storage, at = TRASHED_AT + 1).stage(listOf(docs.child("report.pdf")))
+ // Something else in the same hidden folder: the volume is the user's, not the trash's to tidy.
+ val foreign = trash(storage).root().child("holiday-photos")
+ storage.createDirectory(foreign)
+
+ val removed = trash(storage).emptyAll()
+
+ assertEquals(2, removed)
+ assertTrue(storage.contains(foreign))
+ assertTrue(trash(storage).restorable().isEmpty())
+ }
+
@Test
fun `staging moves an item aside and records where it came from`() = runBlocking {
val storage = storage()
diff --git a/app/src/test/java/de/softwareapp_hb/filemanager/ui/browser/BrowserComponentsTest.kt b/app/src/test/java/de/softwareapp_hb/filemanager/ui/browser/BrowserComponentsTest.kt
new file mode 100644
index 0000000..8575c26
--- /dev/null
+++ b/app/src/test/java/de/softwareapp_hb/filemanager/ui/browser/BrowserComponentsTest.kt
@@ -0,0 +1,68 @@
+package de.softwareapp_hb.filemanager.ui.browser
+
+import androidx.compose.ui.test.assertCountEquals
+import androidx.compose.ui.test.junit4.createComposeRule
+import androidx.compose.ui.test.onAllNodesWithContentDescription
+import androidx.compose.ui.test.onNodeWithContentDescription
+import de.softwareapp_hb.filemanager.core.FileEntry
+import de.softwareapp_hb.filemanager.core.StoragePath
+import de.softwareapp_hb.filemanager.ui.theme.FileManagerTheme
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.robolectric.RobolectricTestRunner
+import org.robolectric.annotation.Config
+import org.robolectric.annotation.GraphicsMode
+
+/**
+ * The dot that marks a row an operation produced.
+ *
+ * Present when the view model says so, absent otherwise, and **readable**: a dot is the only thing on the
+ * row that says "new", so it carries a content description rather than being a shape TalkBack skips.
+ */
+@RunWith(RobolectricTestRunner::class)
+@Config(sdk = [34])
+@GraphicsMode(GraphicsMode.Mode.NATIVE)
+class BrowserComponentsTest {
+
+ @get:Rule
+ val compose = createComposeRule()
+
+ private val downloads = StoragePath.of("/storage/emulated/0/Download")
+
+ private fun entry(name: String) =
+ FileEntry(downloads.child(name), isDirectory = false, sizeBytes = 4L, lastModifiedMillis = 0L)
+
+ @Test
+ fun `a row an operation produced carries the mark`() {
+ compose.setContent {
+ FileManagerTheme {
+ EntryRow(entry = entry("a.txt"), selected = false, changed = true, onClick = {})
+ }
+ }
+
+ compose.onNodeWithContentDescription("New").assertExists()
+ }
+
+ @Test
+ fun `an ordinary row carries no mark`() {
+ compose.setContent {
+ FileManagerTheme {
+ EntryRow(entry = entry("a.txt"), selected = false, onClick = {})
+ }
+ }
+
+ compose.onAllNodesWithContentDescription("New").assertCountEquals(0)
+ }
+
+ @Test
+ fun `a grid cell an operation produced carries the mark too`() {
+ compose.setContent {
+ FileManagerTheme {
+ EntryGridCell(entry = entry("a.txt"), selected = false, changed = true, onClick = {})
+ }
+ }
+
+ compose.onNodeWithContentDescription("New").assertExists()
+ }
+}
diff --git a/app/src/test/java/de/softwareapp_hb/filemanager/ui/browser/BrowserViewModelTest.kt b/app/src/test/java/de/softwareapp_hb/filemanager/ui/browser/BrowserViewModelTest.kt
index 56e4d5d..e5bfab8 100644
--- a/app/src/test/java/de/softwareapp_hb/filemanager/ui/browser/BrowserViewModelTest.kt
+++ b/app/src/test/java/de/softwareapp_hb/filemanager/ui/browser/BrowserViewModelTest.kt
@@ -9,6 +9,7 @@ import de.softwareapp_hb.filemanager.R
import de.softwareapp_hb.filemanager.core.BatchRename
import de.softwareapp_hb.filemanager.core.ConflictPolicy
import de.softwareapp_hb.filemanager.core.FileCategory
+import de.softwareapp_hb.filemanager.core.ShortcutRoute
import de.softwareapp_hb.filemanager.core.FileEntry
import de.softwareapp_hb.filemanager.core.FileKind
import de.softwareapp_hb.filemanager.core.SortDirection
@@ -30,6 +31,8 @@ import de.softwareapp_hb.filemanager.domain.OperationKind
import de.softwareapp_hb.filemanager.domain.OperationNotifier
import de.softwareapp_hb.filemanager.domain.OperationProgress
import de.softwareapp_hb.filemanager.domain.SearchIndexer
+import de.softwareapp_hb.filemanager.domain.Trash
+import de.softwareapp_hb.filemanager.data.TrashIndex
import de.softwareapp_hb.filemanager.domain.testutil.InMemorySearchIndex
import de.softwareapp_hb.filemanager.domain.testutil.InMemoryStorageSource
import de.softwareapp_hb.filemanager.ui.browser.testutil.FakeStorageLocation
@@ -439,6 +442,150 @@ class BrowserViewModelTest {
assertEquals(R.string.browser_action_undo, message.actionLabelRes)
}
+ @Test
+ fun `a copy into the folder on screen marks the copy`() {
+ val model = viewModel()
+ model.openDirectory(documents)
+ model.copyToClipboard(listOf(downloads.child("a.txt")), cut = false)
+
+ model.paste()
+
+ assertEquals(setOf(documents.child("a.txt")), model.state.value.changed)
+ }
+
+ @Test
+ fun `a copy into another folder marks it there, not here`() {
+ val model = viewModel()
+ model.openDirectory(downloads)
+ model.toggleSelection(downloads.child("a.txt"))
+
+ model.startTransferTo(cut = false)
+ model.pickerOpen(documents)
+ model.confirmTransferTo()
+
+ // The user is still in `downloads`, which gained nothing — the copy went elsewhere.
+ assertTrue(model.state.value.changed.isEmpty())
+
+ model.openDirectory(documents)
+ assertEquals(setOf(documents.child("a.txt")), model.state.value.changed)
+ }
+
+ @Test
+ fun `reading the folder again spends its marks`() {
+ val model = viewModel()
+ model.openDirectory(documents)
+ model.copyToClipboard(listOf(downloads.child("a.txt")), cut = false)
+ model.paste()
+ assertTrue(model.state.value.changed.isNotEmpty())
+
+ model.openDirectory(root)
+ model.openDirectory(documents)
+
+ assertTrue(model.state.value.changed.isEmpty())
+ }
+
+ @Test
+ fun `a rename marks the name it produced`() {
+ val model = viewModel()
+ model.openDirectory(downloads)
+
+ model.rename(downloads.child("a.txt"), "renamed.txt")
+
+ assertEquals(setOf(downloads.child("renamed.txt")), model.state.value.changed)
+ }
+
+ @Test
+ fun `compressing asks for a name and a choice before writing`() {
+ val model = viewModel()
+ model.openDirectory(downloads)
+
+ model.beginCompress(listOf(downloads.child("a.txt")))
+
+ val request = model.state.value.compressRequest
+ assertNotNull(request)
+ assertEquals("a.txt.zip", request!!.name)
+ // Nothing has been written: both answers belong to the dialog.
+ assertFalse(storage.contains(downloads.child("a.txt.zip")))
+ }
+
+ @Test
+ fun `a confirmed compress writes the name that was typed, and marks it`() {
+ val model = viewModel()
+ model.openDirectory(downloads)
+ model.beginCompress(listOf(downloads.child("a.txt")))
+
+ model.confirmCompress("fast.zip", compressContents = false)
+
+ assertTrue(storage.contains(downloads.child("fast.zip")))
+ assertNull(model.state.value.compressRequest)
+ assertEquals(setOf(downloads.child("fast.zip")), model.state.value.changed)
+ }
+
+ @Test
+ fun `cancelling the compress dialog writes nothing`() {
+ val model = viewModel()
+ model.openDirectory(downloads)
+ model.beginCompress(listOf(downloads.child("a.txt")))
+
+ model.cancelCompress()
+
+ assertNull(model.state.value.compressRequest)
+ assertFalse(storage.contains(downloads.child("a.txt.zip")))
+ }
+
+ @Test
+ fun `opening the trash sweeps what has expired`() {
+ val stagedAt = 1_000L
+ val trash = Trash(storage, root, TrashIndex.None, clock = { stagedAt })
+ runBlocking { trash.stage(listOf(downloads.child("a.txt"))) }
+ assertFalse(storage.contains(downloads.child("a.txt")))
+
+ // A day and a moment later: the batch is past the window, and opening the trash is what notices.
+ val model = viewModel(clock = { stagedAt + Trash.RETENTION_MILLIS + 1 })
+ model.openTrash()
+
+ assertEquals(0, runBlocking { storage.list(trash.root()) }.size)
+ }
+
+ @Test
+ fun `opening the trash keeps what is still inside the window`() {
+ val stagedAt = 9_000_000L
+ val trash = Trash(storage, root, TrashIndex.None, clock = { stagedAt })
+ runBlocking { trash.stage(listOf(downloads.child("a.txt"))) }
+
+ val model = viewModel(clock = { stagedAt })
+ model.openTrash()
+
+ assertEquals(1, runBlocking { storage.list(trash.root()) }.size)
+ }
+
+ @Test
+ fun `emptying the trash removes what is in it`() {
+ val stagedAt = 9_000_000L
+ val trash = Trash(storage, root, TrashIndex.None, clock = { stagedAt })
+ runBlocking { trash.stage(listOf(downloads.child("a.txt"))) }
+
+ val model = viewModel(clock = { stagedAt })
+ model.emptyTrash()
+
+ assertEquals(0, runBlocking { storage.list(trash.root()) }.size)
+ assertEquals(R.string.message_trash_emptied, model.state.value.message?.textRes)
+ }
+
+ @Test
+ fun `a shortcut opens the view it names`() {
+ val model = viewModel()
+
+ model.openShortcut(ShortcutRoute.IMAGES)
+ assertEquals(FileCategory.IMAGES, model.state.value.category)
+
+ model.openShortcut(ShortcutRoute.RECENT)
+ assertEquals(FileCategory.RECENT, model.state.value.category)
+
+ model.openShortcut(ShortcutRoute.TRASH)
+ assertTrue(model.state.value.overlay is Overlay.Trash)
+ }
+
@Test
fun `navigating up goes to the parent then to the roots`() {
val model = viewModel()
diff --git a/config/detekt/baseline.xml b/config/detekt/baseline.xml
index 3088118..8fab1fa 100644
--- a/config/detekt/baseline.xml
+++ b/config/detekt/baseline.xml
@@ -9,7 +9,7 @@
CyclomaticComplexMethod:ArchiveFormats.kt$ArchiveFormats$fun formatOf(fileName: String): ArchiveFormat
CyclomaticComplexMethod:BrowserContent.kt$@Composable fun BrowserContent( state: BrowserUiState, contentPadding: PaddingValues, crumbLabel: (StoragePath) -> String, onOpenEntry: (FileEntry) -> Unit, onFocusEntry: (FileEntry) -> Unit, onFocusRoot: (RootItem) -> Unit, onToggleSelection: (StoragePath) -> Unit, onOpenRoot: (StoragePath) -> Unit, onNavigate: (StoragePath) -> Unit, onOpenCategory: (FileCategory) -> Unit, onOpenBookmark: (StoragePath) -> Unit, onRemoveBookmark: (StoragePath) -> Unit, onGrantAllFiles: () -> Unit, onPickFolder: () -> Unit, onRebuildIndex: () -> Unit, /** Hoisted by the screen so the scroll position outlives a viewer taking over. */ listState: LazyListState = rememberLazyListState(), gridState: LazyGridState = rememberLazyGridState(), )
CyclomaticComplexMethod:BrowserContent.kt$@Composable private fun DirectoryView( state: BrowserUiState, crumbLabel: (StoragePath) -> String, wide: Boolean, listState: LazyListState, gridState: LazyGridState, onOpenEntry: (FileEntry) -> Unit, onFocusEntry: (FileEntry) -> Unit, onToggleSelection: (StoragePath) -> Unit, onNavigate: (StoragePath) -> Unit, onGrantAllFiles: () -> Unit, onRebuildIndex: () -> Unit, modifier: Modifier = Modifier, )
- CyclomaticComplexMethod:BrowserScreen.kt$@OptIn(ExperimentalMaterial3Api::class) @Composable fun BrowserScreen( incoming: IncomingRequest? = null, onDeliver: (FileEntry) -> Unit = {}, onDone: () -> Unit = {}, viewModel: BrowserViewModel = viewModel(factory = BrowserViewModel.Factory), )
+ CyclomaticComplexMethod:BrowserScreen.kt$@OptIn(ExperimentalMaterial3Api::class) @Composable fun BrowserScreen( incoming: IncomingRequest? = null, startRoute: ShortcutRoute? = null, onDeliver: (FileEntry) -> Unit = {}, onDone: () -> Unit = {}, viewModel: BrowserViewModel = viewModel(factory = BrowserViewModel.Factory), )
CyclomaticComplexMethod:BrowserViewModel.kt$BrowserViewModel$fun open(entry: FileEntry)
CyclomaticComplexMethod:BrowserViewModel.kt$BrowserViewModel$fun previewArchiveEntry(entry: ArchiveEntry)
CyclomaticComplexMethod:FileOperations.kt$FileOperations$private suspend fun transfer( from: StoragePath, to: StoragePath, move: Boolean, state: OperationState, )
@@ -17,7 +17,7 @@
LargeClass:BrowserViewModel.kt$BrowserViewModel : ViewModel
LargeClass:BrowserViewModelTest.kt$BrowserViewModelTest
LongMethod:BrowserContent.kt$@Composable fun BrowserContent( state: BrowserUiState, contentPadding: PaddingValues, crumbLabel: (StoragePath) -> String, onOpenEntry: (FileEntry) -> Unit, onFocusEntry: (FileEntry) -> Unit, onFocusRoot: (RootItem) -> Unit, onToggleSelection: (StoragePath) -> Unit, onOpenRoot: (StoragePath) -> Unit, onNavigate: (StoragePath) -> Unit, onOpenCategory: (FileCategory) -> Unit, onOpenBookmark: (StoragePath) -> Unit, onRemoveBookmark: (StoragePath) -> Unit, onGrantAllFiles: () -> Unit, onPickFolder: () -> Unit, onRebuildIndex: () -> Unit, /** Hoisted by the screen so the scroll position outlives a viewer taking over. */ listState: LazyListState = rememberLazyListState(), gridState: LazyGridState = rememberLazyGridState(), )
- LongMethod:BrowserScreen.kt$@OptIn(ExperimentalMaterial3Api::class) @Composable fun BrowserScreen( incoming: IncomingRequest? = null, onDeliver: (FileEntry) -> Unit = {}, onDone: () -> Unit = {}, viewModel: BrowserViewModel = viewModel(factory = BrowserViewModel.Factory), )
+ LongMethod:BrowserScreen.kt$@OptIn(ExperimentalMaterial3Api::class) @Composable fun BrowserScreen( incoming: IncomingRequest? = null, startRoute: ShortcutRoute? = null, onDeliver: (FileEntry) -> Unit = {}, onDone: () -> Unit = {}, viewModel: BrowserViewModel = viewModel(factory = BrowserViewModel.Factory), )
LongMethod:BrowserTopBar.kt$@OptIn(ExperimentalMaterial3Api::class) @Composable fun BrowserTopBar( title: String, canNavigateUp: Boolean, /** Whether this view is a folder, and so can be starred at all. */ canBookmark: Boolean, bookmarked: Boolean, query: String, searchOpen: Boolean, searchScope: SearchScope, /** Whether the scope is the user's to choose at all; see the note beside the toggle. */ scopeChoosable: Boolean, canPaste: Boolean, onUp: () -> Unit, onQuery: (String) -> Unit, onSearchOpen: (Boolean) -> Unit, onSearchScope: () -> Unit, onSort: () -> Unit, onPaste: () -> Unit, onToggleBookmark: () -> Unit, onRefresh: () -> Unit, onUsage: () -> Unit, onDuplicates: () -> Unit, onTrash: () -> Unit, )
LongParameterList:BrowserContent.kt$( state: BrowserUiState, contentPadding: PaddingValues, crumbLabel: (StoragePath) -> String, onOpenEntry: (FileEntry) -> Unit, onFocusEntry: (FileEntry) -> Unit, onFocusRoot: (RootItem) -> Unit, onToggleSelection: (StoragePath) -> Unit, onOpenRoot: (StoragePath) -> Unit, onNavigate: (StoragePath) -> Unit, onOpenCategory: (FileCategory) -> Unit, onOpenBookmark: (StoragePath) -> Unit, onRemoveBookmark: (StoragePath) -> Unit, onGrantAllFiles: () -> Unit, onPickFolder: () -> Unit, onRebuildIndex: () -> Unit, /** Hoisted by the screen so the scroll position outlives a viewer taking over. */ listState: LazyListState = rememberLazyListState(), gridState: LazyGridState = rememberLazyGridState(), )
LongParameterList:BrowserContent.kt$( state: BrowserUiState, crumbLabel: (StoragePath) -> String, wide: Boolean, listState: LazyListState, gridState: LazyGridState, onOpenEntry: (FileEntry) -> Unit, onFocusEntry: (FileEntry) -> Unit, onToggleSelection: (StoragePath) -> Unit, onNavigate: (StoragePath) -> Unit, onGrantAllFiles: () -> Unit, onRebuildIndex: () -> Unit, modifier: Modifier = Modifier, )
@@ -60,13 +60,13 @@
NestedBlockDepth:ArchiveEngine.kt$ArchiveEngine$private suspend fun readArchive( archive: ArchiveInputStream<*>, destination: StoragePath, state: ArchiveState, )
NestedBlockDepth:ArchiveEngine.kt$ArchiveEngine$private suspend fun readSevenZip( channel: SeekableByteChannel, destination: StoragePath, state: ArchiveState, )
NestedBlockDepth:ArchiveEngine.kt$ArchiveEngine$private suspend fun withEntry( archive: StoragePath, name: String, sink: suspend (InputStream) -> Unit, ): Boolean
- NestedBlockDepth:ArchiveEngine.kt$ArchiveEngine$suspend fun createZip( entries: List<StoragePath>, destination: StoragePath, onProgress: (OperationProgress) -> Unit = {}, ): OperationResult
+ NestedBlockDepth:ArchiveEngine.kt$ArchiveEngine$suspend fun createZip( entries: List<StoragePath>, destination: StoragePath, compress: Boolean = true, onProgress: (OperationProgress) -> Unit = {}, ): OperationResult
NestedBlockDepth:ArchiveEngine.kt$ArchiveEngine$suspend fun extract( archive: StoragePath, destination: StoragePath, onProgress: (OperationProgress) -> Unit = {}, ): OperationResult
NestedBlockDepth:ArchiveEngine.kt$ArchiveEngine$suspend fun list(archive: StoragePath): List<ArchiveEntry>
NestedBlockDepth:ArchiveEngineTest.kt$ArchiveEngineTest$private fun sevenZip(vararg entries: Pair<String, String>): ByteArray
RethrowCaughtException:BrowserViewModel.kt$BrowserViewModel$throw cancellation
ReturnCount:ArchiveEngine.kt$ArchiveEngine$private suspend fun withEntry( archive: StoragePath, name: String, sink: suspend (InputStream) -> Unit, ): Boolean
- ReturnCount:BrowserScreen.kt$@OptIn(ExperimentalMaterial3Api::class) @Composable fun BrowserScreen( incoming: IncomingRequest? = null, onDeliver: (FileEntry) -> Unit = {}, onDone: () -> Unit = {}, viewModel: BrowserViewModel = viewModel(factory = BrowserViewModel.Factory), )
+ ReturnCount:BrowserScreen.kt$@OptIn(ExperimentalMaterial3Api::class) @Composable fun BrowserScreen( incoming: IncomingRequest? = null, startRoute: ShortcutRoute? = null, onDeliver: (FileEntry) -> Unit = {}, onDone: () -> Unit = {}, viewModel: BrowserViewModel = viewModel(factory = BrowserViewModel.Factory), )
TooGenericExceptionCaught:ArchiveEngine.kt$ArchiveEngine$failure: Exception
TooGenericExceptionCaught:BrowserViewModel.kt$BrowserViewModel$failure: Exception
TooGenericExceptionCaught:FileOperations.kt$FileOperations$failure: Exception
diff --git a/docs/CODE_MAP.md b/docs/CODE_MAP.md
index bec9655..0e277bd 100644
--- a/docs/CODE_MAP.md
+++ b/docs/CODE_MAP.md
@@ -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, 13481 lines - 35 test files, 409 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.
+80 source files, 13841 lines - 37 test files, 427 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`.
@@ -23,6 +23,7 @@ Pure Kotlin, **no Android imports**: paths, file names, kinds, sorting, formatti
| `MimeTypes.kt` | 110 | Best-effort MIME lookup for the "open with" intent. MimeTypes | `FileEntryTest` (8) |
| `NameAllocator.kt` | 30 | Picks a name that is not already in use, in the familiar "name (1)" style. NameAllocator | `NameMatcherTest` (10) |
| `NameMatcher.kt` | 63 | The in-folder search matcher. NameMatcher | `NameMatcherTest` (10) |
+| `ShortcutRoute.kt` | 27 | Where a launcher shortcut asks the app to open. ShortcutRoute | `ShortcutRouteTest` (2) |
| `SortSpec.kt` | 82 | A complete, serialisable description of the ordering of a directory listing. SortKey, SortDirection, SortSpec, NaturalOrder | `SortSpecTest` (8) |
| `SortedMerge.kt` | 42 | Adds a freshly read batch to an already sorted list, in one pass. SortedMerge | `SortedMergeTest` (4) |
| `StoragePath.kt` | 89 | A normalized, absolute, backend-agnostic storage path. StoragePath | `StoragePathTest` (8) |
@@ -61,14 +62,14 @@ Operations over a source: copy/move/delete/rename, archives, search walking, dup
| file | lines | what it holds | tests |
|---|---|---|---|
-| `ArchiveEngine.kt` | 658 | Creates and extracts archives, on top of the storage backends. ArchiveEntry, ArchiveEngine | `ArchiveEngineTest` (30) |
+| `ArchiveEngine.kt` | 667 | Creates and extracts archives, on top of the storage backends. ArchiveEntry, ArchiveEngine | `ArchiveEngineTest` (31) |
| `DuplicateFinder.kt` | 202 | Finds files that hold the same bytes. DuplicateGroup, DuplicateProgress, DuplicateScan, DuplicateFinder | `DuplicateFinderTest` (8) |
| `FileOperations.kt` | 272 | Copy, move and delete, assembled from the StorageSource primitives. FileOperations | `FileOperationsTest` (19) |
| `FileSearch.kt` | 79 | Recursive name search. FileSearch | `FileSearchTest` (8) |
| `OperationModels.kt` | 42 | The kind of long-running operation a progress notification can describe. OperationKind, OperationProgress, OperationFailure, OperationResult | - |
| `OperationNotifier.kt` | 25 | Keeps the foreground service in step with a running operation. OperationNotifier | - |
| `SearchIndexer.kt` | 173 | Fills a SearchIndex by walking a volume. SearchIndexer | `SearchIndexerTest` (14) |
-| `Trash.kt` | 338 | A staging folder that makes a delete undoable. TrashedEntry, TrashBatch, Trash | `TrashTest` (19) |
+| `Trash.kt` | 360 | A staging folder that makes a delete undoable. TrashedEntry, TrashBatch, Trash | `TrashTest` (20) |
| `UsageAnalysis.kt` | 95 | Works out where the space went. UsageNode, UsageAnalysis | `UsageAnalysisTest` (6) |
## service/
@@ -95,15 +96,15 @@ The browser screen: view model, state, list and grid, dialogs, selection bar
| file | lines | what it holds | tests |
|---|---|---|---|
-| `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() | - |
+| `BrowserComponents.kt` | 365 | The thumbnail an entry's leading visual gets in a list row. ListThumbnailSize, GridThumbnailSize, GridCellMinSize, EntryIcon(), FileEntry(), FileEntry(), VIDEO_FRAME_MILLIS, iconFor(), iconFor(), MarkOfChange(), EntryRow(), EntryGridCell(), FileEntry() | `BrowserComponentsTest` (3) |
+| `BrowserContent.kt` | 465 | 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` | 385 | The Copy to… / Move to… picker. TransferToDialog(), titleFor(), hereFor(), BatchRenameDialog(), PREVIEW_NAMES, batchRenameNote(), NameDialog(), ConfirmDialog(), ConflictDialog() | `BrowserDialogsTest` (5) |
+| `BrowserDialogs.kt` | 444 | Compressing something, with the one choice that changes what comes out. CompressDialog(), 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` | 622 | The text of a snackbar message. BrowserScreen(), messageText() | - |
+| `BrowserScreen.kt` | 661 | The browser, and everything that can be on top of it. BrowserScreen(), messageText() | - |
| `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` | 379 | One immutable description of everything the browser shows. ViewMode, SearchScope, Clipboard, PickerFolder, TransferPicker, MessageAction, UiMessage, ConflictPrompt, RootItem, Bookmark, DetailFocus, Undo, UndoMove, Overlay, BrowserUiState | - |
-| `BrowserViewModel.kt` | 2430 | Drives the browser screen. BrowserViewModel, ArchivePreview | `BrowserViewModelTest` (102) |
+| `BrowserUiState.kt` | 391 | One immutable description of everything the browser shows. ViewMode, SearchScope, Clipboard, CompressRequest, PickerFolder, TransferPicker, MessageAction, UiMessage, ConflictPrompt, RootItem, Bookmark, DetailFocus, Undo, UndoMove, Overlay, BrowserUiState | - |
+| `BrowserViewModel.kt` | 2540 | Drives the browser screen. BrowserViewModel, ArchivePreview | `BrowserViewModelTest` (113) |
| `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() | - |
@@ -139,7 +140,7 @@ The trash screen
| file | lines | what it holds | tests |
|---|---|---|---|
-| `TrashScreen.kt` | 192 | What the trash still holds, and the way to put it back. TrashScreen(), BatchHeader(), TrashEntryRow() | - |
+| `TrashScreen.kt` | 220 | What the trash still holds, and the way to put it back. TrashScreen(), BatchHeader(), TrashEntryRow() | - |
## ui/duplicates/
@@ -164,7 +165,7 @@ Compose theme, colours, type
| file | lines | what it holds | tests |
|---|---|---|---|
| `FileManagerApplication.kt` | 151 | Application entry point and the app's tiny object graph. FileManagerApplication | - |
-| `MainActivity.kt` | 65 | MainActivity | - |
+| `MainActivity.kt` | 69 | MainActivity | - |
## benchmark/
@@ -279,6 +280,11 @@ Every test name in the suite, by file: the fastest way to see whether something
- treats a dotfile as having no extension
- preserves the base of multi-dot names
+### `core/ShortcutRouteTest.kt` (2)
+
+- each shortcut key maps to its route
+- anything else is ignored rather than thrown
+
### `core/SortSpecTest.kt` (8)
- directories come first in both directions
@@ -427,9 +433,10 @@ Every test name in the suite, by file: the fastest way to see whether something
- a volume without a space reading contributes nothing
- used bytes never go negative
-### `domain/ArchiveEngineTest.kt` (30)
+### `domain/ArchiveEngineTest.kt` (31)
- a zip round-trips folders and files
+- an uncompressed zip round-trips and is larger than a squeezed one
- createZip reports progress over the files it will write
- a zip-slip entry cannot escape the destination
- a single-file gzip is unwrapped to its inner name
@@ -521,8 +528,9 @@ Every test name in the suite, by file: the fastest way to see whether something
- the timestamp is stamped from the clock when the pass finishes
- a second pass replaces the first rather than doubling it
-### `domain/TrashTest.kt` (19)
+### `domain/TrashTest.kt` (20)
+- emptying removes every batch and leaves what is not one
- staging moves an item aside and records where it came from
- restoring puts an item back exactly where it was
- a folder comes back whole
@@ -559,6 +567,12 @@ Every test name in the suite, by file: the fastest way to see whether something
- a determinate operation shows the counter
- starting the service puts it in the foreground with that title
+### `ui/browser/BrowserComponentsTest.kt` (3)
+
+- a row an operation produced carries the mark
+- an ordinary row carries no mark
+- a grid cell an operation produced carries the mark too
+
### `ui/browser/BrowserDialogsTest.kt` (5)
- the batch dialog spells the names out before anything moves
@@ -581,7 +595,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` (102)
+### `ui/browser/BrowserViewModelTest.kt` (113)
- starts on the root list
- opening a folder lists it with directories first and natural order
@@ -601,6 +615,17 @@ Every test name in the suite, by file: the fastest way to see whether something
- a paste into the folder on screen names no destination and offers no action
- the message's undo action is the undo
- a move to a chosen folder offers undo rather than show
+- a copy into the folder on screen marks the copy
+- a copy into another folder marks it there, not here
+- reading the folder again spends its marks
+- a rename marks the name it produced
+- compressing asks for a name and a choice before writing
+- a confirmed compress writes the name that was typed, and marks it
+- cancelling the compress dialog writes nothing
+- opening the trash sweeps what has expired
+- opening the trash keeps what is still inside the window
+- emptying the trash removes what is in it
+- a shortcut opens the view it names
- navigating up goes to the parent then to the roots
- selection survives toggling and clears on navigation
- a file with no preview of its own is handed to the system
@@ -698,4 +723,4 @@ Every test name in the suite, by file: the fastest way to see whether something
---
-Purpose taken from the first KDoc rather than from a declaration sharing the file's name (15 of 78): `MainActivity.kt`, `ArchiveFormats.kt`, `FileNames.kt`, `ApkInspector.kt`, `OperationModels.kt`, `TextRes.kt`, `BrowserComponents.kt`, `BrowserDetailPane.kt`, `BrowserDialogs.kt`, `BrowserRoots.kt`, `BrowserScreen.kt`, `EntryIntents.kt`, `Color.kt`, `Theme.kt`, `Type.kt`
+Purpose taken from the first KDoc rather than from a declaration sharing the file's name (14 of 79): `MainActivity.kt`, `ArchiveFormats.kt`, `FileNames.kt`, `ApkInspector.kt`, `OperationModels.kt`, `TextRes.kt`, `BrowserComponents.kt`, `BrowserDetailPane.kt`, `BrowserDialogs.kt`, `BrowserRoots.kt`, `EntryIntents.kt`, `Color.kt`, `Theme.kt`, `Type.kt`
diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md
index 1cf7510..9c0583c 100644
--- a/docs/ROADMAP.md
+++ b/docs/ROADMAP.md
@@ -26,6 +26,12 @@ Legend: ✅ done · 🚧 in progress · ⏳ not started · 💡 candidate (propo
| M13 | Video thumbnails | ✅ | A video row shows **a frame of the video** instead of a film icon: images and videos take the same path through Coil, with the video request asking for a frame a second in. One dependency — `coil-video` at the Coil version already pinned, whose POM adds only coil-core/stdlib/core-ktx — the platform's own `MediaMetadataRetriever` behind it, **no new permission** (no `READ_MEDIA_VIDEO`), and the decoder registered **explicitly** against an `ImageLoader` in `FileManagerApplication` — because R8 strips `coil-video`'s ServiceLoader entry from a release build, which would otherwise have left frames decoding in debug and quietly falling back to icons for real users. A decode that fails settles on the icon rather than an empty square. Verified on the phone against two purpose-made clips and a real video of the device's own, with the demo library's stand-ins falling back as intended, and **re-verified on the release APK**. **324 JVM tests** |
| M14 | Batch rename with sequence continuation | ✅ | Selecting more than one file and choosing Rename opens a **pattern** dialog: a name, a start number, and a live preview of the names it will produce. `core/BatchRename` plans the whole batch before a single file moves and returns one of three answers — **Ready**, **Blocked** (naming the target the folder already holds) or **NothingToDo** — with the deliberate absence of a fourth: a batch that renamed nine of twelve and stopped would leave the user to work out which nine. The numbering **continues the folder's own series** `nextNumber` from the highest `base (n)` it finds, which is the market survey's most-helpful complaint answered by name; the extension is kept per file, the series is counted across extensions, and continuing beats filling the first gap. `SelectionBar` now offers Rename to any selection (one file keeps the name dialog, several get the pattern one), and the batch's renames are **one** `Undo.Relocate` step. The same commit hardens the single rename: `core/FileNames.isUsableName` refuses a name that is not one path segment, because `notes/final.txt` was being resolved as a path and **moved** the file instead of renaming it. **350 JVM tests** (26 added) |
| M15 | Favourites | ✅ | A star in the app bar of any folder, and a **Favourites** section on the home screen above the libraries — absent while empty, so a first-time user still meets the libraries first. `data/BookmarkStore` + `SqliteBookmarkStore` keep one path per row in their own database: a **reference, never a copy**, so the list costs one query and no filesystem work. `BrowserUiState.Bookmark` carries an `exists` flag, and a folder that has gone is **kept and marked** rather than deleted — an unmounted card and a deleted folder are the same thing from here — with opening re-checked at that moment so the answer is a message instead of an empty listing. The row's filled star is the removal (the mark that says "favourite" is the thing you tap to stop it being one), there is no star in a library or on the root screen, and no `Undo` for a bookmark because that type is "the last change to the filesystem" and a favourite is not one. **371 JVM tests** (16 added) |
+| M16 | Copy to… / Move to… | ✅ | A destination picker behind the selection bar's overflow — volumes, then folders one level at a time, with Up and the trail above them — that copies or moves **without leaving the folder you are in**. The selection survives a copy, so a second destination is two taps; a move clears it. Conflicts ask what a paste asks, naming the picked folder; a copy answers "Copied to *folder*" with **Show**. Detailed below |
+| M17 | The mark of a change | ✅ | A dot on the rows an operation produced, spent by the next read of that folder. In memory, per folder: no timer, no watcher, no badge. `BrowserUiState.changed` + `markChanged` on every operation that creates something; the dot is drawn by `MarkOfChange` in both list and grid, with a content description TalkBack reads. **7 tests** (4 view model, 3 Compose) |
+| M18 | Store-only archives | ✅ | Compressing asks two things: the name, and whether to compress. Off stores the files as they are — `Deflater.NO_COMPRESSION`, one pass — which is what a bulk copy off the phone actually wants. A `STORED` entry would need each file's size and CRC before its header, i.e. reading everything twice. **4 tests** |
+| M19 | The trash says what it does | ✅ | The trash states its window ("Deleted files are kept for 24 hours") and offers **Empty trash** behind one confirmation; opening the trash sweeps expired batches, so the 24-hour retention no longer waits for the next delete to run. **4 tests** |
+| M20 | Launcher shortcuts | ✅ | Images, Recent and Trash as static shortcuts — three intents with a route extra, `core/ShortcutRoute` answering `null` for anything it does not know. Favourites was dropped from the plan: it is a section of the home screen, not a view. **3 tests** |
+| M21 | Android TV | ⏳ | Specified below and deliberately not started: its acceptance needs a TV device pass this machine cannot provide. |
## Key decisions
@@ -69,6 +75,10 @@ scaling numbers (which turned into progressive listing), Copy to… / Move to…
left is the baseline profile's *measurement*, which needs a physical API 33+ device and cannot be finished
on this machine; everything else in the list says what it produced.
+**M17–M20** come from the same survey's remaining gaps and are implemented (the change mark, store-only
+archives, a trash that says what it does, launcher shortcuts). **M21** (Android TV) is specified and
+deliberately not started: its acceptance needs a TV device pass this machine cannot provide.
+
1. **Baseline profile** — **generated and committed**: `app/src/main/baseline-prof.txt` is bundled in the
release APK, written by the `:baselineprofile` module. What remains is its *measurement*: collection
needs a device with API 33+, and the phone is Android 12, while the API 35 emulator here is too noisy to
@@ -131,3 +141,107 @@ destination picker.
**Not in scope**: drag and drop, a two-pane phone layout, remembering recent destinations.
+### M17 — The mark of a change
+
+**What**: the rows an operation created carry a dot until the folder is read again, in both the list and the
+grid.
+
+**Why this shape**: the survey's 3.6.5 ("temporarily highlight new files with a dot after file operations")
+answers an obvious question — *what did that 4 GB copy just do?* — and it got sharper with M16, because a copy
+can now land in a folder the user is not looking at. The dot is a **set of paths the view model marks when an
+operation lands**, not a timestamp on every row: no timer, no background job, and "temporarily" means "until
+you see the folder again". The marks live in memory, so a restart forgets them — the same lifetime as the
+clipboard, and for the same reason.
+
+**Acceptance criteria**
+
+- Copying, moving, compressing, extracting, renaming and creating a folder or file mark what they produced.
+- The dot is drawn in the list and in the grid and carries a content description, so TalkBack says it and a
+ Compose test can find it.
+- Opening the folder again clears its marks; opening a *different* folder does not disturb them.
+- Tests: a copy into the current folder marks the copy and no untouched row; a copy into another folder marks
+ it there; re-opening clears.
+
+**Not in scope**: catching files that appear while the folder is open (that needs a watcher), a notification
+or a badge on the home screen.
+
+### M18 — Store-only archives
+
+**What**: compressing asks two things — the name, and whether to compress — because the survey's most
+enthusiastic review is a 150 GB push to a PC, and that push is faster as one file that was cheap to build.
+
+**Why this shape**: we refuse `INTERNET`, so their FTP-server answer is out; what is left is to make the file
+that leaves as cheap as possible. `Deflater.NO_COMPRESSION` does that in one pass. A `STORED` zip entry would
+be more literal and needs each file's size and CRC *before* the entry header is written, i.e. reading every
+file twice — slower than the deflate it avoids.
+
+**Acceptance criteria**
+
+- `ArchiveEngine.createZip` takes the choice; the archive is a valid zip either way and extracts to identical
+ bytes.
+- The dialog opens on "compress contents" and does not remember the last answer.
+- Tests: both variants round-trip; the uncompressed one is measurably larger; the view model passes the flag.
+
+**Not in scope**: a remembered preference, an estimated time, choosing a compression *level*.
+
+### M19 — The trash says what it does
+
+**What**: the trash screen states the window (24 hours) and offers **Empty trash**; the expiry sweep runs when
+the trash is opened, not only after the next delete.
+
+**Why this shape**: the retention already exists (`Trash.RETENTION_HOURS`) and is invisible, and
+`purgeExpired` runs *after staging* — so a user who deletes once and never again keeps a day-old batch
+forever. Those are the two halves of "why is my storage full" that the app itself can answer. Making the
+window configurable would need a settings surface this app does not have; saying what it is costs nothing.
+
+**Acceptance criteria**
+
+- Opening the trash sweeps expired batches first, and the screen says how long items are kept.
+- **Empty trash** asks once, then deletes every batch for good — it is the one destructive action in the app
+ with no undo, because that is what emptying means.
+- Tests: an expired batch is gone after opening, a fresh one survives, emptying removes all and leaves the
+ screen saying it is empty.
+
+**Not in scope**: a per-item permanent delete, a configurable window, a size cap.
+
+### M20 — Launcher shortcuts
+
+**What**: long-press the app icon → **Images**, **Recent**, **Trash**.
+
+**Why this shape**: static shortcuts need no permission and no database — three intents with an extra, mapped
+to views that are otherwise two or three taps deep. It is the cheapest route to the screens the survey says
+people install the app for.
+
+**Recent, not Favourites** — the one change from the proposal above. Favourites is a *section of the home
+screen* rather than a view of its own, so a shortcut to it would open the home screen and promise a section
+that is absent when nothing is starred. Recent is a library with its own name and its own state, so the
+shortcut opens exactly what it says.
+
+**Acceptance criteria**
+
+- Three shortcuts in `res/xml/shortcuts.xml`; each opens the app directly at that view, and back from there
+ behaves like any other entry.
+- An unknown or absent extra is ignored, so an old shortcut cannot crash a new build.
+- Tests: the route parser maps the three names and returns `null` for anything else; each route opens the
+ right view.
+
+**Not in scope**: dynamic shortcuts built from favourites, deep links to a path.
+
+### M21 — Android TV (specified, not started)
+
+**What**: a leanback-capable build — banner, launcher entry, and the whole browser and every dialog reachable
+with a d-pad.
+
+**Why this shape, and why it is not done**: Android TV is the only genuinely *new market* the survey names that
+costs no permission, and it is also the one milestone whose acceptance cannot be met on this machine — there
+is no TV AVD here and no KVM to run one at a usable speed. A half-tested TV build reviews worse than no TV
+build, which is the survey's own lesson about the competitor's timeouts, so the plan is written down and the
+work waits for a device.
+
+**Acceptance criteria (when it starts)**: `LEANBACK_LAUNCHER` intent filter and a banner; focus traversal
+through the browser, the selection bar, the transfer picker and every dialog; no touch-only affordance (long
+press and double tap need a d-pad equivalent); a TV emulator pass recorded in [EDGE_CASE_TESTING](EDGE_CASE_TESTING.md).
+
+**Not in scope**: TV-specific layouts, gamepad support, a screensaver.
+
+