Skip to content

feat: list the drives that are plugged in - #28

Merged
hiroaki222 merged 2 commits into
mainfrom
feat/drive-list
Aug 13, 2026
Merged

hiroaki222 merged 2 commits into
mainfrom
feat/drive-list

Conversation

@hiroaki222

Copy link
Copy Markdown
Owner

Choosing a stick meant a folder dialog and knowing where the thing was mounted. Nobody has /Volumes/… memorised, and the list was already being fetched and thrown away — usb.rs asked the system for every disk, kept the one matching the path, and discarded the rest.

The screen

Laid out the way a player lays out SOURCE: what is plugged in down the left, everything known about the chosen one on the right. The list stays put while the right side is read, so moving between two sticks is one click rather than a trip back through a dialog.

Each row carries the volume label, the filesystem, the free space, and how many of the chosen players read it. A bar runs down the leading edge in the colour of that verdict, and it sits outside the row's own colour — a selected row already carries one, and a verdict that disappears when you select the row is no verdict.

transcrate usb with no path prints the same list:

DJ                   exFAT    /Volumes/DJ
KOMORI               FAT32    /Volumes/KOMORI

What is listed

Removable volumes only, which is what separates a stick from the machine's own disk. Verified against a real machine rather than assumed:

removable=false  apfs   "Macintosh HD"  /
removable=true   msdos  "KOMORI"        /Volumes/KOMORI
removable=true   exfat  "DJ"            /Volumes/DJ

Nothing else is filtered. A mounted disk image is removable too and will appear; hiding a volume somebody can see in their file manager would be the worse surprise of the two.

Free space is decimal GB, not binary — it is what the label on the stick says, and being seven per cent off from Finder would look like a bug.

The command line stops giving up early

On a filesystem no player reads it printed one line and returned. The window has always gone on to read the drive anyway, and it is right to: what is written to the stick has to be put right as well, and finding that out only after reformatting means doing the work twice.

/Volumes/BACKUP
  apfs — no player reads this

  2 tracks, 8 folders, 9 deep

  past 8 folders deep, so the browser never reaches it
    Set B/2024/Live/A/B/C/D/TooDeep

Keeping the two front-ends saying the same thing is the reason the core is shared at all, so a divergence found is a divergence to close.

Tests

One new test in usb.rs, written to hold whatever is plugged into the machine running it: the list is removable volumes only, is stable between two looks, never contains /, and every entry it offers can be answered by drive_at — or the picker would offer something the check cannot then look at.

Checked by hand against three mounted volumes: FAT32 (reads everywhere), exFAT (three players refuse it), and APFS (none do).

Choosing a stick meant a folder dialog and knowing where it was mounted.
Nobody has /Volumes/... memorised, and the list was already being fetched
and thrown away: usb.rs asked the system for every disk, kept the one
matching the path, and discarded the rest.

The window now lays the screen out the way a player does — what is
plugged in down the left, everything known about the chosen one on the
right — so moving between two sticks is one click rather than a trip back
through a dialog. Each row carries the volume label, the filesystem, the
free space and how many of the chosen players read it, with a bar down
the leading edge in the colour of that verdict. The bar sits outside the
row's own colour, because a verdict that disappears when the row is
selected is no verdict.

transcrate usb with no path prints the same list.

Removable volumes only, which is what separates a stick from the
machine's own disk. Nothing else is filtered: a mounted disk image is
removable too and will appear, and hiding a volume somebody can see in
their file manager would be the worse surprise.

The command line also stops giving up early on a filesystem no player
reads. It printed that line and returned; the window has always gone on
to read the drive anyway, and it is right to. What is written to the
stick has to be put right as well, and finding that out only after
reformatting means doing the work twice.
@hiroaki222
hiroaki222 merged commit b3fbb11 into main Aug 13, 2026
5 checks passed
@hiroaki222
hiroaki222 deleted the feat/drive-list branch August 13, 2026 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant