Skip to content

feat(tables): preview referenced rows inline - #7106

Open
j15z wants to merge 6 commits into
feat/table-fksfrom
feat/reference-row-preview
Open

feat(tables): preview referenced rows inline#7106
j15z wants to merge 6 commits into
feat/table-fksfrom
feat/reference-row-preview

Conversation

@j15z

@j15z j15z commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

Reference cells display the target table name and open the referenced row inline. Table load fetches only the unique names needed by its Reference columns, and previews wait for their schema and row before appearing, so users do not see placeholder content flash.

  • One bounded name request handles all direct Reference columns instead of issuing one request per column or loading every table in the workspace.
  • If the opened row contains nested Reference columns, one additional batched name request resolves those chip labels before the preview appears.
  • Clicking another Reference cell updates the open preview directly.
  • Reference integrity is preserved through table/workspace copying, cascading archive and restore, row mutations, and bulk table deletion.
  • Explicit bulk table deletion now scans the reference graph once, archives referrers before their targets, and rejects reference cycles that the singular restore flow could not recover.
  • The global Reference flag from feat(tables): add reference columns #7105 disables the chips, queries, and preview UI together.
  • This PR builds on the Reference column foundation in feat(tables): add reference columns #7105.

Performance

Explicit tables deleted Reference-graph scans before Reference-graph scans now
1 2 1
100 101 1

The count is structural: the previous path performed one bulk preflight scan plus one scan per table. The new explicit-table phase shares one locked scan for the full selection.

Type of Change

  • New feature

Testing

  • bun run --cwd apps/sim type-check
  • 5 focused table-name and preview test files: 84 passing tests
  • 3 focused bulk-delete and reference-guard suites: 71 passing tests
  • bunx biome check on the 7 files changed by the delete batching pass
  • bun run lint:check (26 tasks)
  • bun run check:api-validation:strict
  • bun run check:react-query
  • bun run check:audits (45 audits)

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added or updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Post-Deploy Monitoring & Validation

  • No user-visible runtime change is expected while TABLE_REFERENCE_COLUMNS is disabled.
  • After enabling it, watch table-name, table-detail, row-detail, and bulk-delete request error rates and latency during the first 24 hours.
  • Healthy signals: one batched name request per loaded table schema, detail and row requests only after a Reference cell opens, one reference-graph scan per explicit delete selection, and no deadlock or dangling-reference errors.
  • Failure signals: one request per Reference column, repeated fetches, incorrect names, stuck loading states, stale previews, repeated reference scans, deadlock errors, or broken archive/restore behavior. Disable TABLE_REFERENCE_COLUMNS first; roll back feat(tables): preview referenced rows inline #7106 if errors continue.
  • Validation owner: Tables team during the first 24 hours after flag enablement.

@vercel

vercel Bot commented Aug 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 3, 2026 11:43pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds inline previews for referenced table rows, backed by bounded table-name queries and on-demand schema and row loading.

  • Renders reference values as table-name chips that open an inline row preview.
  • Adds batched table-name lookup and reference-preview query support.
  • Preserves reference integrity across copying, archive and restore, row mutation, and bulk deletion.
  • Consolidates bulk-delete reference-graph scanning and rejects unsupported cycles.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/reference-row-preview.tsx Implements the inline referenced-row preview and includes the completed normal-weight header fix.
apps/sim/hooks/queries/tables.ts Adds bounded table-name and on-demand reference-row queries with refresh and local-mutation invalidation behavior consistent with the documented snapshot semantics.
apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/table-grid.tsx Integrates reference-cell expansion and preview state into the virtualized table grid.
apps/sim/lib/table/application/bulk.ts Batches reference-graph handling for explicit table deletion while preserving archive ordering and cycle rejection.
apps/sim/app/api/table/names/route.ts Exposes the authenticated lightweight table-name projection through the standard internal route framework.

Reviews (7): Last reviewed commit: "fix(tables): reject incomplete folder co..." | Re-trigger Greptile

Comment thread apps/sim/hooks/queries/tables.ts

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found and verified against the latest diff

Confidence score: 4/5

  • In cell-render.tsx, double-clicking a reference chip can also trigger the cell’s inline edit mode after opening the preview, creating conflicting interactions; stop dblclick propagation on the chip to match URL cell behavior.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/cells/cell-render.tsx">

