Repository navigation
Every view declares what it shows as a class keyword; prepared choices declare their editors - #1543
Merged
Merged
Conversation
…s declare their editors Pairs with OpenHCSDev/formbridge#19, where DeclaredViews stops probing class bodies (`vars(cls).get("shows", ())`) and the family becomes the inheritance tree. The 14 `shows = (...)` body lines become `shows=(...)` class keywords. FieldView lists the DeclaredViews mixin first, so the keyword is taken before Textual's DOMNode.__init_subclass__ sees it. comms_command_dialog wrote `ValueEditor.shown_by[PreparedChoices] = lambda ...` from module scope: a registry entry outside any class. PreparedChoices now inherits DeclaredMetadata and declares its parameter's editor declarations before its own lineage, so the same editor is chosen and the line is deleted. Proof (with formbridge#19 on the path): test_forms, test_settings_screen and test_agent_configuration 16 passed; the 2 failures are the checkbox 'ellipsis' == 'clip' tests already red on main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XbFMSqJMarXn2ZE8iAL7Sd
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. Try requesting a review at a lower effort level.
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.
Pairs with OpenHCSDev/formbridge#19. Land formbridge first, then this, then relock the stack. 5 files, +15/−37.
What changed
shows = (...)class-body lines becomeshows=(...)class keywords (editors.py ×8, form_view.py ×2, settings.py, comms_command_dialog.py ×2, test_settings_screen.py).FieldView(DeclaredViews, WidgetView, VerticalGroup): the capability mixin comes first, soshows=is taken before Textual'sDOMNode.__init_subclass__, which rejects unknown keywords.ValueEditor.shown_by[PreparedChoices] = lambda field: ...(comms_command_dialog.py:46).PreparedChoicesnow inherits formbridge'sDeclaredMetadataand declares its parameter'seditor_declarationsbefore its own lineage. Same editor chosen, no outside writer.Why
Membership by
vars(cls).get("shows", ())was a structural probe of a class body (paper1 Proposition 3.3). My toad#1542 review provedshowing()couldn't return the abstractFieldViewfrom an absence: "its body doesn't sayshows". Called out in #comms. Now each class declares, and the hierarchy answers.Proof
With formbridge#19 on the path:
tests/textual/test_forms.py,tests/textual/test_settings_screen.py,tests/model/test_agent_configuration.py: 16 passed, 2 failed. The 2 are'ellipsis' == 'clip'checkbox-policy tests already red on main (b-ui is taking them). formbridge: 9 passed.🤖 Generated with Claude Code
https://claude.ai/code/session_01XbFMSqJMarXn2ZE8iAL7Sd