Skip to content

Commands: an invalid shape id is an error instead of the selection - #97

Merged
h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
mikl0s:fix/invalid-shape-id-error
Oct 14, 2026
Merged

h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
mikl0s:fix/invalid-shape-id-error

Conversation

@mikl0s

@mikl0s mikl0s commented Oct 10, 2026

Copy link
Copy Markdown

A shape id that was present but not a valid id (negative, not an integer, larger than u32) was treated as absent. Commands that fall back to the selection when id is missing, such as text.set and text.edit, then silently edited the selected shape instead.

Before: text.set {"id": -1, "text": "x"} returns success and rewrites whichever shape is selected.

Fix: id_param now tells three cases apart: absent (the selection fallback is unchanged), valid, and invalid (an error that names the command). The arrange, edit (edit.select), inspect, review, table and text commands, the commands defined in cmd/mod.rs, and the animation painter pick this up, including the id_param call in painter_pick.

Tests: new MCP tests set_text_unknown_id_is_error and invalid_id_never_falls_back_to_selection.

  • Without the fix: cargo test -p deckcraft-mcp --lib runs 6 tests, 4 pass and 2 fail.
  • With the fix: 6 passed, 0 failed; deckcraft-engine 42 passed.
  • cargo xtask ci passes on the patched tree.

Made with Opus 5.5 high.

A shape id that was present but not a valid id (negative, not an integer,
larger than u32) was treated as absent, so commands such as text.set and
text.edit silently edited the selected shape instead. id_param now tells three
cases apart: absent (the selection fallback is unchanged), valid, and invalid
(an error naming the command). arrange, edit (select), inspect, review, table,
text and the animation painter pick this up.
@h-a-n-a-s-h-i
h-a-n-a-s-h-i merged commit c57d25e into storytold:main Oct 14, 2026
h-a-n-a-s-h-i pushed a commit that referenced this pull request Oct 14, 2026
…ter main's selection.select)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@echelon

echelon commented Oct 14, 2026

Copy link
Copy Markdown
Member

Thank you for this contribution, @mikl0s! It has landed on main and will ship in the next DeckCraft release.

If you haven't already, please come join us on Discord: https://discord.gg/artcraft

h-a-n-a-s-h-i pushed a commit that referenced this pull request Oct 14, 2026
…d param (#544 after #97); its test no longer writes to /tmp

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anishguduru pushed a commit to anishguduru/deckcraft that referenced this pull request Oct 16, 2026
…t ship (storytold#97)

Its Status line said 38 tools and listed form authoring, redaction tools and MCP page-image resources as planned; 123 tools and all three ship. It now names the areas the tools cover and points to printcraft-cli tools for the current list instead of a count that goes stale, and the MCP section lists the resources/* methods and resource templates. ROADMAP's M13 row said 91 tools.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anishguduru pushed a commit to anishguduru/deckcraft that referenced this pull request Oct 16, 2026
Docs: automation README, internal craftrules links, docs/releasing.md (storytold#97, storytold#98, storytold#100)
rlaks5757 added a commit to DTS-Development/deckcraft that referenced this pull request Nov 13, 2026
fix(host-lock): 찾기 단축키가 브라우저 찾기 창을 함께 열지 않게 한다 (dts-craft storytold#97)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants