Skip to content

(hub-client) Divert ctrl/cmd+s to pop up a toast#5

Merged
cscheid merged 3 commits intokyotofrom
divert-save
Jan 22, 2026
Merged

(hub-client) Divert ctrl/cmd+s to pop up a toast#5
cscheid merged 3 commits intokyotofrom
divert-save

Conversation

@shikokuchuo
Copy link
Copy Markdown
Member

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.

@shikokuchuo shikokuchuo requested a review from cscheid January 20, 2026 16:14
@cscheid cscheid merged commit efb6ac6 into kyoto Jan 22, 2026
2 checks passed
@shikokuchuo shikokuchuo deleted the divert-save branch January 22, 2026 16:04
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cmd + S should do nothing

2 participants