open-code-review icon indicating copy to clipboard operation
open-code-review copied to clipboard

Viewer redesign: Session detail — Review Comments

Open lizhengfeng101 opened this issue 2 months ago • 1 comments

Part of the viewer UI redesign (see #1319). Depends on #1320, #1321.

Summary

Restyle the Review Comments section: severity/category filter chips, the marked/hidden controls, per-file grouping, and each comment's EXISTING CODE / SUGGESTED CHANGE blocks and Fixed / Ignored / Clear actions.

Design reference

Session detail — light Session detail — dark

"Review Comments (N findings)" with Severity chips (All / Medium / Low …), Category chips (Maintainability / Documentation …), a right-aligned "Hide marked" toggle + "clear all marked" and an "N marked, N hidden" counter. Each finding groups under its file path, shows a category+severity badge, an EXISTING CODE block (with line numbers) and a green SUGGESTED CHANGE block, plus Fixed / Ignored / Clear buttons.

Current state

  • Template: internal/viewer/templates/session.html — .comments-section, .comment-filter-bar, .comment-filter-chip, severity/category chips (~line 113+), EXISTING/SUGGESTED code blocks, mark buttons.
  • Script: internal/viewer/static/session.js (filtering + marked/hidden state; CSP-safe).
  • Template helpers: severityClass, categoryClass, groupCommentsByFile, numberedCodeLines, severity/category counts in server.go.

Scope

  • [ ] Restyle filter chips (active/inactive, counts) for severity and category to match the mockup; keep aria-pressed semantics.
  • [ ] Restyle the marked/hidden toggle + "clear all marked" + counter.
  • [ ] Restyle per-file comment groups, the category/severity badges, and the EXISTING CODE (numbered) vs SUGGESTED CHANGE (accent-green) blocks.
  • [ ] Restyle the Fixed / Ignored / Clear action buttons and their marked state.
  • [ ] Preserve all existing JS behavior (filtering, marking, hide-marked) and CSP safety.

Out of scope

  • Coverage/token cards (#1325), tasks/conversations (#1327).

Acceptance criteria

  • Section matches the mockup in light and dark; filters, marking and hide-marked still work.
  • No CSP console errors; make check and make test pass.

Parallelization & conflicts

Depends on #1320/#1321. Conflict hotspot: #1326 (this one — Review Comments), #1324, #1325 and #1327 all edit session.html, and this issue plus #1327 also touch session.js. Coordinate with the other three — ideally one owner for session.html, or serialize these four — and rebase frequently. static/style.css is shared with all screens too.

AI disclosure: The scope, decisions and issue breakdown are my own. An AI assistant (Claude Code) was used only to polish the English wording.

lizhengfeng101 avatar Sep 16 '26 12:09 lizhengfeng101

I'd like to work on this.

jimpablo avatar Sep 17 '26 15:09 jimpablo