feat(viewer): add review comment tag filters - #779
Conversation
|
🔍 OpenCodeReview found 2 issue(s) in this PR.
|
| {{if .Medium}}<span class="severity-badge severity-medium">Medium: {{.Medium}}</span>{{end}} | ||
| {{if .Low}}<span class="severity-badge severity-low">Low: {{.Low}}</span>{{end}} | ||
| <div class="comment-filter-bar severity-filters" aria-label="Filter comments by severity"> | ||
| <button type="button" class="comment-filter-chip filter-all is-active" data-filter-kind="all" data-filter-value="" aria-pressed="true">All: {{len $.Session.Comments}}</button> |
There was a problem hiding this comment.
[maintainability · low]
The "All" button only appears in the severity filter bar. If the severity filter bar happens to be hidden (e.g., in a future refactor) or if a user is focused on the category bar, the only way to reset from a category filter is to click the already-active category chip again. Consider adding an "All" chip to the category filter bar as well for consistency and discoverability, or alternatively moving the "All" button outside both {{with}} blocks so it's always visible.
Use the same empty-string fallback when updating filter-chip active state as when handling clicks, preventing filters without a value attribute from appearing inactive after selection. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
Nice feature — the filter chips feel clean and the severity normalization is a solid catch. A couple of small things I noticed:
Neither is blocking — just some polish. Thanks for the work here! |
Done |
|
Thanks for adding the category let activeKind = 'all';
function cardMatches(card){
if (activeKind === 'all') return true;
return card.dataset[activeKind] === activeValue; // only ever one dimension at a time
}A few consequences of that:
I think the cleaner model is two independent dimensions AND-ed together, each row with its own let activeSeverity = 'all';
let activeCategory = 'all';
function cardMatches(card){
return (activeSeverity === 'all' || card.dataset.severity === activeSeverity)
&& (activeCategory === 'all' || card.dataset.category === activeCategory);
}That makes each One small thing on top: it'd help to prefix each row with a little header label ( Not blocking, but I think it'd make the interaction feel a lot more predictable. Thanks again! |
|
One more small visual nit on the filter chips: the active state currently stacks two selection indicators, which reads as a double ring. .comment-filter-chip.is-active {
border-color: currentColor; /* ring #1: border at the edge */
box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px currentColor; /* ring #2: a surface-colored gap, then a colored outer ring */
}The first Collapsing it to a single ring looks a lot cleaner: .comment-filter-chip.is-active {
border-color: transparent;
box-shadow: 0 0 0 2px currentColor;
}I tried this locally and it reads much better — one crisp ring, no gap, and no layout shift since the chip already reserves a 1px transparent border. Totally optional polish, but figured I'd pass it along. Thanks! |
Description
Adds client-side filtering for review comments in the WebUI Viewer.
Users can now filter comments by severity or category, including Critical, High, Bug, Security, Maintainability, Test, and Other. Nonmatching comments and empty file groups are hidden, with an empty-state message when no comments match.
Type of Change
How Has This Been Tested?
go test ./...go test -race ./internal/viewergo vet ./...node --check internal/viewer/static/session.jsgit diff --checkChecklist
go fmt,go vet)Related Issues
Fixes #778