(hub-client) Divert ctrl/cmd+s to pop up a toast#5
Merged
Conversation
gordonwoodhull
added a commit
that referenced
this pull request
May 10, 2026
…w render Adds Plan 1 §Test plan post-bug-fix assertion #5 to `website_q2_preview_renders_through_orchestrator`: pre-write "fake image bytes for q2-preview test" to `hero.png`, run the render, assert the file's contents equal the pre-render bytes. The native preview renderer (`RenderToPreviewAstRenderer::render`) does NOT call `write_artifacts` for page-scoped entries — it returns them in `output.page_artifacts` to the caller, who routes project-scoped via `flush_site_libs` and merges page-scoped into the orchestrator's accumulator. So the empty-content manifest entries from `Artifact::from_path` (produced by `ResourceCollectorTransform`) ride along but never reach a `file_write` call. That accident is what kept bd-3gtn from manifesting natively while it bit the WASM flush loop in `wasm-quarto-hub-client/src/lib.rs` (fixed in c8a684b). This assertion locks the native contract: if a future change adds a `write_artifacts(page_artifacts, ...)` call to the preview renderer, this test will fail and force the same `is_empty()` guard to land alongside it. Belt-and-suspenders coverage at the native layer parallel to the WASM-bridge assertion in `hub-client/src/services/assetManifestProject.wasm.test.ts`. Plan reference: 2026-05-04-q2-preview-plan-1-pipeline.md §Test plan, "Website fixture with embedded image", post-bug-fix item #5. The plan's earlier "fragile-by-design" assertion #3 was never implemented in the test (the implemented assertion is content- agnostic `!page_artifacts.is_empty()`); this commit lands the post-fix counterpart instead. Verification: full quarto-core suite (1904 tests) passes.
gordonwoodhull
added a commit
that referenced
this pull request
May 10, 2026
Cross-checked Plan 2C against what Plan 2B actually shipped on feature/q2-preview and the current state of the Rust transform sources. Five mechanical corrections, no design changes: 1. Stale Rust plain_data writer line refs: - theorem.rs:282-285 → :145 - equation_label.rs:215-217 → :316 (two occurrences) - crossref_resolve.rs:294-314 → :316 2. framework/types.ts:89 → :163 (Plan 2B added CustomNode shape types and gap-fill block types ahead of FormatRegistry). 3. entry.tsx:179-182 → :228-231 (Plan 2B added the AssetManifestContext.Provider and Note-numbering useMemo, pushing mergedRegistry down). 4. Provider stack updated to include NoteNumberingContext.Provider (Plan 2B Phase 3.4); full post-2C stack is PreviewContext → AssetManifest → NoteNumbering → CustomNodeRegistry → Ast. 5. Naming convention pinned to mergedPreviewRegistry throughout; plan body and code samples no longer mix mergedRegistry (legacy 2A name) and mergedPreviewRegistry (new symmetric name). 2C's implementation does a 1-line rename of the existing variable. Plus one fixture-spec correction: 6. multi-element-doc.qmd footnote syntax pinned to inline `^[body]` (not reference `[^1]: body`). Discovered during Plan 2B implementation that pampa's postprocess at crates/pampa/src/pandoc/treesitter_utils/postprocess.rs:1134-1146 converts Inline::NoteReference to an empty Span(class="quarto-note-reference") before any quarto-core transform runs; nothing downstream resolves those Spans. Reference-style footnotes don't render in either q2-preview or HTML pipelines today; only inline `^[body]` syntax produces the `<sup class="footnote-ref">` markup the smoke fixture's ensureHtmlElements selectors expect. And one template recommendation: 7. customNodeWireFormatProject.wasm.test.ts (Plan 2C item 5.3) now points at assetManifestProject.wasm.test.ts (Plan 2B) as the closer template; the older themeFingerprint.wasm.test.ts reference is preserved as a secondary touchstone since it locks theme_fingerprint regression coverage. Informational notes appended to the revision history (no plan changes needed): bd-3gtn fix landed in c8a684b so smoke fixtures with images don't need post-render-add workarounds; Plan 2B added 5 inline gap-fill renderChildrenRegistry entries (Underline / Strikeout / Superscript / Subscript / SmallCaps) via a makeFlatInlineRenderer helper; Plan 1's "fragile-by-design" assertion #3 was never implemented, and assertion #5 (bytes survive) landed as 07e5205 and assetManifestProject.wasm.test.ts.
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.
Closes #2.
Prevents the browser's "Save Page" dialog from appearing on ctrl/cmd+s.
Rather than have this do nothing (which could be potentially confusing for users), we pop up a little "Auto-saved" toast, which appears bottom-centred and dismisses after 2s.
This works whether focus is in the editor, preview pane, or elsewhere in the app.