Skip to content

Replace the session resume stylesheet with native declarations - #1414

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

trissim merged 5 commits into
mainfrom
fix/session-resume-native-styles

Conversation

@trissim

@trissim trissim commented Nov 2, 2026 •

Copy link
Copy Markdown

Summary

3 files, +98/-45: session-resume stylesheet 35 -> 0 lines, including its CSS_PATH. Textual#226 is merged as da21bbd4784a59e2c6416077d90da30eee87db20; this consumer uses its native declaration API.

Before / After

Before: nested stylesheet selectors identify generic Markdown, Static, container, table and button roles and decide their geometry and colours.

After: NativeLayout supplies one cooperative registration hook. ResumeHeading retains MarkdownH1, ResumeHelp extends Markdown's decoder using the heading LEVEL, and ResumeWarning/ResumeFrame compose NativeTheme + NativeLayout + their original Static/VerticalGroup parents. Table/container/buttons retain DataTable, Center and HorizontalGroup. SessionResumeModal retains DismissibleScreen and its existing store/actions.

The caller remains screens/store.py. Session queries, row keys, actions, selection and dismissal are unchanged. WidgetView is not substituted wholesale: its complete defaults would overwrite inherited Markdown/DataTable overflow, borders and margins.

Deleted decisions and their owners

Deleted the entire 35-line session_resume_modal.tcss and CSS_PATH. Each role owns its irreducible geometry on its class. Warning border/text and frame-border alpha retain actual Styles property descriptors and nominal Variable/TextVariable/Keyword/Percent values.

NativeTheme.apply_native_styles participates in Textual's existing Stylesheet.apply publication, including cache hits and same-name palette refresh through App.refresh_css. Its native_declarations method supports cooperative provider composition. My earlier registration/Mount/theme-signal path was incomplete for KnownPalette.refresh_colours and is deleted, not retained as another invalidation path.

Textual#226 binds NativeDeclaration directly to its property implementation. CSS alone resolves external names. Both paths retain shared substitution, StylesBuilder and PaintState semantics, including automatic contrast and alpha; there is no copied Color.parse shortcut or ColorSystem derivation. A provisional WarningTextColour class was removed because text-warning is an expression rather than the RGB contract.

Evidence and limits

  • Final reviewed head34095462775122359861e3e6c7e309f829e621a8 merged as5fde3b5a6818297a72edfcb863a059fa48177d58. Tracked source is clean; retained untracked scripts are preserved. The installed build was independently read as Core04c174d6e8d20b81cbe7f31a467d6eea820d1fab / Toad5fde3b5a6818297a72edfcb863a059fa48177d58 / Textual06317bf19837d9e62fc670767ef5fdf3935d7a73. Installed native provider and stylesheet publication hook match the delivered source; the old stylesheet is absent.
  • 10 direct value controls and 6 actual ResumeWarning/ResumeFrame declaration controls returned rc0 after property-owned binding. Artifacts: native-declarations-bind-final and native-consumer-bind-final under /home/ts/.cache/agent-scratch/pi-block-spacing/.
  • Two real-node/Stylesheet controls returned rc0 for initial publication and changed variables on the same sheet, including auto75% text and frame20% alpha: native-application-check01.log. No synthetic app or theme signal supplied the result.
  • Earlier misleading default-only control and whitespace/alias failures remain retained; they are not passing evidence for corrected epochs.
  • Authored Textual regression tests and the affected Toad test tests/textual/test_command_pane_and_resume_modal.py::test_the_resume_modal_lists_a_saved_session_and_returns_it_typed are distinct from executed controls. Author pytest/full suite and physical dialog equivalence are not claimed. claude-ai owns the shared parser execution.
  • Final hosted NRA gate41503896727/job125478091521 passed at340954627; suite SKIPPED. The author's exact-head source judgment and explicit growth reasons are recorded, not represented as independent execution. Earlier c89509 failed because the library API had not landed; that original failure remains retained. A skipped suite is not a pass.

Assumed: these controls establish specified declaration/publication behavior, not painted geometry, focus, selection or real dialog acceptance. Those affected application cases remain open. P1088's merged spacing source and open physical acceptance are a separate order; its source delivery claim is now recorded at revision17.

Copilot AI balanced review requested due to automatic review settings November 2, 2026 14:58

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.

@trissim
trissim force-pushed the fix/session-resume-native-styles branch from 51abd8e to 2e10058 Compare November 2, 2026 15:42
@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

debt-src at 3409546 passes.

Warn-only, never blocks (2)
src/toad/screens/session_resume_modal.py: Unformatted +1
found Unformatted:src/toad/screens/session_resume_modal.py at src/toad/screens/session_resume_modal.py:1 (Black would reformat this file)

@trissim
trissim force-pushed the fix/session-resume-native-styles branch from 2e10058 to c89509b Compare November 2, 2026 16:30
@trissim
trissim force-pushed the fix/session-resume-native-styles branch from c89509b to 3409546 Compare November 2, 2026 18:47
@trissim
trissim merged commit 5fde3b5 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