Skip to content

SmartArt: Text Pane, add and remove shapes, promote and demote - #596

Merged
h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
NikitkaRa:smartart-editing
Oct 14, 2026
Merged

h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
NikitkaRa:smartart-editing

Conversation

@NikitkaRa

Copy link
Copy Markdown
Contributor

First slice of SmartArt editing (after-beta pool in docs/gaps.md). Based on main; it doesn't depend on any open PR. #242 and #209 touch PowerPoint-read SmartArt, which this doesn't change.

Summary

  • Model: Shape.diagram: Option<Diagram>, holding the layout kind and its nodes ({text, level}). It is skipped when None, so existing files are unchanged, and it is saved in .deckcraft.
  • Engine: new crates/engine/src/cmd/smartart.rs.
    • Every edit regenerates the group's children inside its child rectangle, so the diagram keeps its place and size. Text typed straight into a diagram shape is read back into the nodes first.
    • New commands, each targeting the SmartArt group or any shape inside it:
      • smartArt.nodes (query)
      • smartArt.setNodes: the whole outline, tab-indented lines, or one node's text
      • smartArt.addNode: after, before, above or below, as in PowerPoint
      • smartArt.removeNode: sub-points move up a level
      • smartArt.promote and smartArt.demote: they move the node's whole subtree
      • smartArt.layout
  • Layouts: sub-points become bullets inside their parent's shape in list, process, cycle, pyramid and matrix. Hierarchy is now a real tree: each subtree is as wide as its leaves, with connector lines.
  • insert.smartArt: accepts tab-indented items or nodes, and returns {id}.
  • UI:
    • A SmartArt Design contextual tab with Text Pane, Add Shape (After/Before/Above/Below), Promote, Demote and Layout.
    • A Text Pane task pane: Enter adds a line, Tab and Shift+Tab demote and promote, Backspace on an empty line removes it, and a line's edit is committed when it loses focus.
    • Inserting a SmartArt graphic opens the Text Pane.
  • Docs: gaps.md (SmartArt entry rewritten), parity checklist (Text pane and layout switching M → P, recomputed), file-format and target-app parity.
  • Not in this slice: PowerPoint-authored diagrams are still read as plain groups (no outline, so no Text Pane). The outline isn't written to .pptx dgm parts; the diagram saves as shapes, as before. There are six layouts.

Test plan

  • Unit tests for the outline operations and the layout mapping (cmd::smartart::tests)
  • Engine test: insert, type into a shape, add, demote, promote, remove, switch layout from a child, box unchanged, undo, .deckcraft round trip
  • UI kittest: type in a Text Pane line, Enter adds a line, Tab demotes it
  • Rendered hierarchy and list diagrams via deckcraft-cli render and checked them by eye
  • cargo xtask ci (all 6 steps pass)

A SmartArt group now keeps its outline (Shape.diagram: layout + nodes with
levels) and its shapes are regenerated from it inside the group's child
rectangle. New commands: smartArt.nodes, setNodes, addNode (after, before,
above, below), removeNode, promote, demote and layout. Sub-points become
bullets in their parent's shape; the hierarchy layout is a real tree with
connector lines. Text typed into a diagram shape is read back first.

UI: a SmartArt Design contextual tab and a Text Pane (Enter adds a line,
Tab/Shift+Tab demote/promote, Backspace on an empty line removes it).

Co-authored-by: Cursor <cursoragent@cursor.com>
@echelon

echelon commented Oct 14, 2026

Copy link
Copy Markdown
Member

Thank you for this contribution, @NikitkaRa! 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

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