Repository navigation
4.6.0: comments keep their place; renderComposer returns { setValue } - #12
Conversation
A *** fragment after an empty segment (^^***) is now a standalone note step on its own line instead of the previous step's label, and buildWCBValue writes a note step that follows another step as ^^***text (a note first in the value stays ***text). A comment parsed from a single ^ after a delay, a labelled step or another note carries inline: true and is written back with one ^, so those values rebuild byte for byte too. A comment directly after a command or raw step (^***) is still that step's label. The WCB skips empty segments and comments alike, so the firmware runs the same commands. DroidNet's stored-command field writes these spellings; a builder action now changes only the step it touches. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TpbbHNL9m8Gw9PAjSjiW3C
setValue hands the composer a host's new value: it does nothing when the value equals the compiled steps; otherwise it re-parses them, cancels a step being edited in the add bar, and re-renders the step list, length and safety note, keeping a half-filled add bar. It never calls onChange. Callers that ignore the return value are unaffected. The composer test runs under jsdom (jest-environment-jsdom 29, a dev dependency; Jest 28+ ships it separately). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TpbbHNL9m8Gw9PAjSjiW3C
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TpbbHNL9m8Gw9PAjSjiW3C
A board-read value such as 4T3^^4T92 rebuilds as 4T3^4T92, so it never equals compiled() and every setValue call re-renders the list, shows the rebuilt length and cancels a step being edited, without calling onChange. DroidNet's stored-command field relies on that, so lock it down. The first test fails if setValue short-circuits on a value that parses to the same steps. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TpbbHNL9m8Gw9PAjSjiW3C
The composer reset its edit state in five places. Three wrote all four fields, and the two in moveStep and the remove handler left editLabel and editWasAuto stale (harmless only because loadStepIntoAddBar resets both). cancelEdit() now does the whole reset for Cancel, Update, removing the edited step, reordering and setValue. test/ui-edit-cancel.test.js covers the four exits besides setValue (Cancel, Update, remove, reorder), which had no coverage: each returns to Add mode with no step highlighted, and the next Insert appends. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TpbbHNL9m8Gw9PAjSjiW3C
Review summary (advisory)Checks
Scope: No board files under Versioning: Engine (
UI (
Other: No blocking issues found. Looks good to merge from a correctness and safety standpoint. |
DroidNet's WCB stored-command value field is becoming a native textarea that stays in step with the row's builder in both directions. That needs two library changes.
Engine
parseWCBValueturns a***fragment after an empty segment (^^***) into a standalone note step instead of the previous step's label;buildWCBValuewrites a note step that follows another step as^^***text(a note first in the value stays***text).^after a delay, a labelled step or another note is markedinline: trueand written back with one^, soA^***c^***d,;t500^***waitand***a^***bstill rebuild byte for byte.^***) is still that step's label. The WCB skips empty segments and comments alike, so the firmware runs the same commands.^^***instead of^***(which read back as the step's label).UI
renderComposerreturns{ setValue(value) }: a no-op when the value equals the compiled steps; otherwise it re-parses, cancels a step being edited in the add bar, and re-renders the step list, length and safety note, keeping a half-filled add bar. It never callsonChange. Callers that ignore the return value are unaffected.Tests
test/comment-steps.test.js: standalone comment parse and build, and the round-trip list (inline comment, comment on its own line, comment first, two comment lines, comment after a delay, a builder note after a command).test/ui-set-value.test.js(jsdom): the handle's no-op, re-render, Add bar kept, edit cancelled, noonChange. Addsjest-environment-jsdom@^29.7.0as a dev dependency.npm run validateclean;npm testgreen.🤖 Generated with Claude Code
https://claude.ai/code/session_01TpbbHNL9m8Gw9PAjSjiW3C