feat(web): insert dialog lists allowed elements first, refused ones on demand #334

Merged
dominik.polakovics merged 1 commit from afk/333 into main 2026-10-21 10:00:21 +02:00

Closes #333

What

  • ElementPicker.tsx shows only what the target allows by default. Categories, counts and order are unchanged.
  • When the current category hides refused elements, a line under the grid says "N more elements are not allowed here." It has a btn btn--xs btn--ghost toggle, "Show them" / "Hide them", which resets on every open and keeps its state across categories.
  • Revealed tiles come after the allowed ones, disabled, with the insertRefusal reason on the tile. The title tooltip and the uppercase marker are gone.
  • A search always reveals a refused match with its reason. While a search is active the toggle line is hidden, since nothing is left to hide.
  • When nothing is allowed at all, a note says so and the whole catalogue is revealed. The existing slot note takes precedence when the slot is what refuses.
  • Enter still picks the first allowed tile.

Rules and owners

The refusal rule stays with insertRefusal / pickerEntries in elementcrud.ts, which is untouched. The dialog only splits entries on refusal === null.

Styleguide

  • Uses the shared .btn.btn--xs.btn--ghost.
  • .etile__refusal is now sentence text in --tone-warn-text (it used the --amber-700 primitive before).
  • New product-only .epick__more in --color-text-muted.
  • No new token or shared component; styleguide.html is unchanged. The .etile[disabled] opacity rule stays.

Docs and skills

  • scaffold/site/AGENTS.md needed a small truth fix, which the issue did not foresee: refused elements no longer show by default.
    • The "Category and description" paragraph now says refused elements wait behind "Show them" and that a search shows them with their reason.
    • The add-element verify step now says the element shows in the insert dialog "at a position its placement allows".
  • No skill describes the picker's rendering, so none changed.

i18n

  • New elementPicker.{hideRefused,moreRefused.one/.other,nothingAllowed,showRefused} keys in en/de.
  • insert.notAllowedHere is kept, contrary to the issue: PageContent.tsx still uses it for a clipboard paste verdict.

Verification

  • cd web && npx vitest run: 132 files, 3369 tests pass.
  • npx tsc --noEmit: clean.
  • npm run build: builds.
  • go test ./scaffold/ ./internal/element/ ./docs/: ok.

🤖 Generated with Claude Code

Closes #333 ## What - `ElementPicker.tsx` shows only what the target allows by default. Categories, counts and order are unchanged. - When the current category hides refused elements, a line under the grid says "N more elements are not allowed here." It has a `btn btn--xs btn--ghost` toggle, "Show them" / "Hide them", which resets on every open and keeps its state across categories. - Revealed tiles come after the allowed ones, disabled, with the `insertRefusal` reason on the tile. The `title` tooltip and the uppercase marker are gone. - A search always reveals a refused match with its reason. While a search is active the toggle line is hidden, since nothing is left to hide. - When nothing is allowed at all, a note says so and the whole catalogue is revealed. The existing slot note takes precedence when the slot is what refuses. - Enter still picks the first allowed tile. ## Rules and owners The refusal rule stays with `insertRefusal` / `pickerEntries` in `elementcrud.ts`, which is untouched. The dialog only splits entries on `refusal === null`. ## Styleguide - Uses the shared `.btn.btn--xs.btn--ghost`. - `.etile__refusal` is now sentence text in `--tone-warn-text` (it used the `--amber-700` primitive before). - New product-only `.epick__more` in `--color-text-muted`. - No new token or shared component; `styleguide.html` is unchanged. The `.etile[disabled]` opacity rule stays. ## Docs and skills - `scaffold/site/AGENTS.md` needed a small truth fix, which the issue did not foresee: refused elements no longer show by default. - The "Category and description" paragraph now says refused elements wait behind "Show them" and that a search shows them with their reason. - The add-element verify step now says the element shows in the insert dialog "at a position its placement allows". - No skill describes the picker's rendering, so none changed. ## i18n - New `elementPicker.{hideRefused,moreRefused.one/.other,nothingAllowed,showRefused}` keys in en/de. - `insert.notAllowedHere` is **kept**, contrary to the issue: `PageContent.tsx` still uses it for a clipboard paste verdict. ## Verification - `cd web && npx vitest run`: 132 files, 3369 tests pass. - `npx tsc --noEmit`: clean. - `npm run build`: builds. - `go test ./scaffold/ ./internal/element/ ./docs/`: ok. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(web): insert dialog lists allowed elements first, refused ones on demand
All checks were successful
ci / build-and-test (pull_request) Successful in 3m37s
ci / release (pull_request) Has been skipped
783a2abf86
The insert dialog now shows only what the target allows. When the current
category hides refused elements, a line under the grid counts them with a
Show them / Hide them toggle that resets on every open. Revealed tiles come
after the allowed ones and carry the refusal reason on the tile instead of a
tooltip and an uppercase marker. A search always reveals a refused match,
and a target that allows nothing reveals the catalogue under a note (the
slot's own note takes precedence).

The refusal rule stays with insertRefusal/pickerEntries; the dialog only
partitions on it. AGENTS.md now says refused elements wait behind Show them,
and the add-element verify step names a position the placement allows.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Author
Owner

[autoland] verdict: pass

PASS. Signal: CI aggregate success (ci / build-and-test: npm build + vitest, go vet + go test ./... incl. the AGENTS.md/skills/docs drift tests). Title is Conventional Commits, body carries Closes #333, branch sits on current main. The diff matches the issue's settled design: refused entries are hidden by default, the per-category toggle line resets per open, revealed tiles come after the allowed ones with the insertRefusal reason on the tile, a search always reveals, nothing-allowed reveals all under a note, and the slot note takes precedence. The refusal rule stays with pickerEntries/insertRefusal in elementcrud.ts. Styleguide: the toggle uses the shared .btn--xs.btn--ghost, and .etile__refusal moves from the --amber-700 primitive to --tone-warn-text. Two deviations from the issue, both justified: insert.notAllowedHere is kept because PageContent.tsx:442 still uses it, and the AGENTS.md truth fix at :408 and :465 is what CLAUDE.md requires once refused elements stop showing by default. No skill describes the picker's rendering.

[autoland] verdict: pass PASS. Signal: CI aggregate success (ci / build-and-test: npm build + vitest, go vet + go test ./... incl. the AGENTS.md/skills/docs drift tests). Title is Conventional Commits, body carries Closes #333, branch sits on current main. The diff matches the issue's settled design: refused entries are hidden by default, the per-category toggle line resets per open, revealed tiles come after the allowed ones with the insertRefusal reason on the tile, a search always reveals, nothing-allowed reveals all under a note, and the slot note takes precedence. The refusal rule stays with pickerEntries/insertRefusal in elementcrud.ts. Styleguide: the toggle uses the shared .btn--xs.btn--ghost, and .etile__refusal moves from the --amber-700 primitive to --tone-warn-text. Two deviations from the issue, both justified: insert.notAllowedHere is kept because PageContent.tsx:442 still uses it, and the AGENTS.md truth fix at :408 and :465 is what CLAUDE.md requires once refused elements stop showing by default. No skill describes the picker's rendering.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Cloonar/deckle!334
No description provided.