Skip to content

fix(tables): stop remote cell selections painting over the row gutter - #6310

Merged
waleedlatif1 merged 3 commits into
stagingfrom
worktree-tables-realtime-selection-gutter
Aug 6, 2026
Merged

fix(tables): stop remote cell selections painting over the row gutter#6310
waleedlatif1 merged 3 commits into
stagingfrom
worktree-tables-realtime-selection-gutter

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Remote collaborators' cell selections painted on top of the sticky row gutter and pinned columns whenever the marked cell was scrolled behind them — the overlay sat at z-[8], above the z-[6] opaque frozen cells
  • Split the overlay into two layers: ordinary-column selections at z-[5] (below the frozen cells, so paint order hides them, exactly like the local selection already does), and wholly-pinned ones at z-[8] (above, or the pinned cell's own background swallows them)
  • Pinned-ness is read per-cell from a new data-pinned attribute; a range straddling the boundary defers to the frozen zone rather than bleeding over the gutter
  • Hover hit-test and the peer name label now exclude the frozen zone too
  • Fixes both the table view and the mothership panel — one grid serves both

Type of Change

  • Bug fix

Testing

Typecheck, lint, and the tables test suite pass. Not yet verified in-browser — reproducing needs two live clients.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/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)

@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 6, 2026 4:41am

Request Review

@cursor

cursor Bot commented Aug 6, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
UI-only presence overlay and z-index layering in the table grid; no auth, data, or API changes.

Overview
Fixes remote collaborator selection highlights bleeding over the sticky row gutter and pinned columns when scrolled content sits behind the frozen left zone.

data-pinned on cells marks frozen columns so RemoteSelectionOverlay can tell pinned vs scrolling endpoints (with a column-level DOM fallback when rows are virtualized off-window). Ranges that straddle the frozen boundary are treated as unpinned so they don’t paint over the gutter.

Two overlay layers replace a single z-[8] stack: scrolling selections at z-[5] (below opaque frozen cells at z-[6], matching local selection paint order) and wholly-pinned selections at z-[8] so they stay visible on pinned cells. table-grid passes stickyLeftWidth (pinnedStickyLeftEdge) so hover hit-testing and peer name labels ignore the frozen zone and clamp label position.

Reviewed by Cursor Bugbot for commit 1bfc501. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR fixes remote table-selection overlays painting over the frozen row gutter and pinned columns.

  • Marks rendered pinned cells for endpoint classification.
  • Splits remote selections into scrolling and frozen z-index layers.
  • Excludes the frozen zone from hover hit-testing and clamps collaborator labels outside it.
  • Applies the frozen-zone width supplied by the shared table grid.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains; the current endpoint classification requires both endpoints to resolve as pinned, with unresolved cases falling to the occluded scrolling layer.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/remote-selection-overlay.tsx Classifies both endpoints with a rendered-column fallback, separates frozen and scrolling overlays, and updates hover and label boundaries; the previously reported partial-virtualization misclassification is fixed.
apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/data-row.tsx Exposes each rendered cell’s pinned state through a data attribute used by overlay classification.
apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/table-grid.tsx Passes the computed frozen-zone edge to the remote-selection overlay.
apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/constants.ts Documents the frozen checkbox cell’s z-index relationship with the overlay layers.

Reviews (3): Last reviewed commit: "fix(tables): classify an off-window sele..." | Re-trigger Greptile

@waleedlatif1
waleedlatif1 force-pushed the worktree-tables-realtime-selection-gutter branch from fed4689 to f6826ef Compare August 6, 2026 04:20
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit f6826ef. Configure here.

@waleedlatif1
waleedlatif1 force-pushed the worktree-tables-realtime-selection-gutter branch from f6826ef to 1bfc501 Compare August 6, 2026 04:41
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

Pushed 1bfc501 — follow-up on the P1 fix. Requiring both endpoints to resolve was too blunt: rows are virtualized (@tanstack/react-virtual), so a wholly-pinned range whose other endpoint is scrolled out of the window was falling to the scrolling layer and getting occluded by the very pinned column it sits on — visible on staging, hidden after my first fix.

Endpoint classification now falls back to the column when the cell itself isn't rendered, since pinning is a per-column property:

function endpointIsPinned(scrollEl, cell, columnIndex) {
  if (cell !== null) return cell.hasAttribute('data-pinned')
  if (columnIndex === undefined) return false
  return scrollEl.querySelector(`[data-col="${columnIndex}"][data-pinned]`) !== null
}

Full matrix now: both pinned → frozen layer; straddling → scrolling layer (no bleed, your original finding); pinned with an off-window endpoint → frozen layer (visible again); column hidden locally so it can't be classified → scrolling layer (safe direction). The fallback query only runs on the rare unresolved-endpoint path, so the common case costs nothing.

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 1bfc501. Configure here.

@waleedlatif1
waleedlatif1 merged commit 3510b0c into staging Aug 6, 2026
30 checks passed
@waleedlatif1
waleedlatif1 deleted the worktree-tables-realtime-selection-gutter branch August 6, 2026 04:47
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