Skip to content

feat(viewer): add review comment tag filters - #779

Open
amh1k wants to merge 2 commits into
alibaba:mainfrom
amh1k:feat/viewer-comment-tag-filters
Open

feat(viewer): add review comment tag filters#779
amh1k wants to merge 2 commits into
alibaba:mainfrom
amh1k:feat/viewer-comment-tag-filters

Conversation

@amh1k

@amh1k amh1k commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

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

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Refactoring (no functional changes)
  • Documentation update
  • CI / Build / Tooling

How Has This Been Tested?

  • go test ./...
  • go test -race ./internal/viewer
  • go vet ./...
  • node --check internal/viewer/static/session.js
  • git diff --check
  • Manual testing with a temporary session containing categorized review comments

Checklist

  • My code follows the project's coding style (go fmt, go vet)
  • I have performed a self-review of the code
  • I have added tests that prove this feature works
  • New and existing unit tests pass locally
  • I have updated the documentation accordingly (not required for this UI-only change)
  • I have signed the CLA

Related Issues

Fixes #778

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

🔍 OpenCodeReview found 2 issue(s) in this PR.

  • ✅ Successfully posted inline: 2 comment(s)

Comment thread internal/viewer/static/session.js Outdated
{{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>

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.

[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>
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.

Suggestion: viewer: Filter comments by tags

1 participant