Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(web): wide chat tables grow past the reading column before scrolling #13443

Closeditssotsot(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/13443/headopened View on GitHub

Showing 3 changed files with 65 additions and 95 deletions.

x
0 of 3 viewed, 3 left
7 additions and 2 deletionsapps/web/src/components/chat/MessagesTimeline.tsxModified
View file
@@ -1234,7 +1234,7 @@
// from TimelineRowCtx, which propagates through LegendList's memo.
const renderItem = useCallback(
({ item }: { item: MessagesTimelineRow }) => (
- <div className="mx-auto w-full min-w-0 max-w-3xl overflow-x-clip" data-timeline-root="true">
+ <div className="mx-auto w-full min-w-0 max-w-3xl" data-timeline-root="true">
<TimelineRowContent row={item} />
</div>
@@ -1305,7 +1305,7 @@
onScroll={handleScroll}
onItemSizeChanged={reportContentOverflow}
className={cn(
- "scrollbar-gutter-both h-full min-h-0 overflow-x-hidden overscroll-y-contain px-3 [overflow-anchor:none] sm:px-5",
+ "@container/chat-timeline scrollbar-gutter-both h-full min-h-0 overflow-x-hidden overscroll-y-contain px-3 [overflow-anchor:none] sm:px-5",
topFadeEnabled && "topbar-scroll-fade",
ListHeaderComponent={
@@ -2348,6 +2348,10 @@
+/**
+ * An assistant reply in the timeline. Its markdown opts into
+ * `chat-markdown-wide-tables`, so top-level tables may widen past the column.
+ */
function AssistantTimelineRow({ row }: { row: Extract<TimelineRow, { kind: "message" }> }) {
const ctx = use(TimelineRowCtx);