feat(inbox): send an ask's filled fields with the reply, no Submit
What was asked
The developer: "if I fill something in partially it should still send", then, refining it: "I don't want to press submit - anything I fill out in an ask should automatically be sent."
What changed
No Submit on a form answer ask (thread, version 5). Fields attach to the reply as soon as one is filled, the way a decide's pick already attaches without a press. Sending the reply (its button or Enter) sends them. attachedAnswers in inbox-model.ts returns the submitted answer once the developer has filled any field; the Submit AskPress is gone from inbox-pane.tsx.
- A reply with no field filled is still a plain reply and leaves the ask open, so the developer can still write back without answering. A switch left alone does not count as filled, though it is sent as "no" once something else is.
- The attached-answer stamp, and the reply button that takes its name, read "Send N fields" instead of "Submit". Its × takes the answer off by emptying the filled fields, since there is no longer a press to undo (
withoutAnswer). - The no-fields
answerask keeps its Answer press (agreed with the orchestrator). Without it, any words on the thread would settle the ask, and a plain reply would no longer be possible.
A form filled in part sends. Required fields left empty no longer block a send:
- Wire (
inbox-wire.ts'sformRefusal, used by bothinboxReplyRefusalandinboxAnswersRefusal): asubmittedanswer with required fields empty is accepted as long as something is given, either a filled value or the developer's words or files beside it. A field left empty is simply absent from the values, which is already how an empty optional field reads to the agent. - The service (
inbox-procedures.tsandinbox-store.ts) checks answers through these same functions, so it now accepts and records a partial answer. - Pre-v5 single-card items: the box's Send and Enter send whatever is filled. Only when nothing at all is filled does Enter still move the keyboard to the first required field with "Fill in ", because there is nothing to send.
Still sends nothing: a form with nothing filled and no words, a decide with no pick, an approval with no decision. The do path is untouched.
The "Optional" marker stays as a hint of what the agent wanted. The agent-facing description of required ("required where it must be filled") says what the agent wants, not what the answer must carry, so it is left alone and the prompt-cache bytes don't change.
Tests
inbox-asks.test.ts: a partial form, words alone, or a file alone is taken by both refusal functions; a form given nothing is refused.inbox-threads.test.ts: the service takes and records a partial answer, with the missing required field absent, and refuses one with nothing filled.inbox-model.test.ts: partial v4 replies; thread fields attach with no press and words alone stay a plain reply; the stamp reads "Send 1 field"; × empties the fields. The missing-line test is updated to the new rule.desktop-inbox.test.ts: a new DOM test checks that a thread's form has no Submit and sends a partial answer from the reply. The v4 Enter test now sends a form with only one of its two required fields filled.
pnpm check:affected passed except two problems in the sandbox, not in this change: Electron's binary wasn't installed, and the @luke/luke typecheck ran out of memory. Both passed when rerun by hand.
Made with Luke