Skip to content

fix(settings): telemetry in real units from the start, host and port saved on commit with validation, psu fields follow imports - #157

Merged
mottihoresh merged 2 commits into
fix/chunk-5from
fix/c5b-telemetry-settings
Oct 17, 2026
Merged

mottihoresh merged 2 commits into
fix/chunk-5from
fix/c5b-telemetry-settings

Conversation

@mottihoresh

@mottihoresh mottihoresh commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Part of chunk 5 (#134): items X10, N5 and N8. Base: fix/chunk-5.

X10: one telemetry spec

  • Today: the idle placeholders are their own spec. IAS and Press Alt read % FS until the first telemetry tick, then switch to kt and ft. Press Alt's idle id was D_ALT_NEEDLE, not ALT_FT.
  • After: there is one spec, TELEMETRY in main/dcs/sim-telemetry-decoder.ts. idleTelemetry() returns the decoder's live readouts with nothing decoded yet, so the gauges show kt, ft and % from the start. The contract's TELEMETRY_IDLE (shared/dcs/ipc.ts) is the renderer's starting value. A test pins it to the decoder's output.
  • Side effect: the idle Press Alt ring now uses the secondary tone, the same as the live Press Alt ring. Before, the idle ring was primary and only switched to secondary on the first tick. This follows from having one spec.

N5: host and port

  • Today: the host and port are saved on every keystroke, and a port that isn't a number silently saves as 7778.
  • After: typing saves nothing. The field is saved on commit (blur or Enter). Main checks the port in settings-form.ts commandPortOf, which accepts whole digits from 1 to 65535. A bad port saves nothing and pushes nothing. config:edit then answers { ok: false, error } (new ConfigEditResult). Both the Settings › Connection form and the Connection tab's DCS Link form show main's error using the existing input--bad / aria-invalid outline and set-err text. No new CSS. A blur that follows an Enter with nothing new typed sends nothing. An import resets the typed text and the error.
  • API guard: editConfig now answers ConfigEditResult instead of AppConfig. The frozen copy is updated on purpose, with a header note. No channel was added, removed or renamed.

N8: PSU limit fields

  • Today: Settings › Cockpit's custom-limit fields hold their own typed text, which is never refreshed after an import replaces the settings.
  • After: an import (and config:get) bumps the config store's formsReset. PowerSupply is keyed on it, so the fields restart from the pushed config. This works the same way as the other form fields, which restart from the config on an import. A form's own edit still leaves its typed text alone.

Tests changed on purpose (they pinned the old behaviour)

  • sim-telemetry-decoder.test.ts: the "idle readouts are their own spec" test becomes "one spec": idle equals the live snapshot, with units % RPM / kt / % DN / ft / % QTY. A new test checks that the first frame keeps the idle ids, labels and units.
  • t27: the idle gauges read —kt / —ft instead of —% FS.
  • settings-edit.test.ts: removed the "junk port saves as 7778" assertions. Added tests for commandPortOf, for a junk port being refused with its error, and for SettingsService.edit saving and pushing nothing on a junk port. Updated the tests for the new SavedEdit / ConfigEditResult shapes.
  • pushed-rules.seam.test.ts: config:edit { port: '77a' } is refused with the error. config.json and config:get keep the last good port, and no config:changed is pushed.
  • t28 / t31: "saved as typed" becomes "saved on commit". These tests check that typing saves nothing, that blur and Enter each save, and that a blur after Enter does not send again. New tests check that a junk port shows the error with aria-invalid and saves nothing, and that a good port then saves and clears the error.
  • t29 (new): renders the Cockpit and Configuration sections together. A typed (refused) limit is followed by an import with other limits, and the fields show the imported limits.
  • skyhawk-mock.ts: editConfig answers ConfigEditResult the way main does.

All new and changed tests fail on the old source. I checked this by stashing the non-test changes: 16 tests failed.

How verified

npm run lint, npm run lint:deps, npm run typecheck and npm test (1421 tests) all pass locally, after rebasing onto fix/chunk-5 at 8c48345 (#156). I have not tested on the DCS computer yet; that belongs in the chunk 5 device session.

The idle placeholders were their own spec: IAS and Press Alt read "% FS" (and Press Alt keyed
on D_ALT_NEEDLE) until the first telemetry tick, then kt / ft. The idle readouts are now the
decoder's live readouts with nothing decoded (idleTelemetry), so the gauges show kt / ft / %
from the start; the contract's TELEMETRY_IDLE is pinned to them (X10, #134).
…lds follow imports

N5: the DCS host and command port were saved on every keystroke, and a junk port silently
saved as 7778. They are now saved on commit (blur / Enter). Main checks the port
(settings-form.ts commandPortOf: whole digits, 1-65535); a bad one saves nothing and
config:edit answers why (ConfigEditResult), which the field shows under it (input--bad,
set-err). The API guard records the new answer type.

N8: Settings › Cockpit's PSU limit fields kept their own typed text after an import replaced
the settings. They now start over from the pushed config on an import (and config:get), as
the other form fields do.

Refs #134
@mottihoresh
mottihoresh force-pushed the fix/c5b-telemetry-settings branch from a6951b9 to 9a41a80 Compare October 17, 2026 18:33
@mottihoresh
mottihoresh merged commit 2868185 into fix/chunk-5 Oct 17, 2026
3 checks passed
@mottihoresh
mottihoresh deleted the fix/c5b-telemetry-settings branch October 17, 2026 18:35
mottihoresh added a commit that referenced this pull request Oct 18, 2026
…etry in real units, port validated on commit (#158)

Chunk 5 of the fix track (#135): relay, telemetry and the settings form.
Closes #134.

Item PRs squash-merged into `fix/chunk-5`:
- #156 — one `relayEndpoint` label for the pill, the Overview and the
event log, correct per transport (Unicast reads "this PC:<port>");
Record only while relaying (or to stop a recording in progress), in
Settings and on the Connection card, enforced in main before the save
dialog; no device-waiting wording in Monitor; a Replay that drives the
device shows the same waiting reason as Bridge.
- #157 — one telemetry spec: idle gauges read kt/ft/% from the start;
host and port are saved on commit (blur/Enter), a bad port shows an
error and nothing is saved; the PSU custom-limit fields refresh after an
import.

Tested with a recorded replay before merge (checklist in #134); a live
DCS session goes on the v0.2.0 QA run. Rebased on main after chunk 4.

BEGIN_COMMIT_OVERRIDE
fix(dcs): one relay endpoint label, record only while relaying, waiting
wording matches the mode
fix(settings): telemetry in real units from the start, host and port
saved on commit with validation, psu fields follow imports
END_COMMIT_OVERRIDE
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.

1 participant