Skip to content
TypeScript

fix(web): chat tables and subagent rows line up (#24835)

Theo Browne2d620f5dcc0f
diff --git a/apps/web/src/components/chat/MarkdownTable.tsx b/apps/web/src/components/chat/MarkdownTable.tsx
index c86acc8543c..4f75a74193c 100644
--- a/apps/web/src/components/chat/MarkdownTable.tsx
+++ b/apps/web/src/components/chat/MarkdownTable.tsx
@@ -114,7 +114,8 @@ export function MarkdownTable({ children, ...props }: ComponentProps<"table">) {
{children}
</table>
</ScrollArea>
- <div className="mt-0.5 flex items-center justify-between select-none">
+ {/* Stays within the row's px-1: the chat lane clips sideways overflow. */}
+ <div className="mt-0.5 -mx-1 flex items-center justify-between select-none">
{hasClippedCells ? (
<Tooltip>
<TooltipTrigger
diff --git a/apps/web/src/components/chat/TimelineV2EventRow.tsx b/apps/web/src/components/chat/TimelineV2EventRow.tsx
index 9a64ca0f031..650c930cd11 100644
--- a/apps/web/src/components/chat/TimelineV2EventRow.tsx
+++ b/apps/web/src/components/chat/TimelineV2EventRow.tsx
@@ -251,11 +251,12 @@ const V2SubagentGroup = memo(function V2SubagentGroup({
return (
<WorkLogBlock continues={row.continuesWorkLog}>
<Collapsible open={expanded} onOpenChange={toggleExpanded} data-subagent-group>
+ {/* pr-3.25 matches the panel border, padding, and row inset so the times line up. */}
<CollapsibleTrigger
aria-label={label}
aria-description={statusSummary}
className={cn(
- "flex w-full min-w-0 items-center gap-3 py-2 text-left transition-opacity hover:opacity-100",
+ "flex w-full min-w-0 items-center gap-2.5 py-2 pr-3.25 text-left transition-opacity hover:opacity-100",
expanded || summary.active
? "text-foreground opacity-100"
: "text-muted-foreground opacity-55",
diff --git a/apps/web/src/components/chat/V2LifecycleRow.tsx b/apps/web/src/components/chat/V2LifecycleRow.tsx
index 7e7ef86b6f7..193ac1bf297 100644
--- a/apps/web/src/components/chat/V2LifecycleRow.tsx
+++ b/apps/web/src/components/chat/V2LifecycleRow.tsx
@@ -439,21 +439,7 @@ function SubagentTimelineLink(props: {
status={status ?? undefined}
/>
<span className="min-w-0 flex-1">
- <span className="flex items-baseline gap-2">
- <span className="min-w-0 truncate text-xs font-medium text-foreground">
- {props.title}
- </span>
- {detail !== null && (props.event !== undefined || status !== "completed") ? (
- <span
- className={cn(
- "shrink-0 text-3xs",
- failed ? "text-destructive" : "text-muted-foreground",
- )}
- >
- {statusLabel}
- </span>
- ) : null}
- </span>
+ <span className="block truncate text-xs font-medium text-foreground">{props.title}</span>
<span
className={cn(
"block text-2xs leading-relaxed",
@@ -469,6 +455,13 @@ function SubagentTimelineLink(props: {
)}
</span>
</span>
+ {detail !== null && (props.event !== undefined || status !== "completed") ? (
+ <span
+ className={cn("shrink-0 text-xs", failed ? "text-destructive" : "text-muted-foreground")}
+ >
+ {statusLabel}
+ </span>
+ ) : null}
<span className="shrink-0 text-xs text-muted-foreground tabular-nums">
{props.event ? props.event.timestamp : <SubagentElapsed agent={timing} />}
</span>
diff --git a/apps/web/src/index.css b/apps/web/src/index.css
index 0f1f4b2b1f8..df5fede8b8d 100644
--- a/apps/web/src/index.css
+++ b/apps/web/src/index.css
@@ -2135,10 +2135,21 @@ code {
font-size: 0.75rem;
}
+/* Top-aligned so wrapped rows share a first line, and the outer columns sit
+ flush with the surrounding prose. */
.chat-markdown th,
.chat-markdown td {
padding: 0.45rem 0.75rem;
text-align: start;
+ vertical-align: top;
+}
+
+.chat-markdown :is(th, td):first-child {
+ padding-inline-start: 0;
+}
+
+.chat-markdown :is(th, td):last-child {
+ padding-inline-end: 0;
}
.chat-markdown thead th {