editor: element cards show a served children digest instead of nested cards and image-only thumbnails #260
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#260
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?
Summary
The page overview's element card shows one server-served digest of the element's children — count, the first three row summaries, thumbnails where a summary is an image — for every kind of child, and never nests cards. This replaces today's two inconsistent treatments: container children as nested cards, and item rows as image-only thumbnails (or nothing). With #259 landed, every child is managed in the owner's form, so the overview no longer needs to reach them.
Mockup (private artifact, decided with the maintainer; the "Page overview" tab with its "Show today's layout for comparison" switch is this issue): https://claude.ai/artifact/7TnAN5rACaDYNv6iZPsak5
Current behavior
web/src/components/ElementCard.tsx) shows label,#uid, badges, the servedsummaryline and, throughelementImageRefs(web/src/elementcard.ts), up to three thumbnails of its item rows'image-typed params. Item rows without an image (cards→card) show nothing, althoughcarddeclaressummary: heading.hasSubList,LayoutGrid's sub-list with its own insert rows), draggable into and out of the container.gridCardCountcounts nested cards; the translation grid (web/src/translationgrid.ts) walks into translated containers to place placeholders for untranslated nested children.Desired behavior
labelor the child element's label), then the first three rows' summaries separated by a dot, then "+n" for the rest. A row whose summary came from an image-typed param shows a thumbnail in place of its text (so the image card keeps its thumbnails). Disabled rows count and show, dimmed like the form shows them. A card with no children shows nothing extra.content.Verdict,elemops.Verdicts) carries it, exactly asroleandsummaryare served today, so the client assembles the line from served data and derives no summary, role or field-type rule itself (CLAUDE.md "Every rule has exactly one owner";elemops.ElementSummaryis the one summary rule).hasSubList, the sub-list rendering and nested drag targets go. Clicking the card opens the owner's form, where #259 put the children. Inserting into a container happens from its form's Add, or by cut and paste (the ⋮ menu / ⌘X ⌘V still paste into a container as a target? — see Decisions).gridCardCount) counts top-level cards only; the translation grid shows a translated container as one card with its digest and no nested placeholders (an untranslated nested child is reached from the translated container's form, which #259 shows read-only with the pencil).summaryis shown beside the element, where that is useful; at minimum the overview and the unused-content dense list.Decisions
elemops.ElementSummary; the client gets a verdict, not a recipe.Key interfaces
content.Verdict/shortcodeJSON(internal/content/json.go): a new optional children digest besideroleandsummary, present only for a node with children of role item or element; shape: count, label, and up to three entries each either{text}or{image: <media ref>}; built ininternal/elemopsfromChildRoleandElementSummary(which already knows whether the summary came from a basename/image param — expose that, do not re-derive it).web/src/api/content.tsnode types;web/src/elementcard.ts(elementImageRefs,hasSubList,gridCardCount);web/src/components/ElementCard.tsx,LayoutGrid.tsx(the sub-list and nestedInsertRow),web/src/translationgrid.ts,web/src/dragReorder.ts/dropzone.tsfor nested drop targets.internal/pagepath/testdatapattern) if any client logic depends on it beyond rendering.scaffold/site/AGENTS.mdwherever it describes the Content tab's cards, nested elements and thumbnails;scaffold/site/.claude/skills/add-element/SKILL.md(verification of a container or items element on the overview),verify-site,preview-siteandedit-contentwhere they mention nested cards;scaffold/skills_test.goandinternal/element/agentsdoc_test.gomust stay green.Acceptance criteria
text-mediawith images shows thumbnails; an element without children shows no digest.go testpins the verdict for an items owner, a container, an element with a disabled child, and one with more than three children; no client code reads a schema's params or field types to build it.scaffold/site/AGENTS.mdand the affected skills describe the digest and no longer describe nested cards; drift tests pass.How to verify
go test ./...(needsweb/dist),cd web && npm test,harness checkon the scaffolded site.harness servethe scaffold site, open the showcase page's Content tab and compare against the mockup's "Page overview" tab.Assumptions to check
elemops.ElementSummarycan report which step produced the summary without a second evaluation (refactor it to return the origin rather than mirroring its precedence elsewhere).internal/server/linktargets.go) composes "ElementCarddense) — whether it should show the digest or stay one line.Out of scope
Blocked by