Skip to content

fix(data-table): render separator rows with valid table structure#28499

Draft
abdulbaqui17 wants to merge 3 commits intocalcom:mainfrom
abdulbaqui17:fix-28184-separator-row-dom
Draft

fix(data-table): render separator rows with valid table structure#28499
abdulbaqui17 wants to merge 3 commits intocalcom:mainfrom
abdulbaqui17:fix-28184-separator-row-dom

Conversation

@abdulbaqui17
Copy link

Summary

  • fix separator row rendering in the data table to use a table cell inside the table row
  • replace the invalid tr > div structure with tr > td and set colSpan to the current column count

Why

SeparatorRowRenderer currently renders a div directly under tr, which violates HTML table nesting rules and triggers React validateDOMNesting warnings.

Validation

  • TZ=UTC yarn vitest run apps/web/modules/data-table/components/filters/ColumnVisibilityButton.test.tsx

Fixes #28184

Copilot AI review requested due to automatic review settings March 19, 2026 05:46
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions github-actions bot added the 🐛 bug Something isn't working label Mar 19, 2026
@abdulbaqui17 abdulbaqui17 marked this pull request as draft March 19, 2026 05:46
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to fix invalid HTML table nesting in the web DataTable separator rows (eliminating React validateDOMNesting warnings) by ensuring separator content renders inside a table cell and spans the table width. It also includes additional changes related to attendee email time format fallback and reschedule redirect duration propagation.

Changes:

  • Fix SeparatorRowRenderer to render a <td> (TableCell) within <tr> and span across columns.
  • Add attendee email rendering fallback so attendee timeFormat defaults to organizer’s when missing, with a unit test.
  • Add reschedule redirect behavior to include duration in the destination query string, with SSR tests; add a small unit test for getMultipleDurationValue.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/features/bookings/lib/get-booking.test.ts Adds unit coverage for getMultipleDurationValue defaulting behavior.
packages/emails/templates/attendee-scheduled-email.ts Ensures attendee timeFormat falls back to organizer’s for email rendering.
packages/emails/email-manager.test.ts Adds test asserting renderEmail receives attendee timeFormat fallback.
apps/web/modules/data-table/components/DataTable.tsx Fixes separator row DOM structure by rendering a TableCell with colSpan.
apps/web/lib/reschedule/[uid]/getServerSideProps.ts Adds duration query param to reschedule redirect based on booking time range.
apps/web/lib/reschedule/[uid]/getServerSideProps.test.ts Adds tests verifying duration is preserved/included in reschedule redirects.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

<SeparatorRowRenderer
separator={row.original as SeparatorRow}
className={separatorClassName}
colSpan={table.getAllColumns().length}
Comment on lines +185 to +191
const originalBookingDurationInMinutes = Math.round(
(booking.endTime.getTime() - booking.startTime.getTime()) / (1000 * 60)
);

if (originalBookingDurationInMinutes > 0) {
destinationUrlSearchParams.set("duration", String(originalBookingDurationInMinutes));
}
Copy link
Contributor

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

Choose a reason for hiding this comment

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

1 issue found across 6 files

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/web/modules/data-table/components/DataTable.tsx">

<violation number="1" location="apps/web/modules/data-table/components/DataTable.tsx:399">
P2: Separator row colSpan uses all columns instead of visible leaf columns, causing misalignment when columns are hidden or grouped.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

<SeparatorRowRenderer
separator={row.original as SeparatorRow}
className={separatorClassName}
colSpan={table.getAllColumns().length}
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Mar 19, 2026

Choose a reason for hiding this comment

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

P2: Separator row colSpan uses all columns instead of visible leaf columns, causing misalignment when columns are hidden or grouped.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/web/modules/data-table/components/DataTable.tsx, line 399:

<comment>Separator row colSpan uses all columns instead of visible leaf columns, causing misalignment when columns are hidden or grouped.</comment>

<file context>
@@ -384,7 +393,11 @@ function DataTableBody<TData>({
+              <SeparatorRowRenderer
+                separator={row.original as SeparatorRow}
+                className={separatorClassName}
+                colSpan={table.getAllColumns().length}
+              />
             </TableRow>
</file context>
Suggested change
colSpan={table.getAllColumns().length}
colSpan={table.getVisibleLeafColumns().length}
Fix with Cubic

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

Labels

🐛 bug Something isn't working size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SeparatorRowRenderer renders <div> inside <tr>, causing invalid DOM nesting warning

3 participants