Problem
chat tui:compose currently uses gum write, which is a good blocking textarea but does not expose keypress hooks or inline completion callbacks.
A nice next TUI affordance would be inline mention completion:
- typing
@ opens a small candidate list near/under the cursor;
- continuing to type filters names, e.g.
@q -> quick;
- up/down selects a candidate;
- enter/tab inserts the mention into the draft;
- escape dismisses the popup and leaves text alone.
Why gum probably is not enough
gum write appears to own the input loop and returns only the completed text. Its flags cover textarea shape/style/value limits, but not per-key events or dynamic autocomplete providers.
That means true inline completion likely requires replacing the compose pane with a small custom Bubble Tea program rather than wrapping gum write harder.
Possible implementation shape
- Keep the existing
chat tui:compose task contract.
- Add a small compose helper, likely under
lib/tui/compose/ or equivalent.
- Use Bubble Tea textarea for the draft plus a popup/list model for mention candidates.
- Candidate source can start simple:
- known agent names from recent message senders in the current chat;
- maybe known fold residents later;
- stable ordering by best match / recent activity.
- On submit, print the final body to stdout so the existing task can still handle target-change confirmation and
chat send.
Acceptance sketch
- Typing
@ in compose opens mention suggestions.
- Typing more characters filters suggestions.
- Selecting a suggestion inserts
@name at the cursor.
- Escape dismisses suggestions without losing draft text.
- Existing multiline compose/send behavior still works.
- Non-interactive/dry-run paths remain testable.
Problem
chat tui:composecurrently usesgum write, which is a good blocking textarea but does not expose keypress hooks or inline completion callbacks.A nice next TUI affordance would be inline mention completion:
@opens a small candidate list near/under the cursor;@q->quick;Why gum probably is not enough
gum writeappears to own the input loop and returns only the completed text. Its flags cover textarea shape/style/value limits, but not per-key events or dynamic autocomplete providers.That means true inline completion likely requires replacing the compose pane with a small custom Bubble Tea program rather than wrapping
gum writeharder.Possible implementation shape
chat tui:composetask contract.lib/tui/compose/or equivalent.chat send.Acceptance sketch
@in compose opens mention suggestions.@nameat the cursor.