Insert dialog: list allowed elements first, reveal refused ones on demand #333
Labels
No labels
bug
enhancement
needs-triage
ready-for-agent
ready-for-human
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/deckle#333
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The insert dialog (
web/src/components/ElementPicker.tsx, issue #171) lists every insertable element and disables the ones the target refuses. The rationale was sound: an editor should see what exists and why it cannot go here instead of a list that silently shrinks. The cost is paid on every insert, and in the common cases it dominates:Design (settled)
insertRefusalalready produces) instead of a tooltip and an uppercase marker.elements: [], a slot that admits nothing): a note explains it and the catalogue is revealed so each tile shows its reason. The existing slot note stays and takes precedence when the slot is what refuses.Rules and owners
insertRefusal/pickerEntriesinweb/src/elementcrud.ts. No new derivation; the dialog only partitions the entries it already gets.Styleguide
.btn.btn--xs.btn--ghostfor the toggle. No new token, no new shared component, no new status;styleguide.htmlis unchanged. The picker's own classes (.epick__*,.etile*) are product-only.disabledand its opacity rule (the one place opacity is allowed); the reason text replaces the uppercase marker.Docs and skills
scaffold/site/AGENTS.mddescribes the picker only as "limited to what the container's placement allows" (Children section) and theinsertable/hiddenkeys; both stay true. No skill walks through the dialog's rendering. No doc change.en.jsonandde.json;insert.notAllowedHeregoes away.Tests
web/src/test/ElementPicker.test.tsx: default hides refused, toggle reveals after the allowed ones with the reason, search reveals a refused match, empty allowlist reveals with the note, Enter still picks the first enabled tile, toggle resets per open.ElementCrud.test.tsxandLayoutGrid.test.tsxassert on the tooltip and marker today; they move to the tile text.