feat(settings): enum control type, and surface race_mode - #389
Open
TheAngryRaven wants to merge 1 commit into
Open
feat(settings): enum control type, and surface race_mode#389TheAngryRaven wants to merge 1 commit into
TheAngryRaven wants to merge 1 commit into
Conversation
The device settings schema only knew 'string' and 'number', so anything with a fixed set of values was a free-text box. That is worse than it sounds: the firmware compares the literal, so a typo doesn't error — it silently falls back to the default, which reads as the setting not working at all. race_mode is the case that already existed. It lives on the logger but was never in this schema, so it rendered as a raw text field with no hint of what it does. It is now a Circuit / Sprint picker, described accurately as a tiebreak that only applies when both kinds of track are in range. spark_mode and cylinder_count are added ahead of the firmware that introduces them (plan 0003). Rows are built from what the DEVICE reports, not from the schema, so they stay invisible until a logger actually has them — the schema entry just means they render properly when it does. A stored value this build doesn't recognise — older or newer firmware, or a hand-edited SETTINGS.json — is shown verbatim rather than rendered as one of the options we do know. settingDisplayValue owns that rule so it is testable. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ESkRRtF4vRrANPL6huSgmD
Coverage SummaryLines: 58.29% (7486/12842) · Statements: 57.44% · Functions: 55.22% · Branches: 55.25% Per-file coverage
|
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
lapwing | 6d63ebe | Commit Preview URL Branch Preview URL |
Aug 06 2026, 02:02 AM |
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Device settings only knew
'string'and'number', so anything with a fixed set of values was a free-text box. That's worse than it sounds: the firmware compares the literal, so a typo doesn't error — it silently falls back to the default, which reads as the setting not working at all.race_modeis the case that already existed. It lives on the logger but was never in this schema, so it rendered as a raw text field with no hint of what it does. It's now a Circuit / Sprint dropdown, described accurately — it only breaks a tie when both a circuit and a sprint track are in range, and never overrides a single match.spark_modeandcylinder_countare added ahead of the firmware PR. Rows are built from what the device reports (k in settings), not from the schema, so these stay invisible until a logger actually has them — the schema entry just means they render properly when it does. That's why this can land before or after the firmware side without either being broken.Also added
settingDisplayValue: a value this build doesn't recognise — older or newer firmware, or a hand-editedSETTINGS.json— is shown verbatim rather than rendered as one of the options we do know.Related Issues
Groundwork for
DovesDataLoggerplan 0003 (RPM spark type & cylinder count), which the firmware PR implements.Type of Change
Checklist
bun run lintpassesbun run typecheckpassesbun run test:runpasses (2734 tests, 190 files — +12 here)bun run buildsucceedsCHANGELOG.mdNotes for Reviewers
One thing to sanity-check:
cylinder_countis "cylinders the pickup SEES", not the engine's cylinder count. A clamp around one plug wire of a twin sees one, so that stays at 1 — only a shared coil or all-cylinder harness sees them all. I put that in the field description because getting it wrong halves or doubles every RPM reading, but you know the users better than I do and may want it worded differently.Two deliberate calls:
WASTEDis rejected), because the device compares the literal. Being lenient here would let a value through that the firmware then ignores — exactly the failure this replaces.I did not add
camera_serialto the schema even though it's on the device and missing here — it's captured automatically by the pairing flow and has its own page, so a hand-editable text box seemed like a way to break pairing rather than a feature. Easy to add if you disagree.Generated by Claude Code