Skip to content

Replace the permissions stylesheet with shared native capabilities - #1415

Merged
trissim merged 5 commits into
mainfrom
fix/native-permissions-styles
Nov 2, 2026
Merged

trissim merged 5 commits into
mainfrom
fix/native-permissions-styles

Conversation

@trissim

@trissim trissim commented Nov 2, 2026 •

Copy link
Copy Markdown

Summary

Five commits; 4 files; complete73-line permissions sheet removed. Initial affected controls4/4 in42.19s; corrected isolated resume control 1/1 in7.53s, rc0. Delete the complete 73-line permissions stylesheet and its load path. Existing permission controls compose shared partial fill, background and frame providers, preserving their Question/OptionList/Select/VerticalScroll implementations.

Native owners

Before: one screen selector reached through ids and descendants to supply geometry, paint and focus borders.

After:

  • FillArea supplies the common available-space constraint to the grid, navigator and tool scroll.
  • BackgroundArea supplies the existing background variable to the screen, grid and tool scroll; FaintArea supplies the translucent inset background to instructions and the question.
  • FramedArea supplies the faint outline. FocusedFrame changes the same border property from the framework's current focus state, shared by Question and ToolScroll.
  • The grid, instructions, question, navigation area and navigator retain only their irreducible geometry differences.
  • NativeLayout and NativeTheme come from the merged and installed provider in Toad#1414; values use the descriptor-owned native expression API from Textual#226.

Theme declarations extend native_declarations() cooperatively. Textual's normal stylesheet application invokes the native-style hook with its existing resolver, so same-name variable refreshes and ordinary theme switches use the same value owner. Focus changes reapply that hook after the control's inherited focus lifecycle. The frontend control includes same-name register_theme + refresh_css, not only theme-name switching.

The full WidgetView is deliberately not mixed into these controls: doing so would replace their inherited overflow, component paint, borders and other contracts. These partial capabilities apply their declared inputs through the existing Styles owners.

Preserved behavior

Question's answer, selection, blink, key and presentation lifetimes remain inherited. OptionList navigation, diff selection and VerticalScroll retain their implementation parents. The existing permission source-binding/cancellation check in PermissionReview remains unchanged.

The screen inherits ToadNode through PriorityActions → ActionPresentation → DeclaredWidgetActions and reads the configured diff preference through one method. The initial direct ToadNode base was placed before its descendant PriorityActions and made C3 inconsistent; that redundant base/import is removed. The removed two generic-App tests had no named generic-App constructor: the production factory is AgentSurface's PermissionReview; all found permission controls/tests use the Toad workspace.

Deleted selectors

  • Entire permissions.tcss and the sole CSS_PATH reference.
  • Its #changes rule had no matching id in the permission composition or the current textual_diff_view implementation; make_diff supplies item-N ids and the external renderer only forwards supplied ids.
  • The nested #nav-container Select rule had no matching Select: the diff selector is a direct grid child; the navigation area's children are Question and OptionList.
  • The earlier navigator width:auto is superseded by width:1fr in that same original rule; the native owner retains the effective fill width.

Evidence and remaining work

Source parsing and diff checks pass. The trace covers the screen factory, composition, every selector target, inherited control lifetimes and current diff-view id producers.

Actual combined affected execution: 4 passed in42.19s, rc0; host TestLease released. Selection: new permission layout/focus/theme/answer control, existing permission-request controls, and the saved-session resume-modal control requested by the shared provider owner. The new control exercises ordinary theme switching and same-name register_theme + refresh_css, including background and focus-frame color changes.

Artifact: /home/ts/.cache/agent-scratch/pi-ui-colleague/permissions-controls-01.log. Runtime Core04c174d6e/installed Textual06317bf19837; Toad candidate is the rebased #1415 source at c23ff70 plus the tested control repairs. The sender's unmerged Textual#228 source was not overlaid.

Review caught my resume-control isolation error: removing the state-path patch without requesting Workspace left the test outside the collector's process wrapper. The prior4/4 is a real run, not an isolation certificate. A read-only immutable query found its synthetic saved-session row in /home/ts/.local/state/toad/toad.db; its metadata names the controls-01 test directory. That row is preserved and the diagnostic is permissions-prior-destination-01.json.

I also incorrectly called DB.create deleted. It is declared at db.py:144 and used by App.on_load; my first repair removed necessary schema initialization, which the existing ambient schema hid. Isolated controls02 then failed with no sessions table, rc1. The corrected control now consumes Workspace/project, checks that the DB path lies inside workspace.roots.attempt before any write, calls the existing DB.create schema owner, and retains the real session_new writer and typed Checkout comparison. No path patch or product compatibility method is introduced. The new permission fixture and answer list are typed. Corrected single-control execution: permissions-controls-03, 1 passed in7.53s, rc0; host lease released. It uses the actual process wrapper and fresh state, and its path guard executes before schema installation or session insertion. The prior isolation failure and controls02 schema failure remain retained; neither is reclassified as a pass.

#1414's provider, #226's native expression API and #227's Scalar/Expand annotations are merged and installed. Actual physical/configured-provider acceptance remains distinct from this successful frontend execution.

Assumed: the shared native property/theme refresh interface remains NativeLayout/NativeTheme plus native_theme, as confirmed by its owner; generic foreign-App construction is outside the traced permission-controller interface. Actual configured-provider and physical acceptance remain separate.

Copilot AI balanced review requested due to automatic review settings November 2, 2026 16:21

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 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.

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

debt-src at c162044 passes.

@trissim
trissim force-pushed the fix/native-permissions-styles branch 2 times, most recently from d111c51 to eba5c73 Compare November 2, 2026 19:32
@trissim
trissim force-pushed the fix/native-permissions-styles branch from eba5c73 to c162044 Compare November 2, 2026 19:58
@trissim
trissim enabled auto-merge November 2, 2026 20:07
@trissim
trissim merged commit 8986a06 into main Nov 2, 2026
3 of 4 checks passed
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