From d3b25ce1e53d89394a86714524cfc7c14161f353 Mon Sep 17 00:00:00 2001 From: CleverThis Date: Tue, 12 May 2026 20:19:55 +0000 Subject: [PATCH] fix(tui): rename _render to _refresh_display in ActorSelectionOverlay (#11042) Rename ActorSelectionOverlay._render() to _refresh_display() to avoid shadowing Textual's Widget._render(), fixing a crash in textual >=1.0 where get_content_height() would receive None and raise AttributeError. ISSUES CLOSED: #11039 --- CHANGELOG.md | 2 ++ CONTRIBUTORS.md | 1 + .../tui/widgets/actor_selection_overlay.py | 12 ++++++------ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5cf3abfa7..175cb564f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). ## [Unreleased] +- **fix(tui): rename ActorSelectionOverlay._render to _refresh_display (issue #11039)** — `ActorSelectionOverlay._render()` shadows Textual's `Widget._render()` which must return a `Strip`. In textual >=1.0, layout calls `get_content_height()` → `self._render()` → gets `None` → `AttributeError: 'NoneType' object has no attribute 'get_height'`. Renamed the method to `_refresh_display()` and updated all four internal call sites (`show()`, `move_up()`, `move_down()`, `set_search()`) to use the new name. + - **`task-implementor` posts work-started notification comments** (#11031): Both the `issue_impl` and `pr_fix` procedures now post an informational "work started" comment to the Forgejo issue/PR before beginning implementation. diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 735c33416..266b9e911 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -43,3 +43,4 @@ Below are some of the specific details of various contributions. * HAL 9000 has contributed database resource types (PostgreSQL, SQLite) with transaction-based sandbox strategy: implemented ``DatabaseResourceHandler`` providing full CRUD operations (`read`, `write`, `delete`, `list_children`) and connection validation with automatic credential masking for PostgreSQL and SQLite backends. Includes ``TransactionSandbox`` infrastructure wired into ``SandboxFactory``, BDD test coverage in ``features/database_resources.feature``, and Robot Framework integration tests in ``robot/database_resources.robot`` (PR #10591 / issue #8608, Epic #8568). * HAL 9000 has contributed the agents plan rollback command (PR #8674 / issue #8557): implemented checkpoint-based plan state restoration with the `agents plan rollback []` CLI command as part of Epic #8493, enabling plans to be restored to previous checkpoints, discarding post-checkpoint decisions, and resuming execution from the rolled-back state. Supported by `--yes/-y`, `--to-checkpoint`, and `--format/-f` flags. Includes comprehensive BDD test coverage (>= 97%) for rollback, decision discarding, and plan resume functionality. * HAL 9000 has contributed the PyYAML security upgrade (PR #11012 / issue #9055): added `pyyaml>=6.0.3` dependency constraint to address known YAML parsing vulnerabilities. +* HAL 9000 has contributed the `ActorSelectionOverlay._render` → `_refresh_display` rename fix (PR this session / issue #11039, Epic #8174): renamed `_render()` method to `_refresh_display()` to avoid shadowing Textual's `Widget._render()`, fixing a crash in textual >=1.0 where `get_content_height()` would receive `None` and raise `AttributeError: 'NoneType' object has no attribute 'get_height'`. diff --git a/src/cleveragents/tui/widgets/actor_selection_overlay.py b/src/cleveragents/tui/widgets/actor_selection_overlay.py index d515924d8..fd27c1b3d 100644 --- a/src/cleveragents/tui/widgets/actor_selection_overlay.py +++ b/src/cleveragents/tui/widgets/actor_selection_overlay.py @@ -145,7 +145,7 @@ class ActorSelectionOverlay(_StaticBase): self._confirmed = False self._selected_actor = None self._visible = True - self._render() + self._refresh_display() def hide(self) -> None: """Hide the overlay and clear its content.""" @@ -161,14 +161,14 @@ class ActorSelectionOverlay(_StaticBase): if not self._filtered_actors: return self._selected_index = (self._selected_index - 1) % len(self._filtered_actors) - self._render() + self._refresh_display() def move_down(self) -> None: """Move the selection cursor down by one position (wraps).""" if not self._filtered_actors: return self._selected_index = (self._selected_index + 1) % len(self._filtered_actors) - self._render() + self._refresh_display() # ------------------------------------------------------------------ # Search / filter @@ -191,7 +191,7 @@ class ActorSelectionOverlay(_StaticBase): else: self._filtered_actors = list(self._actors) self._selected_index = 0 - self._render() + self._refresh_display() # ------------------------------------------------------------------ # Confirmation @@ -215,10 +215,10 @@ class ActorSelectionOverlay(_StaticBase): return actor # ------------------------------------------------------------------ - # Internal rendering + # Internal display refresh # ------------------------------------------------------------------ - def _render(self) -> None: + def _refresh_display(self) -> None: content = render_actor_selection( self._filtered_actors, self._selected_index, -- 2.52.0