feat(review): add focused thread highlight and headerSlot to ThreadList

- FOCUSED_BG and FOCUSED_BORDER tokens in feedbackStyles
- headerSlot prop for draft pin comment input above thread list
- focusedThreadId prop highlights active thread row with accent border
- ThreadListItem gains focused prop with left border + subtle background
This commit is contained in:
Hiren Kangad
2026-03-12 22:09:12 +05:30
parent 9bd2810f5a
commit a1efdedb2a
3 changed files with 20 additions and 3 deletions
@@ -10,15 +10,18 @@ import {
STATUS_RESOLVED,
BORDER,
HOVER_BG,
FOCUSED_BG,
ACCENT,
} from './feedbackStyles';
interface ThreadListItemProps {
thread: Thread;
pinNumber: number;
onClick: () => void;
focused?: boolean;
}
export default function ThreadListItem({ thread, pinNumber, onClick }: ThreadListItemProps) {
export default function ThreadListItem({ thread, pinNumber, onClick, focused }: ThreadListItemProps) {
const firstComment = thread.comments[0];
const isResolved = thread.status === 'resolved';
@@ -30,9 +33,11 @@ export default function ThreadListItem({ thread, pinNumber, onClick }: ThreadLis
borderBottom: `1px solid ${BORDER}`,
cursor: 'pointer',
transition: 'background 0.1s ease',
background: focused ? FOCUSED_BG : 'transparent',
borderLeft: focused ? `2px solid ${ACCENT}` : '2px solid transparent',
}}
onMouseEnter={(e) => (e.currentTarget.style.background = HOVER_BG)}
onMouseLeave={(e) => (e.currentTarget.style.background = 'transparent')}
onMouseEnter={(e) => { if (!focused) e.currentTarget.style.background = HOVER_BG; }}
onMouseLeave={(e) => { if (!focused) e.currentTarget.style.background = 'transparent'; }}
>
{/* Row 1: author circle + name + timestamp */}
<div style={{ display: 'flex', alignItems: 'center', gap: '8px', marginBottom: '6px' }}>