view: the preview is just the site — remove the editor bridge #241
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#241
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
In the View module, clicking an element in the preview jumps into that element's edit form. Editors expect the view to be the site: they want to click around it, open accordions, use buttons, follow links. Today a click inside any marked element is intercepted by the theme's preview bridge (
scaffold/themes/deckle/assets/js/ce-bridge.js): it callspreventDefault(so a<summary>toggle, a form button or a lightbox trigger never fires) and posts adeckle:selectmessage the app turns into a navigation to the edit module.Decision
Remove the editor bridge entirely. The View module is a preview of the site and nothing else, as TYPO3's View module is. Editing starts from the Page module, never from the preview. There is no toggle and no modifier-click.
Consequences decided:
location.pathname) was the only way the app learned where the user browsed inside the iframe. The tree selection no longer follows in-preview navigation.selection.selectPage(web/src/selection.ts) deliberately no-ops on the same page, and must keep doing so (the selection is derived from the route, issue #33). The "go there" needs its own signal from the tree pane's click to the view module (a click counter / anonActivatenext to the selection), not a second selection store. Re-assigning the same iframesrcdoes nothing in Solid, so the load has to go through the iframe ref or a changed value.#c-<uid>appended — the anchorpartials/ce/attrs.htmlalready emits in every build and the link picker already uses. The browser scrolls natively. No outline. The view route keeps itselementparameter (routing.viewElementRoute,readElement); the resolution behind it (fetching the page,findNodeByUid,childPathToOrdinal, the reveal signal inViewModule) goes.returnnavigation back to the form is untouched.PreviewPaneis mounted only in the View module, the cards only in the Page module.id="c-<uid>"anchor stays.An existing site needs no theme update for the fix to take effect: the old bridge intercepts clicks only after the app's
deckle:hellohandshake, and the new app never sends one, so an old script sits idle. The theme cleanup is hygiene, not a prerequisite.Scope
App (
web/src)bridge.ts(message types,parseBridgeMessage,previewOrigin,ordinalToChildPath,childPathToOrdinal) and its teststest/bridge.test.ts,test/Bridge.test.tsx.PreviewPane.tsx: drop the handshake, themessagelistener,bridgeLive,iframeShownPath,onBridgeSelect,highlight,reveal,onPreviewNavigate. Keep the viewport toggle and the crash/placeholder states. Rework the forward navigation so a tree activation always loads (decision 3) and the Preview-button arrival loads<address>#c-<uid>(decision 4). Updatetest/PreviewPane.test.tsx,test/PreviewPaneSync.test.tsx,test/PreviewPaneLang.test.tsxaccordingly.App.tsx: removehandleBridgeSelect,bridgeSeq, thehighlightsignal and its module-switch reset, and theonBridgeSelect/highlight/onHighlightentries of the module context.modules.tsx:ModuleContextloseshighlight,onHighlight,onBridgeSelect;ViewModuleloseshandlePreviewNavigate, the reveal effect andreveal; thePAGE_MODULEcomment about the bridge naming it is rewritten.previewmap.tskeepspermalinkForPage/normalizePreviewPath/joinPreviewUrl;buildPermalinkMapandlookupPageByPathlose their only caller — remove them and their tests unless another caller appears.PageContent.tsx/PageScreen.tsx: remove the hover → highlight plumbing (hover,hoverAt,hoverPath,onHighlight, the cardhoverStart/hoverEndcallbacks if nothing else uses them).FormScreen.tsxdoPreviewis unchanged in intent; verify it still builds the view route with the element parameter.Theme (
scaffold/themes/deckle)assets/js/ce-bridge.jsandlayouts/partials/ce/path.html.layouts/_default/baseof.html: delete the{{ if hugo.IsServer }}block (the.ce-highlightstyle and the script include).layouts/partials/ce/attrs.html: emit the anchor only; drop thehugo.IsServerbranch and rewrite the header comment (the ordinal-semantics paragraph goes with it).layouts/partials/backendlayout/slot.html: drop the comment about inherited content carrying the ancestor'sdata-ce-page.layouts/partials/l10n/script.html: adjust the note that listsce-bridge.jsamong text-free assets, if present.Go
internal/theme/theme_test.go: remove the test over thehugo.IsServerblock (~line 666) and the marker-value tests (~line 1034–1070); in the production-hygiene test (~line 242) dropdata-ce-andce-bridgefrom the forbidden list, keepHAHAHUGOSHORTCODE.internal/theme/news_test.go~line 1044 expects marker attributes on the news list — update.internal/theme/doc.godescribes the leak guarantee in terms of markers and bridge — rewrite.harness checkand the drift tests (internal/element/agentsdoc_test.go,scaffold/skills_test.go) must stay green; AGENTS.md mentions none of this and is untouched.Docs and skills (same change, per CLAUDE.md)
scaffold/themes/deckle/README.md: asset list (~107, ~801), the inheritance paragraph (~446: inherited content "keeps the ancestor's markers so clicking selects it on the owning page" — now simply inherits), the l10n note (~647), and the "Editor integration" section (~755–765), which shrinks to: the anchor exists in every build, internal links and the editor's Preview button use it; keep thece/attrs.htmlcall on every block element's frame.scaffold/site/.claude/skills/redo-theme/SKILL.md: asset inventory (~92) and step 4 (~136–138): no leak grep, no click-to-select check; instead "the element form's Preview button opens the View module scrolled to that element".scaffold/site/.claude/skills/redo-theme/references/theme-contract.md: the attrs/path partial contract (~30–33), the verbatim server-only block (~78–85), and the "bridge" mention (~146).scaffold/site/.claude/skills/add-element/references/element-contract.md(~53): attrs emits the anchor only.scaffold/site/.claude/skills/migrate-site/SKILL.md(~219): dropce-bridge.jsfrom the carry-over list.scaffold/site/.claude/skills/verify-site/SKILL.md: theme bullet (~91–92) becomes the Preview-button check; drop the leak grep (~109–115) but keep the anchor-presence check.Rules and owners
previewmap.permalinkForPageon the tree's server-sentaddress, as today. The fragment for an element is"#c-" + uid, spelled once in the view module (the link picker's element targets spell the same anchor server-side; if the client already has a helper for it, call that).selection.selectPagekeeps that no-op; the view's reload is a separate activation signal, not a second evaluation of selection.ce/path.html,ordinalToChildPath,childPathToOrdinal) is deleted on both sides at once.Verification
make check(or the repo's equivalent:go test ./...,vitest,harness checkon the scaffold) green.hugobuild of the scaffold containsid="c-…"anchors and nodata-ce-orce-bridgestrings (trivially, since neither exists anymore).