fix(ui): pass through y-axis labels to timelines - #408
Conversation
johanpel
left a comment
There was a problem hiding this comment.
Could we pass ResourceTypeDecl into ResourceTimeline and derive the label from its capacity/quantity metadata?
|
One design nit: i'm a little worried about covering more of the timeline data, I can see the argument for having this as close to the data as possible but I want to consider having this in the "Resource" column |
Yes, went ahead and made that change. It's good as well to give the component access to richer metadata without the caller having to extract properties first. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: QUIET Plan: Enterprise Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughTimeline construction now consumes ChangesTimeline and resource metadata
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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/lib/timeline.utils.ts:
- Around line 75-83: Update deriveCapacityLabel to derive its label from all
capacities emitted by buildBinnedTimelineSeries rather than always selecting
resourceTypeDecl.capacities[0]. Ensure the returned label represents the
aggregate metric plotted by the timeline, while preserving the undefined
behavior for missing or unit-only capacities and the existing quantity-spec
symbol formatting.
In `@ui/src/components/QueryResourceTree.tsx`:
- Around line 223-238: Update the metric-label derivation in QueryResourceTree’s
row rendering so resourceTypeDecl is resolved from the row’s resource type
before deriving availableFsmTypes, matching UsageColumn’s leaf-resource metadata
behavior. Use the active selected FSM as the fallback label when multiple FSMs
are available, while preserving the existing single-FSM “(count)” label and
capacity-label precedence.
🪄 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: 3c2ce1dc-0e25-43de-8c98-f909466bad7a
📒 Files selected for processing (9)
ui/packages/@quent/components/src/index.tsui/packages/@quent/components/src/lib/timeline.utils.tsui/packages/@quent/components/src/resource-tree/ResourceColumn.tsxui/packages/@quent/components/src/resource-tree/ResourceGroupRow.tsxui/packages/@quent/components/src/resource-tree/ResourceRow.tsxui/packages/@quent/components/src/resource-tree/UsageColumn.tsxui/packages/@quent/components/src/timeline/ResourceTimeline.tsxui/packages/@quent/components/src/timeline/Timeline.tsxui/src/components/QueryResourceTree.tsx
There was a problem hiding this comment.
Note
Quiet mode is enabled, so only the most important comments were posted inline. Other review comments are grouped below.
🟠 Other critical/major comments (1)
ui/packages/@quent/components/src/lib/timeline.utils.ts-153-160 (1)
153-160:⚠️ Potential issue | 🟠 MajorStill labels only the first capacity.
buildBinnedTimelineSeriescan emit multiple capacity series, and the visible maximum sums them, butyAxisLabeldescribes onlycapacities[0]. Multi-capacity timelines can therefore display a misleading metric name or unit. Derive the label from all plotted capacities or enforce a single-capacity invariant.🤖 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/lib/timeline.utils.ts around lines 153 - 160, Update buildBinnedTimelineSeries so yAxisLabel reflects every capacity represented in the plotted series rather than only resourceTypeDecl?.capacities[0]. Derive a combined label and unit from all capacities, or explicitly enforce that only one capacity can be plotted; keep the existing undefined behavior when no valid capacity is available.
🤖 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.
Other critical/major comments:
In `@ui/packages/`@quent/components/src/lib/timeline.utils.ts:
- Around line 153-160: Update buildBinnedTimelineSeries so yAxisLabel reflects
every capacity represented in the plotted series rather than only
resourceTypeDecl?.capacities[0]. Derive a combined label and unit from all
capacities, or explicitly enforce that only one capacity can be plotted; keep
the existing undefined behavior when no valid capacity is available.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: QUIET
Plan: Enterprise
Run ID: 028a9ecb-8426-4a5b-a701-6e73fd14c695
📒 Files selected for processing (3)
ui/packages/@quent/components/src/lib/timeline.utils.tsui/packages/@quent/components/src/timeline/ResourceTimeline.tsxui/packages/@quent/components/src/timeline/Timeline.tsx
|
If it's easy - I noticed one thing that becomes a little exaggerated with the new labels: Screen.Recording.2026-07-29.at.1.08.44.PM.movThe "value" box disappears when you scroll all data out of view, and the new request has not completed. It would be better to have that switch to a placeholder value ("-") or something like that to avoid the jumping. |

Description
Previously only network resource timeline rows had units; all other rows just had the axis max with no corresponding label to give the user information about what is being measured. This information was already being passed to the front end as a prop to
ResourceTimeline; thus, we just need to unpack and display it for the other timeline rows. A couple other fixes found while testing:fsmTypeNamein these cases7, while the user could see peak areas measuring greater than7. UseMath.ceilto ensure we are rounding up and encompassing all data within the timeline.computeVisibleMaxValuethe condition was checking whether a bin's timestamp (starting point) fell within the zoom window, however we should be checking whether the bin overlaps with the zoom window, and include it if so.Related Issues
Closes #395
Testing
Screenshots