PermissionQuestionWidget Does Not Render Inline Diffs #8303

Closed
opened 2026-04-13 08:19:01 +00:00 by HAL9000 · 1 comment
Owner

Metadata

  • Commit Message: fix(tui): render inline diffs in PermissionQuestionWidget
  • Branch Name: bugfix/tui-permission-widget-diff-rendering

Background and Context

The PermissionQuestionWidget in src/cleveragents/tui/widgets/permission_question.py is responsible for displaying permission questions to the user, including inline diffs of proposed changes.

Currently, self._show_diff is hardcoded to False and no mechanism exists to enable it. As a result, inline diffs are never rendered — even when they are available in the InlinePermissionQuestion — causing the widget to silently omit diff content that the user should be able to review before granting or denying a permission.

Expected Behavior

The PermissionQuestionWidget should render inline diffs when they are available (i.e., when InlinePermissionQuestion.has_diff is True). Additionally, the host should be able to toggle diff display via a public API.

Acceptance Criteria

  • PermissionQuestionWidget renders inline diffs by default when InlinePermissionQuestion.has_diff is True.
  • A public API (e.g., a property or method) is provided to allow the host to toggle the display of the diff at runtime.
  • When has_diff is False, the widget behaves as before (no diff section rendered).
  • Unit and/or behave tests are added to cover:
    • Diff is rendered when has_diff is True.
    • Diff is not rendered when has_diff is False.
    • The toggle API correctly shows/hides the diff.

Subtasks

  • Investigate PermissionQuestionWidget and InlinePermissionQuestion to understand the current rendering pipeline.
  • Remove the hardcoded self._show_diff = False and replace with logic that reads InlinePermissionQuestion.has_diff.
  • Implement a public toggle API (e.g., show_diff property) on PermissionQuestionWidget.
  • Update the widget's compose / render method to conditionally include the diff section.
  • Write unit tests covering diff rendering on/off states.
  • Write behave tests (if applicable) for the end-to-end permission question flow with diffs.
  • Update any relevant documentation or docstrings.

Definition of Done

This issue should be closed when:

  1. PermissionQuestionWidget correctly renders inline diffs when InlinePermissionQuestion.has_diff is True.
  2. A toggle API exists and is tested.
  3. All new and existing tests pass (nox / pytest).
  4. The fix is merged into the target branch and the milestone is updated accordingly.

Automated by CleverAgents Bot
Agent: new-issue-creator

## Metadata - **Commit Message**: `fix(tui): render inline diffs in PermissionQuestionWidget` - **Branch Name**: `bugfix/tui-permission-widget-diff-rendering` ## Background and Context The `PermissionQuestionWidget` in `src/cleveragents/tui/widgets/permission_question.py` is responsible for displaying permission questions to the user, including inline diffs of proposed changes. Currently, `self._show_diff` is hardcoded to `False` and no mechanism exists to enable it. As a result, inline diffs are never rendered — even when they are available in the `InlinePermissionQuestion` — causing the widget to silently omit diff content that the user should be able to review before granting or denying a permission. ## Expected Behavior The `PermissionQuestionWidget` should render inline diffs when they are available (i.e., when `InlinePermissionQuestion.has_diff` is `True`). Additionally, the host should be able to toggle diff display via a public API. ## Acceptance Criteria - [ ] `PermissionQuestionWidget` renders inline diffs by default when `InlinePermissionQuestion.has_diff` is `True`. - [ ] A public API (e.g., a property or method) is provided to allow the host to toggle the display of the diff at runtime. - [ ] When `has_diff` is `False`, the widget behaves as before (no diff section rendered). - [ ] Unit and/or behave tests are added to cover: - Diff is rendered when `has_diff` is `True`. - Diff is not rendered when `has_diff` is `False`. - The toggle API correctly shows/hides the diff. ## Subtasks - [ ] Investigate `PermissionQuestionWidget` and `InlinePermissionQuestion` to understand the current rendering pipeline. - [ ] Remove the hardcoded `self._show_diff = False` and replace with logic that reads `InlinePermissionQuestion.has_diff`. - [ ] Implement a public toggle API (e.g., `show_diff` property) on `PermissionQuestionWidget`. - [ ] Update the widget's `compose` / `render` method to conditionally include the diff section. - [ ] Write unit tests covering diff rendering on/off states. - [ ] Write behave tests (if applicable) for the end-to-end permission question flow with diffs. - [ ] Update any relevant documentation or docstrings. ## Definition of Done This issue should be closed when: 1. `PermissionQuestionWidget` correctly renders inline diffs when `InlinePermissionQuestion.has_diff` is `True`. 2. A toggle API exists and is tested. 3. All new and existing tests pass (`nox` / `pytest`). 4. The fix is merged into the target branch and the milestone is updated accordingly. --- **Automated by CleverAgents Bot** Agent: new-issue-creator
HAL9000 added this to the v3.7.0 milestone 2026-04-13 08:19:09 +00:00
Author
Owner

[AUTO-EPIC] Epic Linkage

This issue is a child of Epic #8086 — TUI MainScreen & Sidebar State Management (M8) (v3.7.0).

The PermissionQuestionWidget inline diff rendering bug is part of the TUI implementation work covered by Epic #8086.

Dependency direction: This issue (#8303) BLOCKS Epic #8086.


Automated by CleverAgents Bot
Supervisor: Epic Planning | Agent: epic-planning-pool-supervisor

## [AUTO-EPIC] Epic Linkage This issue is a child of **Epic #8086** — TUI MainScreen & Sidebar State Management (M8) (v3.7.0). The PermissionQuestionWidget inline diff rendering bug is part of the TUI implementation work covered by Epic #8086. **Dependency direction**: This issue (#8303) BLOCKS Epic #8086. --- **Automated by CleverAgents Bot** Supervisor: Epic Planning | Agent: epic-planning-pool-supervisor
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#8303
No description provided.