Skip to content

Apply NRA hidden-import promotions, hoist PermissionRequest.presentation, factor PublicationDemand, and fix DiffMode.split crash - #2272

Merged
trissim merged 1 commit into
mainfrom
refactor/nra-toad-hidden-imports
Nov 24, 2026
Merged

trissim merged 1 commit into
mainfrom
refactor/nra-toad-hidden-imports

Conversation

@trissim

@trissim trissim commented Nov 24, 2026

Copy link
Copy Markdown

Numbers

  • 8 files changed, -12 net lines (+36/-48)
  • Guards: qt_inherit_ratchet=0, shadow_check=0, guarded_imports=0, rel_imports=0, cold-start PRE-SPLASH=253, POST-LOAD=1757 (comms=False, pkg=False)
  • Tests: test_shared_frontend_members.py (10 passed), test_tool_output.py (1 passed), test_permission_requests.py (2 passed — fixed live crash on PermissionsScreen)

Mechanisms

  1. NRA hidden_import_promotion (cli.py, conversation_turn.py, web_server.py):
    • Applied 3 clean acyclic hidden-import promotions from NRA 46e9dad3 (reverted render_processes.py worker-only capabilities and workspace_frame.py which pulled +71 Textual modules into Qt cold start).
  2. Hoist PermissionRequest.presentation (src/toad/acp/permission_controller.py, NRA repeated_property_alias_hooks bea3a7a68d):
    • PermissionRequest.__init__ now accepts presentation: PermissionPresentation and defines @property def presentation once, deleting both duplicate overrides on ToolPermissionRequest and ElicitationRequest.
  3. Factor PublicationDemand (src/toad/transcript_publication.py, NRA sibling_override abcfaf5083):
    • Added CleanDemand(PublicationDemand) (CLEAN_PUBLICATION = CleanDemand()) and PendingDemand(PublicationDemand) owning pending = True once, inherited by RefreshDemand and CommitDemand.
  4. Decouple make_diff & fix live #2238 PermissionsScreen crash (src/toad/widgets/diff_view.py, src/toad/screens/permissions.py, src/toad/patch.py):
    • Replaced mid-file from toad.app import ToadApp + isinstance(app, ToadApp) (own_type_test e93123a1bf) and local from textual._context import active_app with top-level imports and isinstance(app, ApplicationSettings).
    • #2238 deleted PatchRows.split while leaving diff_view.py:33 (diff_view_setting.rows.split) and permissions.py:271 (diff_type.rows.split), crashing PermissionsScreen with AttributeError: 'UnifiedRows' object has no attribute 'split'. Added split: ClassVar[bool] = False on DiffMode (SplitDiff.split = True, beside auto_split) and updated both callers (zero rows.split remaining across src/ tests/ tools/).

…ion, factor PublicationDemand, and fix DiffMode.split crash
@trissim
trissim merged commit 5582dfe into main Nov 24, 2026
@trissim
trissim deleted the refactor/nra-toad-hidden-imports branch November 24, 2026 19:47
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