Skip to content
This repository was archived by the owner on Sep 28, 2026. It is now read-only.

fix: Add formatLabel function to format category labels in filter component - #714

Merged
Roopan-Microsoft merged 2 commits into
devfrom
bugfix/filter
Sep 10, 2026
Merged

Roopan-Microsoft merged 2 commits into
devfrom
bugfix/filter

Conversation

@Ayaz-Microsoft

Copy link
Copy Markdown
Contributor

Purpose

Fix UI bugs related to filter name

Does this introduce a breaking change?

  • Yes
  • No

Golden Path Validation

  • I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

Deployment Validation

  • I have validated the deployment process successfully and all services are running as expected with this change.

What to Check

Verify that the following are valid

  • ...

Other Information

Copilot AI 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.

🟡 Changes recommended

Acronym-safe formatting and bounded category rendering are still needed.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Updates the filter component to make category labels more readable and display all available categories.

Changes:

  • Adds formatLabel for camelCase and underscore-separated labels.
  • Removes the 10-category rendering cap.

Review notes: Acronyms must remain intact, and category rendering should remain bounded to prevent an expensive unbounded filter panel.

File summaries
File Summary
App/frontend-app/src/components/filter/filter.tsx Formats category labels and expands category rendering.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread App/frontend-app/src/components/filter/filter.tsx Outdated
Comment thread App/frontend-app/src/components/filter/filter.tsx
Copilot AI review requested due to automatic review settings September 10, 2026 04:05

Copilot AI 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.

🔵 Needs a closer look

Address the category rendering bound and disambiguate colliding labels.

Review details

Suppressed comments (2)

App/frontend-app/src/components/filter/filter.tsx:155

  • Removing the slice removes the only UI-side bound on categories, but keywordFilterInfo is built by merging keyword keys from every document without a global category cap (DataCacheManager.cs:40-65). As the corpus grows this renders every category and all of its keywords in one accordion, creating an unnecessarily large DOM and potentially making the filter panel unusable; retain a bound or add virtualization/pagination instead of removing it for label formatting.
                    {keywordFilterInfo && Object.entries(keywordFilterInfo).map(([category, keywords], index) => (

App/frontend-app/src/components/filter/filter.tsx:157

  • The display normalization can collapse distinct raw category keys: for example, DocumentType and Document_Type both render as Document Type, while selection and query serialization still use the original keys. Since category keys come from generated metadata and are not normalized upstream, duplicate headers can make it impossible to tell which category a checkbox belongs to. Please disambiguate colliding labels or normalize/merge the keys before rendering.
                            <AccordionHeader inline>{formatLabel(category)}</AccordionHeader>
  • Files reviewed: 1/1 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@Roopan-Microsoft
Roopan-Microsoft merged commit b45de60 into dev Sep 10, 2026
6 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants