Skip to content

fix(tui3): Enter key submits standing prompt card (#1506) - #1531

Open
santoshkumarradha wants to merge 3 commits into
devfrom
fix/1506-enter-card
Open

santoshkumarradha wants to merge 3 commits into
devfrom
fix/1506-enter-card

Conversation

@santoshkumarradha

Copy link
Copy Markdown
Member

Summary

Fixes #1506: Enter key does not submit the standing prompt card when the pointer is positioned on an option and the box has no typed text.

Root Cause

The standing card uses Input.Kind = InputText for its typed correction lane. Two gates in the TUI input handling read that as the entire question:

  1. In internal/tui3/question.go, questionEnter gave up early on InputText and returned (nil, false) even when the cursor stood on an answer.
  2. In internal/tui3/questionkeys.go, questionOffers(needPick) offered enter take it for InputText only when the asker recommended something (Pick != nil).

Fix

  • Both early give-ups now yield to a pointer positioned on an option when the question has an answer pick (AskChoice/AskJudgement).
  • Enter over an empty box takes the currently selected option. Typing still routes words directly into the box.

Verification

  • Added internal/tui3/standingenter_test.go with 5 tests:
    • Enter takes the pointer's option
    • Arrow keys move pointer and Enter follows
    • Typed correction travels as words
    • Connect-offer control retains its key law
    • Table offers walk+enter where a pick exists
  • Full internal/tui3 package run: passes with zero regressions (only pre-existing credit warnings from clean dev).
  • Two-pass review (defects & contracts + architecture & craft) completed.

—
Drafted with CodeAF · reviewed and owned by the author

#1506)

The standing card's box is its correction lane, and the InputText give-up
read that as the whole question: enter over an empty box did nothing even
with the pointer standing on an answer, and the key table's own reading
offered enter only where the asker recommended something. Both give-ups
now yield to a pointer that stands on an option on a question that has a
pick to take — a choice or a judgement — while a connect key offer keeps
its own law: one answer, the way out, taken by a digit, and enter means
the words. The walk was already there; enter just never followed it.
@santoshkumarradha santoshkumarradha added this to the Chat & connections milestone Sep 26, 2026
@santoshkumarradha santoshkumarradha added bug Something the code does that it should not area:chat The v3 surface a person sits in front of (internal/tui3) sev:papercut A wording, a hint, a small wrongness that costs a moment labels Sep 26, 2026
agentfield-bot and others added 2 commits September 25, 2026 22:19
Assisted-by: CodeAF (gemini-3.8-flash-high)
Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:chat The v3 surface a person sits in front of (internal/tui3) bug Something the code does that it should not sev:papercut A wording, a hint, a small wrongness that costs a moment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Enter key does not submit standing prompt — only mouse click works

3 participants