Skip to content

Render settings from the device-reported schema - #4

Draft
chrispmonkey wants to merge 2 commits into
PenumbraOS:masterfrom
chrispmonkey:settings-schema
Draft

Render settings from the device-reported schema#4
chrispmonkey wants to merge 2 commits into
PenumbraOS:masterfrom
chrispmonkey:settings-schema

Conversation

@chrispmonkey

Copy link
Copy Markdown

Renders the settings form from the device's GET /api/settings/schema descriptor
instead of hardcoding each field in SettingsPage.tsx. A new setting the device
adds shows up here with no client change.

The descriptor is sections of typed fields (string / text / secret / bool
/ enum); SchemaSettingsForm maps each type to a control, visibleWhen gates
conditional fields, and secret fields stay write-only (the device reports only
configured, so a save sends just what changed). Falls back to the existing
fixed form when the device doesn't serve the descriptor.

Pairs with the server side (PenumbraOS/humane-system-hook#10), which emits the
descriptor.

@chrispmonkey

Copy link
Copy Markdown
Author

Updated to write through the existing typed PUT /api/settings (nesting the descriptor's flat keys), pairing with the now read-only descriptor endpoint in PenumbraOS/humane-system-hook#10.

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