[BUG] TUI MainScreen missing 3-state sidebar (hidden/visible/fullscreen) as specified in ADR-044 #10025

Open
opened 2026-04-16 13:18:01 +00:00 by HAL9000 · 2 comments
Owner

Metadata

  • Commit message: fix(tui): implement MainScreen with 3-state collapsible sidebar per ADR-044
  • Branch name: fix/tui-mainscreen-3state-sidebar-adr044

Background and Context

The TUI implementation in src/cleveragents/tui/app.py does not implement the MainScreen class with the 3-state collapsible sidebar specified in ADR-044 and the product specification (§TUI Architecture, M8).

The current TUI app (_TextualCleverAgentsTuiApp) is a single flat screen with no sidebar, no MainScreen class, and no sidebar state management. This is a significant deviation from the architecture decision recorded in ADR-044, which mandates a right-side collapsible sidebar with three distinct states (hidden → visible → fullscreen) and specific keybindings for state cycling.

Steps to Reproduce:

  1. Review src/cleveragents/tui/app.py
  2. Search for MainScreen, SidebarState, sidebar, HIDDEN, VISIBLE, FULLSCREEN classes or enums
  3. Observe that none of these exist in the TUI codebase

Actual Behavior:

  • The TUI app (_TextualCleverAgentsTuiApp) is a single flat screen with no sidebar
  • No MainScreen class exists
  • No sidebar states are implemented
  • No shift+tab binding for sidebar cycling
  • The layout is a simple vertical column with conversation and prompt

Environment:

  • Repository: cleveragents/cleveragents-core
  • Branch: master
  • File: src/cleveragents/tui/app.py
  • ADR Reference: ADR-044 (TUI Architecture and Framework)
  • Spec Reference: §TUI — Sidebar Three-State Behavior, M8 milestone item #2

Expected Behavior

From ADR-044 §Decision point 2:

  • A MainScreen class that is the primary interface
  • A right-side collapsible sidebar with 3 states: hiddenvisible (~32 chars wide) → fullscreen (covers conversation)
  • State cycling via shift+tab keybinding
  • escape key cascading back from fullscreen → visible → hidden
  • SidebarFullScreen pushed as a separate screen when sidebar enters fullscreen mode
  • PlansPanel and ProjectsPanel collapsible containers in the sidebar

Acceptance Criteria

  • A MainScreen class exists in src/cleveragents/tui/app.py (or appropriate TUI module) as the primary interface
  • A SidebarState enum (or equivalent) defines HIDDEN, VISIBLE, and FULLSCREEN states
  • The sidebar is positioned on the right side of the screen
  • In VISIBLE state, the sidebar is approximately 32 characters wide
  • In FULLSCREEN state, the sidebar covers the conversation area (pushed as SidebarFullScreen screen)
  • shift+tab keybinding cycles the sidebar forward through states: hidden → visible → fullscreen → hidden
  • escape key cascades the sidebar backward: fullscreen → visible → hidden
  • PlansPanel and ProjectsPanel are collapsible containers rendered within the sidebar
  • All existing TUI tests pass with the new implementation
  • New tests cover all 3 sidebar state transitions and keybindings

Subtasks

  • Define SidebarState enum with HIDDEN, VISIBLE, FULLSCREEN values
  • Create MainScreen class as the primary Textual screen
  • Implement right-side sidebar widget with width-constrained VISIBLE state (~32 chars)
  • Implement SidebarFullScreen screen pushed when entering fullscreen mode
  • Wire shift+tab keybinding to cycle sidebar state forward
  • Wire escape keybinding to cascade sidebar state backward
  • Implement PlansPanel collapsible container in sidebar
  • Implement ProjectsPanel collapsible container in sidebar
  • Write unit tests for all sidebar state transitions
  • Write integration tests for keybinding behavior

Definition of Done

