UAT: Escape cascade not implemented — pressing escape does not dismiss modal → overlay → sidebar → main prompt in sequence #10515

Open
opened 2026-04-18 10:31:16 +00:00 by HAL9000 · 1 comment
Owner

Metadata

  • Branch: fix/tui-escape-cascade-missing
  • Commit Message: feat(tui): implement escape cascade: modal → overlay → sidebar → main prompt
  • Milestone: v3.7.0
  • Parent Epic: #868

Bug Report

What Was Tested

Source code inspection of src/cleveragents/tui/app.py and all widget files in src/cleveragents/tui/widgets/.

Expected Behavior (from spec)

Per the specification (§TUI > Safety Behaviors), pressing escape must cascade through the UI layers in order:

  1. If a modal screen is open → dismiss the modal
  2. Else if an overlay (help panel, slash command overlay, reference picker, actor selection) is visible → hide the overlay
  3. Else if the sidebar is visible → hide the sidebar
  4. Else → focus the main prompt input

Actual Behavior

The _TextualCleverAgentsTuiApp in app.py has no escape binding in its BINDINGS list and no action_escape() method. The app's BINDINGS only contains ctrl+q, f1, and ctrl+t.

Individual overlays (e.g., HelpPanelOverlay, SlashCommandOverlay) may handle escape internally, but there is no coordinated cascade logic in the app that:

  1. Checks for open modals first
  2. Then checks for visible overlays
  3. Then checks for visible sidebar
  4. Then falls back to focusing the main prompt

Steps to Reproduce

  1. Inspect src/cleveragents/tui/app.py — no escape binding or action_escape() method exists.
  2. Launch the TUI and open a help panel (F1), then press escape — behavior is undefined/inconsistent.
  3. Open multiple overlays and press escape repeatedly — no ordered cascade dismissal occurs.

Impact

The escape cascade is a core safety behavior specified for the TUI. Without it, users have no reliable way to dismiss UI layers in order. This makes the TUI difficult to use and violates the spec's safety behavior requirements.

Subtasks

  • Add escape to _TextualCleverAgentsTuiApp.BINDINGS in app.py
  • Implement action_escape() method in _TextualCleverAgentsTuiApp with the cascade logic:
    1. If a modal screen is on the screen stack → self.pop_screen()
    2. Elif any overlay is visible (help panel, slash overlay, reference picker, actor selection) → hide the topmost visible overlay
    3. Elif sidebar is visible → hide the sidebar
    4. Else → focus the #prompt widget
  • Tests (Behave): Add TDD scenario tagged @tdd_issue, @tdd_expected_fail asserting escape dismisses modal when modal is open
  • Tests (Behave): Add TDD scenario asserting escape hides overlay when overlay is visible and no modal is open
  • Tests (Behave): Add TDD scenario asserting escape focuses prompt when no modal or overlay is open
  • Remove @tdd_expected_fail once implemented and verify scenarios pass
  • Verify coverage >= 97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

Definition of Done

  • escape binding is registered in _TextualCleverAgentsTuiApp.BINDINGS
  • action_escape() implements the full cascade: modal → overlay → sidebar → main prompt
  • All TDD scenarios pass without @tdd_expected_fail
  • All nox stages pass
  • Coverage >= 97%
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.

Automated by CleverAgents Bot
Supervisor: UAT Test Pool | Agent: uat-test-pool-supervisor


Automated by CleverAgents Bot
Agent: new-issue-creator

## Metadata - **Branch**: `fix/tui-escape-cascade-missing` - **Commit Message**: `feat(tui): implement escape cascade: modal → overlay → sidebar → main prompt` - **Milestone**: v3.7.0 - **Parent Epic**: #868 ## Bug Report ### What Was Tested Source code inspection of `src/cleveragents/tui/app.py` and all widget files in `src/cleveragents/tui/widgets/`. ### Expected Behavior (from spec) Per the specification (§TUI > Safety Behaviors), pressing `escape` must cascade through the UI layers in order: 1. If a modal screen is open → dismiss the modal 2. Else if an overlay (help panel, slash command overlay, reference picker, actor selection) is visible → hide the overlay 3. Else if the sidebar is visible → hide the sidebar 4. Else → focus the main prompt input ### Actual Behavior The `_TextualCleverAgentsTuiApp` in `app.py` has no `escape` binding in its `BINDINGS` list and no `action_escape()` method. The app's `BINDINGS` only contains `ctrl+q`, `f1`, and `ctrl+t`. Individual overlays (e.g., `HelpPanelOverlay`, `SlashCommandOverlay`) may handle escape internally, but there is no coordinated cascade logic in the app that: 1. Checks for open modals first 2. Then checks for visible overlays 3. Then checks for visible sidebar 4. Then falls back to focusing the main prompt ### Steps to Reproduce 1. Inspect `src/cleveragents/tui/app.py` — no `escape` binding or `action_escape()` method exists. 2. Launch the TUI and open a help panel (F1), then press `escape` — behavior is undefined/inconsistent. 3. Open multiple overlays and press `escape` repeatedly — no ordered cascade dismissal occurs. ### Impact The escape cascade is a core safety behavior specified for the TUI. Without it, users have no reliable way to dismiss UI layers in order. This makes the TUI difficult to use and violates the spec's safety behavior requirements. ## Subtasks - [ ] Add `escape` to `_TextualCleverAgentsTuiApp.BINDINGS` in `app.py` - [ ] Implement `action_escape()` method in `_TextualCleverAgentsTuiApp` with the cascade logic: 1. If a modal screen is on the screen stack → `self.pop_screen()` 2. Elif any overlay is visible (help panel, slash overlay, reference picker, actor selection) → hide the topmost visible overlay 3. Elif sidebar is visible → hide the sidebar 4. Else → focus the `#prompt` widget - [ ] Tests (Behave): Add TDD scenario tagged `@tdd_issue`, `@tdd_expected_fail` asserting escape dismisses modal when modal is open - [ ] Tests (Behave): Add TDD scenario asserting escape hides overlay when overlay is visible and no modal is open - [ ] Tests (Behave): Add TDD scenario asserting escape focuses prompt when no modal or overlay is open - [ ] Remove `@tdd_expected_fail` once implemented and verify scenarios pass - [ ] Verify coverage >= 97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done - [ ] `escape` binding is registered in `_TextualCleverAgentsTuiApp.BINDINGS` - [ ] `action_escape()` implements the full cascade: modal → overlay → sidebar → main prompt - [ ] All TDD scenarios pass without `@tdd_expected_fail` - [ ] All nox stages pass - [ ] Coverage >= 97% - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. --- **Automated by CleverAgents Bot** Supervisor: UAT Test Pool | Agent: uat-test-pool-supervisor --- **Automated by CleverAgents Bot** Agent: new-issue-creator
HAL9000 added this to the v3.7.0 milestone 2026-04-18 10:35:43 +00:00
Author
Owner

