Skip to content

feat: FileButton, the system's file picker, and Blitz's leaf as it is now - #31

Merged
adammharris merged 1 commit into
mainfrom
feat/file-button
Nov 19, 2026
Merged

adammharris merged 1 commit into
mainfrom
feat/file-button

Conversation

@adammharris

Copy link
Copy Markdown
Member

FileButton (src/components/file_button.rs): a button that opens the system's file picker, in a browser and on Blitz alike.

  • How it's built: the renderer's own <input type=file>, transparent, laid over a face drawn as a button's. The face is a span, so presses, Tab and assistive tech only ever find the input.
  • Input: a press, a tap, Tab, Return and Space all reach the input. Its keys go to the renderer, as a text field's do.
  • Which picker opens: a browser opens its own. Blitz opens the platform's, now on diaryx-org/blitz's leaf: macOS, Windows, Linux's portal, iOS and the web.
  • Props:
    • label (shown, and the accessible name), icon, variant, disabled;
    • accept, multiple, directory;
    • onchoose gets Dioxus's FileData (name, size, type, and the contents read when asked);
    • oncancel fires when the picker is dismissed.
  • Gallery: a "Choose Pictures…" button (image/*, multiple) in the Buttons card.

Moving to the current Blitz leaf.

  • Cargo.lock now takes the fork's current leaf, which includes the password input and the file input.
  • [patch.crates-io] gains dioxus-native-dom from the same fork. leaf's new events don't compile with the published crate. It needs version = "0.8.0-alpha.3", because the fork also holds an older 0.7 crate of the same name.
  • The gallery's dioxus-native turns on file-dialog.

Tests

  • Library: an SSR test of the markup (a file input over a face that is a span; accept, webkitdirectory, the disabled face).
  • Blitz (gallery):
    • the input exactly covers the face;
    • a press with no system picker is heard as a cancel;
    • the system's answer reaches onchoose, with the file accept doesn't take left out;
    • the Tab-order test now passes through the button.
  • Every job in .config/ship.figl, run by hand (ship isn't installed here): fmt, clippy -D warnings, the wasm web lint, 79 library tests, 80 Blitz tests in light and in dark, the audit (unchanged baseline), and docs.

Generated by Claude Code

… now

- FileButton: the renderer's own <input type=file>, unseen, over a face
  drawn as a button's (a span, so that neither presses, Tab nor assistive
  tech find anything but the input). A press, a tap, Tab, Return and Space
  reach the input; a browser opens its picker, and Blitz the platform's
  (diaryx-org/blitz's leaf: macOS, Windows, Linux's portal, iOS, the web).
  accept, multiple, directory; onchoose gets Dioxus's FileData, oncancel
  a picker dismissed. Its keys are the renderer's (Kind::Text), as a text
  field's are.
- The gallery's Buttons card has one (Choose Pictures..., image/*,
  multiple); a Blitz test presses it, checks the input covers the face,
  and gives it the system's answer, of which what accept does not take is
  left out. The Tab test passes through it.
- Cargo: Blitz from leaf as it is now (password input, file input), and
  dioxus-native-dom from the same fork, which leaf's events need; the
  gallery's dioxus-native with file-dialog.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P3EBi4NUiH6dAfkRnuv9cz
@adammharris
adammharris merged commit 298e57a into main Nov 19, 2026
@adammharris
adammharris deleted the feat/file-button branch November 19, 2026 05:20
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