Skip to content

fix(ui): create map and pass down for legend formatter - #527

Merged
rapids-bot[bot] merged 6 commits into
rapidsai:mainfrom
cmatzenbach:legend-formatting-fix
Aug 4, 2026
Merged

fix(ui): create map and pass down for legend formatter#527
rapids-bot[bot] merged 6 commits into
rapidsai:mainfrom
cmatzenbach:legend-formatting-fix

Conversation

@cmatzenbach

Copy link
Copy Markdown
Contributor

Quickfix follow-up to PR #471 - creates statQuantitySpecs map and passes down to legend for formatting

@cmatzenbach
cmatzenbach requested a review from johallar as a code owner August 3, 2026 18:24
@cmatzenbach cmatzenbach added bug Something isn't working non-breaking Introduces a non-breaking change ui Pertains to the UI labels Aug 3, 2026
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: QUIET

Plan: Enterprise

Run ID: 3b63f1bb-ffed-4b18-9417-fc90ebbde657

📥 Commits

Reviewing files that changed from the base of the PR and between 55f3975 and f63b28c.

⛔ Files ignored due to path filters (2)
  • pixi.lock is excluded by !**/*.lock, !pixi.lock
  • ui/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml, !ui/pnpm-lock.yaml
📒 Files selected for processing (2)
  • pixi.toml
  • ui/package.json

📝 Walkthrough

Walkthrough

DAG charts now pass quantity specifications to legends. Continuous node and edge legends use quantity-aware formatting with field-based fallback. The workspace and UI package metadata now require pnpm 11.19.0 or newer.

Changes

Quantity-aware DAG legends

Layer / File(s) Summary
Quantity metadata wiring
ui/packages/@quent/components/src/dag/DAGChart.tsx
DAGChart builds a statistic-to-quantity-specification mapping and passes it to DAGLegend.
Legend formatter resolution
ui/packages/@quent/components/src/dag/DAGLegend.tsx, ui/src/components/DataFlowOverlay.test.tsx
DAGLegend applies Occupancy quantity formatters to matching continuous legends and retains field-based formatting as a fallback. The test fixture supplies the new prop.

pnpm version updates

Layer / File(s) Summary
pnpm version constraint
pixi.toml, ui/package.json
Workspace and UI package metadata now require pnpm 11.19.0 or newer.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • rapidsai/quent#393: Directly modifies the DAG chart and legend components used by this change.
  • rapidsai/quent#394: Extends shared numeric formatting used by DAG statistic display paths.
  • rapidsai/quent#471: Provides quantity metadata consumed by the new legend formatting.

Suggested reviewers: johallar, johanpel, 9prady9

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the main change but omits the required Related Issues, Testing, and Screenshots sections. Add the required template sections and document related issues, testing performed, and screenshots or state why they are not applicable.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes creating and passing the statistic-to-quantity-spec map for legend formatting.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Note

Quiet mode is enabled, so only the most important comments were posted inline. Other review comments are grouped below.

🟡 Other comments (1)
ui/packages/@quent/components/src/dag/DAGChart.tsx-327-332 (1)

327-332: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use own-property-safe lookups for dynamic statistic and quantity keys.

The HashMap<String, ...> fields do not reject prototype names. In DAGChart, stat.key in result drops valid constructor, toString, or __proto__ statistics. data.quantitySpecs[stat.quantity] can also resolve inherited functions as QuantitySpec values. DAGLegend can then pass an inherited value to formatQuantity. Use Map or null-prototype records with own-property checks in both locations.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ui/packages/`@quent/components/src/dag/DAGChart.tsx around lines 327 - 332,
Use own-property-safe lookups for dynamic statistic and quantity keys in
DAGChart.tsx lines 327-332 and DAGLegend.tsx lines 138-139. Update the DAGChart
result/statistic collection and quantitySpecs access to use Map or
null-prototype records with own-property checks, preserving valid keys such as
constructor, toString, and __proto__; ensure DAGLegend no longer passes
inherited values to formatQuantity.
🧹 Nitpick comments (2)
ui/packages/@quent/components/src/dag/DAGChart.tsx (1)

338-338: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Remove the unconditional debug log.

console.log(statQuantitySpecs) runs when the map is recomputed and exposes server-derived metadata in browser consoles. Remove it or use an existing development-only logger.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ui/packages/`@quent/components/src/dag/DAGChart.tsx at line 338, Remove the
unconditional console.log call for statQuantitySpecs from the map recomputation
logic in DAGChart, or replace it with the existing development-only logger if
diagnostic output is still required.
ui/src/components/DataFlowOverlay.test.tsx (1)

461-461: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add coverage for the non-empty quantity-spec path.

statQuantitySpecs={{}} exercises only the fallback path. It cannot detect an incorrect field-to-spec match or broken quantity formatting. Add a case with a canonical QuantitySpec, a matching custom-stat field, and an unknown field to verify both the override and inferred fallback.

As per path instructions, tests must cover observable behavior, fallback/unknown inputs, and canonical production or generated types for fixtures.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ui/src/components/DataFlowOverlay.test.tsx` at line 461, Extend the DAGLegend
test around the existing isDark={false} case to cover non-empty
statQuantitySpecs using a canonical QuantitySpec fixture, a matching custom-stat
field, and an unknown field. Assert observable quantity formatting for the
matching override and the inferred fallback for the unknown field, using
production or generated types rather than ad hoc fixture shapes.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@ui/packages/`@quent/components/src/dag/DAGLegend.tsx:
- Around line 203-208: Update the DAGLegendProps definition and DAGLegend
component to make statQuantitySpecs optional and default it to an empty object,
while preserving the existing quantity-aware legend behavior when callers
provide specifications. Ensure consumers passing only isDark type-check
successfully.

---

Other comments:
In `@ui/packages/`@quent/components/src/dag/DAGChart.tsx:
- Around line 327-332: Use own-property-safe lookups for dynamic statistic and
quantity keys in DAGChart.tsx lines 327-332 and DAGLegend.tsx lines 138-139.
Update the DAGChart result/statistic collection and quantitySpecs access to use
Map or null-prototype records with own-property checks, preserving valid keys
such as constructor, toString, and __proto__; ensure DAGLegend no longer passes
inherited values to formatQuantity.

---

Nitpick comments:
In `@ui/packages/`@quent/components/src/dag/DAGChart.tsx:
- Line 338: Remove the unconditional console.log call for statQuantitySpecs from
the map recomputation logic in DAGChart, or replace it with the existing
development-only logger if diagnostic output is still required.

In `@ui/src/components/DataFlowOverlay.test.tsx`:
- Line 461: Extend the DAGLegend test around the existing isDark={false} case to
cover non-empty statQuantitySpecs using a canonical QuantitySpec fixture, a
matching custom-stat field, and an unknown field. Assert observable quantity
formatting for the matching override and the inferred fallback for the unknown
field, using production or generated types rather than ad hoc fixture shapes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: QUIET

Plan: Enterprise

Run ID: e9385d65-0477-4f2a-b168-cc52d7619f44

📥 Commits

Reviewing files that changed from the base of the PR and between 153d422 and c0f0d42.

📒 Files selected for processing (3)
  • ui/packages/@quent/components/src/dag/DAGChart.tsx
  • ui/packages/@quent/components/src/dag/DAGLegend.tsx
  • ui/src/components/DataFlowOverlay.test.tsx

Comment thread ui/packages/@quent/components/src/dag/DAGLegend.tsx Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
ui/pnpm-workspace.yaml (1)

35-37: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Store the shared version constraint in catalog:.

Because this is a workspace-wide dependency constraint, add the range to the existing catalog: block and reference it from overrides:

Proposed change
+catalog:
+  brace-expansion: '>=5.0.9'
+
 overrides:
-  brace-expansion: '>=5.0.9'
+  brace-expansion: 'catalog:'

Pnpm supports catalog: references in overrides. (pnpm.io)

As per path instructions, shared dependency versions must live in the top-level catalog: block and use catalog: references.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ui/pnpm-workspace.yaml` around lines 35 - 37, Move the brace-expansion
version range into the existing top-level catalog block, then update the
overrides entry to reference that catalog key with the supported catalog:
syntax. Preserve the same >=5.0.9 constraint and follow the workspace’s existing
catalog naming conventions.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@ui/pnpm-workspace.yaml`:
- Around line 35-37: Move the brace-expansion version range into the existing
top-level catalog block, then update the overrides entry to reference that
catalog key with the supported catalog: syntax. Preserve the same >=5.0.9
constraint and follow the workspace’s existing catalog naming conventions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: QUIET

Plan: Enterprise

Run ID: 4472b74d-68b9-41d7-9658-6d4620f2fce4

📥 Commits

Reviewing files that changed from the base of the PR and between f38a63f and 55f3975.

⛔ Files ignored due to path filters (1)
  • ui/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml, !ui/pnpm-lock.yaml
📒 Files selected for processing (2)
  • ui/packages/@quent/components/src/dag/DAGLegend.tsx
  • ui/pnpm-workspace.yaml

@johallar johallar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the audit failure was fixed in master, try merging that maybe before using the override

@cmatzenbach

Copy link
Copy Markdown
Contributor Author

I think the audit failure was fixed in master, try merging that maybe before using the override

It hasn't been fixed yet, I just tested on latest main and running audit there shows the failure. I think this is the correct fix since the package in question is a transient dependency, but lmk what you think.

@johallar

johallar commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

I think the audit failure was fixed in master, try merging that maybe before using the override

It hasn't been fixed yet, I just tested on latest main and running audit there shows the failure. I think this is the correct fix since the package in question is a transient dependency, but lmk what you think.

Dang this package has come up multiple times then. In any case I think we should prefer updating pnpm-lock.json within the dependencies semver range, instead of the explicit "overrides" section wherever possible.

pnpm update brace-expansion will do it

@cmatzenbach
cmatzenbach requested a review from johallar August 4, 2026 14:22
@cmatzenbach

Copy link
Copy Markdown
Contributor Author

/merge

@rapids-bot
rapids-bot Bot merged commit 0eb0600 into rapidsai:main Aug 4, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working non-breaking Introduces a non-breaking change ui Pertains to the UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants