Skip to content

Decision mode: the thread's question card, drafts, and Send only when pressed - #4016

Merged
backnotprop merged 18 commits into
mainfrom
feat/inbox-decision-mode-modern-cards
Nov 25, 2026
Merged

backnotprop merged 18 commits into
mainfrom
feat/inbox-decision-mode-modern-cards

Conversation

@backnotprop

Copy link
Copy Markdown
Owner

Decision mode keeps its focused dialog over the dimmed Inbox ("Decide", "1 of 5", one question at a time, same way in and out). What changes inside it:

  • The thread's own question card. Each question is drawn by the same card the thread uses (the message body through MessageBody, only that question's card, through a new ui Viewer prop onlyQuestionKey; key and number still come from the whole message). Before/After with the change marked, Where, Shows, Stakes, Why, Holds up, Stopped, Pros/Cons, picture choices, Try prototype, pick-any and text questions, Other, notes and Skip all work. Action items keep decision mode's own card.
  • Answers are drafts. A change saves through the existing picks route as the thread's draft (typed words after the thread's pause); the card shows "Draft", same as in the thread. An action item's Done or Can't do it is staged in the draft, as in the thread's checklist.
  • Nothing sends by itself. The 5-second "Sending in 5 s · Hold" is gone. A Send button is always in the dialog's bottom row and sends what is answered so far, one reply per agent session; unanswered questions stay open. Closing never asks: every answer stays a draft on its card in the thread.
  • Moving. Previous, Next and Later sit in one row with Send. A click on a pick-one choice or Skip still moves to the next card. No new keyboard shortcuts.
  • Pictures, prototypes and files. Pictures (picture-choice zooms included, named by choice) open in the dialog's image viewer. A question's prototypes open in the thread's prototype window, drawn over the dialog. An attached file, or a file the message names, opens beside the thread as from the thread's card; the dialog tucks into its pill and comes back on the same card once the file closes.
  • On by default. Decision mode leaves Experimental: Settings › Capabilities has its switch (config inboxDecisionMode; an older experimental.decisionMode choice is kept; PLANNOTATOR_EXPERIMENTAL=-decision-mode still turns it off). It is declared in the standard capability switch list.

Draft: work remains (see the comments that follow).

…d only when pressed, on by default

- Each question in the focused dialog is drawn by the thread's card (MessageBody, one question only through a new
  Viewer onlyQuestionKey seam): Before/After, Where, Shows, Stakes, Why, Pros/Cons, picture choices, Try prototype,
  multi and text questions, Other, notes and Skip.
- Answers save as the thread's drafts through the picks route (typed words after a pause); action items are staged.
- No auto-send: the 5 s Hold is gone. A Send button is always in the dialog and sends what is answered; closing
  keeps every answer as a draft.
- Pictures open in the dialog's viewer, prototypes in the prototype window over the dialog; an attached file or a
  named file opens beside the thread and the dialog comes back when it closes.
- Decision mode leaves Experimental: on by default, switch in Settings > Capabilities (inboxDecisionMode).
@backnotprop

Copy link
Copy Markdown
Owner Author

Still to do before this is ready:

  • packages/inbox/decisionMode.test.tsx (runs in CI, it starts an Inbox) still checks the old Hold, the close question and the old choice buttons, so it will fail. It needs rewriting to check: nothing sends without a press; Send sends only the answered questions; closing keeps the drafts; with the switch off, "Decide these N" is not shown.
  • The e2e proof spec (tests/e2e/inbox-decision-mode.spec.ts) with whole-window shots at 1440×900 light and dark and 390×844, plus its entry in tests/e2e/shard-times.json. Other e2e specs that open decision mode may need updates too.
  • The docs: the inbox guides still call decision mode experimental and describe the 5-second send. The server API table and the Viewer onlyQuestionKey seam also need to be added.
  • Not run here (they start an Inbox): settingsSections.test.tsx, packages/server/inbox-decisions.test.ts.

…e dialog, docs

- decisionMode.test.tsx rewritten: on by default, nothing sends without a press, Send sends only the
  answered questions, closing keeps every answer as a draft and asks nothing, the switch off hides the way in.
- A picture the store never captured opens in the dialog's own viewer, not the page lightbox behind it
  (MessageBody onOpenUncapturedImage), with a test that fails without it.
- inbox-decision-mode.spec.ts rewritten as the whole-window proof (1440x900 light and dark, 390x844 light),
  asserting nothing is sent before Send, Send carries only answered questions, drafts stay after leaving.
- Other e2e specs moved to the thread card, the always-there Send and the close that asks nothing.
- Docs: decision mode is no longer experimental; new sending; settings and decisions API rows; onlyQuestionKey.
… the staged Done and the first-letter save

- A run of saves that only changed typed words reads nothing again with decision mode on (its cards draw from the
  held thread now, not the decisions), so pickSaveReads' guard holds with the new default.
- decisionMode.test.tsx: the first letter of Other saves at once, the rest once after the pause; an action item's
  Done is staged in the draft and Undo takes it back past the old window.
