Skip to content

feat: use dynamic labels for PanelHeader - #1807

Open
ikondrat wants to merge 2 commits into
mainfrom
feature/lig-9585-categorical-metadata-distribution.panelHeader
Open

feat: use dynamic labels for PanelHeader#1807
ikondrat wants to merge 2 commits into
mainfrom
feature/lig-9585-categorical-metadata-distribution.panelHeader

Conversation

@ikondrat

@ikondrat ikondrat commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

What has changed and why?

Changes in PanelHeader component to reuse it for categorical metadata

How has it been tested?

By unit tests, no bracking changes

Did you update CHANGELOG.md?

  • Yes
  • Not needed (internal change)

Summary by CodeRabbit

  • New Features

    • Added customizable category terminology and sorting labels to dataset distribution headers.
    • Updated summary text and accessibility labels to reflect configured terminology.
    • Preserved existing “class/classes” wording and sorting labels as defaults.
  • Bug Fixes

    • Corrected layout spacing behavior when using default distribution settings.

@ikondrat
ikondrat requested a review from a team as a code owner July 30, 2026 13:34
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

PanelHeader now supports customizable category nouns and sort labels, applies them to summary and accessibility text, and adds tests for custom labels and default layout classes.

Changes

Distribution panel label customization

Layer / File(s) Summary
Label customization contract
lightly_studio_view/src/lib/components/DatasetDistributionPanel/PanelHeader/PanelHeader.svelte
Adds optional category noun, plural noun, and sort-label props with defaults matching existing labels.
Label rendering and validation
lightly_studio_view/src/lib/components/DatasetDistributionPanel/PanelHeader/PanelHeader.svelte, lightly_studio_view/src/lib/components/DatasetDistributionPanel/PanelHeader/PanelHeader.test.ts
Uses configurable labels in summary and configure-button text, with tests covering custom wording and default layout classes.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: leonardorosaa

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: making PanelHeader labels dynamic.
Description check ✅ Passed The description matches the required template and includes the change summary, testing, and changelog status.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/lig-9585-categorical-metadata-distribution.panelHeader

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.

@ikondrat

Copy link
Copy Markdown
Contributor Author

/review

@lightly-fast-track-bot

Copy link
Copy Markdown

❌  Fast Track: checks did not pass

Guardrail Result Message
dummy Always passes.
frontend/complexity 2 file(s) checked, no violations.
backend/complexity 0 file(s) checked.
backend/coverage 0 file(s) checked.
diff-size PR adds 39 line(s) (limit: 215).
frontend/coverage [FAIL] lightly_studio_view/src/lib/components/DatasetDistributionPanel/PanelHeader/PanelHeader.svelte: coverage data not found

View the guardrail run

To run the guardrails locally, from fast_track/ run make install once, then make run-guardrails (or GUARDRAILS=<name1>,<name2> make run-guardrails for some guardrails).

Reflects 174052a.

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

🧹 Nitpick comments (1)
lightly_studio_view/src/lib/components/DatasetDistributionPanel/PanelHeader/PanelHeader.test.ts (1)

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

Cover the custom singular noun.

This test renders five categories, so it only exercises categoryNounPlural; categoryNoun is selected only when classCount === 1. Add a one-category assertion using categoryNoun: 'value' to catch regressions in the singular branch.

🤖 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
`@lightly_studio_view/src/lib/components/DatasetDistributionPanel/PanelHeader/PanelHeader.test.ts`
around lines 47 - 60, Add coverage for the singular category wording in the
PanelHeader tests by rendering or configuring a one-category case with
categoryNoun set to “value” and asserting the displayed text uses the singular
noun. Keep the existing five-category plural assertion unchanged.
🤖 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
`@lightly_studio_view/src/lib/components/DatasetDistributionPanel/PanelHeader/PanelHeader.test.ts`:
- Around line 47-60: Add coverage for the singular category wording in the
PanelHeader tests by rendering or configuring a one-category case with
categoryNoun set to “value” and asserting the displayed text uses the singular
noun. Keep the existing five-category plural assertion unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e86f6b1a-cc45-45f6-b282-113a960f3b20

📥 Commits

Reviewing files that changed from the base of the PR and between e9fc539 and 174052a.

📒 Files selected for processing (2)
  • lightly_studio_view/src/lib/components/DatasetDistributionPanel/PanelHeader/PanelHeader.svelte
  • lightly_studio_view/src/lib/components/DatasetDistributionPanel/PanelHeader/PanelHeader.test.ts

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.

2 participants