Skip to content

Commit 525c340

Browse files
authored
feat(tables): show live cell-selection carets in the embedded chat panel (#6081)
The table cell-selection presence room was joined only on the dedicated /tables/[id] page (useTableRoom was passed an empty id in embedded mode). Join it in embedded too, so the mothership chat resource panel shows collaborators' live cell selections and broadcasts the local one. tableId is already resolved from props in embedded (the data event stream already uses it un-gated), and authz runs on join, so this is safe. Avatars are unaffected — they render only in the !embedded Resource.Header, so the panel gets carets without avatars.
1 parent caa0a73 commit 525c340

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

  • apps/sim/app/workspace/[workspaceId]/tables/[tableId]

apps/sim/app/workspace/[workspaceId]/tables/[tableId]/table.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,11 @@ export function Table({
231231
}
232232
useTableEventStream({ tableId, workspaceId, onUsageLimitReached })
233233

234-
// Live table presence (avatars + cell-selection highlights). Scoped to the
235-
// dedicated tables page — the embedded surface passes no id, disabling it.
236-
const {
237-
otherUsers: presenceUsers,
238-
remoteSelections,
239-
emitCellSelection,
240-
} = useTableRoom(embedded ? '' : tableId)
234+
// Live table presence (cell-selection carets + avatars). Runs in both modes so the
235+
// mothership chat panel shows collaborators' live selections too. The avatar stack lives
236+
// only in the `!embedded` Resource.Header, so the embedded panel gets carets without avatars
237+
// for free — matching the panel's own-chrome layout.
238+
const { otherUsers: presenceUsers, remoteSelections, emitCellSelection } = useTableRoom(tableId)
241239

242240
const [slideout, dispatch] = useReducer(slideoutReducer, { kind: 'none' })
243241
const [showDeleteTableConfirm, setShowDeleteTableConfirm] = useState(false)

0 commit comments

Comments
 (0)