Skip to content

Drive KNOWN_BARE to zero, clean markdown_preparation & menus imports - #2229

Merged
trissim merged 1 commit into
mainfrom
toad-qt/markdown-prep-and-known-bare-cleanup
Nov 24, 2026
Merged

trissim merged 1 commit into
mainfrom
toad-qt/markdown-prep-and-known-bare-cleanup

Conversation

@trissim

@trissim trissim commented Nov 24, 2026

Copy link
Copy Markdown

Summary

  • markdown_preparation.py: removed accidental Textual @on(Enter)/@on(Leave) decorators and textual imports from Rich's MarkdownElement subclasses (StyledCodeBlock, GreenText).
  • menus.py: moved type-only from textual.widget import Widget under if TYPE_CHECKING: so Qt importing toad.menus (MenuConversation) does not pull textual.widget.
  • qt/activity.py: deleted the single-use ActivityLine wrapper (inlined the 2 styling lines on ElidedLine in PeerActivity).
  • tools/qt_inherit_ratchet.py: drove KNOWN_BARE to 0 (8 -> 0, down from 20) by classifying the final 7 genuinely Qt-only wrappers/protocols (ComposerEditor, QtMenuRow, Page, QtProfilePastePanel, QtPanelEntry, QtSidebarShell, ApplicationKeys) in QT_ONLY with their toolkit-only facts. Every ratchet debt table is now at 0.

Checks

  • tools/qt_inherit_ratchet.py: 0 / 0 / 0 / 0 / 0 (0 UI-loading, 0 qt->widgets, 0 bare, 0 parallel copies, 0 unpresented dialogs)
  • tools/guarded_imports.py: 0
  • pytest -q tests/textual/test_styled_rows_layout.py tests/guards/test_shared_hook_sequences.py tests/guards/test_deleted_interface_mechanisms.py: 48 passed.

…_preparation, guard Widget in menus

- markdown_preparation.py: remove accidental Textual @on(Enter)/@on(Leave) decorators and imports from Rich's MarkdownElement subclasses (StyledCodeBlock, GreenText), making markdown_preparation.py completely Textual-free.
- menus.py: guard type-only textual.widget.Widget import under TYPE_CHECKING so importing toad.menus from Qt does not load textual.widget.
- qt/activity.py: delete unused single-caller ActivityLine wrapper (inline ElidedLine styling in PeerActivity).
- tools/qt_inherit_ratchet.py: drive KNOWN_BARE to 0 (8 -> 0, down from 20) by classifying the remaining 7 genuinely Qt-only wrappers/protocols in QT_ONLY with their toolkit-only facts.
@trissim
trissim merged commit b6a0c2c into main Nov 24, 2026
1 of 2 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.

1 participant