Browse the device by what a file is, and find the ones that hold the same bytes

The root screen opened on a list of volumes, so "where are my photos?" began with knowing which folder they were in. It now opens on Libraries - Images, Videos, Audio, Documents, Archives and Recent - each row saying how many files the index knows of that kind, and each opening an ordinary listing with thumbnails, sorting, multi-select, details and the existing viewers, so a tap on a photo opens the image viewer and a tap on a PDF the PDF viewer. Downloads and New files are deliberately absent: one is a folder shortcut and the other a time window, and presenting three different things as one feature is how a listing starts lying about itself. Documents includes .txt, because a user looking for their documents means those too, and DIRECTORY, APK and OTHER belong to no library at all - a test asserts the three omissions so they stay decisions rather than oversights.

A library has to ask for "every image" without reading a name, so IndexedFile gained a derived kind beside FileEntry's and the index stores a copy of it to filter on: schema v3, with a migration that rebuilds the files table and deletes the volume stamps with it, because a stamp means "the rows behind this are this current" and a rebuilt table has no rows behind it. Rebuilding rather than backfilling is legitimate only because this index is a cache of a walk that can be repeated; SqliteTrashIndex's rule is the opposite and its own documentation says why. A library then obeys the indexed search's two rules exactly: the answer comes first with the walk behind it, and every row is confirmed against the filesystem before it is shown, with the rows whose file has gone forgotten rather than displayed. On a device that has never been indexed the first tap on Images therefore starts a walk - which the screen admits to, using the progress row the search already had, instead of showing an empty library that reads as an empty device.

"Find duplicates" in the overflow compares contents in three passes, cheapest first: size, which the index already knows, so the candidate list is one query and reads nothing at all; the first 64 KB of every candidate, a filter whose only power is to rule files out; and the whole file for whatever survives, which is the pass that decides. The separation is enforced by a test that builds two files sharing their first 64 KB and differing afterwards and asserts both were read in full - it would fail if the cheap pass were ever treated as an answer. The screen shows only what was measured: groups ordered by the space deleting the spare copies would give back, each header stating the copies and what they cost, every row carrying its folder as well as its size, and nothing preselected, because which copy to keep is the one decision the screen exists to hand over. A file whose bytes cannot be read is counted and reported rather than skipped, "nothing found" is never claimed without saying how many files were compared, and deleting closes the scan instead of patching it - its rows came from comparing bytes, and quietly dropping some of them would leave a list that still looks like a scan while its headers claim numbers nobody measured.

The thumbnails went from 28 to 48 dp in a list row and 40 to 96 dp in a grid cell, with the grid's minimum column width raised to 144 dp to suit them; ListItem measures its leading slot rather than capping it, so a row grows to fit instead of clipping. That turned out to matter: the commonest complaint in the competitive survey is thumbnails that load only once scrolling stops, which is the failure mode a larger thumbnail invites. Two smaller corrections came out of the same work - a mutation now re-reads whatever is on screen, so a delete from inside a library removes the row instead of doing nothing at all because there was no path to reload, and returning to the app re-reads a library rather than dropping the user back to the roots.

docs/COMPETITIVE_ANALYSIS.md records the market leader's features and what its users praise and complain about, with the sources that were blocked and the size of the review sample stated rather than glossed over; it is where both features came from, and the gaps that cost no permission are listed as candidates in the roadmap. 323 JVM tests (34 added across the two features), lint clean.

Tested on the real phone - the same M2101K7AG, with the debug build installed past MIUI's two gates. The libraries on a cold index (no counts rather than a row of zeroes, "Indexing 300 files..." on the first tap, then "Index updated" and real thumbnails), the counts afterwards (Images 6238, Recent uncounted), a tap opening the viewer and BACK returning with the scroll position, and a duplicate scan that found four genuine groups in the device's own storage with nothing crashing. The duplicate delete was deliberately not pressed on a device that is not ours to empty, the store screenshots predate the new home screen, and the library views turn the M10 screenshot rule into a privacy question as well as a cosmetic one - all of that is recorded in docs/EDGE_CASE_TESTING.md rather than left implicit.
This commit is contained in:
2026-10-17 01:15:41 +02:00
parent 90806fa3cc
commit 05a71f12bf
25 changed files with 2608 additions and 73 deletions
+21 -5
View File
@@ -12,10 +12,17 @@ no advertising or tracking SDKs.
## Status
**M10 — store assets: done.** The app is named **Plain Files**, the icon and feature graphic
are generated from the app's own vectors, and [docs/STORE_LISTING.md](docs/STORE_LISTING.md)
holds length-checked listing copy. The screenshots are captured: 5 phone (1080×2160), 4 on a
7-inch tablet (1200×1920) and 4 on a 10-inch tablet (2560×1600).
**M12 — duplicate finder: done.** The browser scans for files that hold the same bytes — size first,
then the head of every candidate, then the survivors in full — and shows what deleting the spare
copies would give back. Before it: **M11 — library views**, a **Libraries** section on the root
screen (Images, Videos, Audio, Documents, Archives and Recent) whose rows open ordinary listings of
those files, each carrying a count from the search index. And **M10 — store assets**: the app is
named **Plain Files**, the icon and feature graphic come from the app's own vectors, and
[docs/STORE_LISTING.md](docs/STORE_LISTING.md) holds length-checked listing copy. Screenshots exist
for 5 phone (1080×2160), 4 on a 7-inch tablet (1200×1920) and 4 on a 10-inch tablet (2560×1600) —
but they **predate M11**, so the home screen in them is the old volume list and they will need
re-shooting, which the library views make a privacy question as well as a cosmetic one
([docs/STORE_LISTING.md](docs/STORE_LISTING.md)).
## Tech stack
@@ -166,7 +173,8 @@ UI.** Translated UI text has to be supplied in `values-<locale>/`.
no archive encryption or password support.
- **Cancellation happens between entries**, so a single very large file finishes before a
stop is honoured.
- **View state is not persisted across process death** (`SavedStateHandle` is not wired up).
- **A library is not restored across process death.** The persisted view state holds a path, and a
library has none, so a restart returns to the root screen rather than to Images or Recent.
- **Long-press multi-select is awkward to script from the host.** The gesture that opens the
selection bar (`input swipe x y x y 900`) works on the MIUI test device but has also
registered as a plain tap, so compress/extract from the UI wants a manual pass (see
@@ -187,6 +195,14 @@ alternatives and the Console steps: [docs/MONETISATION.md](docs/MONETISATION.md)
⚠️ **The price must be set before the first upload** — Play allows paid → free but never
free → paid.
## Competitive context
The category leader is **File Manager Plus** (AlphaInventor; 100 M+ installs, 4.7–4.8★, free
with ads and in-app purchases, and a Data Safety form that shares device IDs with third
parties). What it offers, what its users praise, what they complain about, and which of those
complaints this app can answer without asking for a single new permission:
[docs/COMPETITIVE_ANALYSIS.md](docs/COMPETITIVE_ANALYSIS.md).
## Licence
Proprietary — all rights reserved.