Repository navigation
Own declared form fields, pages and bounds for every UI backend - #16
Merged
Merged
Conversation
Toad's Textual forms carried the field semantics (label, help, default, validation, edit, search text, typed field paths, Multiline/Placeholder kinds, the widget-family registry) in toad/forms, where a second backend such as pyqt-reactive would have to restate them. They now live in formbridge.forms.declared_fields, plus two new facts read from the declaration: the declared bounds (annotated_types Ge/Gt/Le/Lt/Interval, merged by Interval field name) and FormPage, the tab a top-level group is shown on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dR85kyFKcc2tQAJLhK
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
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.
This PR moves field semantics out of Toad's Textual backend and into formbridge. A second backend (pyqt-reactive) can then read them without restating them. The Toad settings-menu PR (OpenHCSDev/toad, branch `work/toad-settings-menu`) depends on this one and imports `formbridge.forms.declared_fields`.
What moved (from toad/forms, deleted there)
`src/formbridge/forms/declared_fields.py`:
New facts read from the declaration
Backend interface
A backend implements two `DeclaredViews` families:
It also draws one tab per `FormPage`. The editors call `DeclaredField.edit`, and ObjectState owns values and dirty marks. Toad's Textual implementation lives in `toad/forms/{form_view,editors,presentation}.py`.
Checks
Next, not in this PR
🤖 Generated with Claude Code
https://claude.ai/code/session_01RnH6dR85kyFKcc2tQAJLhK