45 Commits
Author SHA1 Message Date
noahandClaude Opus 4.8 6e785275da feat(gui): two-choice restore, dialogs-during-scan, creds-from-settings
source / check (pull_request) Skipped
verify / verify (pull_request) Canceled after 12m59s
Restore-to-stock dialog overhaul (issues #46, #47, #48, #51): a two-source
restore -- the board's on-board stock backup (checkbox, auto-detected via the
merged alkane-flash onboard_stock_backup_present and greyed out with
set_enabled when absent) or a Bitmain stock firmware file picked with a Browse
button (OTA .tar.gz or SD .zip, any X17-series model). The alkane root login
comes from Settings (no per-dialog password field); on-board restore uses the
new stock_ops::start_restore_onboard over DSH's restore_from_onboard_backup.

Install dialog: password field removed too (#46); the login comes from Settings.

Dialogs during scan (#43): install/uninstall dialogs open and can be prepared
while a scan runs (new flash_busy gate); the scan is stopped only when the
operation actually starts (stop_scan_for_op) so the two never touch a board at
once.

Bug report (#50): the always-present "Open issue" button is gone; filing turns
it into a clickable "View issue #N" link.

wx-rs: add set_enabled (grey out a control); captured as patch 0013. Merges
DSH's alkane-flash on-board backup/restore method (sealed in stock_method.rs).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B1W6qKwKxq3oUPDKWicM6i
2026-11-13 13:53:28 -06:00
noahandClaude Opus 4.8 69dcedbd9c build(wx-rs): capture the word-wrap text-ctrl edit into the patch queue
source / check (pull_request) Skipped
verify / verify (pull_request) Failing after 8m11s
verify / verify-windows (pull_request) Skipped
The #37 wrap fix edited the vendored wx-rs tree (wxbr_text_ctrl_wrap in the C++
bridge + text_ctrl_wrapped in widgets.rs) but not the patch queue, so the
`wx_rs_patches.py check` CI gate failed. Capture the delta as patch 0012 so the
queue reproduces the patched tree again.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B1W6qKwKxq3oUPDKWicM6i
2026-11-13 12:02:38 -06:00
noahandClaude Opus 4.8 aab9b63350 fix(gui): install feedback, local .afw picker, scan icons, report wrap
source / check (pull_request) Skipped
verify / verify (pull_request) Failing after 10m54s
verify / verify-windows (pull_request) Skipped
Addresses the bench bug reports filed from the toolkit (issues #37, #38, #39)
and the request for a local-file install source.

Install (issue #38): the install never reached the worker in the reported
case and aborts were only a status-bar line, so the operator saw nothing.
Abort reasons (missing FLASH keyword, no release/asset, no target) now raise
the visible error indicator and keep the dialog open; the actual per-board
failure detail is surfaced and logged instead of a bare count; a clear
"installing..." line and log entry mark the start.

Install source (requested): the install dialog gains a "Browse local .afw"
button beside the Gitea release picker, in the same window. A chosen file
takes precedence over the selected release. start_install takes an AfwSource
(Release or Local); a local file is used in place, a release is downloaded as
before. This brings the CLI's local-file install to the GUI.

Scan icons (issue #39): a hashboard the firmware lists with no active flag and
no working-chip count now reads grey (not detected) instead of green, and the
PSU bolt greens only on real delivery evidence (watts, PSU fan, or PSU output)
-- is_mining counts only when the miner is actually hashing. A stock S17
control board with no PSU or hashboards attached asserts a cgminer mining
status at zero watts, which previously showed green board and PSU icons.
Confirmed against the bench S17 at 10.255.1.111 (reports watts=0). Regression
tests added for both.

Bug report (issue #37): the report box word-wraps instead of running off the
edge (new wx text_ctrl_wrapped without wxTE_DONTWRAP). Sub-window movability
is window-manager behaviour (the dialog already has a caption and resize
border) and is not changed here.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B1W6qKwKxq3oUPDKWicM6i
2026-11-13 09:45:46 -06:00
noah ac6bc20c68 Merge branch 'feature/afw-os-bundle' into release-next-stage
source / check (pull_request) Failing after 20s
verify / verify (pull_request) Skipped
2026-11-11 18:21:46 -06:00
noahandClaude Opus 4.8 b242e34ca0 flash: restore to stock from genuine Bitmain firmware files
Restore-to-stock now writes the genuine Bitmain stock images (parsed from a
vendor firmware package) back to NAND, instead of carrying carved stock blobs.

- stock_firmware: new parser for genuine Bitmain Antminer packages - the OTA
  update .tar.gz (outer sign wrapper -> inner fw.tar.gz) and the SD recovery
  .zip. Extracts BOOT.bin / devicetree.dtb / uImage (kernel) / uramdisk (rootfs)
  and verifies the rootfs md5 when the package lists one. Shells out to the
  system tar/unzip. Verified against real S17 packages.
- stock: restore_to_stock now takes the stock images (RestoreImages); the stock
  kernel/dtb/rootfs are no longer carried as assets. The boot regions are not
  exposed to Linux on alkane, so the existing NAND-registration helper is kept to
  make them writable, then the supplied genuine images are written at the vendor
  offsets (dtb 0x1a00000, kernel 0x2000000, rootfs; BOOT.bin preserved).
- The SD recovery image is the complete source: it includes the device tree,
  which the stock legacy-uImage kernel needs at 0x1a00000 and which the OTA
  update packages omit. Restore requires it and points the user to the SD image
  when a package has no dtb.
- Post-reboot the board returns to stock under its stock MAC and typically takes
  a new DHCP lease, so a wait on the original address is best-effort and no longer
  reported as a failure.
- cli: afw restore-stock takes --stock-firmware <file>. gui: the uninstall dialog
  takes the firmware file path.

Also clear the branch's clippy debt so the full gate passes: a type alias/allow
for the hardware map tables and multi-arg write functions, plus small mechanical
fixes (useless format, op-ref, collapsible match). wx-rs patch 0011 records the
wxWidgets 3.2 build-compat edits.

Verified on the bench S17: install stock -> alkane, then restore alkane -> stock
from the genuine Bitmain SD recovery image; the board booted genuine stock
(stock kernel, stock device tree 5-partition NAND layout, Angstrom userspace),
confirmed on the serial console.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B1W6qKwKxq3oUPDKWicM6i
2026-11-11 18:08:09 -06:00
noahandClaude Opus 4.8 82492231bc gui: right-click install/uninstall of alkane-os via the self-contained engine
Wire the GUI to the toolkit's own compiled-in, network-only stock<->alkane engine
(alkane-flash::stock) and the .afw fetch/verify (alkane-artifacts), so a scanned
control board can be right-clicked to:

  - Install alkane OS (from stock): scans alkane-os releases on Gitea, picks one
    (newest first; pre-releases marked), downloads+verifies the .afw, and installs
    it onto each selected board over the network. Optional board password and an
    allow-unsigned (bench) toggle; typed FLASH confirmation.
  - Uninstall alkane OS (restore to stock): restores each selected board to
    genuine stock over the network, with the board's alkane root credential and a
    typed FLASH confirmation.

Both run on a background thread (stock_ops.rs), streaming progress/results to the
status bar, and share the exclusivity guards so they never race a scan/flash/
restore. These use the same engine the CLI drives; the GUI's older asic-rs
firmware-upload path stays disabled.

alkane-artifacts: add list_releases + fetch_afw_url for the release picker, and an
optional build-time embedded read-only token (option_env!("ALKANE_EMBEDDED_TOKEN"))
so a distributed GUI can scan the private alkane-os releases with no setup; the
env token still wins, and no secret is in the source tree.

wx-rs (vendored, patched): build on system wxWidgets 3.2 - guard the 3.3-only
wxApp::SetAppearance/Appearance behind wxCHECK_VERSION(3,3,0), and emit GTK's own
shared libs (pkg-config --libs gtk+-3.0) at link time since the widget bridge
calls GTK directly. Enables the Linux GUI release build.

docs/install.md: document the GUI actions and that the stock-assets repo is now
public (no token for install/restore; only release scanning needs one).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B1W6qKwKxq3oUPDKWicM6i
2026-11-11 14:18:24 -06:00
noahandClaude Opus 5.5 d22ee79159 Keep every coloured text readable in light and dark themes
verify / verify (pull_request) Successful in 7m18s
verify / verify-windows (pull_request) Successful in 4m48s
source / check (pull_request) Skipped
Checked in real system dark and light mode on macOS (SkyLight theme
switch on the M1, restored afterwards), Windows 11 (the app-mode
setting, run on the VM's desktop) and Linux (Adwaita and Adwaita:dark),
measuring each screenshot's text against its background with the WCAG
contrast formula.

The app's own colours fell short on every platform. The fixed firmware
hues were 2.6 to 3.9:1 (LuxOS gold and ePIC blue on light, Alkane navy,
Braiins purple and Bixbit red on dark). The hashrate greens and
temperature purples were about 4:1, and the play/pause icons about 2:1
on light buttons.

- readable()/readable_at(): nudge a colour toward black (light theme)
  or white (dark theme), keeping its hue, until it reaches 4.5:1 for
  text (3:1 for icons) against every given background.
- palette(): green/amber/red/accent/label are made readable against the
  window, the zebra row and the KPI card; Palette::text() guards every
  computed cell colour (ratio and temperature blends, firmware hues).
- Media button icons: at least 3:1 against the theme's button face.
- macOS snapshot (wx-rs patch 0011): capture the window's frame view.
  The content view alone left unpainted areas transparent, which read
  as a white toolbar strip in dark mode. On screen the area was always
  the dark window colour.

After the change, no app-coloured text is below 4.5:1 in any of the
six theme/platform combinations. What the checker still flags is theme
chrome (grid lines, GTK header labels, button outlines, the zoom
slider) and anti-aliasing on thin fonts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BdKQBRg6YCM1XXQCTnD5GF
2026-11-04 13:40:10 -06:00
noahandClaude Opus 5.5 c9d32f9793 Fix macOS table cells hiding their text; add a self-test snapshot
On macOS several table columns showed no values until a row was
clicked. wxOSX draws custom cells without clipping to the cell, and the
segment renderer paints its zebra background over an oversized rectangle
(a column width either side, 40 px up and down) that GTK and MSW clip
to the cell. On the Mac each cell's fill painted over its neighbours.
Selected rows skip the fill, so their text came back.

On macOS the zebra is now the table's native alternating rows. AppKit
paints them under every cell in the theme's colours, and no row
carries a background attribute, so the renderer never fills. Plain
segment text uses the theme-aware list text colour instead of the
control's foreground colour.

To check rendering without screen-recording permission, the self-test
takes ALKANE_SNAPSHOT=path (macOS) and writes a PNG of the window as
the app draws it (osx_native.mm: cacheDisplayInRect). Before/after
snapshots on the M1 confirm the fix in light and dark appearance.

wx-rs patch 0010. Also folds in PR #24 (build-gui-macos without
--locked).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BdKQBRg6YCM1XXQCTnD5GF
2026-11-04 10:40:43 -06:00
noahandClaude Opus 5.5 bb31a7befc macOS build: universal app for Apple Silicon and Intel, macOS 11+
verify / verify (pull_request) Successful in 7m33s
source / check (pull_request) Skipped
verify / verify-windows (pull_request) Successful in 5m48s
- scripts/build-wx-macos.sh: static, monolithic, universal (arm64 +
  x86_64) wxOSX/Cocoa 3.3.3 from the vendored tree, with wx's bundled
  image/zlib/regex/expat so the app links only system frameworks.
  Minimum macOS 11.0: current SDKs' libc++ supports nothing older.
- scripts/build-gui-macos.sh: builds both Rust targets against that
  prefix and merges them with lipo.
- ci/package-macos.py: "Alkane Toolkit.app" (Info.plist, icon, local
  network usage string), ad-hoc signed, zipped with ditto as
  alkane-toolkit-vX.Y.Z-macos-universal.zip with LICENSE and README.
- crates/alkane-gui/macos: app icon (.icns) from the same glyph as the
  Windows icon, plus the script that makes it.
- wx-rs patch 0009: macOS goes through wx-config (drops the universal
  -arch flags, maps -framework), reports logical sizes like GTK/MSW
  instead of narrowing floats to ints, and links clang's compiler
  runtime for wxOSX's @available checks.
- docs/macos.md, README and the manual's install chapter.

Verified on an M1 running macOS 27.0.1: both slices build, all
workspace unit tests pass, and the headless UI self-test passes 52/52
on arm64.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 15:26:56 -06:00
noahandClaude Opus 5.5 be5edfc2bf Port the toolkit GUI to Windows (wxMSW, cross-built with mingw-w64)
Build: the wx-rs build script chose the platform with cfg!(), which in a
build script describes the build host, so a Linux-to-Windows build took the
GTK path. It now reads CARGO_CFG_TARGET_*, and Windows/GNU builds through
wx-config exactly like GTK, against a static wxMSW from
scripts/build-wx-windows.sh. The C++ runtime is linked statically, so the
.exe imports only Windows system DLLs. crates/alkane-gui/build.rs embeds an
application manifest (Common Controls v6, per-monitor DPI v2, UTF-8 code
page, Windows 10/11), the icon and version info.

Bridge on wxMSW (patches 0007/0008):
- the upstream frame's invisible "OSX key events" child sat above the UI on
  MSW and swallowed every click and key; it is no longer created there
- light/dark is chosen before the first window (wxMSW ignores it later) and
  follows the Windows app mode, with dark grid rules for the data view
- the generic wxDataViewCtrl gets mouse input in its inner main window, so
  drag-select and the per-cell / per-icon tooltips bind there (GTK keeps
  its native GtkTreeView paths; the icon hit-test is shared)
- sizes cross the Rust/C++ boundary in DIPs (identity on GTK), so columns,
  icons, KPI cards and the status bar scale at 125-200 %
- vector shapes go through GDI+ (anti-aliased like Cairo on GTK); selected
  rows use the themed list-view text colour like the native renderer
- the frame never opens larger than the monitor work area; title-bar icon
  from the executable; upstream menu insert no longer reads UTF-8 as UTF-16

App: OS differences live in alkane_core::platform (settings in
%APPDATA%\alkane-toolkit, owner-only secret files, NUL, console-less helper
processes). SSH password logins use SSH_ASKPASS with the toolkit itself as
the helper on every platform, replacing sshpass, which Windows lacks.
Release builds are GUI-subsystem; headless modes attach to the parent
console.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 18:32:44 -06:00
noahandClaude Opus 5.5 569ef9dcd8 Make the wx-rs patch queue reproducible and checkable
The queue had drifted from the patched tree it describes: 0003 predated
rounds 12-19 of bridge work, 0005 no longer applied on top of it, and the
Cargo.toml note and the case-duplicate readme.md were in no patch at all.
Vendor the pristine crates.io crate (sha256 pinned in VERSION) and add
scripts/wx_rs_patches.py: 'check' rebuilds the tree from upstream + patches
and requires an exact match, 'capture' records an edit as the next patch.
0002/0003 are regenerated to the current bridge files (0005's GTK tooltip
fix is folded into 0003); 0005 now carries the packaging leftovers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 18:32:30 -06:00
noahandClaude Opus 4.8 1f0a4cbe76 fix(gui): health icon tooltips never showed -- tip area used wrong coordinates
Round 19 #2. The health-icon hover tooltips never appeared because the GTK
query-tooltip handler built the per-icon "tip area" from gtk_tree_view_get_cell_area
(BIN-WINDOW coordinates) and passed it to gtk_tooltip_set_tip_area, which expects
WIDGET coordinates. The area was offset upward by the column-header height, so it
did not contain the pointer, and GTK suppresses any tooltip whose tip area excludes
the cursor -- so nothing showed. The Errors column worked because it sets no tip
area. Prior fixes (rounds 15/18/19) only tuned the icon slot math, which was already
correct; the coordinate-system mismatch was the actual cause.

Convert the slot rectangle from bin-window to widget coordinates with
gtk_tree_view_convert_bin_window_to_widget_coords before gtk_tooltip_set_tip_area.
The slot hit-test (block_left/adv, in bin-window coords) is unchanged and still
matches DrawShape's uniform health-icon advance. wx-rs patch 0005.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Djv3oncM4LxTS5tb61Ako6
2026-09-24 10:03:58 -06:00
noahandClaude Opus 4.8 ad28dab542 round 19 review fixes + Health-column alignment + badge-push fix
Health column (operator-reported): give every component-health icon a UNIFORM
fixed-width slot in the SegmentRenderer (GetSize + DrawShape), so power/control/
fan/board icons line up in fixed columns across rows regardless of glyph aspect,
and left-align the icon columns (Health/Access/Light) so the block anchors at a
consistent left edge. The per-icon tooltip hit-test uses the same uniform slot.

Code-review-harness fixes:
- High: isolate per-miner telemetry with catch_unwind so one miner's get_data
  panic can't abort the whole scan (and strand the fast-path partial rows).
- Medium: fill the zebra stripe across the full cell for right-aligned colored
  columns (was anchored at the content's left edge, leaving the left unstriped).
- Medium: lower the scan-concurrency ceiling 512 -> 256 (128 is fully reliable,
  192 already dropped responders on the live fleet).
- Medium: board voltage/frequency sort key skips placeholder-zero boards
  (avg_positive), matching how the cell renders them as "-".
- Low: saturating_add for accepted/rejected share sums; moved an orphaned doc
  comment; corrected a stale comment.

CI: fix the README-badge push-back -- `git push -c http.extraheader` is invalid
(`-c` must precede the subcommand), so the badge/coverage/bench-baseline commit
never actually reached main; now `git -c http.extraheader=... push`. This also
lets the bench-delta baseline persist so the delta can compute.

Demo: the offline-demo paused miner now has detected (idle) hashboards so the
paused-blue Health icons (round 19 #19) are exercised.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Djv3oncM4LxTS5tb61Ako6
2026-09-23 12:21:03 -06:00
noahandClaude Opus 4.8 42e3bf8f5b round 19: columns, scan speed, per-firmware logs, more scanned fields
Table/columns:
- Fix the "columns shrink to tiny" bug on language change / add / hide (#3, #24):
  the rebuild-time capped autosize read column widths before GTK's measurement
  landed. Columns keep their default widths; autosize is on-demand only.
- Right-align every column except IP (#21): new alignment param on the bridge
  append calls; the SegmentRenderer and the tooltip hit-test honour it.
- "Auto-size all columns" header menu item; Ctrl+A selects all rows (#4).
- Remove the Boards (dots) column (#7).
- Split the slash-joined Fan column into per-fan columns Fan 1-4 (#8).
- Efficiency: unit moved into the value and made algorithm-aware (J/TH for
  SHA256 families, J/kSol for Equihash), fixing the blank/garbage figure on
  non-SHA256 miners (#9, #23).
- Pool account column before Worker by default (#22).

Scan:
- Fast scan (#18): emit a lightweight identity row the instant a miner is
  identified, then upsert the full telemetry row when get_data completes.
- User-adjustable scan concurrency with a bounded max (#25).
- Surface more scanned values as columns (#10): current tuning target, accepted
  / rejected shares + reject %, and per-hashboard hashrate / voltage / frequency.

Logs (#11-16): fetch the miner log through asic-rs's per-backend read_logs()
instead of the narrow curl paths, fixing Braiins / LuxOS / Z15 / BixBit / stock
Antminer; WhatsMiner keeps the fault-code fallback (no API log). Removed the
summary tidbits from the log viewer (#13).

Misc: fix per-icon health tooltips (advance math matched to the renderer) (#2);
paused miners show blue hashboard icons, healthy stays green (#19); state-aware
Pause/Resume in the right-click menu (#20); export opens a column-picker dialog
(#6) and the default filename carries a UTC timestamp (#5); the scan status bar
says "Scan Paused" / "Scan Stopped" and no longer overwrites Stop with paused
(#17); the bench badge shows the weighted-average microbench delta vs the
previous release (#1).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Djv3oncM4LxTS5tb61Ako6
2026-09-23 11:40:21 -06:00
noahandClaude Opus 4.8 3b18219e4e review wave 1: fix the critical restore false-success + security/correctness findings
From the recursive multi-agent review (18 confirmed findings). This wave clears
the critical, four highs, and several mediums/lows:

- CRITICAL restore.rs: a Braiins SSH restore reported SUCCESS on a wrong password
  or unreachable miner. run_with_timeout now captures the exit code and drains
  stderr on its own thread (also fixing the medium stderr-pipe stall), and a new
  testable classify_braiins() treats an ssh auth/connection failure (stderr
  diagnostic, empty stdout, non-zero exit) as failure while still reading a
  dropped connection / timeout as the expected reboot. Unit-tested.
- HIGH restore exclusivity: apply_restore_confirm now refuses when a scan/refresh/
  action/flash or another restore is in flight, so this destructive action never
  overlaps or orphans a running restore handle.
- HIGH secrets off the command line: Braiins SSH uses `sshpass -e` (env, not -p),
  and the access-probe curl passes credentials through a config on stdin (-K -)
  instead of `-u user:pass`; both were visible in the process list. New masked
  password field (wxTE_PASSWORD bridge) so the Credentials dialog no longer
  renders saved passwords in the clear.
- MEDIUM correctness: per-board Chip-temp readings are now index-aligned with the
  boards (a missing middle board shows "-" instead of shifting later boards left).
- MEDIUM: saved pool lists (which can hold a pool password) are chmod 0600.
- LOW: access-probe curl timeout now reaps the child (no zombie).

95 tests (+classify_braiins) + clippy-clean + selftest green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Djv3oncM4LxTS5tb61Ako6
2026-09-22 18:45:56 -06:00
noahandClaude Opus 4.8 749cdc4eed item 12: CI verify/release split, dependency audit, README + badges
CI is now two workflows: verify.yml (pull requests + non-main pushes) runs the
clippy gate, build, unit tests, microbenchmarks, the headless self-test, and a
best-effort dependency audit; release.yml (main) repeats the clippy gate + audit
before its existing build/test/selftest/package/release, then refreshes the
committed README badges and pushes any change back (best-effort, and a badges-
only push does not bump the version, so it does not loop).

Security: cargo audit found a build-time-only advisory (h2 0.3 in the wx-rs
build script's reqwest 0.11 subtree, never linked into the runtime binary and
never executed on Linux). The vendored/offline tree can't upgrade it without
re-vendoring, so it is documented and accepted in .cargo/audit.toml (mirrored in
deny.toml with the project's permissive-license policy).

Badges: ci/gen-badges.py emits self-contained shields-style SVGs into badges/
(tests, coverage 36%, bench, LOC 12.5k, clippy clean, dependencies, license) --
committed and referenced by relative path so a self-hosted Gitea renders them
with no external service. README rewritten around what the toolkit actually does
today (discover / monitor / operate / install), with build, CLI, dev, and
architecture sections and the dual-license note.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Djv3oncM4LxTS5tb61Ako6
2026-09-22 18:17:31 -06:00
noahandClaude Opus 4.8 b839e9012d gui: default column widths fit contents, capped (round 18 #10)
Columns previously always opened at generous fixed defaults, wasting
horizontal space. Now, the first time the table is populated after a
(re)build, each column is sized to the smaller of its content-fit width
(wxCOL_WIDTH_AUTOSIZE, floored at 24px) and its configured default (the
cap). Done once per rebuild via a new columns_autosized latch, so a
user's later manual resize is preserved -- scan-update refills skip it.

New bridge: wxbr_dvlc_autosize_col_capped (SetWidth AUTOSIZE, read back,
floor, clamp to cap, SetWidth) + Widget::dvlc_autosize_col_capped.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Djv3oncM4LxTS5tb61Ako6
2026-09-22 17:01:25 -06:00
noahandClaude Opus 4.8 64e084ddee ui: per-icon tooltip repositioning + Zcash units/expected (round 18 #4a/#6/#7)
- #4a Health-column tooltips now reposition per icon: the query-tooltip handler
  scopes GTK's tip area to the hovered icon's slot, so moving across icons hides
  the old tooltip and shows a fresh one at the new position (was stuck in place).
- #6 Plain Antminer Z15 firmware omits the expected hashrate (the Z15j reports it),
  so it's filled from the model nameplate (420 KSol/s) -- the actual/expected
  column + colour now work for Z15 like every other miner.
- #7 Equihash hashrate now shows correct units: Sol/s (not TH/s). The stored value
  is Sol/s/1e12, so ths*1e12 recovers the Sol/s count; the per-board tooltip and
  the hashrate KPI card now label Equihash as Sol/s with an SI prefix.

Unit tests (equihash_hashrate_units) + health tests pass; SELFTEST PASS.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Djv3oncM4LxTS5tb61Ako6
2026-09-22 16:45:45 -06:00
noahandClaude Opus 4.8 e45e6eaf91 ui: shrink brain icon, light toggle, blank all unknown-PIC (round 18 #1/#9/#11)
- #1 The control-board (brain) Health icon is drawn at 82% in its full slot, like
  the fan, so it no longer reads oversized (slot advance + tooltip hit-test unchanged).
- #9 The right-click menu now shows a single state-based light toggle: "Stop
  flashing lights" when any selected miner's locate light is on, else "Flash lights".
- #11 The PIC column is blank for every unknown case (non-Antminer makes and
  unclassifiable Antminer models) -- no more "?".

SELFTEST PASS; pic test updated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Djv3oncM4LxTS5tb61Ako6
2026-09-22 16:28:26 -06:00
noahandClaude Opus 4.8 8e67c50fe0 health/pic: shrink fan icon (R1), blank PIC for non-Antminers (R6), add build cleanup
Round 17 queue.

R1 -- the cooling-fan icon in the Health column read as oversized next to the
brain/chip/bolt icons. All four use a square 512x512 viewBox at the same slot
size, so the fan only *looked* bigger because the Font Awesome fan glyph fills
its box more. Draw the fan at 80% size, centred in its full-size slot, so the
slot advance and the per-icon tooltip hit-test (both keyed to the full width)
are unchanged and nothing else moves.

R6 -- WhatsMiner and other non-Antminer makes showed "?" in the PIC column. A
per-board PIC MCU is an Antminer hashboard property with no meaning elsewhere, so
the cell now shows nothing for non-Antminer brands; an unknown *Antminer* model
still shows "?".

Build hygiene (user ask) -- add scripts/clean-old-builds.sh to reclaim the local
cargo target dir. The app/CLI ship as release and tests run under --release, so
the debug tree, cross-compile trees, and coverage tree are disposable; a stray
cargo check had grown the debug tree to 38G and filled the disk. The script drops
those, keeps the warm release build, and is meant to run after each release push.

SELFTEST PASS; model tests (pic_locked, faults_attribute, health) pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Djv3oncM4LxTS5tb61Ako6
2026-09-22 10:31:51 -06:00
noahandClaude Opus 4.8 bafbd519bb GUI round 15 (part 2, #13): Settings menu, localization, Logs page
Add a Settings menu (the old Credentials toolbar button is now "Settings")
containing Credentials, a Language sub-menu, and a Logs page.

Localization (#13): a small i18n layer -- visible strings are wrapped in
t("English") and looked up per language, falling back to English. Built-in
translations for Mandarin, Russian, French, Spanish and Portuguese cover the
toolbar buttons, KPI captions and table column headers; changing the language
re-labels them live (columns via a table rebuild) and localizes dialogs as
they open. The choice persists under the config dir and loads at startup.
(Dialog-internal strings and status text are not yet fully translated -- the
framework is in place to extend them.)

Logs page (#13): an in-app activity log (scans, operations applied, export,
language change) shown in Settings > Logs with Refresh / Clear.

New wx-rs bridge: menu sub-menus (menu_append_submenu). Bridge patches
0002/0003 regenerated. Unit tests + headless selftest pass; the Chinese UI
was verified rendering end to end.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Djv3oncM4LxTS5tb61Ako6
2026-09-21 14:54:10 -06:00
noahandClaude Opus 4.8 0d19e958f0 GUI round 15 (part 1): pool dropdowns, aligned health icons, export, more
Twelve of the round-15 items (the code items; the live-hardware flashing/
testing and the settings/localization/logs work follow separately):

#1 Configure-pools: three pool rows (address, account, worker, password),
each field with a "+" dropdown of presets (top-11 BTC pool stratums;
worker-name placeholders) plus user-addable, persisted entries. Worker
picks insert at the cursor rather than replacing. Writes up to three pools
per miner via set_pools_config, worker expanded per unit.

#2 PIC detection: replace the broken SSH i2cdump (it read 0x48, the temp
sensor, not the PIC) with a model lookup -- no firmware exposes PIC over the
network, so infer it from the model (noPIC: S19k Pro, S21 family, T21,
explicit noPIC; PIC: rest of the S19 line).

#4 Zoom: an editable percent field in the status bar (type an exact scale)
and Ctrl +/- / Ctrl+0 to zoom in/out/reset.

#5 Health icons align in fixed slots (power, control, fans, hashboards);
miners with fewer fans/boards leave a gap so hashboards still line up. The
max fan/board counts are computed parametrically from the fleet.

#6 Light: the locate-light column is on by default (last), shown as a
green-over-red beacon flashing quickly instead of a single amber dot.

#8 The bottom-left status line is now scan-only; operation progress lives in
the Health column (per miner) and failures in the bottom-right indicator.

#9 / #10 / #11: drop the Credentials-dialog blurb; move the scan-ranges
format help to a tooltip; make Restore-to-stock a plain confirmation (no
typed keyword, no warning wall).

#12 Z15 fans: the v2020 backend now reads fans from higher fan slots
(the Z15 reports fan3/fan4 with fan1/fan2 = 0). Vendored patch 0009.

#14 Export: an Export button writes every scanned data point to a CSV, one
value per cell (lists expanded to indexed columns) -- complete and
machine-readable, unlike the on-screen table.

#15 Health tooltips are per-icon: hovering a specific fan or hashboard shows
just that component's state, with errors attributed to the board that names
them in the message.

New wx-rs bridge surface: widget tooltips, save-file dialog, insert-at-cursor,
status-bar zoom entry + Ctrl+/-, the light beacon + alignment-gap sentinels,
and per-icon cell tooltips (bridge patches 0002/0003 regenerated). Unit tests
(worker templates, PIC map, CSV export, health) + headless selftest pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Djv3oncM4LxTS5tb61Ako6
2026-09-21 14:43:00 -06:00
noahandClaude Opus 4.8 368f992404 GUI round 14: bigger health icons, table zoom, pool config, op progress
Seven items from the round-14 list:

#1 Health icons: render bigger (nearly the full row height) and packed
tighter so a row of component icons stays large and readable; the icon
sizes also scale with the new table zoom.

#2 Scan timeout: a per-miner scan timeout (asic-rs identification timeout)
is now configurable in the Scan-ranges dialog and persisted, so slow
miners can be given longer or fast scans sped up.

#3 Table zoom: a slider in the bottom-right of the status bar scales the
whole table together -- font, component icons, row height, and column
widths -- from 50% to 250% (default 100%). Implemented in the wx bridge
(no Rust round-trip); the custom SegmentRenderer draws its text in the
control's scaled font so the coloured columns zoom like the native ones,
and the zoom is re-applied after a column rebuild so it survives show/
hide/reorder.

#4 Operation progress: while an operation runs on a miner (refresh,
config/light/power/tuning action, firmware flash, restore-to-stock, access
check), its Health cell shows the progress text ("refreshing…",
"restarting…", "setting pools…", …) instead of the component icons, and
reverts to icons when the operation finishes.

#5 Remove the SSH PIC probe: the "Detect PIC (SSH)..." right-click flow and
its dialog, background probe, and pic_probe module are removed. PIC state
stays a best-effort model-string heuristic in the PIC column.

#6 WhatsMiner access: WhatsMiners now show the locked/unlocked padlock in
the Access column instead of a blank cell -- since round 12 #8b gave the
V1/V2/V3 backends their control commands, the same capability heuristic the
other brands use applies to WhatsMiner too (the token access check still
refines a read-only unit to "locked").

#7 Configure pools: a right-click "Configure pools..." flow (gated on the
new pools capability) with three fields -- pool address and account
(required) and an optional worker name. The worker name expands per miner
from case-insensitive placeholders scanned from each unit: {ip1}..{ip4},
{serial}, {mac} (colons removed), {nameplate-hr} (rated TH), {brand},
{model}, {submodel}, {cpu}, {cb}, {firmware}, {hostname}. Applied via
asic-rs set_pools_config on a background thread reusing the action plumbing.

wx-rs bridge patches 0002/0003 regenerated. No vendored asic-rs changes.
Unit tests (component health, worker-template expansion) + headless
selftest pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Djv3oncM4LxTS5tb61Ako6
2026-09-21 12:20:06 -06:00
noahandClaude Opus 4.8 ecdb2fab9d GUI round 13: health-icon column, Z15J algorithm, Credentials + Columns dialogs
Five items from the round-13 list:

#4/#5 Z15 hashrate / unknown algorithm: a Z15J reports its model as
"ANTMINER Z15J", which asic-rs' alias table did not recognise, so it
deserialised to Unknown and its Sol/s hashrate was left un-bucketed as
"unknown hashrate". Add a first-class Z15J model (Equihash) in the makes
crate, plus a family-letter fallback in the v2020 backend so other
un-tabled Antminer models still resolve an algorithm (Z->Equihash,
L->Scrypt, S/T->SHA-256; ambiguous K/DR stay Unknown). Live-verified on
the Z15/Z15J fleet. Carried as vendored patch 0008.

#3 Component-health column: a new Health column (power, control board,
each fan front-to-back, each hashboard) drawn as coloured icons -- grey
unreachable, red down, yellow sub-optimal, green healthy -- replacing the
Errors, Boards and Status columns. Left-clicking the header cycles the
sort through the component facets (overall/power/fans/hashboards); the
active facet shows as a tag beside the chevron. Errors move to the cell
tooltip. Four operator-supplied Font Awesome icons registered via the
existing SVG-in-cell renderer (new SHAPE_BOLT/BRAIN/FAN/CHIP sentinels).

#2 Credentials: rename the "Set scan credentials" button to "Credentials"
and make the per-firmware defaults the main dialog (the global "all
firmwares" login is folded in as the top row).

#1 Columns dialog: narrower; new Alphabetical and Categories sort buttons
(via a Column::category grouping and a wxbr_reorder_set_order bridge fn);
one mouse handler that does both drag-to-reorder and drag-to-rubber-band-
select (the old BEGIN_DRAG binding had silently disabled rubber-band
selection); Ctrl+A select-all and Ctrl/Shift+Up/Down extend-selection.

wx-rs bridge patches 0002/0003 regenerated. Unit tests + headless
selftest pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Djv3oncM4LxTS5tb61Ako6
2026-09-21 11:06:05 -06:00
noahandClaude Opus 4.8 c74e8ebaca GUI round 12 (#6): fade the locate-light dot in and out
The Light column's flashing-light dot now pulses (fades between ~30% and 100%
opacity over a ~1.6 s cycle) instead of sitting static, so a flashing locate
light reads as live.

- A distinct SHAPE_PULSE_DOT sentinel marks the fading dot, so only the locate
  light pulses -- the hashboard health dots stay solid.
- A wxTimer in the bridge advances an animation phase and, each 100 ms tick, emits
  a row change so the custom cell renderer re-runs (a plain Refresh() does not
  re-invoke a custom renderer under wxGTK's cell caching); the renderer blends the
  dot toward its cell background by the phase. The timer runs only while a visible
  row's light is actually flashing -- fill_rows calls set_light_pulse(true/false)
  -- so there is no idle repaint loop.

Verified under Xvfb: with the fixture whose locate light flashes and the Light
column shown, the dot's measured intensity oscillates across frames (strong amber
to a pale tint and back); with no flashing light the timer stays stopped.
Self-test still passes. wx-rs patches 0002/0003 regenerated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y8h447BPyJR4fioYZvQ9bh
2026-09-20 00:20:37 -06:00
noahandClaude Opus 4.8 1857a9e1a0 GUI round 12 (#9, #11): SVG icons in table cells (access padlocks + status)
Adds an SVG-backed icon path to the table's segment renderer: the Rust side
registers a raw SVG per shape sentinel (with its viewBox dims), and the renderer
recolours it to the cell's segment colour, rasterises once per (sentinel, colour,
height) and caches the bitmap. The recolour matches the KPI cards' svg_recolored
(replace currentColor + inject a root fill so fill-less SVGs inherit the colour).

- #9: the Access column padlocks now use the operator-supplied Font Awesome
  lock/unlock SVGs (red closed = view-only, green open = writable) instead of the
  hand-drawn vector padlock. The vector padlock remains as a fallback if the SVG
  is somehow unregistered.
- #11: the Status column renders its KPI icon (green rabbit = hashing, amber
  turtle = slow, red cracked wine glass = not hashing, blue otter = paused)
  instead of the status text, matching the dashboard cards. An unrecognised
  status still falls back to coloured text.

The status dots (hashboards, locate light) stay vector so the round-12 #6 fade
can drive them later. Self-test updated (Status is now a shape cell, verified
structurally like the other icon columns) and still passes. Verified under Xvfb:
the Access column shows the FA padlocks and, with the Status column enabled, the
four status icons render in their KPI colours. wx-rs patches 0002/0003
regenerated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y8h447BPyJR4fioYZvQ9bh
2026-09-19 23:55:37 -06:00
noahandClaude Opus 4.8 b7a77cbed8 GUI round 12 (#7): batch multi-select in the Columns and Filter menus
Both list widgets now support Excel-style batch selection so several rows can be
toggled at once.

- Filter menu value list (wxCheckListBox): was wxLB_SINGLE, so only one value
  could ever be selected. Switched to wxLB_EXTENDED -- ctrl-click, shift-click
  and rubber-band drag now select a range of values. Clicking any selected
  row's checkbox applies that new checked state to every selected row.
- Columns menu list (wxListCtrl): already multi-select for the drag-reorder, but
  a checkbox toggle only affected the clicked row. A toggle on a row that is part
  of a multi-row selection now applies to every selected row, so several columns
  can be shown/hidden together. Re-entrancy guarded (CheckItem re-fires the
  event).

Verified under Xvfb by driving the real dialogs: ctrl-click selects several
columns and one checkbox click toggles them together; shift-click selects a
range of filter values and one checkbox click toggles them together. Headless
self-test still passes. wx-rs patch 0003 regenerated to match the edited bridge.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y8h447BPyJR4fioYZvQ9bh
2026-09-19 23:38:57 -06:00
noahandClaude Opus 4.8 7901d82c4b GUI round 11 follow-ups: equal-height zebra, backdrop dimming, SVG KPI icons, boards sort
- Zebra stripe heights: the cell rect wx hands a custom renderer is shrunk to the
  content size in BOTH dimensions, so shape cells (dots) and text cells filled
  different-height bands -> unequal stripes across columns. SegmentRenderer now
  fills an over-sized rect (full column width + well beyond the row vertically);
  the cell DC clips it to the real cell, giving uniform full-row stripes. Verified
  in a screenshot.
- Focus dimming: the treeview's own state flags don't carry GTK_STATE_FLAG_BACKDROP
  (that lives on the toplevel), so uncoloured segments (combined-cell slashes,
  target hashrate, "Stock") never dimmed. ThemedTextColour now reads the toplevel
  window's active state (gtk_window_is_active) and forces BACKDROP onto the
  style-context state when inactive, so those segments take the same dimmed themed
  colour the native columns do.
- KPI icons: replaced the hand-drawn vectors with operator-supplied Font Awesome
  Pro SVGs (rabbit=hashing, turtle=slow, cracked wine glass=not hashing,
  otter=paused) plus matching in-repo bolt (power) and hive (hashrate) SVGs. New
  wxbr_svg_icon renders an SVG via wxBitmapBundle::FromSVG; the GUI recolours
  each icon's currentColor to the card's colour and sizes it to the SVG aspect
  ratio. Removed the old wxbr_kpi_icon path.
- Boards column sort: it sorted by total board count (all ~3, so no visible
  order). It now sorts by the number of ONLINE (green) boards, total count as a
  tiebreaker, so units with dead/missing boards surface.

wx-rs bridge/Rust changes mirrored into patches 0002 (widgets.rs) and 0003
(widgets_bridge.cpp) per ADR 0003.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y8h447BPyJR4fioYZvQ9bh
2026-09-19 11:55:39 -06:00
noahandClaude Opus 4.8 e593548746 GUI round 11 (#4): drag-reorder + multi-select columns dialog (no up/down buttons)
Replaces the columns dialog's wxRearrangeCtrl (checkboxes + up/down buttons)
with a wxListCtrl-based list (new wxbr_reorder_list / Widget::reorder_list):
- No up/down buttons; rows are reordered by dragging.
- Native multi-select: Shift/Ctrl-click and rubber-band drag.
- Keeps per-row checkboxes for show/hide; same [idx | !idx] order encoding, so
  apply_columns is unchanged.

Drag-reorder is implemented by recording the selected rows' base indices on
wxEVT_LIST_BEGIN_DRAG and moving that group to the row under the cursor on the
following mouse-up (no real DnD loop is started, so the mouse-up still arrives).

Verified: the dialog opens without crashing and renders the checkable, button-
free list (headless click test). The drag and shift/ctrl multi-select
interactions are not headlessly simulatable and need interactive confirmation.

Bridge + Rust mirrored into patches 0002 (widgets.rs) and 0003
(widgets_bridge.cpp) per ADR 0003.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y8h447BPyJR4fioYZvQ9bh
2026-09-18 18:03:47 -06:00
noahandClaude Opus 4.8 2fd433c3b0 GUI round 11 (#15): drawn icons on the KPI cards
Each KPI card's value now leads with a small vector icon drawn into a
transparent bitmap via wxGraphicsContext (new wxbr_kpi_icon -> Widget::kpi_icon):
rabbit = Hashing, turtle = Slow, broken wine glass = Not hashing, otter =
Paused, hive = SHA-256 Hashrate, lightning bolt = Est. power; Total has none.
The icon takes the card's value colour (amber on the neutral Est. power card so
the bolt reads).

The icons are simple flat silhouettes so they render at ~22px without external
assets (no emoji/pictographs in source). The rabbit, turtle, wine glass, hive,
and lightning read clearly; the otter is the least distinct at this size.

Bridge + Rust mirrored into patches 0002 (widgets.rs) and 0003
(widgets_bridge.cpp) per ADR 0003. Self-test passes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y8h447BPyJR4fioYZvQ9bh
2026-09-18 17:51:09 -06:00
noahandClaude Opus 4.8 6b4961d7bc GUI round 11 (#2): collapse the two wide KPI cards when the window is too narrow
When the window is narrowed past the width needed to fit all seven KPI cards at
their minimum size, the two wide cards (SHA-256 Hashrate, Est. power) are hidden
so the five miner-count cards fill the row; they return when there is room again.
The five count cards still floor the window's minimum width (unchanged).

Adds a resize event to the wx-rs bridge (WxEV_SIZE -> WxEventKind::Sized, p1 =
client width) and a wxbr_sizer_show helper to hide/restore a sizer child and
reclaim its space. The main panel binds it; App::on_resize toggles the two cards
on a state change only (no per-drag relayout thrash). Bridge + Rust changes
mirrored into patches 0002 (widgets.rs) and 0003 (widgets_bridge.cpp) per
ADR 0003.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y8h447BPyJR4fioYZvQ9bh
2026-09-18 17:39:56 -06:00
noahandClaude Opus 4.8 ae437c0d24 GUI round 11 (batch 1): default columns, control-board split cleanup, Stock/Env fixes, relative sort, consistent zebra + focus-dimming, hashboard/light dots, access icon
Table/model (Rust):
- #12: default columns are now IP, Model, Errors, Hashrate, Power, Chip temp,
  Firmware, CPU, Boards, Access, in that display order (initial ViewState and the
  built-in "Default" preset both updated).
- #14: removed the Control board column (CPU + Board replace it); the underlying
  control-board string stays on MinerRow for the SSH PIC probe.
- #6 (part 1): firmware family strips the vendor word asic-rs prepends on stock
  firmware ("AntMiner Stock" -> "Stock"), moving it into FW Version.
- #17: air-cooled miners' ambient reading routes to a new "Env temp" column
  instead of "Fluid temp" (asic-rs reports ambient in its fluid field and has no
  cooling-type flag; cooling type is inferred from the model name).
- #16: relative-hashrate (actual/expected) sort -- the Hashrate header cycles
  absolute-asc/desc then relative-asc/desc, with right-click menu entries;
  HashrateRel is a sort-only pseudo-column.

Rendering (wx-rs SegmentRenderer bridge, mirrored to patches/0003 per ADR 0003):
- #3: the per-row zebra background now fills the whole column-wide cell (wx
  shrinks a custom renderer's rect to the content size, so the earlier fill
  covered only the text; Render now fills GetOwner()->GetWidth() and wxGTK clips
  it to the cell).
- #1/#7: uncoloured segments (combined-cell slashes, "Stock" firmware) take the
  tree widget's themed text colour at its live GTK state, so they dim on
  window-backdrop like the native cells.
- #10: the Boards column renders per-hashboard status dots (green hashing / red
  faulted / grey undetected, board 1 rightmost); the Light column renders a
  yellow locate dot while flashing.
- #13: the Access column renders a padlock icon (green open = writable, red
  closed = view-only) instead of "locked"/"unlocked" text.

Shapes draw from control-char sentinels (never emoji/pictographs), font-
independent. Self-test verifies the icon columns structurally. 82 unit tests
pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y8h447BPyJR4fioYZvQ9bh
2026-09-18 17:24:09 -06:00
noahandClaude Opus 4.8 b343746718 GUI round 10 (batch 2): consistent zebra on custom columns + neutral KPIs dim with focus
R10.1 (zebra consistency): wxGTK does not paint a custom renderer's cell
background, so the per-row zebra colour set via GetAttrByRow appeared on the
native columns but not on the SegmentRenderer columns (Hashrate, Chip temp,
Firmware, ...), making the striping look inconsistent. SegmentRenderer::Render
now paints the row's GetAttr() background itself (skipping selected rows, which
the control already highlights) so every column stripes identically.

R10.2 (focus dimming): the Total-miners and Est-power KPI cards and the plain
segments in combined cells forced an explicit foreground colour, so they did
not dim when the window lost focus like the rest of the dashboard. mk_card and
repaint_theme now leave ColorKind::Neutral cards on the default text colour, and
SegmentRenderer draws an uncoloured segment with the DC's current text
foreground (falling back to wxSYS_COLOUR_WINDOWTEXT) instead of a hardcoded
system colour.

The widgets_bridge.cpp edit is mirrored into the wx-rs patch queue
(patches/0003-widget-bridge-cpp.patch) per ADR 0003.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y8h447BPyJR4fioYZvQ9bh
2026-09-18 15:44:48 -06:00
noahandClaude Opus 4.8 9b5d811b1e GUI round 9 (batch 2): KPI box layout, bottom-right error indicator, algorithm filter + hashrate cycling
Round-9 UI items #5, #6, #7 and the #9 algorithm-cycle follow-on.

#6 KPI boxes: switch the header from a wrap sizer to a horizontal box
sizer with every card at proportion 1 + EXPAND, so the cards are always
equal width and grow to span the full window; a per-card min size
(116x62) floors them at their largest content. Fix the filter-alignment
drift by re-running each card's sizer in refresh_kpis after set_label
(the centring spacers now recompute around the new value width). The
active-filter highlight now paints the card panel and both its texts, so
the whole box tints instead of only the strip behind the text. Bind the
card click on the value and label static texts too (a click on the number
or caption registers the quick-filter, not just the card gap).

#5 error indicator: add a second, colour-tinted status-bar field pinned
to the bottom-right corner (wxbr_status_indicator_init/set in the widget
bridge; a wxStaticText repositioned into the right field on resize). Scan
and apply outcomes route here without overwriting the left scan-status
text: a total apply failure and a scan failure show red, a partial apply
failure amber, full success clears it; a new scan/action clears any stale
message.

#7 algorithm filter: the Filter dialog now offers every column (via a new
ViewState::filter_columns) rather than only the visible ones, so Algorithm
-- and any other hidden metric -- can be filtered without first un-hiding
its column. Filters already match on the plain model cell, independent of
visibility.

#9 hashrate cycling: compute per-algorithm hashrate totals in compute_kpis
(Kpis::hashrate_by_algo, ordered by total). The hashrate KPI card shows
the selected algorithm's total under a "<Algo> Hashrate" caption and
cycles through the running algorithms when clicked (a no-op with a single
algorithm). SHA256 renders as "SHA-256".

Bridge provenance patches 0002/0003 regenerated to match the -patched tree.
Compile-checked (release + tests); 74 offline tests pass; headless
self-test PASS; screenshot-verified equal-width cards, full-box highlight,
click-through-text, and centred values after filtering.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y8h447BPyJR4fioYZvQ9bh
2026-09-18 11:09:50 -06:00
noahandClaude Opus 4.8 77399bdd06 GUI round 9 (batch 1): column-reorder persistence, post-action refresh, algorithm column, hashrate KPI label
- #1 Column reorder now persists (incl. after sorting a moved column). On wxGTK,
  GetColumnPosition() does not reflect a native GtkTreeView column drag, so the
  reorder was read as a no-op and the rebuild snapped columns back. dvlc_col_at_pos
  now reads the real display order from the GtkTreeView (gtk_tree_view_get_columns
  + GTKColumnToWX) on __WXGTK__, falling back to GetColumnPosition elsewhere.
- #2 A right-click config action (e.g. Flash lights) now re-probes the miners it
  targeted when it finishes, so the change shows in the table (skipped after a
  flash, since the unit is rebooting). New App.action_targets.
- #7 New Algorithm column (from asic-rs hashrate.algo: SHA256/Scrypt/Equihash/...),
  categorical so it is filterable via the value checklist.
- #9 SHA-256 Hashrate KPI: card relabelled "SHA-256 Hashrate" and the value drops
  the "/s" ("685 TH", "1.2 PH"). (Per-algorithm click-cycling deferred.)

Note on #8 (Z15 shows T not k): our formatting already derives the SI prefix from
the base value (si_mantissa), so a wrong 'T' means asic-rs reports the wrong unit
for that Equihash model -- an asic-rs backend fix that needs a live Z15 to verify.

cargo check --release --tests clean; patch 0003 regenerated + validated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y8h447BPyJR4fioYZvQ9bh
2026-09-18 10:41:21 -06:00
noahandClaude Opus 4.8 50cd463bee GUI fix: guard out-of-range dvlc GetItem (crash selecting rows after refresh)
Round-9 #10: selecting miners could trip
`datavcmn.cpp: assert "row < m_hash.GetCount()" failed in GetItem(): invalid
index` and crash. wxDataViewIndexListModel::GetItem() asserts on an out-of-range
row, and three bridge helpers called it with an index that can go stale when the
row set shrinks (a filter, or a scan that returns fewer rows): wxbr_dvlc_
ensure_visible (the round-8 scroll-hold, unguarded), wxbr_dvlc_select_rows and
wxbr_dvlc_select_row (only lower-bounded). All three now bound the row against
the store's item count before calling GetItem, so a stale/empty index is a
no-op instead of a crash.

Local wx-rs bridge compile clean; patch 0003 regenerated + validated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y8h447BPyJR4fioYZvQ9bh
2026-09-18 10:29:14 -06:00
noahandClaude Opus 4.8 a81fef3c7d GUI round 8: Errors column hover tooltip (full message list)
Item 12 (tooltip half): hovering an Errors cell now shows the full list of the
miner's error/event messages ("[Severity] text (component)", most severe first)
as a tooltip; the cell itself keeps the compact red summary.

wxDataViewCtrl has no per-cell tooltip API, and wx mouse-motion events are not
delivered to wx handlers on the native GTK control, so this uses GtkTreeView's
native "query-tooltip" signal directly (guarded by __WXGTK__): a per-cell
tooltip map (row, model column) -> text on the AttrListStore, populated from
Rust via a new dvlc_set_cell_tooltip bridge fn, and looked up by the signal
handler using dv->GTKColumnToWX(gcol)->GetModelColumn(). The map is populated on
every platform (a no-op where nothing reads it) so the non-GTK platform round
can wire its own tooltip surface later.

Local wx-rs bridge compile + full cargo check clean; patches 0002/0003
regenerated + validated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y8h447BPyJR4fioYZvQ9bh
2026-09-17 17:37:18 -06:00
noahandClaude Opus 4.8 365732b5d4 GUI round 8b.2 fix: rubber-band drag-select uses native GtkTreeView on GTK
The wx-mouse-event rubber-band approach (LEFT_DOWN/MOTION/LEFT_UP) does not work
on the native GTK wxDataViewCtrl: the underlying GtkTreeView grabs the pointer
during a button drag, so wx never delivers the MOTION events, and only the
initial click row was selected (verified against the shipped binary).

Fix: on GTK, enable the GtkTreeView's own native rubber-band selection via
dv->GtkGetTreeView() + gtk_tree_view_set_rubber_banding(TRUE), guarded by
__WXGTK__ (gtk/gtk.h included only there). The wx-mouse-event approach is kept
as the non-GTK fallback for the future Windows/macOS builds, where it will be
verified in the platform round. The column-header right-click menu (native wx
dataview event) already worked and is unchanged.

Local wx-rs bridge compile clean; patch 0003 regenerated + validated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y8h447BPyJR4fioYZvQ9bh
2026-09-17 17:27:16 -06:00
noahandClaude Opus 4.8 bc9f847689 GUI round 8b.2: column-header menu + rubber-band drag-select
Bridge + UI (local wx-rs bridge compile + full cargo check clean).

- Column-header right-click menu (#5): right-clicking a column header opens an
  Excel-style menu -- Sort ascending / descending, Auto-size this column, Hide
  <column> (not offered for the fixed IP column), and Columns... (the full
  show/hide picker). New wx event WxEV_DVLC_HEADER_RIGHT_CLICK bound from the
  native wxEVT_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK, plus a wxbr_dvlc_autosize_col
  bridge fn (wxCOL_WIDTH_AUTOSIZE). (Sticky/frozen columns are the separate 8c
  dual-control piece.)
- Rubber-band (click-drag) range selection (#10): wxDataViewCtrl has no native
  drag-to-extend selection (only ctrl/shift-click), so it is tracked in the
  bridge -- LEFT_DOWN records the anchor row (and lets the native handler select
  it), dragging with the button down selects the inclusive row range under the
  cursor, LEFT_UP clears the anchor; modifier-clicks are left to the native
  multi-select. Reuses the existing Select/UnselectAll primitives and emits
  SELECTION_CHANGED so the model's selected-IP set stays in sync.
- KPI cards widened to 150px so "685 TH/s" / "21.3 kW" are no longer clipped.

wx-rs patches 0002/0003 regenerated + round-trip validated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y8h447BPyJR4fioYZvQ9bh
2026-09-17 17:13:27 -06:00
noahandClaude Opus 4.8 71cdf2d988 GUI round 8b.1: scroll-hold, zebra striping + vertical gridlines, default-colour text
Bridge + rendering rework (validated with a local wx-rs bridge compile + full
cargo check; CI is the build oracle).

- Scroll position hold (#2): the table no longer jumps to the top as new rows
  stream in during a scan. fill_rows captures the top visible row before the
  clear+refill and restores it after (new wx-rs bridge fns dvlc_get_top_row /
  dvlc_ensure_visible, wrapping wxDataViewCtrl::GetTopItem / EnsureVisible).
- Default-colour text (#3b): rows are no longer tinted wholesale by status. Every
  cell is now the default text colour (black in light mode, white in dark -- the
  SegmentRenderer falls back to wxSYS_COLOUR_WINDOWTEXT for any run with no
  explicit colour), so IP addresses, slashes, expected/target values and all
  non-conditional cells read in the default colour. Only the conditionally-
  formatted columns carry colour: Hashrate/Boards/Chips actual (ratio scale),
  Chip temp (blue-red), fans (grey-blue), Access (red/green), Errors (red), and
  the Status column keeps its own status colour on its own cell.
- Zebra striping (#8): odd rows get a subtle theme-aware background via the
  AttrListStore (a per-row BACKGROUND attr, so it does not disturb the
  default-foreground fallback and the native selection highlight still shows
  through). This replaces the status row-tint as the row separator. (The earlier
  abandoned attempt used SetAlternateRowColour / GTK CSS against the status
  foreground tint; removing that tint is what makes the background approach
  clean now.)
- Vertical gridlines (#8): wxDV_VERT_RULES added to the table style (row lines
  were already on), so columns have borders.
- KPI cards: wxWrapSizer now drops wxEXTEND_LAST_ON_EACH_LINE, so the last card
  on a line is no longer stretched -- the uniform-size KPI boxes stay uniform.

wx-rs patches 0002/0003 regenerated and round-trip-validated against the source.
cargo check --release --tests is clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y8h447BPyJR4fioYZvQ9bh
2026-09-17 16:55:27 -06:00
noahandClaude Opus 4.8 b6afe08a5f GUI round 6: offline detection, combined columns, per-cell colours, paused status, credentials, refresh, firmware flash
Large round implemented via a research workflow (6 parallel readers) then a
file-partitioned implementation workflow (model/scan/bridge/ui/fixtures), all to
one shared contract.

Table / model:
- Offline recognition fix: the scan loop now emits a row for EVERY probed IP -
  non-responders become an "offline" row (new MinerRow.online flag +
  MinerRow::offline()), so unreachable miners show up (offline, red) instead of
  vanishing. Previously only responders got a row.
- Not-hashing rows are now RED (were grey); offline also red.
- New "paused" status (operating_state contains "pause" while not mining):
  its own blue row colour, a blue "Paused" KPI card, and a Kpis.paused count.
- Combined actual/expected columns: Hashrate, Hashboards and TotalChips fold
  their separate Expected* columns into one "actual / expected" cell; the actual
  is drawn on a smooth red->amber->green scale by ratio (100% = green), the
  expected in plain text, the slash black. num_value is carved out so a numeric
  filter never matches a row that only has an expected value.
- Fan column shows every fan's RPM as "rpm/rpm/rpm" (max 3 sig digits, SI-style),
  each fan coloured on its own grey->blue speed scale, slashes black.
- These four columns render via a new wxDataViewCustomRenderer (SegmentRenderer)
  that draws colour runs from a \x1f/\x1e-encoded value; every other column keeps
  the stock renderer and per-row status colour.

Interaction:
- KPI quick-filter: clicking the Hashing / Slow / Not hashing / Paused card
  filters the table to that status (composed with any column filters) and
  highlights the active card; clicking again clears it.
- Removed "Select all" / "Clear selection" from the right-click menu.
- Right-click "Refresh": re-polls the selected miners (asic-rs scan_miner) on a
  background thread and upserts the rows, without a full network scan.
- "Set scan credentials..." button (top-right): stores a username/password
  (~/.config/alkane-toolkit/scan-credentials.txt, 0600) that is fanned out to
  every asic-rs firmware backend via with_firmware_discovery_auth, so scans and
  all right-click actions authenticate. Applied through a new
  credentials::configured_factory() used everywhere MinerFactory::new() was.
- "Flash firmware..." (right-click): asic-rs UpgradeFirmware for the backends
  that support it (stock Antminer + EPIC; every other backend declines and is
  reported as unsupported). File picker (new wxFileDialog binding) + a typed
  "FLASH" confirmation; one miner at a time; cancel only between miners.
- Responsive layout: the KPI and controls rows use wxWrapSizer so they reflow
  when narrow; the min window size drops from 1200x720 to 640x480.

Bridge (wx-rs): SegmentRenderer + dvlc_append_colored_col, wrap_sizer,
bind_click (clickable KPI cards), file_dialog; dropped a vestigial gtk.h include.
Patches 0002/0003 regenerated + round-trip validated.

Portability note: every widget is a stock, natively-backed wxWidgets control
(ports to wxMSW/wxOSX); wxDataViewCtrl is native on Linux/macOS and wx's own
generic (still-correct) drawing on Windows.

Verified: cargo check --release --tests is clean; the release build + tests +
headless self-test run in CI. (Local release link is OOM-blocked on this
desktop; CI is the authoritative build.)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y8h447BPyJR4fioYZvQ9bh
2026-09-17 13:09:16 -06:00
noahandClaude Opus 4.8 297e21a519 GUI round 3: Excel-style filters, status row colours, icon controls, context menu, live theme
Addresses the round-3 feedback batch:

- Right-click now works: a context menu (open selected in browser, select all,
  clear) pops up from the table. It was never wired before. (The live-config
  intersection over the selection remains a follow-up; no dead menu items.)
- Selection is readable again in both themes: the alt-row/zebra CSS hack (which
  painted row backgrounds over the native highlight, leaving white-on-white) is
  gone; the native selection highlight shows through.
- Row text is coloured by status (green = hashing, amber = slow, grey = not
  hashing), which also separates rows without fragile GTK zebra striping.
- Dark mode: KPI cards and rows follow the system theme (no more white boxes in
  dark mode); a system-colour-changed event repaints them live if the OS toggles
  light/dark while the app is open.
- Play / Pause / Stop are coloured media icons (green triangle / amber bars /
  red square) instead of text buttons.
- Filter panel redesigned Excel-style: a column dropdown at the top selects the
  column; controls adapt to its type. Text columns: a value checklist ("is any
  of") or a predicate (contains / does not contain / begins with / ends with /
  equals). Numeric columns: between / = / != / > / >= / < / <=. Filters AND
  across columns; edits held in a working copy, committed on Apply.
- Auto-rescan label shortened to "Rescan (s):" so the value field has room.

Table: replaced wxDataViewListCtrl with a raw wxDataViewCtrl + a custom
AttrListStore (per-row foreground via GetAttrByRow), which keeps in-table column
drag while enabling status row colours. New wx-rs bridge primitives: wxChoice
dropdown, coloured media buttons (drawn on a transparent bitmap via
wxGraphicsContext), a wxEVT_SYS_COLOUR_CHANGED event, destroy_children, and
call_after (deferred rebuilds). Patches 0002/0003 regenerated + round-trip
validated.

Model: ColFilter { Values, Text{op}, Num{op} } with TextOp/NumOp and
passes_filters -> ColFilter::matches; Column::num_value for numeric filtering.

Review fixes (one review pass):
- Deferred the two rebuilds that destroyed a control from inside its own event
  (filter op-dropdown change; column drag-reorder) via call_after, avoiding a
  use-after-free.
- num_value returns None for a blank-displaying value-type cell (Hashrate,
  Power, ChipTemp, ...), so "ChipTemp <= 50" no longer matches a miner with no
  temperature reading.
- Value checklist maps a checked entry back to its real value by index, so a
  literal "(blank)" value is not confused with an empty cell.

Verified off-screen: 45 unit tests, headless self-test (14 checks), and
interaction screenshots of selection, right-click, the text/numeric filter, the
comparator swap, and dark mode.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y8h447BPyJR4fioYZvQ9bh
2026-09-17 09:19:38 -06:00
noahandClaude Opus 4.8 6955b1e3e3 GUI round 2: selection, scan loop, column management, dark-mode fix
- Fixed "Scan ranges" button label (no longer grows with the range list).
- Dark-mode KPI cards: derive colours from the live system theme luminance
  instead of is_dark(), which mis-detected some GTK dark themes.
- Removed the checkbox column; the table is multi-select (wxDV_MULTIPLE,
  ctrl/shift-click), with the selection tracked by IP so it survives refreshes.
- Replaced Rescan with Play / Pause / Stop; added an editable auto-rescan
  interval (scan-ranges dialog; ~/.config/alkane-toolkit/auto-rescan-secs.txt)
  with a timer-driven countdown scheduler.
- Status bar shows the last-probed IP during a scan and a countdown to the next
  scan when idle (dropped the "scan complete" text).
- Default sort is IP-ascending with a header chevron; IP is column 0, sortable.
- Choose-columns dialog is a wxRearrangeCtrl (check to show; up/down or drag to
  reorder) exposing every metric, including Pool 1/2/3 URL + worker.
- Column drag-reorder moves the whole column with its data on drop.
- Row separator lines (wxDV_ROW_LINES). GTK3 native has no zebra striping; a
  GTK4-forward zebra-CSS hook and pkg-config gtk cflags are in place.

Scan engine: parse each configured pool's (url, worker); Progress carries the
last-probed IP. Model: Column::Sel removed; Pool1/2/3 columns; default IP sort.

wx-rs bridge: multi-select + selection/context-menu events + get_selections,
alternating-row + zebra-CSS hooks, in-place column title, rearrangeable list,
and popup-menu primitives (for the upcoming right-click config menu). Patches
0001-0003 regenerated and round-trip validated.

Review fixes: scan loop no longer sticks "scanning" if a thread ends without
Done (channel-disconnect handling + Stop force-reset); Play no longer starts a
second scan; stale selections pruned on rescan; column apply order/visibility
applied atomically.

Verified: 22 unit tests, a 14-check headless UI self-test, and interaction
checks (multi-select, column rearrange/drag, play/pause/stop, dark mode).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y8h447BPyJR4fioYZvQ9bh
2026-09-16 17:27:20 -06:00
noahandClaude Opus 4.8 d88df603ba Fix GUI layout/crash bugs; add operator features, tests, and dev loop
Round 1 (bug fixes + test harness):
- Fix table rendering in the top-left corner: the dvlc was never added to the
  sizer; add it (proportion 1) and re-run layout; drop the space-eating stretch.
- Fix abort on dialog buttons: the dialog root sizers passed ALIGN_CENTRE_VERTICAL
  to a vertical sizer, tripping a wx consistency assert whose handler pumps a
  nested event loop, re-entering dispatch while it held the App RefCell borrow.
  Remove the invalid flags; split dispatch into two phases with try_borrow_mut.
- Fix header-click sort mapping when columns are hidden (use display_columns);
  drag-reorder splices back into the full order without dropping hidden columns.
- Add offline fixtures + ALKANE_FAKE_SCAN and ALKANE_SELFTEST modes; scripts
  ui-selftest.sh and ui-screenshot.sh; AGENTS.md documents the dev loop.

Round 2 (operator requests):
- Redesigned color-coded KPI cards; light/dark mode follows the system theme.
- SI-formatted hashrate/power on the KPIs and columns (685 TH/s, 21.3 kW).
- Scan ranges accept CIDR, single IP, and A.B.C.D-E.F.G.H / A.B.C.D-N ranges;
  oversized ranges (> 1,000,000 addresses) are rejected.
- Scan progress bar over the table + status-bar text; out-of-range miners are
  dropped when a scan starts.
- Columns panel exposes every scannable MinerData metric (All / None / Defaults).
- Excel-style filter panel: per-category value checklists, per-column All/None,
  Apply / Reset / Cancel, blank handling.
- Sort direction marker in the header (updated in place); double-click a row
  opens the miner in the default browser.

wx-rs: extend the widget bridge (gauge, in-place column title, sort indicator,
browser launch, system appearance/colours, widget colours, item-activated);
patches 0002/0003 regenerated and round-trip validated.

Verified: 22 unit tests + a 13-check headless UI self-test, plus a live scan
against the bench fleet.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y8h447BPyJR4fioYZvQ9bh
2026-09-16 16:24:05 -06:00
noah fcc70c04f6 M1 primary view: wx-rs patched+extended (Linux/GTK3 build, widget bridge), vendored wx 3.3.3 + asic-rs in thirdparty/, UI-SPEC table+KPIs+dialogs, build scripts 2026-09-15 13:59:55 -06:00