Render List<String> as raw paths in SVG and Vello mode instead of ever becoming List<Vector>#4141
Conversation
cfdd328 to
2f9fd96
Compare
|
@Annonnymmousss I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
Code Review
This pull request implements text rendering support by introducing a Text variant to the Graphic enum and providing rendering implementations for SVG and Vello using the parley and skrifa crates. The changes involve updating the node graph runtime to handle font registration, defining new font attributes, and extending the Render and BoundingBox traits. Feedback from the review recommends removing the unused available_fonts field from RenderParams, simplifying font registration using parley's Blob::from_bytes, and refactoring the text layout logic into a shared helper to eliminate code duplication between the SVG and Vello rendering paths.
There was a problem hiding this comment.
3 issues found across 12 files
Confidence score: 3/5
- There is concrete user-facing regression risk in text rendering:
node-graph/libraries/rendering/src/renderer.rsis reported to miss group opacity/blend-mode compositing in Vello, which can visibly darken overlapping glyphs and ignore expected blending/opacity behavior. - Interaction correctness is also at risk in
node-graph/libraries/rendering/src/renderer.rsbecause hit-testing uses a fixed rectangle (font_size * 6.×font_size) instead of real text bounds, which can break clicking and selection. node-graph/libraries/graphic-types/src/graphic.rsreturningRenderBoundingBox::NoneforGraphic::Textadds medium risk, since that value is treated as "skip this element" in list bound computation and may cause text to be excluded from bounds-related logic.- Pay close attention to
node-graph/libraries/rendering/src/renderer.rsandnode-graph/libraries/graphic-types/src/graphic.rs- text visual compositing, hit-testing, and bounding behavior may regress user-visible editor behavior.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="node-graph/libraries/graphic-types/src/graphic.rs">
<violation number="1" location="node-graph/libraries/graphic-types/src/graphic.rs:377">
P2: `Graphic::Text` returns `RenderBoundingBox::None` for both `bounding_box` and `thumbnail_bounding_box`, but it represents renderable path content. `RenderBoundingBox::None` means "skip this element" in list bound computation, which will cause culling, thumbnail, and hit-testing issues for text/path-only groups.</violation>
</file>
<file name="node-graph/libraries/rendering/src/renderer.rs">
<violation number="1" location="node-graph/libraries/rendering/src/renderer.rs:2286">
P1: Vello text rendering missing group opacity/blend-mode compositing: overlapping glyphs double-darken, blend modes ignored, and outline mode ignores opacity</violation>
<violation number="2" location="node-graph/libraries/rendering/src/renderer.rs:2363">
P1: Text click targets use a fixed-size rectangle (`font_size * 6.` × `font_size`) that doesn't match actual text dimensions, breaking hit-testing and selection.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
There was a problem hiding this comment.
1 issue found across 12 files
Confidence score: 3/5
- There is a concrete performance risk in
node-graph/nodes/text/src/font_cache.rs:iter_fontscopies full font bytes into a newArc<[u8]>on each call, which can add avoidable CPU and memory pressure during rendering. - Given the high confidence (9/10) and medium-high severity (7/10), this is more than a cosmetic issue and could regress responsiveness in text-heavy workloads.
- Pay close attention to
node-graph/nodes/text/src/font_cache.rs- repeated per-call font byte cloning initer_fontsmay degrade render performance.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="node-graph/nodes/text/src/font_cache.rs">
<violation number="1" location="node-graph/nodes/text/src/font_cache.rs:138">
P1: `iter_fonts` allocates and copies full font bytes into a new `Arc<[u8]>` for every font on every call, causing unnecessary memory/CPU overhead during rendering.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
|
@Annonnymmousss I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
5 issues found across 12 files
Confidence score: 3/5
- There is concrete regression risk in
node-graph/libraries/graphic-types/src/graphic.rs:IntoGraphicList for List<String>not propagatingATTR_EDITOR_LAYER_PATHcan cause flattened graphics to lose intended inner layer paths and get overwritten by empty defaults. node-graph/libraries/rendering/src/renderer.rshas two medium-high concerns: pointer-address-based font registration IDs can become stale/collide when font data changes, and infinite text layer bounds for opacity/blend may produce incorrect compositing or performance issues.- Given multiple issues at severity 6-7 with high confidence, this looks mergeable with caution but not low-risk until the rendering and layer-path behaviors are addressed.
- Pay close attention to
node-graph/libraries/graphic-types/src/graphic.rs,node-graph/libraries/rendering/src/renderer.rs,editor/src/node_graph_executor/runtime.rs- potential layer-path regressions, font/text rendering correctness, and avoidable per-frame font allocation overhead.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="node-graph/libraries/core-types/src/list.rs">
<violation number="1" location="node-graph/libraries/core-types/src/list.rs:80">
P2: Doc comment claims implicit default `"sans-serif"` for `ATTR_FONT_FAMILY`, but downstream code uses `"Lato"`</violation>
</file>
<file name="editor/src/node_graph_executor/runtime.rs">
<violation number="1" location="editor/src/node_graph_executor/runtime.rs:398">
P2: Unnecessary per-frame font allocation overhead in `execute_network`</violation>
</file>
<file name="node-graph/libraries/graphic-types/src/graphic.rs">
<violation number="1" location="node-graph/libraries/graphic-types/src/graphic.rs:277">
P1: `IntoGraphicList for List<String>` should propagate `ATTR_EDITOR_LAYER_PATH` like `List<Vector>` does to prevent flattening from overwriting inner layer paths with empty defaults</violation>
</file>
<file name="node-graph/libraries/rendering/src/renderer.rs">
<violation number="1" location="node-graph/libraries/rendering/src/renderer.rs:55">
P1: Font registration tracking uses raw pointer addresses as stable IDs without clearing the registry when fonts change, risking both missed registrations (if allocator reuses a dropped address for different font bytes) and unbounded memory growth (if same fonts are re-registered via new allocations).</violation>
<violation number="2" location="node-graph/libraries/rendering/src/renderer.rs:2298">
P2: Vello text rendering uses an infinite layer bounds rect for opacity/blend layers instead of finite bounds</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Re-trigger cubic
Currently :


Now:
Screen.Recording.2026-05-13.at.3.01.06.AM.mov