Repository navigation
Declaration based edit component, validation and playground - #64
Merged
Merged
Conversation
✅ Deploy Preview for device-database-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Collaborator
|
implements OHF-Device-Database/backlog-items#195 |
pierosavi
marked this pull request as ready for review
October 20, 2026 08:37
PhilipTrauner
requested changes
Oct 20, 2026
PhilipTrauner
left a comment
Collaborator
There was a problem hiding this comment.
awesome work! 🤩
considering you already showed off a preview of this in action on the device page, do you think it would make sense to also ship that part gated behind a debug menu of sorts?
Co-authored-by: philip trauner <philip.trauner@arztpraxis.io>
PhilipTrauner
approved these changes
Oct 22, 2026
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.
Adds the edit components that render from a declaration sent by the server. There's no endpoint yet, so the declarations come from a mock (
src/io/mock/declarations.json) behindgetDeclarations(). Brand and category options already use/api/unstable/dimensions.Every field has a view and an edit mode. The view is a plain HTML string, so the device page can render it on the server without JS. The edit mode is a Lit island:
<edit-field>is form associated, so it behaves like a native input inside a<form>, and<edit-form>puts the fields together.Supported types:
The form only submits the fields that changed and never sends "not set". Each changed field gets a Revert button, and a value that was set can't be removed. The validation is in
src/validation, plain TS with tests, so the review bot can reuse it later. Declarations with a type we don't support are skipped with a warning, so the rest of the form still works.Added declaration to component playground at
/edit-playground(not linked, noindex) with examples by component.