@@ -2,10 +2,10 @@ import { SignalReportPriorityBadge } from "@features/inbox/components/utils/Sign
22import { SignalReportStatusBadge } from "@features/inbox/components/utils/SignalReportStatusBadge" ;
33import { SignalReportSummaryMarkdown } from "@features/inbox/components/utils/SignalReportSummaryMarkdown" ;
44import { SOURCE_PRODUCT_META } from "@features/inbox/components/utils/source-product-icons" ;
5+ import { INBOX_LIST_CHECKBOX_CLASSNAME } from "@features/inbox/utils/inboxConstants" ;
56import { EyeIcon } from "@phosphor-icons/react" ;
67import { Checkbox , Flex , Text , Tooltip } from "@radix-ui/themes" ;
78import type { SignalReport } from "@shared/types" ;
8- import { motion } from "framer-motion" ;
99import type { KeyboardEvent , MouseEvent } from "react" ;
1010
1111interface ReportListRowProps {
@@ -14,7 +14,6 @@ interface ReportListRowProps {
1414 isChecked : boolean ;
1515 onClick : ( ) => void ;
1616 onToggleChecked : ( ) => void ;
17- index : number ;
1817}
1918
2019export function ReportListRow ( {
@@ -23,7 +22,6 @@ export function ReportListRow({
2322 isChecked,
2423 onClick,
2524 onToggleChecked,
26- index,
2725} : ReportListRowProps ) {
2826 const updatedAtLabel = new Date ( report . updated_at ) . toLocaleDateString (
2927 undefined ,
@@ -33,19 +31,6 @@ export function ReportListRow({
3331 } ,
3432 ) ;
3533
36- const isStrongSignal = report . total_weight >= 65 || report . signal_count >= 20 ;
37- const isMediumSignal = report . total_weight >= 30 || report . signal_count >= 6 ;
38- const strengthColor = isStrongSignal
39- ? "var(--green-9)"
40- : isMediumSignal
41- ? "var(--yellow-9)"
42- : "var(--gray-8)" ;
43- const strengthLabel = isStrongSignal
44- ? "strong"
45- : isMediumSignal
46- ? "medium"
47- : "light" ;
48-
4934 const isReady = report . status === "ready" ;
5035
5136 const isInteractiveTarget = ( target : EventTarget | null ) : boolean => {
@@ -67,18 +52,20 @@ export function ReportListRow({
6752 onToggleChecked ( ) ;
6853 } ;
6954
55+ const rowBgClass = isSelected
56+ ? "bg-gray-3"
57+ : isChecked
58+ ? "bg-gray-2"
59+ : report . is_suggested_reviewer
60+ ? "bg-blue-2"
61+ : "" ;
62+
7063 return (
71- < motion . div
64+ // biome-ignore lint/a11y/useSemanticElements: whole row is clickable; nested checkbox cannot live inside <button>
65+ < div
7266 role = "button"
7367 tabIndex = { - 1 }
7468 data-report-id = { report . id }
75- initial = { { opacity : 0 , y : 6 } }
76- animate = { { opacity : 1 , y : 0 } }
77- transition = { {
78- duration : 0.22 ,
79- delay : Math . min ( index * 0.035 , 0.35 ) ,
80- ease : [ 0.22 , 1 , 0.36 , 1 ] ,
81- } }
8269 onMouseDown = { ( e ) => {
8370 e . preventDefault ( ) ;
8471 } }
@@ -96,23 +83,21 @@ export function ReportListRow({
9683 handleToggleChecked ( e ) ;
9784 }
9885 } }
99- className = "w-full cursor-pointer overflow-hidden border-gray-5 border-b py-2 pr-3 pl-2 text-left transition-colors hover:bg-gray-2"
100- style = { {
101- backgroundColor : isSelected
102- ? "var(--gray-3)"
103- : isChecked
104- ? "var(--gray-2)"
105- : report . is_suggested_reviewer
106- ? "var(--blue-2)"
107- : "transparent" ,
108- } }
86+ className = { [
87+ "relative isolate w-full cursor-pointer overflow-hidden border-gray-5 border-b py-2 pr-3 pl-2 text-left" ,
88+ "before:pointer-events-none before:absolute before:inset-0 before:z-[1] before:bg-gray-12 before:opacity-0 hover:before:opacity-[0.07]" ,
89+ rowBgClass ,
90+ ]
91+ . filter ( Boolean )
92+ . join ( " " ) }
10993 >
110- < Flex align = "start" justify = "between" gap = "3" >
94+ < Flex align = "start" justify = "between" gap = "3" className = "relative z-[2]" >
11195 < Flex align = "start" gap = "2" style = { { minWidth : 0 , flex : 1 } } >
11296 < Flex align = "center" justify = "center" className = "shrink-0 pt-0.5" >
11397 < Checkbox
11498 size = "1"
11599 checked = { isChecked }
100+ className = { INBOX_LIST_CHECKBOX_CLASSNAME }
116101 tabIndex = { - 1 }
117102 onMouseDown = { ( e ) => {
118103 e . preventDefault ( ) ;
@@ -129,16 +114,16 @@ export function ReportListRow({
129114 />
130115 </ Flex >
131116
132- < Flex direction = "column" gap = "1 " style = { { minWidth : 0 , flex : 1 } } >
117+ < Flex direction = "column" gap = "0.5 " style = { { minWidth : 0 , flex : 1 } } >
133118 < Flex align = "start" gapX = "2" className = "min-w-0" >
134- < Flex
135- direction = "column"
136- align = "center "
137- gap = "0.5 "
138- className = "shrink-0 pt-1 "
139- >
140- { ( report . source_products ?? [ ] ) . length > 0 ? (
141- ( report . source_products ?? [ ] ) . map ( ( sp ) => {
119+ { ( report . source_products ?? [ ] ) . length > 0 && (
120+ < Flex
121+ direction = "column "
122+ align = "center "
123+ gap = "0.5 "
124+ className = "shrink-0 pt-1"
125+ >
126+ { ( report . source_products ?? [ ] ) . map ( ( sp ) => {
142127 const meta = SOURCE_PRODUCT_META [ sp ] ;
143128 if ( ! meta ) return null ;
144129 const { Icon } = meta ;
@@ -147,16 +132,9 @@ export function ReportListRow({
147132 < Icon size = { 12 } />
148133 </ span >
149134 ) ;
150- } )
151- ) : (
152- < span
153- title = { `Signal strength: ${ strengthLabel } ` }
154- aria-hidden
155- className = "mt-1 inline-block h-1.5 w-1.5 rounded-full"
156- style = { { backgroundColor : strengthColor } }
157- />
158- ) }
159- </ Flex >
135+ } ) }
136+ </ Flex >
137+ ) }
160138
161139 < Flex
162140 align = "center"
@@ -210,6 +188,6 @@ export function ReportListRow({
210188 </ Text >
211189 </ Flex >
212190 </ Flex >
213- </ motion . div >
191+ </ div >
214192 ) ;
215193}
0 commit comments