This issue should be closed when:

  1. MainScreen class is implemented and serves as the primary TUI interface
  2. The 3-state sidebar (HIDDEN / VISIBLE / FULLSCREEN) is fully functional with correct keybindings (shift+tab forward, escape backward)
  3. PlansPanel and ProjectsPanel are rendered as collapsible containers in the sidebar
  4. SidebarFullScreen is pushed as a separate screen in fullscreen mode
  5. All acceptance criteria above are verified by passing tests
  6. nox passes with coverage ≥ 97%

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

## Metadata - **Commit message**: `fix(tui): implement MainScreen with 3-state collapsible sidebar per ADR-044` - **Branch name**: `fix/tui-mainscreen-3state-sidebar-adr044` ## Background and Context The TUI implementation in `src/cleveragents/tui/app.py` does not implement the `MainScreen` class with the 3-state collapsible sidebar specified in ADR-044 and the product specification (§TUI Architecture, M8). The current TUI app (`_TextualCleverAgentsTuiApp`) is a single flat screen with no sidebar, no `MainScreen` class, and no sidebar state management. This is a significant deviation from the architecture decision recorded in ADR-044, which mandates a right-side collapsible sidebar with three distinct states (hidden → visible → fullscreen) and specific keybindings for state cycling. **Steps to Reproduce**: 1. Review `src/cleveragents/tui/app.py` 2. Search for `MainScreen`, `SidebarState`, `sidebar`, `HIDDEN`, `VISIBLE`, `FULLSCREEN` classes or enums 3. Observe that none of these exist in the TUI codebase **Actual Behavior**: - The TUI app (`_TextualCleverAgentsTuiApp`) is a single flat screen with no sidebar - No `MainScreen` class exists - No sidebar states are implemented - No `shift+tab` binding for sidebar cycling - The layout is a simple vertical column with conversation and prompt **Environment**: - Repository: cleveragents/cleveragents-core - Branch: master - File: `src/cleveragents/tui/app.py` - ADR Reference: ADR-044 (TUI Architecture and Framework) - Spec Reference: §TUI — Sidebar Three-State Behavior, M8 milestone item #2 ## Expected Behavior From ADR-044 §Decision point 2: - A `MainScreen` class that is the primary interface - A right-side collapsible sidebar with 3 states: **hidden** → **visible** (~32 chars wide) → **fullscreen** (covers conversation) - State cycling via `shift+tab` keybinding - `escape` key cascading back from fullscreen → visible → hidden - `SidebarFullScreen` pushed as a separate screen when sidebar enters fullscreen mode - `PlansPanel` and `ProjectsPanel` collapsible containers in the sidebar ## Acceptance Criteria - [ ] A `MainScreen` class exists in `src/cleveragents/tui/app.py` (or appropriate TUI module) as the primary interface - [ ] A `SidebarState` enum (or equivalent) defines `HIDDEN`, `VISIBLE`, and `FULLSCREEN` states - [ ] The sidebar is positioned on the right side of the screen - [ ] In `VISIBLE` state, the sidebar is approximately 32 characters wide - [ ] In `FULLSCREEN` state, the sidebar covers the conversation area (pushed as `SidebarFullScreen` screen) - [ ] `shift+tab` keybinding cycles the sidebar forward through states: hidden → visible → fullscreen → hidden - [ ] `escape` key cascades the sidebar backward: fullscreen → visible → hidden - [ ] `PlansPanel` and `ProjectsPanel` are collapsible containers rendered within the sidebar - [ ] All existing TUI tests pass with the new implementation - [ ] New tests cover all 3 sidebar state transitions and keybindings ## Subtasks - [ ] Define `SidebarState` enum with `HIDDEN`, `VISIBLE`, `FULLSCREEN` values - [ ] Create `MainScreen` class as the primary Textual screen - [ ] Implement right-side sidebar widget with width-constrained `VISIBLE` state (~32 chars) - [ ] Implement `SidebarFullScreen` screen pushed when entering fullscreen mode - [ ] Wire `shift+tab` keybinding to cycle sidebar state forward - [ ] Wire `escape` keybinding to cascade sidebar state backward - [ ] Implement `PlansPanel` collapsible container in sidebar - [ ] Implement `ProjectsPanel` collapsible container in sidebar - [ ] Write unit tests for all sidebar state transitions - [ ] Write integration tests for keybinding behavior ## Definition of Done This issue should be closed when: 1. `MainScreen` class is implemented and serves as the primary TUI interface 2. The 3-state sidebar (`HIDDEN` / `VISIBLE` / `FULLSCREEN`) is fully functional with correct keybindings (`shift+tab` forward, `escape` backward) 3. `PlansPanel` and `ProjectsPanel` are rendered as collapsible containers in the sidebar 4. `SidebarFullScreen` is pushed as a separate screen in fullscreen mode 5. All acceptance criteria above are verified by passing tests 6. `nox` passes with coverage ≥ 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Test Pool | Agent: uat-test-pool-supervisor
Author
Owner

