fix: Add formatLabel function to format category labels in filter component - #714
Conversation
There was a problem hiding this comment.
🟡 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
formatLabelfor 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.
There was a problem hiding this comment.
🔵 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
keywordFilterInfois 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,
DocumentTypeandDocument_Typeboth render asDocument 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
Purpose
Fix UI bugs related to filter name
Does this introduce a breaking change?
Golden Path Validation
Deployment Validation
What to Check
Verify that the following are valid
Other Information