Skip to content

FE: categorical distribution config dialog and expanded view - #1737

Open
ikondrat wants to merge 1 commit into
kondrat-lig-9585-frontend-categorical-metadata-bar-chart-filter-ui-8-sp.p11from
kondrat-lig-9585-frontend-categorical-metadata-bar-chart-filter-ui-8-sp.p12
Open

FE: categorical distribution config dialog and expanded view#1737
ikondrat wants to merge 1 commit into
kondrat-lig-9585-frontend-categorical-metadata-bar-chart-filter-ui-8-sp.p11from
kondrat-lig-9585-frontend-categorical-metadata-bar-chart-filter-ui-8-sp.p12

Conversation

@ikondrat

Copy link
Copy Markdown
Contributor

Summary

Stacked on p11.

Wires the config helpers from p11 into the panel and adds an expanded view for categorical bar charts:

  • DatasetDistributionPanel: each categorical group now has a gear icon that opens a DistributionConfigDialog (top-N, sort order, manual value selection); the configured top-N is applied via selectVisibleCounts
  • ExpandDialog: renders the full categorical bar chart at a larger size; mirrors the orientation and config from the panel state
  • PanelHeader: renders the optional expand and config action buttons passed from the panel
  • +layout.svelte: passes the new config and expand handlers down to DatasetDistributionPanel

Test plan

  • make static-checks (frontend) passes
  • npm run test:unit passes (new/updated tests in DatasetDistributionPanel, ExpandDialog, PanelHeader)
  • Manual: click the gear icon on a categorical chart, change top-N to 3, verify only 3 bars are shown; click the expand icon, verify a larger chart opens

Part of LIG-9585.

@ikondrat
ikondrat requested a review from a team as a code owner July 22, 2026 16:11
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: e5ae3873-be44-4f8f-a2ef-840fed9a4ceb

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch kondrat-lig-9585-frontend-categorical-metadata-bar-chart-filter-ui-8-sp.p12

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@lightly-fast-track-bot

lightly-fast-track-bot Bot commented Jul 22, 2026

Copy link
Copy Markdown

❌ Fast Track: checks did not pass

Failed guardrails: frontend/complexity (Guardrail threw: Cannot find module 'eslint'
Require stack:

  • /home/runner/work/lightly-studio/lightly-studio/lightly_studio_view/package.json), diff-size (PR adds 287 line(s), which exceeds the limit of 215.), frontend/coverage ( [FAIL] lightly_studio_view/src/lib/components/DatasetDistributionPanel/DatasetDistributionPanel.svelte: coverage data not found
    [FAIL] lightly_studio_view/src/lib/components/DatasetDistributionPanel/ExpandDialog/ExpandDialog.svelte: coverage data not found
    [FAIL] lightly_studio_view/src/lib/components/DatasetDistributionPanel/PanelHeader/PanelHeader.svelte: coverage data not found
    [FAIL] lightly_studio_view/src/routes/datasets/[dataset_id]/[collection_type]/[collection_id]/+layout.svelte: coverage data not found)
Guardrail Result Message
dummy Always passes.
frontend/complexity Guardrail threw: Cannot find module 'eslint' Require stack: - /home/runner/work/lightly-studio/lightly-studio/lightly_studio_view/package.json
backend/complexity 0 file(s) checked.
backend/coverage 0 file(s) checked.
diff-size PR adds 287 line(s), which exceeds the limit of 215.
frontend/coverage [FAIL] lightly_studio_view/src/lib/components/DatasetDistributionPanel/DatasetDistributionPanel.svelte: coverage data not found [FAIL] lightly_studio_view/src/lib/components/DatasetDistributionPanel/ExpandDialog/ExpandDialog.svelte: coverage data not found [FAIL] lightly_studio_view/src/lib/components/DatasetDistributionPanel/PanelHeader/PanelHeader.svelte: coverage data not found [FAIL] lightly_studio_view/src/routes/datasets/[dataset_id]/[collection_type]/[collection_id]/+layout.svelte: coverage data not found

Reflects 58efaf1.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 20d7d76c15

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +170 to +174
let categoricalConfigs = $state<Record<string, DistributionConfig>>({});
const categoricalConfig = $derived<DistributionConfig>(
activeGroup
? (categoricalConfigs[activeGroup.id] ?? {
...defaultCategoricalConfig,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Extract categorical config out of the panel

This patch adds categorical configuration state directly to DatasetDistributionPanel, which is now 498 lines and mixes source selection, categorical config, header actions, dialogs, and chart rendering. The frontend guidelines ask us to split logical, testable parts, so please move this categorical config/defaulting into a small helper or child component instead of growing the top-level panel further.

AGENTS.md reference: AGENTS.md:L39-L41

Useful? React with 👍 / 👎.

Comment on lines +23 to +28
categoryNoun?: string;
categoryNounPlural?: string;
sortLabels?: Record<DistributionSortOption, string>;
showCountMode?: boolean;
/** Keeps categorical metadata horizontal while reusing the expanded chart. */
fixedOrientation?: DistributionOrientation;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep expanded dialog under the size guideline

Adding the categorical wording/config props here pushes ExpandDialog to 116 lines and makes it handle both generic expansion and categorical-specific presentation. The frontend guideline asks components to stay small and split logical parts, so please extract the categorical-specific props/wiring into a wrapper or helper to keep this dialog focused.

AGENTS.md reference: AGENTS.md:L39-L41

Useful? React with 👍 / 👎.

DatasetDistributionPanel gains per-group config dialogs and an expand
button for categorical bar charts; ExpandDialog mirrors the panel config;
layout wires the new handlers.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ikondrat
ikondrat force-pushed the kondrat-lig-9585-frontend-categorical-metadata-bar-chart-filter-ui-8-sp.p12 branch from 20d7d76 to 58efaf1 Compare July 22, 2026 17:06
@ikondrat
ikondrat force-pushed the kondrat-lig-9585-frontend-categorical-metadata-bar-chart-filter-ui-8-sp.p11 branch from 4ea245b to 0d8fd50 Compare July 22, 2026 17:06
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.

1 participant