Skip to content

feat(ui): entities viewer and detail panel - #564

Open
cmatzenbach wants to merge 65 commits into
rapidsai:mainfrom
cmatzenbach:entities-panel
Open

feat(ui): entities viewer and detail panel#564
cmatzenbach wants to merge 65 commits into
rapidsai:mainfrom
cmatzenbach:entities-panel

Conversation

@cmatzenbach

@cmatzenbach cmatzenbach commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Description

This brings in the Entities table originally mocked out by @johanpel, with numerous UI/UX improvements. In addition, it adds an entities detail tab, which can be accessed either by clicking on a row in the entities table or by clicking on an entity in the timeline section.

Entities table changes:

  • Added QueryToolbar to the top of the view, so that current filters can be seen/cleared/etc
  • Revised layout of the dropdowns
  • Improved styling
  • Improved verbiage
  • Fixed default text rendering
  • Added sort options to all columns
  • Added a "Sequence" row, which gives a preview of all the states that particular entity goes through

Entities Detail tab:

  • Fix styling
  • Show total timespan, dominant state (with %), and bar showing % of time spent in each state with tooltip
  • Adds chart showing data consumption/flow per state
  • Colors each state detail section to match up with timelines
  • Adds bar to each state detail section showing how much time was spent in that state

Testing

  1. Open Entities tab, ensure the table works as expected
  2. Click on an entity row, ensure the entity details panel pops up and shows all relevant information
  3. Click on an entity from the timeline view, ensure it is highlighted
  4. Ensure entity details panel pops up after clicking on an entity from timeline
  5. Verify all information is displayed

Screenshots

entities-table.mp4
entity-detail-panel.mp4

johanpel and others added 30 commits July 16, 2026 13:50
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Codex <codex@openai.com>
Auto-load a long-entities Gantt under each leaf resource (injected synthetic
row in QueryResourceTree), filtered by the same getLongEntitiesThreshold cutoff
the timelines use. Remove the entity marks overlay from the resource timelines
(and the now-dead "Hide tasks" toggle / hideTasks atom), and stop requesting
long_fsms in the timeline bulk/single fetches.
Use the shared three-argument builder API after moving elapsed-time normalization earlier in the stack.
Keep the tooltip and row files compliant with the repository copyright hook.
…have same fsm states as timeline; portal tooltip to new re-usable component
@johallar

Copy link
Copy Markdown
Contributor

the fsm capacity chart tooltip overflow is hidden/cutoff, you may need to go the react component route + a portal:
Screenshot 2026-08-11 at 10 34 01 AM

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
ui/packages/@quent/components/src/fsm-chart/FsmCapacityChart.tsx (1)

141-141: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Replace removed series on option updates.

When series shrinks, normal merge retains omitted series. A three-to-one update can leave stale series and tooltip indexes that are absent from the current series array. Add replaceMerge={['series']} and a three-to-one update test.

🤖 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/fsm-chart/FsmCapacityChart.tsx at line
141, Update the chart option configuration near notMerge in FsmCapacityChart to
set replaceMerge for the series collection, ensuring removed series are
discarded during option updates. Add a test covering a three-to-one series
reduction and verify stale series and tooltip indexes are absent afterward.
🟡 Other comments (1)
ui/packages/@quent/utils/src/formatters.ts-262-271 (1)

262-271: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Keep chart values within the safe integer range.

Number(n >> 10n) * 1024 becomes unsafe immediately above Number.MAX_SAFE_INTEGER and rounds the maximum u64 input to 2^64. Use a chart unit that remains within Number.MAX_SAFE_INTEGER, and apply it consistently to the axis formatter and tooltip. Add tests for the threshold and maximum u64 input.

🤖 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/utils/src/formatters.ts around lines 262 - 271, Update
bigintToChartNumber to scale large bigint values using a unit that keeps the
returned number at or below Number.MAX_SAFE_INTEGER, including the maximum u64
input, rather than multiplying shifted values by 1024. Apply the same chart unit
in the axis formatter and tooltip, and add tests covering the safe-range
threshold and maximum u64 conversion.

Source: Path instructions

🧹 Nitpick comments (1)
ui/packages/@quent/components/src/fsm-chart/FsmCapacityChart.tsx (1)

47-51: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Use a collision-free key for resource/stat pairs.

Lines 47-51 use a space-delimited string for dataMap, rawMap, and labelMap. If either identifier contains a space or creates an ambiguous combination, distinct pairs merge into one series and later readings overwrite earlier readings. Use nested maps or a typed composite key. If both values are closed enums, verify that contract and add a test.

As per path instructions, “Avoid sentinel strings that can collide with real identifiers; use typed variants, opaque IDs, or another collision-free representation.”

🤖 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/fsm-chart/FsmCapacityChart.tsx around
lines 47 - 51, Replace the space-delimited key construction in the
FsmCapacityChart dataMap, rawMap, and labelMap initialization with a
collision-free typed composite representation, such as nested maps or a
structured key, so distinct usage.resource/name pairs never merge. Preserve the
existing array initialization and label behavior, and add coverage if the
resource and statistic identifiers are intended to be closed enums.

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/fsm-chart/FsmCapacityChart.tsx:
- Around line 101-113: Update the tooltip formatter in FsmCapacityChart to
HTML-escape the dynamic stateName and each p.seriesName before interpolating
them into the returned markup. Use echarts.format.encodeHTML or the existing
equivalent helper while preserving the tooltip layout and byte formatting.

