Skip to content

Commit 1e35420

Browse files
dnywhclaude
andauthored
fix(design-system): fix last table cell showing independent hover state (supabase#46251)
## What kind of change does this PR introduce? Bug fix. ## What is the current behavior? On pages where the table has horizontal overflow (e.g. Database Tables with its 7 columns), `ShadowScrollArea` unconditionally applies `!bg-surface-200` to `td:last-child` on row hover. Since `TableCell` has `transition-colors`, this gives the last cell an explicit animated background change — making it visually distinct from every other cell, which simply inherit the row's hover bg transparently. This manifests as the last cell appearing to have its own independent hover state, separate from the row hover. ## What is the new behavior? The `!bg-surface-200` override on `td:last-child` is moved inside the `stickyLastColumn` block, since that's the only case where an explicit background is actually needed (sticky cells require a solid bg to avoid showing scrolled content behind them). Non-sticky tables no longer get the spurious cell-level hover. Also reverts the MoreVertical dropdown trigger in `TableList` back to `type="default"` (undoes the workaround from supabase#46247). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Fixed hover styling behavior in horizontally scrollable tables to apply only when appropriate. * **Style** * Updated the visual appearance of the row action dropdown button. <!-- review_stack_entry_start --> [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/supabase/supabase/pull/46251?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent ed90d2a commit 1e35420

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

  • apps/studio/components/interfaces/Database/Tables
  • packages/ui/src/components/ShadowScrollArea

apps/studio/components/interfaces/Database/Tables/TableList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ export const TableList = ({
493493
{!isSchemaLocked && (
494494
<DropdownMenu>
495495
<DropdownMenuTrigger asChild>
496-
<Button type="text" className="px-1" icon={<MoreVertical />} />
496+
<Button type="default" className="px-1" icon={<MoreVertical />} />
497497
</DropdownMenuTrigger>
498498
<DropdownMenuContent side="bottom" align="end" className="w-40">
499499
<DropdownMenuItem

packages/ui/src/components/ShadowScrollArea/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ const ShadowScrollArea = React.forwardRef<HTMLDivElement, ShadowScrollAreaProps>
6060
'[&_tr:hover>*:last-child]:bg-transparent',
6161
'[&_th>*:last-child]:bg-surface-100',
6262
stickyColumnShadow,
63+
hasHorizontalScroll && '[&_tr:hover>td:last-child]:!bg-surface-200',
6364
],
64-
hasHorizontalScroll && '[&_tr:hover>td:last-child]:!bg-surface-200',
6565
canScrollRight &&
6666
'[&_td]:before:opacity-100 [&_tr>*:last-child]:before:opacity-100 [&_th:last-child]:before:opacity-100',
6767
className

0 commit comments

Comments
 (0)