Skip to content

P45: generate Settings and sort forms from ObjectState declarations - #732

Merged
trissim merged 10 commits into
mainfrom
forms/native-settings-v2
Oct 16, 2026
Merged

trissim merged 10 commits into
mainfrom
forms/native-settings-v2

Conversation

@trissim

@trissim trissim commented Oct 16, 2026

Copy link
Copy Markdown

P45: Settings and the session sort form are now generated from the saved-settings ObjectState declarations through FormBridge's ParameterInfo kinds, and drawn with Textual's native geometry and paint instead of TCSS. This replaces #670. #670's P29 part landed as #727, and its P55/reconnect parts landed as #729/#713.

Owners after this change

  • Field identity: FieldPath binds to ObjectState's DottedFieldPath (bind() -> DeclaredField). Parent addresses come from DottedFieldPath.parent, so there's no second path string.
  • Which editor a field gets: the FormBridge ParameterInfo kind (DirectDataclassInfo, OptionalInfo, ...) chosen by its metaclass. FieldView.of reads the declared shows; there's no type switch in Toad.
  • Layout and paint: FormPart(BoxGeometry, PaintLayer, FramePaint) declares geometry and paint directly, with DEFAULT_LAYOUT per view. src/toad/screens/settings.tcss is deleted.
  • Saved values: SavedSettings over ObjectState; Settings edits the same state and discard() reverts it.

Pins (exact git revs; none of these are on PyPI)

Checks

  • Debt ratchet (--root src --base origin/main --head 844b53a6c): exit 0, with no positive deltas.
  • Real UI on an isolated display (Xvfb, plain st, isolated AGENT_COMMS_ROOT and XDG directories), running this branch with the merged stack:
    • Settings render identically to main.
    • Search narrows to the matching field.
    • A checkbox edit saves only that key to toad.json and survives reopening.
    • ctrl+r discards an edit.
    • A sort choice persists across restart.
    • Threads (tool rows, tables, markdown) render normally.
  • Screenshots: /home/ts/.cache/agent-scratch/claude-forms/final-{2-settings,4-reopened,5-search,6-gamma}.png and p45-*.png.

🤖 Generated with Claude Code

trissim and others added 9 commits October 16, 2026 18:10
(cherry picked from commit ea33717136d3b0e1ebd3fd3d73b8b49c7b2ce441, without its dependency pins)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 2a67605, without its scratch file)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…from the field

(source parts of d19c492 and 9fbec1d, whose dependency pins are replaced below)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolve ToadApp bases by keeping main's VisibleReadMarking with the
branch's ScreenWidth modes. Pin objectstate 5.0.0 (ad8727278), formbridge
0.2.0 (ebe2fa917) and textual 25aad306e from git; the lock also moves
python-introspect to 0.3.0 and zmqruntime to 0.6.5. FormPart reads
textual's DEFAULT_LAYER instead of repeating the layer name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 16, 2026 22:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

@trissim
trissim merged commit 38f7069 into main Oct 16, 2026
2 checks passed
@trissim
trissim deleted the forms/native-settings-v2 branch October 16, 2026 22:40
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.

2 participants