Repository navigation
Separate the preview fidelity and origin from the fast canvas (#28) - #201
Merged
Merged
Conversation
The canvas and the Production Preview both showed something about render fidelity, but neither named the render origin, the document-wide preview authority never left Approximate, and no surface said that an approximate overprint render is not proof of print-safe output (#28). Add pdfquick::tokens::classifyPreviewFidelityState / previewFidelityOriginName / resolvePreviewFidelityStateVisual and project them through EditorHost as previewFidelityStateName / previewFidelityOriginName / previewFidelityVisual / previewFidelityColor / previewFidelitySummary / previewRequiresAuthoritative. Both the ordinary canvas banner and the Production Preview render that one projection: fidelity unavailable/stale/exact/approximate/authoritative, origin none/fast-canvas/output-preview. The overprint-sensitive fast render is the `approximate` state, whose summary says its pixels cannot stand as proof of print-safe output and which no state resolves to a pass. EditorHost::ensureAuthoritativePreview() is the explicit switch the preview surfaces call before a page is presented as proof: it moves the current page to the output-preview render and returns false when it is already authoritative or exact. The Production Preview gains a "proof this page" affordance bound to it. Proof: UnitTestsLoopStateVisual (classification, origin, distinct shapes, never a pass), UnitTestsEditorHost::previewFidelityNamesTheOriginAndSwitchesExplicitly (the projection and the explicit switch on a real overprint fixture), and UnitTestsPageSurface::fastCanvasOverprintRenderIsNotTheAuthoritativeGolden (the fast render does not match overprint-cmyk-mode1-on.png while the authoritative render does, and the fast diagnostics report the approximation).
…ritative-but-inexact visible Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
What changed
Implements #28 (L03-02 — Separate Production Preview from fast canvas). The ordinary canvas and the authoritative Production Preview now display render fidelity and origin from one projection; overprint-sensitive content is switched explicitly to the authoritative output-preview render before it is presented as proof; and approximate canvas pixels are never presented as proof of print-safe output.
This is a delta on top of what already shipped:
PreviewStateModelalready carriedAuthority/authorityName,EditorHost::previewIdentity/previewSummary/previewSummaryalready drove the Production Preview workspace,pageFidelityIsExact/pageFidelityIsAuthoritative/toggleCurrentPageFidelityalready existed (#49), and Core already owned the renderer's overprint/transparency behaviour and its differential goldens. The audit found three real gaps: neither surface named the render origin; the Production Preview could still describe an overprint-sensitive fast render without saying its pixels are not proof of print-safe output; and nothing made the switch to the authoritative render an explicit, pre-claim step.Per-criterion: already satisfied vs built
devCanvasPane'srenderFidelityBannershows Approximate/Accurate per page (#49)previewFidelitySummary, naming fidelity and origin, and is always up while a document is openpageFidelityIsExact/reason only; no origin, andpageFidelityIsAuthoritativewas unusedpreviewFidelityVisual/previewFidelitySummaryplus aFidelity …, origin …line frompreviewFidelityStateName/previewFidelityOriginNameApproximatepreviewRequiresAuthoritative()(exactly theapproximatestate) andEditorHost::ensureAuthoritativePreview(), bound to a new "Proof this page (authoritative render)" affordance in the paneapproximateis its own state,previewFidelitySummary()states the pixels cannot stand as proof of print-safe output, and no preview state resolves to a pass (previewFidelityNeverClaimsAPass)overprint-cmyk-mode1-on.png,flatten-transparency-normal-cmyk.png)UnitTestsPageSurface::fastCanvasOverprintRenderIsNotTheAuthoritativeGoldenrenders the same page with and without the authoritative marker and proves the fast render does not match the golden while the authoritative one doesNew production surface (all render Core/host facts, derive no verdict):
LoopLibQuick/sources/loopstatevisual.*—classifyPreviewFidelityState,previewFidelityOriginName,resolvePreviewFidelityStateVisual.LoopEditor/editorhost.*— six read-only properties +ensureAuthoritativePreview().LoopEditor/qml/ProductionPreviewPane.qml(+ mirror) andLoopEditor/qml/CanvasPane.qml(+ mirror).Release changelog
Topic PR: see
changes/codex-issue-28-production-preview.md. The issue stays open on merge (devis not the default branch); close it explicitly when the release promotion lands.Proof
check-change.py—status: pass(report:$LOCALAPPDATA/Temp/issue28-check-change.json). Command and observed result below.changes/codex-issue-28-production-preview.mdfragment (Category/Audience/Breaking-Change/Summary)Commands and observed results
Image: Windows 11 / MSVC 14.44 / Qt 6.11.1 (aqt) / Ninja; build dir
C:/.dev/repos/loop-build-28, configured with the agent-fast options (-DLOOP_BUILD_QUICK_SHELL_SMOKE=ON -DLOOP_BUILD_PRODUCT_QUICK_A11Y_SMOKE=ON -DLOOP_BUILD_CANVAS_BENCHMARK=OFF).check-change.pyselection for this change set (--dry-run): modulesdocumentation, interaction, quick; targetsLoopEditor, LoopLibInteraction, LoopLibQuick, ProductQuickAccessibilitySmoke; 20 mapped tests. The full run's report is quoted below.Internal logic
classifyPreviewFidelityStateordersunavailable → stale → authoritative → approximate → exact);ensureAuthoritativePreview()refuses when there is no document or the page is already authoritative/exact.pageFidelityIsExact,pageFidelityIsAuthoritative,previewStaleReason).ensureAuthoritativePreview()returns false without touching the coordinator.previewFidelityStateName,previewFidelityOriginName,previewRequiresAuthoritative); comments give the rationale (why authoritative outranks pending diagnostics).Quality summary
Added: one pure classifier, one origin lookup and one visual resolver in LoopLibQuick, six read-only projections and one invokable in EditorHost, and the QML that renders them. Kept on purpose:
pageFidelityIsExact/pageFidelityIsAuthoritative/toggleCurrentPageFidelity(the underlying facts) and the #49 canvas banner/toggle, now fed by the shared projection. Removed nothing but the pane's duplicated inline fidelity wording.Security and rollback
ensureAuthoritativePreview()only changes which render path a page uses; it writes nothing and is not an approval.git revert a0195ea1; the change is additive on the preview surface.Docs
docs/RENDERER_DIFFERENTIALS.mdgains the "Fidelity and origin on the two preview surfaces (#28)" section describing the vocabulary, the explicit switch and the fidelity-state proof.Self-review (BSP-002 §4.3)
Anti-slop: the diff adds a small, pure state machine and renders it, rather than re-deriving fidelity in QML — the two panes now share one projection and the words come from
previewFidelitySummary, so there is one place to keep honest. The one judgement call is calling the non-overprint fast pathexact: that mirrors the existing diagnostics semantics ("no overprint content, or none known yet") and the summary still says the interactive preview does not certify print-safe output.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.