Skip to content

Compose ApplicationSettings and NoticeHost onto ThemedApp and fix Conversation.contents selector collision - #2271

Merged
trissim merged 1 commit into
mainfrom
fix/themed-app-and-conversation-contents
Nov 24, 2026
Merged

trissim merged 1 commit into
mainfrom
fix/themed-app-and-conversation-contents

Conversation

@trissim

@trissim trissim commented Nov 24, 2026

Copy link
Copy Markdown

Numbers

  • 7 files changed (-3 net lines in src/), 38 tests turned green across 11 files
  • Guards: qt_inherit_ratchet=0, shadow_check=0, guarded_imports=0, cold-start PRE-SPLASH=253, POST-LOAD=1757 (comms=False, pkg=False)

Mechanisms

  1. ApplicationSettings + NoticeHost capability mixins (Paper 1 Prop. 4.2, Cor. 4.12):
    • #1983 moved saved_settings/settings/configuration_state onto ClientApplication and a later PR moved show_error onto CommsHost, leaving standalone ThemedApp subclasses abstract on configuration_state and show_error while ThemedApp.__init__ still called missing self.open_settings().
    • Extracted ApplicationSettings in src/toad/client/view_settings.py (inherited by both ClientApplication and ThemedApp; ThemedApp.open_settings returns in-memory SavedSettings(), ClientApplication.open_settings loads SavedSettings.path()) and NoticeHost in src/toad/client/host.py (inherited by both CommsHost and ThemedApp, after App so App.notify wins).
    • Changed NavigatingHost[Source](CommsHost) -> NavigatingHost(Generic[Source], CommsHost) so Generic precedes CommsHost/NoticeHost consistently with textual.app.App(Generic[ReturnType], DOMNode).
  2. Conversation.contents CSS type collision (IDEN-2):
    • Conversation.compose() always mounts ConversationContents, while Conversation.contents queried getters.query_one(Contents). Because Collapsible.Contents and MessageNotifications.Contents also carry CSS type name "Contents", mounting/expanding MessageNotifications under Conversation threw WrongType.
    • Changed Conversation.contents = getters.query_one(ConversationContents) at src/toad/widgets/conversation.py:577.
  3. Stale test call sites updated alongside the touched suites:
    • tests/textual/test_draft_render_task.py: import FragmentPlan, PageFiles, transcript_fragments from toad.client.transcript_fragments and pass classes=TEXTUAL_FRAGMENT_CLASSES, files=PageFiles().
    • tests/textual/test_forms.py: OptionalEditor.member -> member_editor (renamed on src/toad/forms/editors.py:234).

Verification

  • Verified MRO on ToadApp, QtToadApp, ThemedApp (ThemedApp.__abstractmethods__ == frozenset()).
  • qt_inherit_ratchet.py, shadow_check.py, guarded_imports.py: all 0.
  • PRE-SPLASH: 253 window=False comms=False pkg=False, POST-LOAD: 1757 comms=False pkg=False.
  • pytest -p no:xdist across tests/guards/test_shared_frontend_members.py + 10 Textual test files: 38 passed.

@trissim
trissim merged commit 06e483a into main Nov 24, 2026
@trissim
trissim deleted the fix/themed-app-and-conversation-contents branch November 24, 2026 19:38
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.

1 participant