Skip to content

feat(dashboards): register maps and recording to file - #17

Merged
chetto1983 merged 6 commits into
masterfrom
claude/modernizzazione-design-5y4lwf
Nov 6, 2026
Merged

chetto1983 merged 6 commits into
masterfrom
claude/modernizzazione-design-5y4lwf

Conversation

@chetto1983

Copy link
Copy Markdown
Owner

What & why

Spec: docs/superpowers/specs/2026-11-06-register-maps-logging-design.md. Plan: docs/superpowers/plans/2026-11-06-register-maps-logging.md. Verification: docs/superpowers/verification/2026-11-06-register-maps-logging.md.

Register maps

  • Import: a device's register table in CSV becomes a new dashboard with a table panel that reads every row.
    • Required columns: name, table and address, plus type for registers.
    • Optional columns: byte order, units, decimals and scaling.
  • Export: a table writes the same CSV back.
  • Validation: a file with one invalid row is refused whole, with its line and column. Addresses are protocol addresses from 0; the 40001 notation is refused with the reason.

Recording

  • Record writes the dashboard's values, scaled, to a CSV file a day.
  • Columns: a local time column first, then one column per variable named after the variable or the panel that shows it, with its units.
  • Folder: Documents/ModbusTool/recordings, or ~/ModbusTool/recordings where no Documents folder is defined (Linux without XDG user dirs). The fs scope covers only those two folders.
  • Cadence: a row is written when a reading arrives, with no timer. Measured: the recording goes on with the window hidden. A 200-register map at 1 s writes about 1 KB a row (about 90 MB a day) at 0.7% of one core.

Decisions changed by measurements (recorded in the spec)

  • Fixed folder instead of a folder choice: the GTK folder dialog cannot be driven in the E2E after three attempts. The user chose this.
  • No "Open folder" button: tauri-plugin-opener added 457 Cargo.lock lines (zbus). The status shows the full file path instead.

Closes #

Type

  • feat — new capability
  • fix — bug fix
  • refactor / perf
  • docs
  • test
  • chore / ci / build

Checklist

  • npm run check && npm run lint && npm run format:check && npm test pass. 146 tests.
  • cargo fmt --check && cargo clippy --all-targets -- -D warnings && cargo test pass (in src-tauri/). No Rust code changed; only the capability file changed.
  • Coverage ≥ 85% (Rust and frontend), no test skipped to hide a failure. Frontend: 99.78% of lines.
  • No file exceeds 600 LOC (npm run file-size); touched files refactored on touch. Number formatting is now shared in i18n.svelte.ts.
  • Checked end to end against pymodbus (npm run e2e): 91/91 locally.
    • Map import and export go through the native GTK dialogs, driven with xdotool. That runs on Linux only; Windows reports these checks as not run.
    • Recording is checked on both Linux and Windows.
  • Spec / CHANGELOG.md updated if behaviour or interfaces changed, per CLAUDE.md. The changes are under Unreleased.
  • UI changes use the Aura tokens only (no hard-coded colours)

Notes for reviewers

  • xdotool: CI now installs it, and knip.json lists it as a binary.
  • What is not shown: native dialogs on Windows, a real desktop minimise (only an unmapped window under Xvfb), and load over hours.

Generated by Claude Code

The user's decisions (2026-11-06): an imported register map becomes a
dashboard with a table panel; recording writes a dashboard's variables,
scaled, as a wide CSV, one file per day. The spec records the inventory
(our CSV parser, plugin-fs append, the dialog scopes: save grants one file,
a folder pick grants the folder) and the measurement that the native GTK
dialog can be driven under Xvfb with xdotool, so both features get a real
E2E on Linux. The plan splits the work into six tasks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Rdii6QU3MVeyCefPEk5AL
A register map in CSV (name, table, address, type, and optionally byte
order, units, decimals and two-point scaling) becomes a new dashboard with
one table panel that reads every row through the existing grouped reads.
The table exports the same CSV, and a file with one invalid row is refused
whole, with its line and column: a map imported in part looks complete.
Addresses are protocol addresses; the 40001 notation is refused with the
reason, since guessing it would shift every register by one unnoticed.

The parser reuses src/lib/csv.ts; number formatting moved to i18n.svelte.ts
so the value panel and the table share it. Tests: example cases from a
drive's table, every refused cell, and a fast-check round trip.

The E2E imports a map through the native GTK dialog, driven with xdotool
under Xvfb (keys sent before the dialog is ready are lost, measured, so the
answer is repeated until the dialog closes), checks the values read from
pymodbus, scaled and formatted, and compares the exported file. Windows
cannot drive native dialogs: the run says those checks did not run. Local:
90/90. CI installs xdotool.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Rdii6QU3MVeyCefPEk5AL
The GTK folder dialog could not be driven in the E2E: the typed path and
Enter enter the folder, and neither a second Enter nor Alt+S selects it.
After three attempts the user chose a fixed folder, which needs no dialog
and gets a real E2E on Linux and Windows: Documents/ModbusTool/recordings,
or ~/ModbusTool/recordings where no Documents folder is defined (on Linux
it comes from user-dirs.dirs, often missing on WSL2, containers and CI;
dirs 7.0.0). The fs scope covers only those two folders. No Open folder
button: tauri-plugin-opener added 457 lockfile lines (zbus) for it.

Columns of unnamed variables take the title of the panel that shows only
them. Measured: rows go on with the window hidden; a 200-register map at
1 s writes about 1 KB a row (about 90 MB a day) at 0.7% of one core.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Rdii6QU3MVeyCefPEk5AL
Record writes the dashboard's variables, scaled, as a wide CSV: a time
column in local time that spreadsheets read as a date, then one column per
location the dashboard reads, named after the variable or the panel that
shows it, with its units. A row is written when a reading arrives, at most
one per half period, so the cadence needs no timer and survives a hidden
window (measured); without good readings no row is written and the gap is
visible. Cells of values not read stay empty.

Files go to Documents/ModbusTool/recordings, or ~/ModbusTool/recordings
where the system names no Documents folder, one per day; a file of the day
with the same columns is continued, one with other columns gets a _2 copy.
A failed write or folder stops the recording and says why. The fs scope is
limited to those two folders.

Tests: the pure parts (columns, header, local time, file names, cadence)
and the recorder with fs mocked (day change, existing and foreign files,
home fallback, failures). E2E on Linux and Windows: records the dashboard
at 200 ms against pymodbus and checks the file's pressure column and row
spacing. Local: 91/91.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Rdii6QU3MVeyCefPEk5AL
…cation

The README lists both features and documents the register map format
(columns, values, the 40001 notation); the changelog has them under
Unreleased; the verification file records the E2E (91/91), the separate
measurements and what they do not show: no native dialogs on Windows, a
hidden window under Xvfb only, a one-minute load test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Rdii6QU3MVeyCefPEk5AL
@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6c3ccddc-e1e7-4b27-973f-9694a19b5769
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

…ding

Version 3.5.0 in package.json, Cargo.toml and tauri.conf.json, and the
changelog section named after it. The page lists the two new features;
eight cards fit two rows of four on a desktop (cards from 240 px), one
column on a phone, no horizontal scroll (checked in dark, light and phone).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Rdii6QU3MVeyCefPEk5AL
@chetto1983
chetto1983 merged commit 7423a15 into master Nov 6, 2026
23 checks passed
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.

2 participants