Roadmap: #115
Respect the roadmap first and the AGENTS.md file of every repository touched.
Previous roadmap step
[adm 6] (#121) restores selected-node binding authoring. This issue extends the same selection-aware AppBar and canonical placement model with production-quality Insert/Delete and in-canvas drag-and-drop.
Repository impact
Likely:
ankhorage/studio
ankhorage/zora only if metadata/slot capabilities are incomplete
ankhorage/react-native-reanimated-dnd-web only if the DnD implementation boundary lacks required reusable behavior
Do not add Studio-local workarounds for missing owning-package capabilities.
Goal
Restore intuitive component insertion and real placement-backed drag-and-drop directly in the app editing surface.
Requirements
Canonical placement model
Use one placement model for all insert/move behavior.
Support, where valid:
Validate using canonical injected/ZORA metadata such as allowedChildren and slots. Root/invalid placements must remain protected.
Contextual Insert
Use the selected-node AppBar architecture from [adm 1].
Expose contextual actions such as Add child, Add item, Add image or equivalent only when component capabilities justify them. Do not hardcode one universal wording/action for every component.
Do not restore a permanent legacy Toolbox panel.
DnD UX
The old behavior was functionally promising but not production-quality. Improve it materially:
- drag handle/grab target must be comfortably usable, not a tiny hit area;
- dragged content should have a meaningful visible preview approximating its real size/shape;
- prospective drop location should visibly make space so the user can understand the final placement;
- drop zones/states must clearly distinguish before/inside/after;
- invalid placements must communicate rejection rather than silently failing;
- touch and pointer input must both be considered;
- DnD chrome must not corrupt persisted manifest/layout.
Do not implement a second tree or placement algorithm for a future Layers UI. Reusable functions should make such a future surface possible later.
Delete
Restore contextual delete for selected nodes with appropriate protection/confirmation where destructive ambiguity exists. Root/non-deletable nodes must be protected by canonical rules.
Likely files
Studio, non-exhaustive:
src/insertModalModel.ts
src/studioSelectionModel.ts
src/manifestState.ts
src/ui/useStudioAppBarAugmentation.ts
src/ui/AnkhStudio.ts
src/ui/canvas/*
src/dnd/*
docs/studio-canvas-drag-model.md
Historical references include ankhorage4 PR #253/#254 and late placement/tree DnD behavior. Reference only; redesign the UX.
Phases
Phase 1 — placement/insert model hardening
Unify insert/move validation around one canonical placement model and metadata injection.
Phase 2 — contextual Insert/Delete
Add real selected-node AppBar contributions and insertion flow with blueprint/default props.
Phase 3 — production DnD UX
Implement usable handles, previews, displacement/drop feedback and valid placement execution.
Tests
Cover at minimum:
- before/inside/after placement calculations;
allowedChildren/slot validation;
- invalid/root moves;
- same-parent and cross-parent moves;
- insertion blueprint/default props;
- contextual action availability;
- delete protections;
- deterministic manifest mutation after move/insert/delete;
- drag-state helpers and drop-target resolution through unit-testable models.
Do not introduce a new cross-repo E2E strategy; create [Proposal] ... separately if needed.
Acceptance criteria
- Insert and move use one canonical placement model.
- Valid before/inside/after placements work.
- ZORA metadata/slots govern valid children.
- Contextual Insert/Add actions appear only when meaningful.
- No permanent Toolbox panel is restored.
- Drag handles are comfortably usable.
- Drag preview and prospective drop placement are visually understandable.
- Invalid placements are clearly rejected.
- Delete is contextual and safely validated.
- Root/non-deletable rules are protected.
- No separate Layers panel/tree implementation is added.
- Behavior-focused tests and full validation pass.
- No legacy/compatibility/
ankhorage4 dependency is introduced.
Roadmap: #115
Respect the roadmap first and the
AGENTS.mdfile of every repository touched.Previous roadmap step
[adm 6](#121) restores selected-node binding authoring. This issue extends the same selection-aware AppBar and canonical placement model with production-quality Insert/Delete and in-canvas drag-and-drop.Repository impact
Likely:
ankhorage/studioankhorage/zoraonly if metadata/slot capabilities are incompleteankhorage/react-native-reanimated-dnd-webonly if the DnD implementation boundary lacks required reusable behaviorDo not add Studio-local workarounds for missing owning-package capabilities.
Goal
Restore intuitive component insertion and real placement-backed drag-and-drop directly in the app editing surface.
Requirements
Canonical placement model
Use one placement model for all insert/move behavior.
Support, where valid:
Validate using canonical injected/ZORA metadata such as
allowedChildrenand slots. Root/invalid placements must remain protected.Contextual Insert
Use the selected-node AppBar architecture from
[adm 1].Expose contextual actions such as
Add child,Add item,Add imageor equivalent only when component capabilities justify them. Do not hardcode one universal wording/action for every component.Do not restore a permanent legacy Toolbox panel.
DnD UX
The old behavior was functionally promising but not production-quality. Improve it materially:
Do not implement a second tree or placement algorithm for a future Layers UI. Reusable functions should make such a future surface possible later.
Delete
Restore contextual delete for selected nodes with appropriate protection/confirmation where destructive ambiguity exists. Root/non-deletable nodes must be protected by canonical rules.
Likely files
Studio, non-exhaustive:
Historical references include
ankhorage4PR #253/#254 and late placement/tree DnD behavior. Reference only; redesign the UX.Phases
Phase 1 — placement/insert model hardening
Unify insert/move validation around one canonical placement model and metadata injection.
Phase 2 — contextual Insert/Delete
Add real selected-node AppBar contributions and insertion flow with blueprint/default props.
Phase 3 — production DnD UX
Implement usable handles, previews, displacement/drop feedback and valid placement execution.
Tests
Cover at minimum:
allowedChildren/slot validation;Do not introduce a new cross-repo E2E strategy; create
[Proposal] ...separately if needed.Acceptance criteria
ankhorage4dependency is introduced.