Editor header: slot for host navigation and a compact preview status when hosted #139
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#139
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?
What to build
Give the editor's header a slot for host navigation. When deckle runs behind a host that wraps it, such as deckle-hosted, the host can supply where the user is and where they can go: a brand link home, breadcrumb segments with switcher menus, the sections next to the editor, and an account menu. The editor renders them in its own header, so the host does not need a second bar above the editor and the user sees one bar across both products.
Standalone deckle does not change. With no host, the header looks and behaves exactly as it does today.
The same change makes the Hugo status compact when a host is present, because a hosted editor cannot act on the Hugo version or on where the binary comes from.
Why a slot in deckle
The host cannot draw this itself. The editor runs on its own origin and hardcodes absolute paths, so the host can only reverse-proxy it. Framing the editor would stack two headers and break deep links. The editor's header is the only place where one bar is possible.
Design reference
The target is drawn in the dashboard redesign mockup of deckle-hosted:
design/hosted-shell-mockup.htmlinCloonar/deckle-hosted, state "Editor open". A published copy is at https://claude.ai/artifact/E6dcK8zKFALE3navT8QmhC. The bar in that mockup already uses the editor's own chrome colors, sizes and header height.Cloonar/deckle-hosted#51specifies the dashboard side of the same bar.The contract
deckle owns this contract. The host implements the producer.
Where the data comes from
The editor requests
GET /api/hoston its own origin, with a relative URL, once when it loads./api/path. That 404 is how standalone deckle says "no host".Shape, version 1
Proposed shape. Refine it while implementing if needed, and document the final form, since the host builds against the documentation.
versionis optional. A host may send only a brand, or segments without menus.hrefis a plain label. A segment withoutmenuhas no arrows. A section withouthrefis not a link.mark.kindisinitial, a small colored square with one character, orstatus, a small state mark withstatusone ofok,busy,error,locked,none. deckle picks the colors for the states from its own tokens and showslockedas a lock icon, so state is never carried by color alone.metais short trailing text such as a count or a state, anddetailis a second line under the label.Header with host navigation
Left to right, as in the mockup: the brand as a link in place of the "Deckle" wordmark; the segments separated by a slash; the sections with the current one marked; then, unchanged, the publish chip and Publish all; the compact preview status; the account menu.
href. A separate arrows control next to it opens its menu.Following a host link
Every host entry is a plain link, followed in the same tab. The editor never sends a POST to the host.
When a form has unsaved changes, following a host link goes through the editor's existing unsaved-changes dialog with Save, Discard and Stay. The browser's generic leave prompt is not the answer here; it stays for closing the tab.
Compact preview status
With host navigation present, the Hugo status pill becomes a dot with a short label:
Everything the pill shows today, the state, restart count, version and binary source, moves into the tooltip and the accessible name. The "disconnected" hint stays. Without host navigation the pill is unchanged.
Safety
https:andhttp:URLs are accepted ashref. An entry with any other scheme is dropped.coloris accepted only as a six-digit hex value. Anything else falls back to a neutral color.Acceptance criteria
hrefis not a linkhrefis dropped; a malformed color falls back; host strings containing markup are shown literallyOut of scope
Cloonar/deckle-hostedimplements it in a follow-up once this contract is final.Blocked by
None - can start immediately