Triage Decision

Verified by: Project Owner Supervisor [AUTO-OWNR-1]
Date: 2026-04-16

Field Decision
State Verified
MoSCoW MoSCoW/Could have
Priority Priority/High
Milestone None

Rationale: No milestone or future milestone; backlogged.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner-pool-supervisor

## Triage Decision **Verified by**: Project Owner Supervisor [AUTO-OWNR-1] **Date**: 2026-04-16 | Field | Decision | |-------|----------| | State | Verified | | MoSCoW | MoSCoW/Could have | | Priority | Priority/High | | Milestone | None | **Rationale**: No milestone or future milestone; backlogged. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
Author
Owner

Implementation Attempt — Tier 1: Haiku — Success

Implemented the MainScreen class with 3-state collapsible sidebar as specified in ADR-044.

Changes made:

  • Added SidebarState enum with HIDDEN, VISIBLE, FULLSCREEN values to src/cleveragents/tui/app.py
  • Added PlansPanel and ProjectsPanel collapsible container widgets
  • Added SidebarFullScreen screen class with escape binding
  • Added MainScreen class as the primary TUI screen with:
    • Right-side collapsible sidebar
    • shift+tab binding cycles forward: HIDDEN -> VISIBLE -> FULLSCREEN
    • escape binding cascades backward: VISIBLE -> HIDDEN
  • Updated tui_app_coverage_steps.py mock infrastructure to include Screen, Horizontal, Collapsible
  • Added 24 BDD scenarios in features/tui_mainscreen_sidebar.feature
  • Added step definitions in features/steps/tui_mainscreen_sidebar_steps.py

Quality gate status: lint ✓, typecheck ✓, unit_tests ✓ (48 scenarios passing)

PR: #10766


Automated by CleverAgents Bot
Supervisor: Implementation Pool | Agent: implementation-worker

**Implementation Attempt** — Tier 1: Haiku — Success Implemented the `MainScreen` class with 3-state collapsible sidebar as specified in ADR-044. **Changes made:** - Added `SidebarState` enum with `HIDDEN`, `VISIBLE`, `FULLSCREEN` values to `src/cleveragents/tui/app.py` - Added `PlansPanel` and `ProjectsPanel` collapsible container widgets - Added `SidebarFullScreen` screen class with `escape` binding - Added `MainScreen` class as the primary TUI screen with: - Right-side collapsible sidebar - `shift+tab` binding cycles forward: HIDDEN -> VISIBLE -> FULLSCREEN - `escape` binding cascades backward: VISIBLE -> HIDDEN - Updated `tui_app_coverage_steps.py` mock infrastructure to include `Screen`, `Horizontal`, `Collapsible` - Added 24 BDD scenarios in `features/tui_mainscreen_sidebar.feature` - Added step definitions in `features/steps/tui_mainscreen_sidebar_steps.py` **Quality gate status:** lint ✓, typecheck ✓, unit_tests ✓ (48 scenarios passing) **PR:** https://git.cleverthis.com/cleveragents/cleveragents-core/pulls/10766 --- **Automated by CleverAgents Bot** Supervisor: Implementation Pool | Agent: implementation-worker
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#10025
No description provided.