feat(preview): doc-route toolbar affordances, page-break and header/footer markers - #195
Open
ThatScalaGuy wants to merge 1 commit into
Open
Conversation
…ooter markers Document routes carried report-shaped chrome: search indexed only [data-bino-kind] elements and layout pages (dead on docs), no document settings were visible anywhere before build, page breaks rendered as invisible 0-height divs, and displayHeaderFooter had no representation at all. - The toolbar shows a meta strip on /doc/* routes (format · orientation · locale · chapters · TOC · header/footer) fed by new doc-only fields on the injected artefact payload. Chapter counts resolve the same sources the renderer uses. - A Build PDF button copies 'bino build --artefact <name>' — the honest affordance for 'show me the real pages'; the preview deliberately does not simulate pagination. The textarea fallback matters: the VS Code webview iframe grants no clipboard permission. - Search gains a heading pass over .bn-document-content (headings carry auto-generated anchor ids; the selector matches nothing on report routes) and a route-aware placeholder. - The Inspect tooltip says 'Inspect embedded engine components' on doc routes — a prose-only doc yields an empty inspector, and the report wording promised more than docs deliver. - Page breaks show as a dashed rule with a 'page break' chip, and displayHeaderFooter docs get placeholder bands sized by the real margins (spec values validated as CSS lengths, else the Chrome defaults 20mm/15mm). Both are preview.css-only, so built PDFs are untouched. The geometry rides as bn-context attributes (withDocumentPreviewMeta, extending the page-width attribute from the live-reload fix) so manifest edits update it through SSE morphs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #194.
Document routes carried report-shaped chrome. This makes them feel designed-for:
/doc/*routes:a4 · portrait · en · 3 chapters · TOC · header/footer, fed by new document-only fields on the injected artefact payload (omitempty, so report artefacts are unchanged). Chapter counts resolve the same sources the renderer resolves.bino build --artefact <name>to the clipboard with a ✓ Copied state. The preview deliberately does not simulate pagination — this is the honest "show me the real pages" affordance. The textarea fallback is load-bearing inside the VS Code preview webview, whose iframe sandbox grants no clipboard permission.[data-bino-kind]elements and layout pages). A new pass indexes.bn-document-contentheadings — they carry auto-generated anchor ids, and the selector matches nothing on report routes. Placeholder switches to "Search headings..." on doc routes.pageBreakBetweenSourcesrendered as invisible 0-height divs. Preview now shows a dashed rule with a "page break" chip. preview.css never loads in builds, so PDFs keep the clean break.displayHeaderFooterdocs show labeled placeholder bands sized by the real margins (marginTop/marginBottomvalidated as CSS lengths, otherwise the Chrome print defaults 20mm/15mm). The geometry travels asbn-contextattributes (withDocumentPreviewMeta, extending fix(preview): live-reload DocumentArtefact routes, pin doc page width #191's page-width attribute), so manifest edits update it live through SSE morphs — head-injected styles would go stale.internal/web/static/preview.jsregenerated.