---

Outside diff comments:
In `@ui/packages/`@quent/components/src/fsm-chart/FsmCapacityChart.tsx:
- Line 141: Update the chart option configuration near notMerge in
FsmCapacityChart to set replaceMerge for the series collection, ensuring removed
series are discarded during option updates. Add a test covering a three-to-one
series reduction and verify stale series and tooltip indexes are absent
afterward.

---

Other comments:
In `@ui/packages/`@quent/utils/src/formatters.ts:
- Around line 262-271: Update bigintToChartNumber to scale large bigint values
using a unit that keeps the returned number at or below Number.MAX_SAFE_INTEGER,
including the maximum u64 input, rather than multiplying shifted values by 1024.
Apply the same chart unit in the axis formatter and tooltip, and add tests
covering the safe-range threshold and maximum u64 conversion.

---

Nitpick comments:
In `@ui/packages/`@quent/components/src/fsm-chart/FsmCapacityChart.tsx:
- Around line 47-51: Replace the space-delimited key construction in the
FsmCapacityChart dataMap, rawMap, and labelMap initialization with a
collision-free typed composite representation, such as nested maps or a
structured key, so distinct usage.resource/name pairs never merge. Preserve the
existing array initialization and label behavior, and add coverage if the
resource and statistic identifiers are intended to be closed enums.
🪄 Autofix

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: 8efed289-5a67-4aec-a7fc-eb1add12dbfd

📥 Commits

Reviewing files that changed from the base of the PR and between 58cf8c9 and db891b6.

📒 Files selected for processing (3)
  • ui/packages/@quent/components/src/fsm-chart/FsmCapacityChart.tsx
  • ui/packages/@quent/utils/src/formatters.ts
  • ui/packages/@quent/utils/src/index.ts

Comment thread ui/packages/@quent/components/src/fsm-chart/FsmCapacityChart.tsx Outdated
Comment thread ui/src/components/entities-table/EntityDetailPanel.tsx
Comment thread ui/src/components/entities-table/EntityResults.tsx Outdated
rapids-bot Bot pushed a commit that referenced this pull request Aug 19, 2026
# Description
This iteration is to improve usability when handling large numbers of entities. 
* Adds expand/collapse controls for long entities swimlanes
* Adds loader and persistent page size for "show more" functionality. Reduces jumpyness by not hiding/showing the button while loading, and keeps page size when Zooming/Panning so swimlanes jump less.
* Update tooltip to truncate after showing a certain number of entities when many are overlapping. Not being able to show all information should be mitigated by the detail panel #564. Future iterations may also add aggregate stats about the entities if too many to show all individually.
* More informative "No Entities" message, shows the threshold being used
* Adds rough setting for long entities threshold (show less <--> show more)

## Related Issues
Fixes: #98 
Relates to: #215 

## Testing
* Simulate a query with many entities and many threads so there are many concurrent entities in the chart. 
`cargo run -p quent-simulator -- --num-query-groups 1 --num-queries 1 --num-workers 2 --num-threads 24 --num-tasks 65536 --exporter collector --collector-address http://localhost:7836`
* Open query and open any resource with entities that have usage on that resource
* Change the entities slider to show more/less entities (changes the long entity threshold in the request)
* Entity rows are expandable/collapsible
* Resource tree virtualization works as expected (opening every resource will not overwhelp the browser), charts render as they scroll into view.

## Screenshots
Demo with an absurd (i think?) amount of entities. Every interaction should be able to handle huge amounts of entities. It can get a little jumpy when there are so many, but the price we pay RN. 

https://github.com/user-attachments/assets/b245bc12-6774-4467-8f30-afe063321313

Authors:
  - Joe O'Hallaron (https://github.com/johallar)

Approvers:
  - Pradeep Garigipati (https://github.com/9prady9)

URL: #569
Comment thread ui/src/components/entities-table/useEntityTable.ts Outdated
const activeFilterCount = activeEntityFilterCount(filters, defaults, operatorId);

return {
activeFilterCount,

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.

nit: I get why this is all one hook, but it's a bulky interface. Consider nesting one level (pagination stuff, filters stuff, query stuff, etc) to keep it a little more readable.

</div>
</div>

{validationErrors.length > 0 && (

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.

Consider using shadcn mechanisms for this, they come with validation stuff: https://ui.shadcn.com/docs/components/base/input#invalid

};
}

// Find data volume from derived attributes (last bytes-stat with a numeric value)

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.

This panel already shows all derived attributes, I think we can remove this specific calculation + section

minUsageS: '',
windowStart: '0',
windowEnd: String(durationS),
sortDir: 'Desc',

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.

nit: re-usable constants better than using these string literals throughout, packaged with the SortableHeader ideally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature request New feature or request 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.

3 participants