<violation number="1" location="apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/cells/cell-render.tsx:409">
P2: Double-clicking a reference chip still bubbles `dblclick` to the cell, so opening the preview can also enter inline edit mode. Stop double-click propagation on the chip, matching the URL cell behavior.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

@j15z
j15z requested a review from a team as a code owner August 29, 2026 05:41
@j15z
j15z force-pushed the feat/reference-row-preview branch from bc7186a to e4ded13 Compare September 2, 2026 07:35
@j15z
j15z force-pushed the feat/reference-row-preview branch from e4ded13 to a3d2126 Compare September 2, 2026 07:38
@j15z
j15z force-pushed the feat/reference-row-preview branch from a3d2126 to 5eef2b1 Compare September 2, 2026 17:30
@j15z
j15z force-pushed the feat/reference-row-preview branch from 5eef2b1 to 2921222 Compare September 2, 2026 17:31
@j15z
j15z force-pushed the feat/reference-row-preview branch from 2921222 to 2deec54 Compare September 2, 2026 18:34
@j15z
j15z force-pushed the feat/reference-row-preview branch from 2deec54 to 1b145fe Compare September 2, 2026 20:57
@j15z
j15z force-pushed the feat/reference-row-preview branch from 1b145fe to b4cbd5e Compare September 2, 2026 21:00
@j15z

j15z commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator Author

@greptile

@j15z

j15z commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@j15z I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 43 files

Re-trigger cubic

Comment thread apps/sim/lib/table/application/bulk.ts
Comment thread apps/sim/lib/folders/config.ts Outdated
Comment thread apps/sim/lib/table/service.ts
Comment thread apps/sim/lib/table/application/bulk.ts
@j15z

j15z commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator Author

@greptile

@j15z

j15z commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@j15z I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 46 files

Confidence score: 2/5

  • In apps/sim/lib/table/application/bulk.ts, bulkDeleteFolders can receive the request order when selected folders reference one another, causing a target folder to fail while its referrer is still active; resolve dependencies before issuing bulk deletions.
  • In apps/sim/lib/folders/orchestration.ts, child-table archive conflicts can be reported as failures after folder rows are already stamped, leaving bulk-delete bookkeeping inconsistent; make the archive operation and failure state atomic or reconcile the recorded result.
  • In apps/sim/lib/table/service.ts, listActiveTableNames still executes its reference query when TABLE_REFERENCE_COLUMNS is disabled, so the feature flag does not fully disable that work; gate the query on the flag.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/sim/lib/table/application/bulk.ts">

<violation number="1" location="apps/sim/lib/table/application/bulk.ts:593">
P1: When selected folders reference each other and the target folder appears first, this branch passes request order to `bulkDeleteFolders`. The target folder fails while its referrer is still active, and the later successful referrer deletion never triggers a retry, leaving the bulk delete partially applied. Order folder cascades by the reference graph or retry folder reference failures after each dependency wave.</violation>
</file>

<file name="apps/sim/lib/folders/orchestration.ts">

<violation number="1" location="apps/sim/lib/folders/orchestration.ts:865">
P1: When child table archiving encounters a lock or reference conflict after the folder rows are stamped, this catch reports failure even though the folder is already archived. In bulk deletes, `bulkDeleteFolders` records that failure without retrying, leaving active tables under an archived folder; roll back the folder stamp or retry the cascade before returning the failure.</violation>
</file>

<file name="apps/sim/lib/table/service.ts">

<violation number="1" location="apps/sim/lib/table/service.ts:388">
P2: When `TABLE_REFERENCE_COLUMNS` is disabled, `listActiveTableNames` still queries and returns referenced table names. Gate this operation before executing the query so the flag disables the name query along with the chips and preview UI.</violation>
</file>

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/lib/table/application/bulk.ts
Comment thread apps/sim/lib/folders/orchestration.ts
Comment thread apps/sim/lib/table/service.ts
@j15z

j15z commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator Author

@greptile

@j15z

j15z commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@j15z I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 47 files

You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/lib/table/service.ts
@j15z

j15z commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator Author

@greptile

@j15z

j15z commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@j15z I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 47 files

You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/lib/folders/config.ts
@j15z

j15z commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator Author

@greptile

@j15z

j15z commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@j15z I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 47 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

Re-trigger cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant