render+web: latex pipeline fixes, error visibility, render UX #28

Merged
nicolas_naranjo merged 1 commit from integrator/render-and-editor-ux into master 2026-10-24 07:53:35 -05:00
Owner

User-reported round (6 items)

  1. Save-after-transform blocked — web validateFa mirrored the pre-ε contract (symbols ⊆ alphabet), so every Thompson NFA was structurally invalid client-side. ε is now legal outside the alphabet, matching the amended backend. Regression-tested.
  2. Latex render of Thompson NFAs → "render failed" — three stacked bugs, all reproduced and fixed: raw ε glyph vs pdflatex inputenc (fatal), pgf-2.x >=latex' arrow tips removed in modern pgf, ellipse shape needing shapes.geometric. Pipeline verified in-container and live.
  3. Latex SVG unreadable on the dark UI — latex output now renders on a paper card (black-on-transparent paths become a readable document).
  4. No download — [ SAVE SVG ] button (blob download, name derived from the saved doc).
  5. DELETE 403 on dev — bodyless DELETEs carried no content-type; SvelteKit's CSRF check classifies missing content-type as form content and rejects even same-origin. Client now always sends application/json on non-GET/HEAD. Root cause + fix verified against the live stack (403 → 204).
  6. In-editor visualization — the render modal is now wide (1100px), zoomable 50-400% with scroll panning and a FIT reset.

Error visibility (the meta-issue)

  • render crate: failure snippets now carry the combined tail of stderr+stdout — pdflatex reports on stdout, so the old stderr-only snippet was empty.
  • [CROSS-LANE per #20] crates/rgxr-api/src/error.rs: RenderError::Failed detail now lands in the envelope message ("render failed: pdflatex exited with code 1: ! LaTeX Error: …") instead of only the tracing log. Tool output, not internals; 2 lines. Flagging for your review — revert to log-only if you object and I will open an issue instead.

Gates

  • cargo fmt + clippy --workspace --all-targets clean; 99 tests green (44 core + 28 core-acceptance + 11 api + 16 render; new: ε math label, pgf3 compat, snippet tail/capture).
  • bun test 13 pass (new client + fa suites); svelte-check 0 errors; build green.
  • Live stack (compose): regex→nfa→save→latex render of (a|b)*ab through the proxy — previously failed at save AND render, now green.
## User-reported round (6 items) 1. **Save-after-transform blocked** — web `validateFa` mirrored the pre-ε contract (symbols ⊆ alphabet), so every Thompson NFA was structurally invalid client-side. ε is now legal outside the alphabet, matching the amended backend. Regression-tested. 2. **Latex render of Thompson NFAs → "render failed"** — three stacked bugs, all reproduced and fixed: raw ε glyph vs pdflatex inputenc (fatal), pgf-2.x `>=latex'` arrow tips removed in modern pgf, `ellipse` shape needing `shapes.geometric`. Pipeline verified in-container and live. 3. **Latex SVG unreadable on the dark UI** — latex output now renders on a paper card (black-on-transparent paths become a readable document). 4. **No download** — `[ SAVE SVG ]` button (blob download, name derived from the saved doc). 5. **DELETE 403 on dev** — bodyless DELETEs carried no content-type; SvelteKit's CSRF check classifies missing content-type as form content and rejects even same-origin. Client now always sends `application/json` on non-GET/HEAD. Root cause + fix verified against the live stack (403 → 204). 6. **In-editor visualization** — the render modal is now wide (1100px), zoomable 50-400% with scroll panning and a FIT reset. ## Error visibility (the meta-issue) - render crate: failure snippets now carry the **combined tail of stderr+stdout** — pdflatex reports on stdout, so the old stderr-only snippet was empty. - **[CROSS-LANE per #20]** `crates/rgxr-api/src/error.rs`: `RenderError::Failed` detail now lands in the envelope message ("render failed: pdflatex exited with code 1: ! LaTeX Error: …") instead of only the tracing log. Tool output, not internals; 2 lines. Flagging for your review — revert to log-only if you object and I will open an issue instead. ## Gates - `cargo fmt` + `clippy --workspace --all-targets` clean; **99 tests green** (44 core + 28 core-acceptance + 11 api + 16 render; new: ε math label, pgf3 compat, snippet tail/capture). - `bun test` 13 pass (new client + fa suites); `svelte-check` 0 errors; build green. - Live stack (compose): regex→nfa→save→latex render of `(a|b)*ab` through the proxy — previously failed at save AND render, now green.
render+web: latex pipeline fixes, error visibility, render UX
All checks were successful
ci / rust (pull_request) Successful in 1m0s
ci / web (pull_request) Successful in 1m42s
ci / image (pull_request) Has been skipped
9dac5e3150
Six user-reported issues, one round:

Latex render (crates/rgxr-render):
- ε edges emitted the raw U+03B5 glyph, which pdflatex's inputenc
  rejects ("Unicode character ε not set up") — every Thompson
  construction failed with a swallowed error. The latex dot now
  carries a math-mode $\varepsilon$ label (pipeline-generated;
  user names stay verbatim-escaped, no TeX-injection path).
- dot2tex emits pgf-2.x arrow tips (>=latex') that modern pgf removed,
  and ellipse node shapes that live in shapes.geometric — rewritten/
  loaded (pgf3_compat + standalone_doc preamble).
- error visibility: the failure snippet read stderr only, but pdflatex
  reports on stdout — snippets now carry the combined tail of both
  streams, and the api envelope includes the detail instead of a bare
  "render failed" (crates/rgxr-api/src/error.rs — CROSS-LANE per #20:
  2-line change, flagged for review).

Web (web/):
- validateFa mirrored the pre-ε contract: any Thompson NFA was
  "structurally invalid" client-side, blocking save-after-transform.
  ε is now legal outside the alphabet, matching the backend.
- bodyless DELETEs went out without a content-type and were killed by
  SvelteKit's CSRF check (missing content-type counts as form
  content, even same-origin) → the delete button's 403. Non-GET/HEAD
  requests now always carry application/json.
- render modal: zoom (50-400%, fit reset), scroll panning, paper card
  for latex output (black-on-transparent paths read on white), wide
  variant, and a [ SAVE SVG ] download button.

Gates: 99 rust tests green (incl. new ε-label, pgf3-compat, snippet
tests); 13 web tests (new client + fa suites); svelte-check clean;
build green; live stack verification: regex→nfa→save→latex render of
(a|b)*ab works through the proxy (previously failed at save and
render).
nicolas_naranjo deleted branch integrator/render-and-editor-ux 2026-10-24 07:53:35 -05:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
k8s-services/rgxr!28
No description provided.