Skip to content

docs: add settings validation reference#5218

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/generate-validation-documentation
Draft

docs: add settings validation reference#5218
Copilot wants to merge 2 commits into
mainfrom
copilot/generate-validation-documentation

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 22, 2026

Comprehensive reference documenting the validation rules enforced on every radio config and module config settings screen, sourced from both protobuf max_size annotations and the UI form layer.

  • Device config screens (User, Device, Position, Power, Network, Display, LoRa, Bluetooth, Security) — per-field type, constraint, and conditional visibility rules
  • Module config screens (MQTT, Serial, Ext Notification, Store & Forward, Range Test, Telemetry, Canned Message, Audio, Remote Hardware, Neighbor Info, Ambient Lighting, Detection Sensor, Paxcounter, Status Message, Traffic Management, TAK) — same treatment
  • Channel config — name byte limit, PSK length constraints (0/16/32 bytes)
  • Interval configurations — all 17 IntervalConfiguration contexts with their exact allowed value sets in seconds
  • UI component validation — documents how each reusable core:ui component (EditTextPreference, DropDownPreference, EditIPv4Preference, EditBase64Preference, BitwisePreference, SliderPreference, etc.) enforces constraints

Example entry:

Field Type Validation Notes
long_name String maxSize: 39 bytes (proto max_size: 40) Required (non-blank)
latitude Double Range: −90.0 to +90.0 Visible only when fixed_position = true
fixed_pin String Exactly 6 digits

Also notes known discrepancies (e.g. allow_input_source UI enforces 63 bytes while proto specifies max_size: 16).

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a comprehensive documentation reference for validation rules across radio/device/module/channel configuration screens, including interval presets and reusable core:ui component behavior, with constraints sourced from protobuf max_size annotations and the settings UI form layer.

Changes:

  • Introduces docs/settings-validation.md as a field-by-field validation reference for config screens.
  • Documents IntervalConfiguration allowed value sets and shared constants (e.g., GPIO pin ranges).
  • Summarizes validation/enforcement behavior of reusable core:ui preference components.

Comment on lines +55 to +58
| Field | Type | Validation | Notes |
|-------|------|------------|-------|
| `long_name` | String | maxSize: 39 bytes (proto max_size: 40) | Required (non-blank) |
| `short_name` | String | maxSize: 4 bytes (proto max_size: 5) | Required (non-blank) |
| Field | Type | Validation | Notes |
|-------|------|------------|-------|
| `public_key` | Base64 | 32 bytes; read-only | Auto-derived from private key |
| `private_key` | Base64 | 32 bytes | Key generation applies bit masking: `f[0] &= 0xF8`, `f[31] = (f[31] & 0x7F) ǀ 0x40` |
Comment on lines +432 to +433
Shows a live byte counter when focused.
- **Int mode:** Validates with `toIntOrNull()`; sets error icon on failure.

### EditIPv4Preference

- Regex validation: `\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}`.
@github-actions github-actions Bot removed the Stale label May 24, 2026
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.

3 participants