Break the UI→HAL dependency: Views and ViewModels no longer import
`crate::hal` directly. DeviceRepo is the single bridge — it re-exports
all needed types, provides 16 blocking static methods for background
tasks, and owns all state mutations + event emissions.
- device.rs: Add FreshDeviceState, apply_fresh_state(), update_fido_info(),
read_device_serial_blocking(), 16 *_blocking() wrappers, full re-exports
- app.rs: Remove unconditional passkeys nilling on sidebar navigation;
only invalidate on device_changed (replug). Remove stale
refresh_device_status method.
- config/view_model.rs: Replace all io::* / fido::* calls with
DeviceRepo::*_blocking(). Use apply_fresh_state() instead of refresh()
for RS-Key LED/management writes.
- passkeys/view_model.rs: Replace all io::* calls with
DeviceRepo::*_blocking(). Fix sync_fido_state to use
repo.update_fido_info() instead of manual field mutation.
Restore refresh_if_unlocked via DeviceEvent subscriber.
- Update all view imports: hal::types → ui::models::device,
hal::rescue::constants → ui::models::device
- Update docs in main.rs, app.rs, ui/mod.rs to reflect the new architecture
- Decompose flat about.rs/home.rs/security.rs/config.rs/passkeys.rs into
per-screen directories with mod.rs, view.rs, view_model.rs
- Extract ApplicationRoot, LayoutState, ActiveView, ViewModelStore into new app.rs
- Replace DeviceConnectionState (snapshot-based) with reactive Entity<DeviceRepo>
- Replace ViewCache with ViewModelStore using uniform get_or_insert_with lazy init
- Add AppModels DI bag shared across all view constructors
- Move side types (UsbIdentityPreset, LedDriverType, etc.) into local view_model files
- Delete src/ui/types.rs
- Strip thinking-out-loud and notes-to-self comments from
device/fido/hid.rs, device/rescue/mod.rs, error.rs, ui/views/passkeys.rs
- Replace redundant let c_i = i binding with direct i usage (Copy type)
- Replace magic number 8 with LedColor::all().len() in config.rs
Summary of changes:
- src/device/fido/constants.rs — added ML-DSA-44/65/87 post-quantum COSE algorithm variants (-48 to -50); updated from_raw/Display; refreshed VendorCommand docs with version history and RS-Key caveat; removed stale CTAP2-vs-firmware discrepancy comment
- src/device/rescue/constants.rs — added 8 new curve flags to RescueCurves (SECP256R1, SECP384R1, SECP521R1, BP256R1/384R1/512R1, ED25519, ED448, CURVE25519, CURVE448); corrected MANAGEMENT_AID doc to say it's available on both firmwares
Non-breaking. All additions are purely additive:
- CoseAlgorithm — only accessed via from_raw() (has _ => None catch-all) — existing match arms unaffected
- RescueCurves — bitflags! type, existing code only touches SECP256K1 via contains/bits — new flags don't affect those
- cargo check and cargo clippy both pass clean with no warnings