UAT: TUI Reference Picker () only activates on prompt submission — should open overlay while typing #6827

Open
opened 2026-04-10 02:22:22 +00:00 by HAL9000 · 0 comments
Owner

Bug Report

Feature Area: TUI — Reference Picker (@ prefix)
Spec Reference: §TUI — Reference Picker (@), §TUI — Prompt Input Modes

Summary

The spec requires the Reference Picker overlay to open while typing when @ is entered in the prompt, providing real-time fuzzy search as the user types. The current implementation only calls set_suggestions() after prompt submission (in on_input_submitted), so the overlay never shows during input — it appears only after the message is sent.

Spec Requirements

From §TUI — Reference Picker (@):

Typing @ anywhere in a normal-mode prompt activates the Reference Picker — a fuzzy-search overlay for projects, plans, and resources

The spec's input mode table:

First Character Mode Overlay
@ (inline) Normal + Reference ReferencePickerOverlay

The Reference Picker is an interactive overlay that should:

  1. Appear when the user types @ anywhere in the prompt
  2. Update results in real-time as the user continues typing (fuzzy search)
  3. Allow selection via enter, cancellation via escape
  4. Automatically dismiss when the reference is selected and inserted into the prompt

What Was Found

File: src/cleveragents/tui/app.pyon_input_submitted() method (lines ~170–209)

def on_input_submitted(self, event: InputSubmittedEvent) -> None:
    ...
    if "@" in text:
        ref_picker = self.query_one("#reference-picker", ReferencePickerOverlay)
        ref_picker.set_suggestions(
            text, suggestions(text.replace("@", "").strip())
        )
    conversation.update(preview)

The reference picker is only activated in on_input_submitted, which fires after the user presses Enter to submit the message. This means:

  1. The overlay never opens while typing — it only shows after submission
  2. The user cannot fuzzy-search and select a reference before sending the message
  3. The @ reference is never expanded inline in the prompt as the user types — it's only parsed post-submission

The correct implementation should respond to prompt on_change (or equivalent Textual Input.Changed) events, detecting @ typed anywhere in the text and opening the overlay with live search results.

Expected Behavior

  1. User types @hand in the prompt
  2. Reference Picker overlay appears immediately, showing fuzzy matches
  3. User uses up/down to navigate and enter to select
  4. Selected reference (e.g. @project:api-service:src/auth/handler.py) is inserted into the prompt
  5. Prompt continues, overlay dismissed

Impact

The spec's primary input UX for referencing projects, plans, and resources is broken. Users have no way to interactively search and select references before submitting a message.


Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: uat-tester

## Bug Report **Feature Area**: TUI — Reference Picker (`@` prefix) **Spec Reference**: §TUI — Reference Picker (@), §TUI — Prompt Input Modes ### Summary The spec requires the Reference Picker overlay to open **while typing** when `@` is entered in the prompt, providing real-time fuzzy search as the user types. The current implementation only calls `set_suggestions()` **after prompt submission** (in `on_input_submitted`), so the overlay never shows during input — it appears only after the message is sent. ### Spec Requirements From §TUI — Reference Picker (@): > Typing `@` anywhere in a normal-mode prompt activates the Reference Picker — a fuzzy-search overlay for projects, plans, and resources The spec's input mode table: | First Character | Mode | Overlay | |-----------------|------|---------| | `@` *(inline)* | Normal + Reference | `ReferencePickerOverlay` | The Reference Picker is an interactive overlay that should: 1. Appear when the user types `@` anywhere in the prompt 2. Update results in real-time as the user continues typing (fuzzy search) 3. Allow selection via `enter`, cancellation via `escape` 4. Automatically dismiss when the reference is selected and inserted into the prompt ### What Was Found **File**: `src/cleveragents/tui/app.py` — `on_input_submitted()` method (lines ~170–209) ```python def on_input_submitted(self, event: InputSubmittedEvent) -> None: ... if "@" in text: ref_picker = self.query_one("#reference-picker", ReferencePickerOverlay) ref_picker.set_suggestions( text, suggestions(text.replace("@", "").strip()) ) conversation.update(preview) ``` The reference picker is only activated in `on_input_submitted`, which fires **after the user presses Enter to submit the message**. This means: 1. The overlay **never opens while typing** — it only shows after submission 2. The user cannot fuzzy-search and select a reference **before** sending the message 3. The `@` reference is never expanded inline in the prompt as the user types — it's only parsed post-submission The correct implementation should respond to prompt `on_change` (or equivalent Textual `Input.Changed`) events, detecting `@` typed anywhere in the text and opening the overlay with live search results. ### Expected Behavior 1. User types `@hand` in the prompt 2. Reference Picker overlay appears immediately, showing fuzzy matches 3. User uses `up`/`down` to navigate and `enter` to select 4. Selected reference (e.g. `@project:api-service:src/auth/handler.py`) is inserted into the prompt 5. Prompt continues, overlay dismissed ### Impact The spec's primary input UX for referencing projects, plans, and resources is broken. Users have no way to interactively search and select references before submitting a message. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.6.0 milestone 2026-04-10 02:22:22 +00:00
HAL9000 self-assigned this 2026-04-10 06:07:50 +00:00
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.

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