Item 11: a "Presets" button (top-right) opens a dialog to save the current
table view -- column arrangement + visibility, sort, and all active filters --
as a named profile, load a saved one, or delete it. The built-in "Default"
profile is always the first preset and shows IP, Model, Hashrate, Power, Chip
temp, Firmware, Control board, PIC and Status; the app now boots with it.
- New presets.rs: a serde-serialized PresetView snapshot of ViewState (Vec-based
so the JSON has no enum map keys), Preset { name, view }, and load/save to
~/.config/alkane-toolkit/presets.json. "Default" is re-seeded on load and not
written, so it can't be lost or deleted. A loaded preset missing newer columns
still covers every column (they're appended hidden).
- serde/serde_json added to alkane-gui (already vendored + locked via asic-rs);
Column/ColFilter/TextOp/NumOp derive Serialize/Deserialize and ViewState is
now Clone.
- ui.rs: build_presets_dialog + apply_preset_load/save/delete, wired to the new
Presets button.
Unit tests: default-preset round-trips through ViewState and JSON.
cargo check --release --tests is clean.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y8h447BPyJR4fioYZvQ9bh
Completes the right-click config menu (round-2 item 11): the menu now offers
real actions computed from the intersection of what every selected miner
supports, and applies them to the fleet over the network.
- Capability detection: to_row probes each miner's asic-rs supports_* methods
(fault light, restart, pause, resume, power limit, tuning) at scan time and
stores them in MinerRow.caps -- no extra network round-trip.
- Intersection: MinerCaps::intersect_all yields the actions common to the whole
selection; the context menu offers only those (a mixed mining + idle selection
shows just fault light + restart; an all-mining selection shows everything).
- Write path: scan::start_config_action runs on a background thread -- it
re-discovers each selected miner with asic-rs scan_miner(ip), applies the
setter, and reports per-IP results that drain into the status bar (running
progress while applying, a pass/fail summary when done). Cancellable, and a
new action cancels any in-flight one so two never overlap. In fake-scan mode
it simulates success so the flow is exercisable offline.
- Actions: fault light on/off, pause, resume, restart apply immediately; set
power limit and set tuning % open a small value-prompt dialog first. Factory
reset, change password, and firmware upgrade are deliberately not exposed in a
casual right-click.
Adds the `measurements` dependency (already in the lock, transitive via asic-rs)
for Power::from_watts.
Review fixes (one review pass):
- Restart / pause / resume now require a confirmation dialog (naming the count)
so a misclick can't stop a producing fleet; fault light stays instant, and
power/tuning are confirmed by their value entry.
- The action result is held on the status bar for a few ticks so a fleet
action's outcome (including failures) isn't clobbered by the next timer tick.
- The action loop uses a current-thread tokio runtime (it applies to one miner
at a time; a worker pool was wasted).
- The value prompt validates before closing: a bad value keeps the dialog and
the captured selection so it can be corrected.
- The menu's "(N)" counts use the rows-backed selection, matching what is
actually acted on.
Verified off-screen: capability intersection (mixed vs all-mining selections),
the value-prompt and confirmation nested modals (menu -> dialog) with no crash,
the end-to-end apply flow, 46 unit tests (incl. a caps-intersection test), and
the headless self-test.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y8h447BPyJR4fioYZvQ9bh