feat(panel,ui): draw a settled inbox ask filled in as it was answered

Merged
DA
5d ago
+1069-219

What this does

The developer asked: "I want to improve UI so that I can see what I filled in for asks in the same style as how they originally were."

Until now, an answered Inbox ask folded to one line saying who answered and how. A form's values were listed separately on the reply, and an older item's options were folded behind "2 options · you picked …".

Now the answering member's comment leads with the ask's own card, under their face, name ("You") and time: the ask's live controls, read-only and filled in with the answer. The card replaces the reply's stamp chip, since it now marks which message was the answer. Its head gives the ask's kind and how it was answered ("Pick one · ✓ Chose 7 days"). The agent's message ends with its words and no card. (This placement follows the developer's review: "the 'you' should be above the answer".)

  • decide: the same option list, with the pick(s) checked and the rest unchecked. The key numbers are dropped, and the Recommended badge turns neutral.
  • yes-or-no (two small buttons): the same two buttons, with the one pressed marked in its tone: a green check going ahead, a red turn-back holding back.
  • do: the same checklist, ticked as sent, over Mark done and Couldn't do it with the one pressed marked. A version-4 to-do with no steps ticks its title's step where it was marked done.
  • answer form: the same fields, each holding what it was given and empty where it was left empty. Text fields draw their words as a sent message does, so mentions show as chips. There's no Submit button.
  • answer with words only: the card's head alone ("Your answer · ✓ Answered") over the reply's words.

Edges:

  • Replaced and withdrawn asks look as they did before.
  • An ask whose answering reply the thread read no longer carries stays in the agent's message, saying "Answered".
  • An answer whose ask the thread no longer carries keeps its stamp and lists its values. The same list is the fallback for a response type this build doesn't know.
  • Answered controls are left out of the number keys' and Enter's search for an open ask's options and fields, so a settled ask above the open one never takes the keyboard.

Older single-item layout (items from before wire v5): an answered choice, approval, to-do, or form now leads the developer's answer comment with the question's controls filled in, under their name. This replaces the "N options · you picked …" fold at the end of the question. These items never had a card, so the controls stand bare, as they did while open. A withdrawn or closed item, or one whose read lacks its answer, keeps the fold.

Not faded, not "sending"

Disabled controls fade to about 40%, which reads as a pending send. So @luke/ui gains a read-only state that keeps the live look at full strength and takes no press:

  • ChoiceList readOnly: rows disabled at full opacity, aria-readonly on the radio group, neutral badge.
  • Checkbox readOnly: aria-readonly, hands on no change, not disabled.
  • Button readOnly and pressed (aria-pressed, which the outline and quiet looks already draw as selected): disabled at full opacity.

Screenshots (light, desktop profile)

These are the real panel, rendered from the inbox test harness's fixtures with the bundled panel stylesheet.

AskBeforeAfter
v5 decide
v5 yes-or-no
v5 do (couldn't, 1 of 3 ticked)
v5 form (partly filled)
v5 answer, words
v4 choice
v4 approval
v4 form

Tests

  • desktop-inbox.test.ts:
    • New v5 tests: answered decide (the card under the reply's name and gone from the agent's message, with a number key still picking the open ask below it), yes-or-no, do (and a do with no steps), a partly filled form, and the edges (words only, reply not carried, ask not carried, response type unknown). answeredWords, the settled line's wording, lost its last caller, so it and its one assertion are removed.
    • The older layout's settled-choice, approval/to-do, teammate, and form tests are rewritten for the filled-in look, which replaces the fold and chip they checked.
  • @luke/ui tests for each new read-only state.
  • pnpm check:affected: lint and tests are green except app-menu.test.ts, which needs the Electron binary that a Linux bootstrap skips. The panel typecheck was OOM-killed inside the run, so I reran it alone for @luke/panel and @luke/ui, and both pass.

Out of scope, left to the sibling PRs: the partial-send change, do's Done enablement, clearing the reply box on send.

Made with Luke