Skip to content

Commit 50d5680

Browse files
committed
Fix for hover states on different backgrounds & runs table select cell
1 parent ba60cb6 commit 50d5680

File tree

2 files changed

+31
-8
lines changed
  • apps/webapp/app
    • components/primitives
    • routes/resources.orgs.$organizationSlug.projects.v3.$projectParam.runs.$runParam.spans.$spanParam

2 files changed

+31
-8
lines changed

apps/webapp/app/components/primitives/Table.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,13 @@ type TableCellProps = TableCellBasicProps & {
141141
hasAction?: boolean;
142142
isSticky?: boolean;
143143
actionClassName?: string;
144+
rowHoverStyle?: keyof typeof rowHoverStyles;
145+
};
146+
147+
const rowHoverStyles = {
148+
default: "group-hover/table-row:bg-charcoal-800",
149+
dimmed: "group-hover/table-row:bg-charcoal-850",
150+
bright: "group-hover/table-row:bg-charcoal-750",
144151
};
145152

146153
const stickyStyles =
@@ -158,6 +165,7 @@ export const TableCell = forwardRef<HTMLTableCellElement, TableCellProps>(
158165
onClick,
159166
hasAction = false,
160167
isSticky = false,
168+
rowHoverStyle = "default",
161169
},
162170
ref
163171
) => {
@@ -184,12 +192,11 @@ export const TableCell = forwardRef<HTMLTableCellElement, TableCellProps>(
184192
<td
185193
ref={ref}
186194
className={cn(
187-
"text-xs text-charcoal-400",
188-
to || onClick || hasAction
189-
? "cursor-pointer group-hover/table-row:bg-charcoal-800"
190-
: "px-3 py-3 align-middle",
195+
"text-xs text-charcoal-400 transition-colors",
196+
to || onClick || hasAction ? "cursor-pointer" : "px-3 py-3 align-middle",
191197
!to && !onClick && alignmentClassName,
192198
isSticky && stickyStyles,
199+
rowHoverStyles[rowHoverStyle],
193200
className
194201
)}
195202
colSpan={colSpan}

apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.v3.$projectParam.runs.$runParam.spans.$spanParam/route.tsx

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -338,16 +338,32 @@ function SpanBody({
338338
);
339339
return (
340340
<TableRow key={run.friendlyId}>
341-
<TableCell to={path} actionClassName="py-1.5">
341+
<TableCell
342+
to={path}
343+
actionClassName="py-1.5"
344+
rowHoverStyle="bright"
345+
>
342346
{run.number}
343347
</TableCell>
344-
<TableCell to={path} actionClassName="py-1.5">
348+
<TableCell
349+
to={path}
350+
actionClassName="py-1.5"
351+
rowHoverStyle="bright"
352+
>
345353
{run.taskIdentifier}
346354
</TableCell>
347-
<TableCell to={path} actionClassName="py-1.5">
355+
<TableCell
356+
to={path}
357+
actionClassName="py-1.5"
358+
rowHoverStyle="bright"
359+
>
348360
{run.lockedToVersion?.version ?? "–"}
349361
</TableCell>
350-
<TableCell to={path} actionClassName="py-1.5">
362+
<TableCell
363+
to={path}
364+
actionClassName="py-1.5"
365+
rowHoverStyle="bright"
366+
>
351367
<DateTime date={run.createdAt} />
352368
</TableCell>
353369
</TableRow>

0 commit comments

Comments
 (0)