feat(editor): rebuild the Page module screen on shared components #174
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!174
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "afk/171"
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?
Closes #171
Rebuilds the Page module's content screen on a shared component layer, following the Direction A mockup (
docs/mockups/editing-screens/).What changed
Shared components (
web/src/components/)Menu(MenuButton, built onlayers.ts),Badge,Tabs,ButtonBar,PageBanner,ClipboardBar,ErrorStrip,ElementPicker,LayoutGrid→SlotColumn→InsertRow+ElementCard,PageContent,PageScreen,PendingChanges.Docheadergains title, badge and tab rows, and its stale note is gone.BadgeandErrorStrip.FormPanewrapper is removed.Content grid (
PagePane.tsxis deleted)PageContent.dropzone.tsitself stays, because TreePane, item collections and pagemanage still use it; the grid no longer does.#uid, the Disabled badge, a two-line summary and image thumbnails. Hover reveals Edit, Enable/Disable and ⋮.web/.Insert dialog
Clipboard
ClipboardBarnames the element and its source page. Shortcuts: ⌘/Ctrl+X and +C on a focused card, ⌘/Ctrl+V on a focused insert row.Page level
?tab=properties, and?props=1is gone.Server / engine
categoryanddescriptionkeys. The scaffold, the news bundle andtestdata/sitedeclare them,scaffold/site/AGENTS.mddocuments them, and the drift test pins them.POST /api/element/transfermoves or copies an element to a slot or container on the same or another page:POST /api/element/enabledtoggles one element.GET /api/publish/pendingreturns the pending listing, with element counts diffed by uid against main.POST /api/publish/discard-allresets every pending change.GET /api/git/statenow describes what undo would revert.Assumptions checked
inheritslot. Its own content wins, so no engine change was needed.accordionhas them (cards,imageandtext-mediause hidden items). The nested sub-list is built generally.publish.go's changed-file set (ChangedPublishFiles) already gives the list. Element counts needed a new main-version reader (gitrepo.MainFile).?props=1or the PagePane DOM.Verification
make testpasses: 79 web test files with 2218 tests, and every Go package.go vet ./...andtsc --noEmitare clean. The onlygofmt -lhit isinternal/theme/icon_test.go, which is already on main.harness serveon a git copy oftestdata/site:POST /api/element/transfermove produced exactly onedeckle: transfer A -> Bsnapshot touching both files.?tab=propertiesserves.Notes / follow-ups
…text.{{< note >}}). This iscontent.InsertChildbehaviour shared by the existing insert op, and worth its own issue.🤖 Generated with Claude Code
[autoland] verdict: pass
Verdict: CONCERNS (non-blocking). Landable as-is; the findings below are follow-up material.
Signal relied on: Forgejo Actions
ci / build-and-testgreen on head3aba648(make test, go vet, tsc) — not re-run. Head is up to date with main; no conflict. Title is Conventional Commits; body carriesCloses #171.scaffold/site/AGENTS.mddocuments the newcategory/descriptionsidecar keys and the drift test pins them.Reviewed: full Go diff (transfer/enabled/pending/discard-all/undo/sidecar keys), full web diff (LayoutGrid/PageContent/PageScreen/clipboard/picker/pending panel vs the Go handlers), every acceptance criterion of #171, and deckle-hosted (pure reverse proxy, no dependency on removed DOM/routes). styles.css churn is a diff-algorithm artifact (histogram: +1514/−611), all feature work.
CONCERNS
web/src/components/PageEditorChrome.tsx:122-135+web/src/undoinfo.tsname the site's last snapshot regardless of the open page, but/api/page/undorestores only the open page (plus a transfer partner when the open page is one of the step's pages). Save on Services, open About → tooltip "Undo: save on Services", click restores About only (a no-op).internal/server/pending.go:538-548,internal/server/git.go:554-568): tooltip reads "Undo: discard on all" (while the confirm atPendingChanges.tsx:295says "This cannot be undone"); undo restores only the open page, and that page can then reference a library upload discard-all deleted. Draft-only — the publish dangling-refs check keeps it off main. No test combines discard-all with undo.internal/server/element_transfer.go:242-262serializes and writessrcDocin copy mode too, though copy leaves it unchanged — a hand-edited non-canonical source gets reformatted and shows as modified with zero element changes (an unserializable source 422s the copy). The test fixture is already canonical. Skip the source write whenmode == copy./<pageA>/#c-<uid>(and restamped colliding uids) dangle, and bundle-local media (bare filenames) stop resolving on the destination; delete warns about linking pages, cut/paste doesn't.Minor
scaffold/editor/elements/html.yaml(insertable: false) gained adescription, contradicting AGENTS.md:90-92 ("have no use for either key").accordion-itemhas nocategory, so the scaffold's top-level insert dialog shows an "Other" category holding only a disabled tile.styles.css:5066-5088re-declares.app-header--hostedgrid areas for the pending chip, silently overriding the originals at:2455/:3111— worth a look in a hosted instance.Addressed the review concerns in
6a40e75andbc735c9:/api/git/statealways reports the step's language (undoLang). When the last step didn't touch the open page (another page, another language, or a media op), Undo is disabled with "Nothing to undo on this page — the last change was save on Services, 2 min ago". Discard all is no longer undoable: git state reports nothing to undo, and/api/page/undorefuses it with a 409, so the confirmation's "This cannot be undone" is true. New test:TestDiscardAllIsNotUndoable.deckle: save <dst>snapshot. A hand-formatted source keeps its bytes (TestElementTransferCopyLeavesNonCanonicalSourceAlone). The PR body's "Undo on either page restores both" now applies only to cross-page moves.GET /api/element/move-refs?page=&lang=&uid=&toPage=lists the pages linking to any#c-<uid>in the cut subtree, plus the bare-filename images that the source bundle holds and the destination's doesn't. Pasting a cut on another page shows a warn-and-proceed "Move element" dialog when either list is non-empty (Cancel / Move anyway), like Delete. Copies and same-page cuts are never asked about.Minor:
html.yamlno longer has a description.accordion-itemis in category Text, so there is no lone "Other" heading.pendingcolumn once, in the original rules at the top and in the 900px query. The later re-declaration is gone.Verification:
go test ./...,go vet ./...,tsc --noEmitand vitest (79 files, 2227 tests) all pass.[autoland] verdict: pass
Re-verified on head
bc735c9— verdict: PASS.Signal relied on: Forgejo Actions
ci / build-and-testgreen onbc735c9(run 165) — not re-run. Head is up to date with main; no conflict.Prior CONCERNS, all resolved (reviewed the 3aba648..bc735c9 delta):
undoReach(web/src/undoinfo.ts) disables Undo on a page the last step didn't touch and names that step;/api/git/statealways reportsundoLangwithundoPages. Discard all is no longer undoable: git state reports nothing to undo and/api/page/undo409s (isDiscardAllStep,internal/server/git.go), matching the confirmation's "cannot be undone". Test:TestDiscardAllIsNotUndoable.savesnapshot (internal/server/element_transfer.go). Test:TestElementTransferCopyLeavesNonCanonicalSourceAlone.GET /api/element/move-refs(samelinkrefs.Referencesscan as the delete warning, plus bundle-local images the destination lacks) feeds a warn-and-proceed "Move element" dialog; copies and same-page cuts are never asked. Tests:TestElementMoveRefs+ two Clipboard tests.html.yamldescription dropped;accordion-itemin Text (no lone "Other"), both pinned byTestElementSidecarsCategories; hosted header grid declared once in the original rules (column/area counts match at both widths).Note (below the CONCERNS bar): in branch mode a
deckle: save before sync/save before publishtip (only written when the worktree was dirty) parses as opsaveon page "before sync", so Undo is disabled everywhere with "the last change was save on before sync" — rare, and the old behaviour there wasn't meaningful either.