Pin the component library at 9036c92: RaTeX formulas, Mermaid diagrams, pictures from the document's folder

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-12 00:23:04 -04:00
1 parent 4183f729d1
commit 53bcf09b0b
8 files changed
+267 -11

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
FAIL
1. `../Ely-GPUI-Components/src/typography/math.rs:122` — The guarded layout failure logs the entire formula source, violating the rule against logging document content and PRD §18.2. A parseable formula containing confidential text reaches this branch whenever RaTeX layout panics. A fault-injected copy reproduced `latex: RaTeX failed to lay out "\\text{PRIVATESENTINEL}"` in the captured diagnostic log; this verifies the error path, not a naturally panicking input. Remove the source from diagnostics and add a regression asserting that layout failures cannot log document text.
2. `../Ely-GPUI-Components/src/typography/math.rs:141` — Formula assets have no release path; the same problem affects `diagram.rs:116` and `picture.rs:158`. GPUI's application asset cache retains their source keys and decoded images until explicitly removed, and painted images also require atlas cleanup. The exact-source view probe loaded a formula, removed it from the view, and still found its asset cached. Opening and closing distinct documents in one window therefore accumulates resources, contrary to PERF-08. The new gap row documents this defect but does not resolve it. Give these assets a bounded or owner-managed lifetime and release unused cache entries and atlas images; test repeated removal without breaking shared users.
3. `../Ely-GPUI-Components/src/documents/render.rs:356` — Invalid math replaces the original formula with only an error message; asynchronous failures in `typography/math.rs:146` do the same. Additionally, `math.rs:39` and `math.rs:94` discard RaTeX's error location by keeping only `error.message`. For `$$x^2^3$$`, the renderer shows only `Double superscript`, losing both `x^2^3` and the parser's position 3. This violates C14.2 and PRD §14.2. Preserve the source alongside parse/layout/raster errors and retain the available error position; cover the rendered failure state, not just parser rejection.
4. `../Ely-GPUI-Components/src/typography/math.rs:113` — Zero SVG padding clips outlined glyphs that extend beyond RaTeX's layout metrics. The exact-source probe for `\text{私密}` at 16 px produced an SVG viewport height of 19.626667 with glyph ink extending to 21.28897, so rasterization cuts off the characters' bottom strokes. Even `x` extends above and below its viewport. Account for the actual glyph bounds or sufficient padding, include that space in the returned logical size, and test that complete glyphs survive rasterization.
5. `../Ely-GPUI-Components/src/documents/picture.rs:65` — The `file://` branch treats URI components as filename text. `file:///C:/notes/a.png#preview` resolves to `C:/notes/a.png#preview`, so an existing `a.png` fails to load. `file://server/share/a.png` becomes the relative path `server/share/a.png`, potentially reading an unrelated working-directory file instead. Both cases failed exact-source probes. Parse file URLs before converting them to paths: exclude query/fragment components, preserve supported authorities correctly, and explicitly reject unsupported hosts. Add regressions for these cases.
6. `../Ely-GPUI-Components/src/documents/diagram.rs:71` — Assigning only `theme.text_color` does not apply Ely's foreground to ordinary diagram labels. With ink `#eeeeee`, `flowchart LR\n A --> B` emits Mermaid's default `#e0dfdf` and no `#eeeeee`; the exact-source probe failed. This contradicts the last decision's claim that diagram text uses Ely's palette. The existing test named `a_flowchart_draws_with_the_ground_and_ink` checks only the background. Map the foreground to the theme fields actually used by unstyled labels and assert their emitted colors.
+3
View File
@@ -0,0 +1,3 @@
FAIL
1. `../Ely-GPUI-Components/src/primitives/held.rs:14` — Releasing one holder unconditionally evicts the shared asset and removes its image from every window's atlas, although other holders can still display it. The exact-source primitive probe renders two users of one image, with the surviving user inside an `Entity::cached` view. Remove the other user and render the parent again: both the asset and the surviving image's atlas entry become absent, while the cached child still references that image and never reloads it. The single-user control retains both entries. Thus the round-1 resource fix invalidates live cached scenes; the existing shared-formula test masks this by repeatedly refreshing the entire window. Retain shared assets and atlas images until their last holder leaves, and test a cached survivor without forcing its refresh, together with cleanup after the final holder leaves. Evidence: `.work/C14.2-r2-held-probe.log` and `.work/C14.2-r2-held-probe-source.log`. The unmodified library's 1748 tests and `cargo clippy --all-targets --features test-support -- -D warnings` passed.
+5
View File
@@ -0,0 +1,5 @@
FAIL
1. `../Ely-GPUI-Components/src/primitives/held.rs:44` — A departing holder discards its image when another holder remains, but the last holder may still have `image: None`. For example, two windows start loading the same asset; one stays covered while the other receives and paints the result. Remove the painted element, then close the covered window before it redraws: the last release removes the asset but never calls `drop_image`, leaving the first window's atlas entry allocated. The exact-source lifecycle probe seeds that pending-holder state and reproduces `asset=false, atlas=true` after every holder leaves; this is a primitive reproduction, not a native-window visibility test. Retain the loaded image with the shared asset record until the last holder leaves, and cover this release order with an atlas assertion. Evidence: `.work/C14.2-r3-pending-source.log` and `.work/C14.2-r3-pending.log`. Round 2's cached-survivor defect is fixed: its original probe now retains both asset and atlas entries. The library's 1748 tests and `cargo clippy --all-targets --features test-support -- -D warnings` passed.
2. `../Ely-GPUI-Components/src/primitives/held.rs:56` — The newly changed comment contains 11 whitespace-delimited words: "`source` as `A` for element `id`; the previous one let go." Applying the required ten-word comment rule to this revision fails on that line. Shorten it to ten words or fewer. Evidence: `.work/C14.2-r3-checks.log`.