feat(editor): element cards show a served children digest instead of nested cards #262
No reviewers
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!262
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "afk/260"
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?
Summary
digest({of, count, label, i18n?, rows[≤3]: {name, text?|image?, disabled}}), built inelemops.ChildrenDigestfromChildRoleand the refactoredelemops.Summarize(the single summary owner;ElementSummary= its text).elemops.ItemsLabelis shared with the form's items section.hasSubList/elementImageRefs/sourceChildrenOfremoved.pasteFor(same refusals, same move/transfer requests).gridCardCountcounts top-level cards only; the Columns view shows a translated container as one card with no nested placeholders; a change anywhere inside a card marks that card.Decisions to review
imgrows with alt text. The issue's literal rule (a thumbnail only when the summary came from an image param) would show alt texts on the showcase Image card, which contradicts the AC and the mockup. A row therefore also shows as a thumbnail when its element declares an image param withitemDisplay: readonly(img.yaml: "the file is the row's identity"; card.yaml deliberately has no itemDisplay, so its rows keep their headings). This is documented in AGENTS.md and in the element package comments.Verification
go vet ./...,gofmt,go test ./...(withweb/distbuilt): all green. New tests pin the digest for an items owner, an image owner (rules a and b), a container, a disabled child, more than three children, mixed names, no children and a slot wrapper.cd web && npm test: 124 files / 3178 tests pass;tsc --noEmitis clean;npm run buildsucceeds.harness checkpasses on a freshharness initsite with the showcase page.GET /api/pagefor it serves: cards → 3 heading rows; image → 2 image rows; text-media → 1 image row; accordion →of: element, label "Accordion item", 2 summaries; hero (only button chips) → no digest.Closes #260
🤖 Generated with Claude Code
Every shortcode node of the served tree now carries an optional `digest` in its verdict, beside `role` and `summary`: the count of its item or element children, the collection's label (items.label, else the item element's label; for element children the shared child label), and the first three children's summaries, a row being a media reference instead of text when its summary came from an image param or its element declares an image param `itemDisplay: readonly` (the file is the row's identity, as in `img`). elemops.Summarize is the one summary owner; ElementSummary is its text, and ChildrenDigest builds the digest from ChildRole. elemops.ItemsLabel is now shared by the form's items section and the digest. The page overview renders the digest under each card's summary ("3 Cards · … · …", thumbnails, "+n", disabled rows dimmed), also in the unused content list, and no card nests cards or insert rows any more: a container's children are managed in its form (#259). A container card's ⋮ menu offers "Paste inside" (and ⌘V on the focused card), going through the same paste as an insert row. The Content tab counts top-level cards only, the translation grid shows a translated container as one card with no nested placeholders, and a change anywhere inside a card marks that card. AGENTS.md documents the summary rule, itemDisplay and the digest; the add-element, edit-content, verify-site, preview-site and redo-theme skills and the README follow. Closes #260 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>[autoland] verdict: pass
Lander verdict: CONCERNS (non-blocking) — approved, not merged
Signal relied on:
labctl pr checks 262→success(ci / build-and-test: npm ci +vite build+vitest run, thengo vet ./...,go test ./...,go build;releaseskipped as expected on a PR). Nothing re-run locally beyondgofmt -lon the changed Go files (clean). Branch is current withmain(merge-base =origin/main90f5e81), so there's no conflict.Conventions: the title follows Conventional Commits (
feat(editor): …), andCloses #260is present. The diff stays within #260: server digest inelemops, client rendering, nested cards/insert rows/drop targets removed, Paste inside, top-level-only counts and translation grid, AGENTS.md + README + the add-element / edit-content / verify-site / preview-site / redo-theme skills. TheItemsLabelextraction ininternal/server/forms.gomoves an existing rule to one shared owner, as CLAUDE.md asks. I found no client re-derivation of summaries or field types.ElementSummary's text precedence is unchanged, so the link picker and chips behave as before.Concern (for the maintainer's eye, not blocking)
itemDisplay: readonlynow also controls the digest, which goes past the issue's stated rule. The PR flags this itself under "Decisions to review".imgrows all carryalt, so that rule alone would give the Image card text rather than the thumbnails the AC asks for. The PR closes that gap with a second trigger: an image param withitemDisplay: readonlyholding a file (internal/elemops/summary.go:93-96,identityImage).itemDisplayused to be "client-only, inert outside items rows". It now has a server-side display meaning (internal/element/schema.go:19-22,internal/element/load.gobuildParam comment). AGENTS.md documents the new behaviour (scaffold/site/AGENTS.md:562), but then says at:567-568(andREADME.mdin the tree-verdict section) "No sidecar key controls the digest:items,summary,itemDisplay, … decide it". Those two statements pull against each other.card.yamldeliberately has noitemDisplay, so cards keep their headings. But a site developer'sitemDisplaychoice now decides how their rows appear on the overview, so this needs an explicit yes from the maintainer before it becomes part of the documented contract.No other findings. The Go tests pin the digest for an items owner, a container, a disabled child, more than three children, mixed and unknown children, a slot wrapper and the JSON placement. Vitest covers the digest line, Paste inside / ⌘V, and the top-level-only translation grid and counts.