githubnext/chopinPublic

Let's compose rich plans together

Keep the first input in an empty custom answer

Replacing a custom answer always deleted the current text first. On an
empty answer json-joy 17 binary-encodes that zero-length delete so the
server decodes garbage that swallows the following insert, yet still
acknowledges the edit. A paste, fill or one-character answer into the
empty box was lost, and a verbatim host question then saved "".

Delete only existing text, and skip the insert for an empty value, which
json-joy refuses: clearing a typed answer threw after its delete.

Assistant-model: Claude Opus 5.5
Assistant-workflow: goal (run 98acf681-3730-4957-b885-0d70e0e6b32a)
Assistant-verification: fail-before/pass-after passed: with the unfixed change() the 5 new controller tests failed (the server-applied draft kept custom "" after one input for verbatim and ordinary questions and a host-only paste, and clearing threw EMPTY_STRING); 12 of 12 passed after
Assistant-verification: bun test passed: 1732 pass, 2 PostgreSQL skips, 0 fail, 7402 assertions across 196 files
Assistant-verification: bun test packages/question passed: 35 pass, 0 fail
Assistant-verification: bun run types passed: all workspaces and E2E
Assistant-verification: bun run fix passed: no change to tracked files; one existing lint warning
Assistant-verification: bun run ci failed: dprint flagged only three untracked .atomic/todos files; dprint check excluding .atomic, oxlint, token, type-scale and design checks then passed
User-preference: "Atomic's SDK is the runtime and the host supplies human input; Chopin implements HostInput rather than intercepting tools"
User-preference: "In local mode the Planner may run as a full Atomic session so workflows run inside Chopin with questions in Decisions"
Co-authored-by: Alex Lavaee <lavaman131@github.com>
ALAlex Lavaee authored
13271afPatch
Parent7f467bc
2 files changed+100-3
StackedSplit
packages/question/src/react/use-questionnaire.test.ts+95 −1
packages/question/src/react/use-questionnaire.ts+5 −2