Skip to content

[web-console] Sort metrics lexicographically inside each block#6474

Open
Karakatiza666 wants to merge 1 commit into
mainfrom
issue6406
Open

[web-console] Sort metrics lexicographically inside each block#6474
Karakatiza666 wants to merge 1 commit into
mainfrom
issue6406

Conversation

@Karakatiza666

Copy link
Copy Markdown
Contributor

Added sorting of each block's entries by their displayed label with a locale-aware, natural-number-aware comparison so e.g. slot 2 precedes slot 10.

Testing: manual, added unit tests

Fix #6406

Closes #6406. The metrics tab grouped metrics by category but listed them in
discovery order, forcing readers to scan an entire block to find a specific
metric. Sort each block's entries by their displayed label with a locale-aware,
natural-number-aware collator so e.g. `slot 2` precedes `slot 10`.

Adds a vitest setup to profiler-layout (jsdom environment, since profiler-lib's
main entry pulls in cytoscape modules that touch `window`) and unit tests
covering the alphabetisation and the natural-number ordering case.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@Karakatiza666 Karakatiza666 requested a review from mihaibudiu June 15, 2026 13:28

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

LGTM.

"@tailwindcss/vite": "^4.1.17",
"@vitest/browser-playwright": "^4.1.8",
"feldera-theme": "workspace:*",
"jsdom": "^29.1.1",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nit: jsdom is added to devDependencies, but vitest.config.ts already runs in real Chromium via @vitest/browser-playwright and this test only exercises pure logic. Is jsdom actually required by something, or can this dep be dropped?


function makeAttrs(metrics: string[]): NodeAttributes {
return {
title: 'n op',

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 cannot guess what this is

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[profiler-ui] Metrics are not sorted

3 participants