Skip to content

ADR-408: A question on the chat's bar is answered by a click as by a key, and one rule closes every overlay

Summary

  • Decided: a pane's question that waits for y is the shell's own confirm. The bottom bar shows the question and its two answers as lozenges, and a click on an answer gives that answer, as its key does. Every overlay over a pane closes on Esc or on a click outside it, and closing says nothing. A click that closes an overlay and lands on the tab bar or on the chat's left column then does what it would have done with nothing open.
  • Trades away: n no longer types into the draft while a question waits; it answers. A click in the feed while a question waits answers no rather than leaving the question armed.
  • One-way? No. This is input handling and drawing in agent-tui and attend-chat; nothing on disk changes.
  • Probes: Confident: a question drawn with its answers should take a click on them. Not confident: a click on the tab bar or the column that closes a menu should also act there, rather than only close it. The agent chose this default; it is how desktop menus behave.
  • Inversion: one end is overlays that swallow every click outside them, so each one needs its own dismissal before anything else works; the other is overlays that never block, so a stray click acts behind them. This sits between them: a click outside always closes, and acts only on the two navigation surfaces.

Context

ADR-405 made every menu item that drops something ask for y first. The chat drew that question as text on the bottom bar and answered it only from the keyboard. A click on the bar dropped the question, and a click in the feed left it armed out of sight. The shell already drew its own confirms with clickable answers. Two implementations of one behaviour had drifted apart, and only one of them answered the mouse.

Closing an overlay also varied. A pane's menu closed on Esc saying "unchanged", a word from the settings tree, where a picker edits a value. A click outside a menu closed it, and a second click was needed to reach the tab or row the operator had aimed at. The compose box lent to a new channel's name stayed lent after a click elsewhere.

Decision

(a) One question. A pane asks through Open::Ask(Question), a Question holding its id, the question, what yes and no do (yes may be absent, for a question only no dismisses), whether yes waits (pending), and an optional Expiry (ADR-504, note of 2026-10-14). The shell owns the question while it waits: the bottom bar draws the question, cut short where it must be so the answers fit, and y <yes> and n <no> at the bar's right end as lozenges recorded as click targets. The answer reaches the pane through Pane::picked under id.

  • y, or a click on the yes lozenge, answers yes.
  • n, Esc, a click on the no lozenge, a click of any button anywhere else, or any other key answers no.
  • After a no, a character the pane types and a key the shell takes (F1, F2, Ctrl+digit, Alt+m) go on as if nothing were asked. Enter and the editing keys only answer, so an Enter meant for the question never sends a draft.
  • A paste over the question answers no, then lands in the compose box.
  • The chat's own question state and its key handling for y are removed. Its Quit question, asked where Ctrl+3 arrives as Esc, is the same Open::Ask, and its yes asks the shell to quit through Open::Quit. A quit from a click ends the session through App::ended, since a click has no return value to end it with.

(b) One closing rule. Over a pane, the menu, the picker, the question, the key help, the response modal and the compose box lent to a name or description each close on Esc or on a click outside them. Closing says nothing on the bar. The settings tree's own picker still says "unchanged", since there it reports that a value was left as it was.

(c) Clicks that go on. A left or right click that closes an overlay goes on to act when it lands on the tab bar, or on a part of the pane the pane names through Pane::click_through. The chat names its left column. Elsewhere such a click only closes. A click on the tab bar or the bottom bar also gives a lent compose box back (Pane::clicked_outside).

ADR-405's rule that a destructive item asks first stands. ADR-407 (e), the question guard, now holds by construction: the question lives in the shell, so a click on a column row answers it no before the row acts, and no later y can answer a question out of sight.

Consequences

Positive

  • Every destructive menu item can be finished with the mouse.
  • A key and a click on an answer run the same code and land in the same state.
  • Reaching another channel or tab with a menu open takes one click.

Negative

  • A click intended only to dismiss a menu that lands on a tab or a column row also acts there.
  • n typed while a question waits is not kept in the draft.

Neutral

  • agent-tui gains Open::Ask, Open::Quit, Pane::click_through, Pane::clicked_outside and App::ended. The other panes, ways introspect and ways projects, keep their defaults: nothing passes clicks through.
  • Esc with nothing open is unchanged here. Whether it quits is a separate decision.

Alternatives Considered

  • Make the chat's bar text clickable in place. It would keep two implementations of one confirm, which the operator asked to avoid.
  • Swallow every click outside an overlay. Each overlay would cost a click before the next action, which is what the operator reported as unexpected.
  • Pass every outside click through, including the feed. A click to dismiss a menu would select a message behind it.

Correction (2026-10-11): what other panes get, and the review's refinements

Review of the change corrected the Neutral bullet and refined (a) and (c). The decision text above stands as accepted.

  • Other panes are not untouched. ways introspect and ways projects pass no part of their own area through, but the rule in (b) and (c) is the shell's. On them too, a click on the tab bar that closes an overlay then acts on the tab, and a right click outside an overlay closes it as a left click does.
  • Only a left click gives an answer. A middle or right click on an answer lozenge answers no, as a press of any button elsewhere does.
  • A click on a menu's own anchor only closes it. The row or tab a menu docks under does not act on the click that closes the menu, which would open the same menu again.
  • Left and right clicks dismiss alike. A right click in the pane outside a lent compose box gives it back, as a left click does. The hook is Pane::dismiss(at), which replaces the Pane::clicked_outside named in (c).
  • Ctrl-C over a question answers it no before the exit guard asks, so the pane says "kept" and holds nothing for an answer that will not come.