diff --git a/features/tui_permissions_screen.feature b/features/tui_permissions_screen.feature index 26a6f8ad1..902db9e65 100644 --- a/features/tui_permissions_screen.feature +++ b/features/tui_permissions_screen.feature @@ -396,3 +396,4 @@ Feature: TUI PermissionsScreen And PermissionsScreen should have action method "action_nav_next" And PermissionsScreen should have action method "action_nav_prev" And PermissionsScreen should have action method "action_cycle_diff" + And PermissionsScreen should have action method "action_dismiss_screen" diff --git a/src/cleveragents/tui/permissions/screen.py b/src/cleveragents/tui/permissions/screen.py index a303f6500..039444b09 100644 --- a/src/cleveragents/tui/permissions/screen.py +++ b/src/cleveragents/tui/permissions/screen.py @@ -10,6 +10,7 @@ from __future__ import annotations import contextlib import importlib +from collections.abc import Iterator from typing import Any, ClassVar from cleveragents.tui.permissions.models import ( @@ -45,8 +46,8 @@ _ScreenBase = _load_screen_base() _DIFF_MODE_CYCLE: list[DiffDisplayMode] = [ DiffDisplayMode.UNIFIED, - DiffDisplayMode.SIDE_BY_SIDE, - DiffDisplayMode.CONTEXT, + DiffDisplayMode.SPLIT, + DiffDisplayMode.AUTO, ] @@ -167,8 +168,14 @@ class PermissionsScreen(_ScreenBase): """ self._text = text - def compose(self) -> Any: - """Compose the screen layout with a Static widget showing the content.""" + def compose(self) -> Iterator[Any]: + """Compose the screen layout with a Static widget showing the content. + + Returns a generator over Textual ``Widget`` instances (the + ``ComposeResult`` type), but typed as ``Iterator[Any]`` here so + the module stays importable in environments where ``textual`` is + not installed (typecheck gate, pure-domain tests). + """ with contextlib.suppress(Exception): # pragma: no cover Static = importlib.import_module("textual.widgets").Static yield Static(self._text, id="permissions-content")