Let a folder be starred, and put the starred ones on the home screen
The app bar of any folder now carries a star, and a starred folder appears in a Favourites section on the home screen, above the libraries. Above, because it is the user's own list - and absent entirely while empty, so someone opening the app for the first time still meets the libraries first, which is the order they were given for a reason. The star in the row is the removal, which is what a star means everywhere else: the mark that says "this is a favourite" is the thing you tap to stop it being one. That avoids a long-press as well, and with it a destructive gesture nobody can see. A favourite is a reference, not a copy: data/BookmarkStore keeps one path per row and nothing about the folder's contents, so reading the whole list is one query and no filesystem work, which is what makes it affordable on every visit to the home screen. It has its own SQLite database rather than a table in the trash index - one table and three queries do not justify Room in a build that has no annotation processor, and the two stores have nothing to say to each other. Two behaviours there are decisions rather than defaults. A folder that has gone is kept and marked (Folder not found) instead of being deleted: a card out of its slot and a folder deleted in another app are indistinguishable from here, and silently forgetting someone's list because their SD card was out is the worse of the two mistakes. And opening the row re-checks existence at that moment, because the flag is as old as the screen - so the answer is a message rather than an empty listing, which would read as an empty folder instead of a missing one. Two smaller refusals came out of the same question. There is no star in a library or on the root screen, because neither is a folder and there would be nothing to come back to: the distinction that governs the new-folder button, and one the view model enforces too rather than trusting a stale screen. And a bookmark has no undo, because Undo means "the last change to the filesystem the app made" and a favourite is not one - the star is one tap to put back. The row's label comes from the same place the breadcrumbs do, which is why a starred volume root reads as "Internal storage" rather than as "0". Sixteen tests: nine against real SQLite through Robolectric (round trip, ordering, starring twice neither duplicating nor moving a row, and the same no-drop migration guard the trash index carries), and seven through the view model (toggling, outliving the view model that added it, newest first, the missing folder kept and marked, the missing folder refusing to open, and a library refusing to be starred). 371 JVM tests, lint clean. Verified on the phone: the star appears only inside a folder and flips from "Add to favourites" to "Remove from favourites" without leaving the screen; the home screen lists the volume root above the libraries with its own label and its path underneath; the row opens it with the star already filled; and the row's star takes the whole section away with a snackbar. The documentation moved with it - CHANGELOG, ROADMAP (M15), README, COMPETITIVE_ANALYSIS (that gap closes instead of joining the candidates), EDGE_CASE_TESTING, and the generated code map.
This commit is contained in:
@@ -91,6 +91,40 @@ upload needs a **higher `versionCode`** than every previous upload.
|
||||
from the first KDoc rather than from a declaration sharing the file's name, and the generated file
|
||||
lists those at the end instead of pretending otherwise.
|
||||
|
||||
- **Folders can be starred, and the home screen opens with your own list.** The app bar of any folder
|
||||
now carries a star; a filled one means it is already in **Favourites**, which sits above the
|
||||
libraries on the home screen — above, because it is the user's own list, and absent entirely while
|
||||
it is empty, so a first-time user still meets the libraries first. The star in the row *is* the
|
||||
removal, which is what a star means everywhere else: the mark that says "this is a favourite" is
|
||||
the thing you tap to stop it being one.
|
||||
|
||||
A favourite is a **reference, not a copy**: one path per row in a small SQLite table
|
||||
(`data/BookmarkStore` and `SqliteBookmarkStore`, in their own database rather than as a table in
|
||||
the trash index, because the two have nothing to say to each other), so reading the whole list is
|
||||
one query and no filesystem work. That is what makes it affordable on every visit to the home
|
||||
screen, and it is also why **a folder that has gone is kept and marked rather than deleted**: a
|
||||
card out of its slot and a folder deleted in another app look exactly alike from here, and
|
||||
silently forgetting someone's list because their SD card was out is the worse of the two
|
||||
mistakes. The row then says *Folder not found*, and opening it re-checks at that moment — the flag
|
||||
is as old as the screen — so the answer is a message rather than an empty listing, which would
|
||||
read as "this folder is empty" instead of "this folder is gone".
|
||||
|
||||
Two smaller decisions came out of the same question. **No star in a library or on the root
|
||||
screen**: neither is a folder, so there is nothing to come back to — the distinction that governs
|
||||
the new-folder button — and the view model refuses the toggle there too rather than trusting a
|
||||
stale screen. And **no undo for a bookmark**: `Undo` is "the last change to the filesystem the app
|
||||
made", which a favourite is not, and one tap on the star is already the way back. **16 tests** (9
|
||||
against real SQLite through Robolectric — round trip, ordering, "starring twice neither
|
||||
duplicates nor moves it", and the same no-drop migration guard the trash index carries; 7 through
|
||||
the view model — toggling, outliving the view model that added it, newest first, the missing
|
||||
folder kept and marked, the missing folder refusing to open, and a library refusing to be
|
||||
starred). **371 JVM tests**, lint clean.
|
||||
|
||||
Verified on the phone: the star appears only inside a folder; a starred volume reads as "Internal
|
||||
storage" rather than as `0`, because the label comes from the same place the breadcrumbs do; the
|
||||
home screen lists it above the libraries; the row opens it with the star already filled; and
|
||||
removing it from the row takes the whole section away with a snackbar.
|
||||
|
||||
### Changed
|
||||
|
||||
- **File thumbnails are bigger.** The leading visual in a list row went from 28 dp to 48 dp and
|
||||
|
||||
Reference in New Issue
Block a user