Skip to content

feat: compile notifications and long-running provider feedback#55

Merged
barrettruth merged 7 commits intomainfrom
doc/cleanup
Mar 6, 2026
Merged

feat: compile notifications and long-running provider feedback#55
barrettruth merged 7 commits intomainfrom
doc/cleanup

Conversation

@barrettruth
Copy link
Owner

@barrettruth barrettruth commented Mar 6, 2026

Problem

The compiler had no user-facing feedback during compilation and
long-running providers like typst watch had no per-recompile
notifications at all.

Solution

Add "compiling…" / "compilation complete" / "compilation failed"
notifications for oneshot providers, then extend the same feedback to
long-running providers via a persistent output_watcher fs_event and
has_errors tracking on BufState. Also switch the markdown preset
from --embed-resources --mathml to --katex and update docs.

Problem: No user-facing feedback when compilation starts or finishes.
Long-running compilers like pandoc with `--embed-resources` leave the
user staring at nothing for 15+ seconds.

Solution: Notify "compiling..." at compile start and "compilation
complete" on success. The initial `toggle` call uses a combined
"compiling with <name>..." message to avoid stacking two notifications.
Problem: `--embed-resources` with `--mathml` caused pandoc to inline all
assets at compile time, adding ~15s per save for KaTeX-heavy documents.

Solution: Default to `--katex`, which inserts a CDN `<script>` tag and
defers rendering to the browser. Users can opt into `--embed-resources`
or `--mathml` via `extra_args`.
@barrettruth barrettruth changed the title fix(presets): add --mathml to pandoc presets, document KaTeX recipes feat: compile notifications, switch pandoc presets to --katex Mar 6, 2026
Problem: `compile()` used an `opts.silent` escape hatch so `toggle()`
could suppress duplicate notifications. Compilation failures had no
user-facing notification.

Solution: Remove `opts.silent` — `compile()` unconditionally notifies
on start, success, and failure. `toggle()` no longer emits its own
message.
…iders

Problem: long-running providers like `typst watch` had no per-recompile
feedback — the process stays alive and individual success/failure was
never reported.

Solution: add a persistent `output_watcher` fs_event that fires
"compilation complete" on every output mtime bump, and track
`has_errors` on `BufState` so stderr diagnostics trigger a one-shot
"compilation failed" notification. `diagnostic.set()` now returns the
diagnostic count to support this flow.
@barrettruth barrettruth changed the title feat: compile notifications, switch pandoc presets to --katex feat: compile notifications and long-running provider feedback Mar 6, 2026
@barrettruth barrettruth merged commit 39406c5 into main Mar 6, 2026
7 checks passed
@barrettruth barrettruth deleted the doc/cleanup branch March 6, 2026 19:58
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.

1 participant