Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions cmd/lrc/static/components/IssuesPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ export async function createIssuesPanel() {
const { html, useState, useEffect, useCallback } = await waitForPreact();

return function IssuesPanel({ files, visible, onNavigate, onClose }) {
// Multi-select filters: Set of active severity types (default: error + warning)
const [activeFilters, setActiveFilters] = useState(new Set(['error', 'warning']));
// Multi-select filters: Set of active severity types (default: critical + error + warning)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot I am confused - so how many levels are expected from the LLM side (check the prompt). Support all the labels/levels supported by the LLM prompt/specification for reviews.

const [activeFilters, setActiveFilters] = useState(new Set(['critical', 'error', 'warning']));
const [selectedIndices, setSelectedIndices] = useState(new Set());
const [copyStatus, setCopyStatus] = useState(null); // null, 'copied', 'error'

Expand Down Expand Up @@ -34,6 +34,7 @@ export async function createIssuesPanel() {
});

// Count issues by severity
const criticalCount = issues.filter(i => (i.severity || '').toLowerCase() === 'critical').length;
const errorCount = issues.filter(i => (i.severity || '').toLowerCase() === 'error').length;
const warningCount = issues.filter(i => (i.severity || '').toLowerCase() === 'warning').length;
const infoCount = issues.filter(i => (i.severity || '').toLowerCase() === 'info').length;
Expand All @@ -45,7 +46,7 @@ export async function createIssuesPanel() {
return activeFilters.has(sev);
}, [activeFilters]);

// Initialize: select all issues matching default filters (error + warning)
// Initialize: select all issues matching default filters (critical + error + warning)
useEffect(() => {
const newSelected = new Set();
issues.forEach((issue, idx) => {
Expand Down Expand Up @@ -151,6 +152,14 @@ export async function createIssuesPanel() {
<div class="issues-header">
<div class="issues-actions">
<div class="severity-filters">
<button
class="severity-filter-btn critical ${activeFilters.has('critical') ? 'active' : ''}"
onClick=${() => toggleFilter('critical')}
title="Toggle critical issues"
>
CRITICAL
<span class="filter-badge">${criticalCount}</span>
</button>
<button
class="severity-filter-btn error ${activeFilters.has('error') ? 'active' : ''}"
onClick=${() => toggleFilter('error')}
Expand Down
2 changes: 2 additions & 0 deletions cmd/lrc/static/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -1095,6 +1095,8 @@ body {

.severity-filter-btn.all { color: var(--accent-blue); }
.severity-filter-btn.all.active { background: rgba(96,165,250,0.15); }
.severity-filter-btn.critical { color: #dc2626; }
.severity-filter-btn.critical.active { background: rgba(220,38,38,0.15); }
.severity-filter-btn.error { color: #ef4444; }
.severity-filter-btn.error.active { background: rgba(239,68,68,0.15); }
.severity-filter-btn.warning { color: #eab308; }
Expand Down
Loading