feat(view): the preview is just the site — remove the editor bridge #242
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!242
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "afk/241"
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 #241
What changes
The View module is now a plain preview of the site. Accordions, buttons and links in it work natively, and nothing in it navigates the editor. Editing starts from the Page module.
App (
web/src)bridge.tsand its tests are deleted. Also gone: the hello handshake and message listener, click-to-edit (handleBridgeSelect), preview→tree sync (onPreviewNavigate,lookupPageByPath,buildPermalinkMap,samePreviewPath), and the reveal fetch (childPathToOrdinal). The Page module's hover → highlight plumbing goes too (PageContent, PageScreen, ElementCard, LayoutGrid, gridContext, EntryEditor, UnusedContent).TreePanegainsonActivate. The shell records each click as a{page, seq}activation (ctx.pageActivation/ctx.onPageActivate), separate from the selection.selection.selectPagekeeps its same-page no-op.PreviewPaneloads on every activation. When the URL is unchanged it reloads through the iframe ref.pendingOwnLoadflag, cleared on each iframeload, means a click that also changes the selection loads the page once, whichever signal arrives first.permalinkForPage(...) + elementAnchor(uid)when the route carrieselement, so the browser scrolls to the element natively.returnnavigation is unchanged.Theme
ce-bridge.jsis deleted.hugo.IsServerblock (.ce-highlightstyle + script) is removed frombaseof.html.ce/attrs.htmlemits only theid="c-<uid>"anchor.slot.htmlandl10n/script.htmlare removed.Deviation from the issue:
ce/path.htmlis keptThe read-only
deckle-hostedrepo'scontact-formandappointmentsbundles callpartial "ce/path.html"for their fallback form key on content without a uid. Deleting it would break those bundles on every new site. It stays as a theme-only helper and its comment is rewritten: the editor never uses it, and no client-side ordinal code remains. The theme README,theme-contract.mditem 4 andadd-elementstill document it for that use.Go tests and docs
internal/themetests:hugo.IsServertest and the bridge-marker tests.HAHAHUGOSHORTCODE.TestSlotAnchorsInProduction.doc.gois rewritten.redo-theme(SKILL and theme-contract, whose items were renumbered with their references fixed),add-element/element-contract,migrate-siteandverify-site(the Preview-button check replaces click-to-select, the leak grep is dropped, the anchor check stays).AGENTS.mdmentions none of this and is untouched.Verification
web:tsc --noEmitis clean.npm testpasses 115 files / 2828 tests.npm run buildsucceeds.PreviewPaneSync: exactly one load in either signal order, a reload after browsing away, no double load while a load is pending, the fragment target.ViewModule(full app): a click on the already-selected page, an activation from before mount being ignored, the Preview button giving…/#c-<uid>.TreePaneModes:onActivatefires.go vet ./...andgo test -count=1 ./...pass, with hugo v0.167.0 for the theme integration tests.harness initfollowed byharness check: "ok: no problems found".hugobuild oftestdata/library-sitehas 27id="c-…"anchors and nodata-ce-,ce-bridgeorce-highlight.🤖 Generated with Claude Code
[autoland] verdict: pass
PASS. Signal: CI aggregate success (ci / build-and-test: web npm build + npm test, go vet, go test ./... with hugo v0.167.0; release skipped on PRs). Conventions: Conventional Commits title, Closes #241, branch level with main. Scope matches #241: bridge removed on both sides; tree activation reloads via onActivate/pageActivation with a single-load guard; the Preview button opens address + elementAnchor(uid), reusing the existing helper (no second owner). Deviation: ce/path.html is kept. It is documented and justified: deckle-hosted's contact-form and appointments bundles call it, and add-element/SKILL.md:145 documents it as the form-key fallback. Docs and skills are updated per CLAUDE.md; the renumbered theme-contract item references were verified.