- The linked computers' capabilities answer may carry decision_mode.
…son sees; drop decision mode leftovers

The DOM test waited for a read of the open thread, which only came while the
server had not resolved the project's repo yet. Decision mode, now on by
default, reads every decision at load and so resolves each project's repo;
the thread read then says repo_known, and a later agent message is taken into
the held thread in place with no read of it (openThreadReads.ts, as designed
and unit-tested). The test now checks that the message shows in the open
thread and the list is read while the save is still out.

Also drop the unused DECISION_ACTION_UNDO_MS, the unused .ib-dm-tiles and
.ib-dm-pics rules, and the keyboard world's old experimental switch (decision
mode is on by default).
The conflict loop (save again over another window's answer, or draw the
Inbox's) and the pagehide/visibilitychange listener move out of Thread.tsx
into pickConflict.ts and pageLeave.ts, so decision mode can run the same
machinery. Thread.tsx shrinks; its ceiling follows.
The dialog saves answers with the thread's machinery (decisions/saves.ts):
typed words after their pause, one save at a time, conflicts saved over
quietly, a refused save kept on the card and owed, Send saving first and
sending nothing when it cannot, a reload refused while anything is
unsaved, a keepalive save as the page goes, and the answers still on
their way put on the thread card when the dialog closes or tucks away.

The Can't do it reason is a draft too (decisions/reasonDrafts.ts, kept in
the thread's comment drafts), restored on the card and on reopening; its
button says Save, since it stages the mark. A failure while the dialog is
closed goes to onAway for the window's toast.
App passes onAway to decision mode: a Send or a save that fails once the
dialog is closed or tucked away shows the window's toast with the
existing line and Open the thread.

The doc comments and declarations joined onto one line in api.ts and
the two props joined in App.tsx go back to normal formatting. To stay
under the ceilings, the tuck handler moves to app/decideTuck.ts and
InboxLaunchSettings to launchSettingsModel.ts; both ceilings are lowered
to the new counts.
…ode-modern-cards

# Conflicts:
#	apps/mobile/contract/parity/ledger.json
#	docs/agent-guides/environment.md
#	docs/agent-guides/inbox-machines.md
#	docs/agent-guides/server-and-storage.md
#	packages/inbox/capabilities.test.ts
#	packages/inbox/capabilities.ts
#	packages/inbox/eventFrames.ts
#	packages/server/inbox.ts
One slow or failed read of the sitting's thread left the card on
"Reading the question…" for good. The read now goes again twice, later
each time (decisions/readRetry.ts), and only then the card says it could
not read the question, with Try again.
A project whose own name holds " · " was named again for every decision on
the end screen and the chips: the chip's projects are now compared whole.
A group whose replies went in part reads "1 of 2 replies sent" instead of
"Not sent".
…ws them

Every record batch in every window read GET /api/inbox/decisions, a scan
of all open decisions. Now a batch reads it only when it touched a thread
whose decisions the window draws (a pane's Decide these N, the sitting's
thread) or named no thread; a thread asked for the first time reads it
once, so its count stays current.
…; quiet reason clear; no reason drafts for a far thread

- A Send waiting on a save that fails after the dialog closed tells the save
  notice once, not the send notice; a Send that finds a reply draft tells it
  once away.
- A reason's failed save has its own toast line.
- Emptying a reason after its mark saved never tells a failure or stops a
  reload; it is tried again quietly.
- One reason's writes go one after another, the newest words last.
- A thread on a linked computer reads and writes no reason draft (comment
  drafts are not forwarded).
- DOM tests for the failed pick save, the save failing after close, and the
  reason draft round trip.
@backnotprop backnotprop added the ci:e2e Run the full browser suite (Inbox window e2e) on this PR label Nov 24, 2026
…by default); a phone leaves the file by Back to the thread
…ox-decision-mode-modern-cards

# Conflicts:
#	apps/mobile/contract/parity/ledger.json
…ox-decision-mode-modern-cards

# Conflicts:
#	tests/inbox-size-ceilings.json
@backnotprop
backnotprop marked this pull request as ready for review November 25, 2026 19:16
@backnotprop
backnotprop merged commit 9d77678 into main Nov 25, 2026
78 of 79 checks passed
backnotprop added a commit that referenced this pull request Nov 27, 2026
Inbox: hold only the watched threads' decisions (memory soak growth doubled by #4016)
yermakoffivan pushed a commit to yermakoffivan/plannotator that referenced this pull request Nov 27, 2026
Decision mode turned on by default (backnotprop#4016), so every window read
GET /api/inbox/decisions, which lists every open decision in the store,
and kept the whole list in state. On the memory soak's store that is
2,610 decisions, 4.25 MB of JSON: the heap at open rose 4.7 MB and the
soak's growth went from 4 to 13 MB, for people who never open decision
mode.

The window draws decisions only for the threads it watches (a pane's
"Decide these N", the sitting's thread). A read now keeps those
threads' decisions and a count for every thread, so a thread just
opened still shows its count at once.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:e2e Run the full browser suite (Inbox window e2e) on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant