feat(webapp): config and call-home writes wait for phases 4-5; Diagnostics only for a confirmed Series-3 unit

- Config, with a serial: Read shows the unit's shared UnitSettings (setup,
  record mode, sample rate, record time, histogram interval, geo trigger,
  notes; — for null) in place of the write form.  settingsRows() is in the
  device-routing block, Node-tested; the rows are rendered as text, since
  setup names and notes come from the unit.
- Write stays off for both series (and without a serial), tooltip
  "Coming in phase 5 (#46)"; Call Home write likewise, "Coming in phase 4".
- Call Home read follows controlsFor().callHomeRead; for a confirmed Series 4
  the tab says "Not yet available for Series 4".
- Diagnostics: every button follows controlsFor().diagnostics (Task 3), and a
  refresh for anything but a confirmed Series-3 unit sends nothing and says
  why.  Its requests carry the typed serial, so the server guard checks it.
- Without a serial the legacy reads are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
This commit is contained in:
serversdownandClaude Opus 5.5 committed 2026-10-29 11:59:11 -04:00
1 parent 3f249e2322
commit a709d2388d
2 files changed
+85 -3

No files matched your search

+17 -1
View File
@@ -24,7 +24,7 @@ PAGE = Path(__file__).resolve().parent.parent / "sfm" / "sfm_webapp.html"
NODE = shutil.which("node")
pytestmark = pytest.mark.skipif(NODE is None, reason="node is not installed; the page-logic tests need it")
EXPORTS = ["seriesFromSerial", "unitQuery", "deviceUrl", "confirmedSeries", "controlsFor", "eventView",
EXPORTS = ["seriesFromSerial", "unitQuery", "deviceUrl", "confirmedSeries", "controlsFor", "eventView", "settingsRows",
"changeSummary", "downloadSummary"]
@@ -204,3 +204,19 @@ def test_event_view_reads_both_event_shapes():
assert b == {"label": "2026-10-26 16:06:37", "title": "Waveform",
"peaks": {"tran": 0.03, "vert": 0.095, "long": 0.02, "pvs": 0.1, "micPsi": 0.0001}}
assert c == {"label": "Event 5", "title": "", "peaks": None}
def test_settings_rows_show_unit_settings_with_a_dash_for_null():
full = {"serial": "UM20147", "series": 4, "setup_name": "TMI default", "record_mode": "Waveform",
"sample_rate": 1024, "record_time_s": 2.0, "histogram_interval_s": 900, "geo_trigger_ips": 0.02,
"notes": {"project": "Bench", "client": ""}}
empty = {"serial": "BE9441", "series": 3, "setup_name": None, "record_mode": None, "sample_rate": None,
"record_time_s": None, "histogram_interval_s": None, "geo_trigger_ips": None, "notes": {}}
a, b, c = run(["settingsRows", [full]], ["settingsRows", [empty]],
["settingsRows", [{**empty, "histogram_interval_s": 15}]])
assert a == [["Setup Name", "TMI default"], ["Record Mode", "Waveform"], ["Sample Rate", "1024 sps"],
["Record Time", "2.00 s"], ["Histogram Interval", "15 min"], ["Geo Trigger", "0.0200 in/s"],
["Note: project", "Bench"], ["Note: client", "—"]]
assert b == [["Setup Name", "—"], ["Record Mode", "—"], ["Sample Rate", "—"], ["Record Time", "—"],
["Histogram Interval", "—"], ["Geo Trigger", "—"], ["Notes", "—"]]
assert c[4] == ["Histogram Interval", "15 s"]