[GROOMED] Quality Analysis Report

Issue Validity: VALID & ACTIONABLE

This is a well-documented, critical UAT bug with clear specifications, reproduction steps, and acceptance criteria.

Label Verification

Current Labels:

  • State/Unverified (id: 846)
  • Type/Bug (id: 849)
  • Priority/Critical (id: 858)
  • MoSCoW/Must have (id: 883)

Status: All required labels present (State/, Type/, Priority/)

Milestone Assignment

Status: ASSIGNED to v3.7.0 (M8: TUI Implementation)

This is correct per the issue metadata which specifies "Milestone: v3.7.0"

Epic Linkage

Parent Epic: #868 (mentioned in issue metadata)

Priority/Critical Flag 🚨

CRITICAL ATTENTION REQUIRED:

  • This is a Priority/Critical issue
  • Currently in State/Unverified (not yet verified/started)
  • Action Required: Once this issue is verified and work begins, it should transition to State/In Progress
  • This is a core safety behavior for the TUI — escape cascade is essential for user experience

Issue Assessment Summary

Aspect Status Notes
Validity Valid Well-documented bug with clear spec violation
Required Labels Complete All State/, Type/, Priority/ labels present
Milestone Assigned v3.7.0 (TUI Implementation)
Epic Linked Parent Epic #868
Assignee ⚠️ Unassigned Needs assignment when work begins
Subtasks Detailed 7 clear subtasks with DoD criteria
  1. Verify & Transition: Move to State/Verified when ready to begin work
  2. Assign: Assign to implementation owner
  3. Implement: Follow the detailed subtasks in the issue description
  4. Test: Ensure all TDD scenarios pass with coverage ≥ 97%
  5. Review & Merge: Submit PR to master, review, and merge

Automated by CleverAgents Bot
Supervisor: Grooming | Agent: grooming-pool-supervisor

## [GROOMED] Quality Analysis Report ### Issue Validity: ✅ VALID & ACTIONABLE This is a well-documented, critical UAT bug with clear specifications, reproduction steps, and acceptance criteria. ### Label Verification **Current Labels:** - ✅ State/Unverified (id: 846) - ✅ Type/Bug (id: 849) - ✅ Priority/Critical (id: 858) - ✅ MoSCoW/Must have (id: 883) **Status:** All required labels present (State/, Type/, Priority/) ### Milestone Assignment **Status:** ✅ ASSIGNED to v3.7.0 (M8: TUI Implementation) This is correct per the issue metadata which specifies "Milestone: v3.7.0" ### Epic Linkage **Parent Epic:** #868 (mentioned in issue metadata) ### Priority/Critical Flag 🚨 **CRITICAL ATTENTION REQUIRED:** - This is a `Priority/Critical` issue - Currently in `State/Unverified` (not yet verified/started) - **Action Required:** Once this issue is verified and work begins, it should transition to `State/In Progress` - This is a core safety behavior for the TUI — escape cascade is essential for user experience ### Issue Assessment Summary | Aspect | Status | Notes | |--------|--------|-------| | Validity | ✅ Valid | Well-documented bug with clear spec violation | | Required Labels | ✅ Complete | All State/, Type/, Priority/ labels present | | Milestone | ✅ Assigned | v3.7.0 (TUI Implementation) | | Epic | ✅ Linked | Parent Epic #868 | | Assignee | ⚠️ Unassigned | Needs assignment when work begins | | Subtasks | ✅ Detailed | 7 clear subtasks with DoD criteria | ### Recommended Next Steps 1. **Verify & Transition:** Move to `State/Verified` when ready to begin work 2. **Assign:** Assign to implementation owner 3. **Implement:** Follow the detailed subtasks in the issue description 4. **Test:** Ensure all TDD scenarios pass with coverage ≥ 97% 5. **Review & Merge:** Submit PR to master, review, and merge --- **Automated by CleverAgents Bot** Supervisor: Grooming | Agent: grooming-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#10515
No description provided.