-
+
{table?.name ?? 'Referenced table'}
From 9b1191e71adb20cf306b019728c0f8a570f0320f Mon Sep 17 00:00:00 2001
From: Justin Blumencranz <96924014+j15z@users.noreply.github.com>
Date: Wed, 26 Aug 2026 10:20:53 -0700
Subject: [PATCH 3/5] revert(tables): keep preview dividers within grid
---
.../components/table-grid/reference-row-preview.test.tsx | 2 --
.../[tableId]/components/table-grid/reference-row-preview.tsx | 2 +-
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/reference-row-preview.test.tsx b/apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/reference-row-preview.test.tsx
index 6e392091e74..758fac2b367 100644
--- a/apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/reference-row-preview.test.tsx
+++ b/apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/reference-row-preview.test.tsx
@@ -112,8 +112,6 @@ describe('ReferenceRowPreview', () => {
expect(container.querySelector('td > div')?.className).toContain(
`h-[${REFERENCE_ROW_PREVIEW_HEIGHT}px]`
)
- expect(container.querySelector('td > div > div')?.className).toContain('border-t')
- expect(container.querySelector('td > div > div')?.className).toContain('border-b')
const subtable = container.querySelector('td table')
expect(subtable?.className).toContain('w-[100cqw]')
expect(subtable?.className).toContain('border-t')
diff --git a/apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/reference-row-preview.tsx b/apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/reference-row-preview.tsx
index ae3dbb530f3..5a84cae3ec6 100644
--- a/apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/reference-row-preview.tsx
+++ b/apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/reference-row-preview.tsx
@@ -122,7 +122,7 @@ export const ReferenceRowPreview = memo(function ReferenceRowPreview({
-
+
{table?.name ?? 'Referenced table'}
From a9482dafab44699e9db13e4aad9dd618427f5f70 Mon Sep 17 00:00:00 2001
From: Justin Blumencranz <96924014+j15z@users.noreply.github.com>
Date: Wed, 26 Aug 2026 10:28:19 -0700
Subject: [PATCH 4/5] fix(tables): contain reference preview within table
---
.../components/table-grid/reference-row-preview.test.tsx | 3 +++
.../components/table-grid/reference-row-preview.tsx | 5 ++++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/reference-row-preview.test.tsx b/apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/reference-row-preview.test.tsx
index 758fac2b367..6674d8ee59e 100644
--- a/apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/reference-row-preview.test.tsx
+++ b/apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/reference-row-preview.test.tsx
@@ -107,6 +107,9 @@ describe('ReferenceRowPreview', () => {
expect(container.textContent).toContain('Acme')
expect(container.textContent).toContain('Enterprise')
expect(container.textContent).not.toContain('Open in sub view')
+ const previewCell = container.querySelector('tbody > tr > td')
+ expect(previewCell?.className).toContain('overflow-clip')
+ expect(previewCell?.className).toContain('border-r')
expect(container.querySelector('td > div')?.className).toContain('sticky left-0')
expect(container.querySelector('td > div')?.className).toContain('w-0')
expect(container.querySelector('td > div')?.className).toContain(
diff --git a/apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/reference-row-preview.tsx b/apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/reference-row-preview.tsx
index 5a84cae3ec6..b8865049331 100644
--- a/apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/reference-row-preview.tsx
+++ b/apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/reference-row-preview.tsx
@@ -120,7 +120,10 @@ export const ReferenceRowPreview = memo(function ReferenceRowPreview({
return (
- |
+ |
From e4d355c9609753e9e97ada74bf55babe9fdfda2a Mon Sep 17 00:00:00 2001
From: Justin Blumencranz <96924014+j15z@users.noreply.github.com>
Date: Wed, 26 Aug 2026 10:37:53 -0700
Subject: [PATCH 5/5] improvement(tables): finish reference preview layout
---
.../table-grid/reference-row-preview.test.tsx | 7 ++++++-
.../table-grid/reference-row-preview.tsx | 19 +++++++++++++++----
2 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/reference-row-preview.test.tsx b/apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/reference-row-preview.test.tsx
index 6674d8ee59e..f4b89af010d 100644
--- a/apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/reference-row-preview.test.tsx
+++ b/apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/reference-row-preview.test.tsx
@@ -107,6 +107,11 @@ describe('ReferenceRowPreview', () => {
expect(container.textContent).toContain('Acme')
expect(container.textContent).toContain('Enterprise')
expect(container.textContent).not.toContain('Open in sub view')
+ const goToTableLink = Array.from(container.querySelectorAll('a')).find(
+ (link) => link.textContent === 'Go to table'
+ )
+ expect(goToTableLink?.getAttribute('href')).toBe('/workspace/workspace-1/tables/table-accounts')
+ expect(goToTableLink?.parentElement?.className).toContain('h-9')
const previewCell = container.querySelector('tbody > tr > td')
expect(previewCell?.className).toContain('overflow-clip')
expect(previewCell?.className).toContain('border-r')
@@ -120,7 +125,7 @@ describe('ReferenceRowPreview', () => {
expect(subtable?.className).toContain('border-t')
expect(subtable?.className).toContain('border-b')
expect(subtable?.querySelectorAll('col')).toHaveLength(3)
- expect(container.querySelector('td > div > div > div:last-child')?.className).toContain(
+ expect(container.querySelector('.overscroll-x-contain')?.className).toContain(
'overscroll-x-contain'
)
expect(container.innerHTML).not.toContain('rounded-md')
diff --git a/apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/reference-row-preview.tsx b/apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/reference-row-preview.tsx
index b8865049331..2ad4e6c9a78 100644
--- a/apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/reference-row-preview.tsx
+++ b/apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/reference-row-preview.tsx
@@ -1,8 +1,10 @@
'use client'
import { memo, type ReactNode, useMemo } from 'react'
+import { buttonVariants } from '@sim/emcn'
import { Loader } from '@sim/emcn/icons'
import { noop } from '@sim/utils/helpers'
+import Link from 'next/link'
import { columnTypeById } from '@/lib/table/column-types'
import { CellContent } from '@/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/cells'
import { ColumnTypeIcon } from '@/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/headers/column-type-icon'
@@ -10,12 +12,12 @@ import { expandToDisplayColumns } from '@/app/workspace/[workspaceId]/tables/[ta
import { useTable, useTableRow } from '@/hooks/queries/tables'
/**
- * Must match the sticky anchor's `h-[184px]` class below because the row
+ * Must match the sticky anchor's `h-[144px]` class below because the row
* virtualizer reserves this exact height. The zero-width anchor stays sticky
* across the full table width, while its `100cqw` child uses TableGrid's
* inline-size query container to cover the visible viewport.
*/
-export const REFERENCE_ROW_PREVIEW_HEIGHT = 184
+export const REFERENCE_ROW_PREVIEW_HEIGHT = 144
const ReferenceIcon = columnTypeById('reference').icon
@@ -124,16 +126,25 @@ export const ReferenceRowPreview = memo(function ReferenceRowPreview({
colSpan={colSpan}
className='overflow-clip border-[var(--border)] border-r border-b bg-[var(--surface-2)] p-0'
>
-
+
{table?.name ?? 'Referenced table'}
-
+
{content}
+
+
+
+ Go to table
+
+
|
| |