Skip to content

Commit f10cda9

Browse files
authored
Merge pull request #3103 from GCWing/gcwing/remove-user-message-min-width
fix(flowchat): restore transcript width and remove user minimum
2 parents 2eb3399 + 3102006 commit f10cda9

8 files changed

Lines changed: 27 additions & 24 deletions

‎src/web-ui/src/flow_chat/_transcript-layout.scss‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,17 @@ $turn-rail-width: 30px;
1111
box-sizing: border-box;
1212
min-width: 0;
1313
width: 100%;
14-
margin-inline: 0;
14+
max-width: 900px;
15+
margin-inline: auto;
1516

16-
// Reserve only the rail side plus a small opposite inset. Message rows use
17-
// the remaining transcript width; neither the composer nor the welcome
18-
// surface needs this lane.
17+
// Reserve only the rail side plus a small opposite inset. Wide columns stay
18+
// centered; neither the composer nor the welcome surface needs this lane.
1919
@container flow-chat-transcript (min-width: 0px) {
2020
width: calc(100% - #{$turn-rail-offset + $turn-rail-width} - var(--openbitfun-space-1) - var(--openbitfun-space-2));
21-
margin-inline-start: calc(#{$turn-rail-offset + $turn-rail-width} + var(--openbitfun-space-1));
21+
margin-inline-start: max(
22+
calc(#{$turn-rail-offset + $turn-rail-width} + var(--openbitfun-space-1)),
23+
calc((100% - 900px) / 2)
24+
);
2225
}
2326
}
2427

‎src/web-ui/src/flow_chat/components/modern/ExploreRegion.scss‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
@include transcriptLayout.content-column;
88
position: relative;
99
overflow: hidden;
10-
/* Fill the shared transcript row so the collapse header (`>`) and the
11-
* round's body text share both edges. */
12-
width: 100%;
13-
margin: 0;
10+
/* Same column box as .model-round-item so the collapse header (`>`) and the
11+
* round's body text share one leading edge. */
12+
width: min(100%, 900px);
13+
margin: 0 auto;
1414
padding-block: 0;
1515
}
1616

‎src/web-ui/src/flow_chat/components/modern/FLOWCHAT_VIRTUALIZATION.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ actions remain visible at rest, without requiring hover or keyboard focus.
181181
shells, model rounds, Explore regions, and the runtime-status footer.
182182
The messages viewport enables a shared outer column rule for virtual rows and
183183
the runtime footer: reserve the turn rail's offset and hit area plus space-1 on
184-
the leading side, and only space-2 on the trailing side. Rows use the remaining
185-
transcript width without a fixed reading-width cap. This rule is local to the
184+
the leading side, and only space-2 on the trailing side. Columns remain centered
185+
when there is room for the full 900px reading width. This rule is local to the
186186
transcript; the composer and welcome surface keep their existing widths, and
187187
embedded transcripts without a rail keep their own layout. The scroller remains
188188
full width.

‎src/web-ui/src/flow_chat/components/modern/UserMessageItem.scss‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
* its radius so the rounded surface and message text meet that column.
2121
*/
2222
width: fit-content;
23-
min-width: min(8rem, 72%);
2423
max-width: min(72%, 48rem);
2524
padding: 0.46rem var(--_user-message-padding-inline);
2625
background: var(--openbitfun-color-action-quiet-hover);

‎src/web-ui/src/flow_chat/components/modern/UserMessageItemActions.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ describe('UserMessageItem metadata visibility', () => {
4343
expect(textarea).toContain('min-height: var(--openbitfun-control-height-sm);');
4444
expect(richInput).toContain('min-height: var(--openbitfun-control-height-sm);');
4545
expect(bubble).toContain('width: fit-content;');
46-
expect(bubble).toContain('min-width: min(8rem, 72%);');
46+
expect(bubble).not.toContain('min-width:');
4747
expect(bubble).toContain('max-width: min(72%, 48rem);');
4848
expect(bubble).toContain('border: none;');
4949
expect(main).toContain('justify-content: center;');

‎src/web-ui/src/flow_chat/components/modern/VirtualItemRenderer.scss‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* Virtual item renderer wrapper styles.
3-
* Shared transcript row geometry and content rhythm.
3+
* A4-like reading width with centered content.
44
*/
55
@use '../../flat-markdown-surfaces' as flatMarkdownSurfaces;
66
@use '../../markdown-typography' as markdownTypography;
@@ -17,10 +17,11 @@
1717
display: flow-root;
1818

1919
/*
20-
* One transcript row is shared by every item type (model rounds, explore
21-
* groups, user messages, notices). transcript-layout reserves the turn-rail
22-
* lane; leaf content owns its inset, and user-bubble decoration may extend
23-
* into that gutter without shifting the text.
20+
* Single reading column shared by every item type (model rounds, explore
21+
* groups, user messages, notices). Matches ChatInput's 900px so headers,
22+
* `>` collapse rows, and message text all sit on the same leading edge.
23+
* transcript-layout owns the shared content inset; user-bubble decoration
24+
* extends into that gutter without shifting the reading column.
2425
*/
2526
margin-block: 0;
2627
min-height: 1px;

‎src/web-ui/src/flow_chat/components/modern/VirtualItemRenderer.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ export const VirtualItemRenderer = React.memo<VirtualItemRendererProps>(
118118
}
119119
})();
120120

121-
// The wrapper owns shared transcript geometry and virtualization measurement.
122-
// Render it even when content is empty to avoid zero-size issues.
121+
// A4-like layout: wrap with a max-width container.
122+
// Render the container even when content is empty to avoid zero-size issues.
123123
// data-turn-id is used for long-image export.
124124
return (
125125
<div

‎src/web-ui/src/flow_chat/components/modern/VirtualMessageList.scss‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525

2626

2727
/*
28-
* The scroller spans the full panel width. Message rows reserve their shared
29-
* transcript insets, and `overflow-anchor: none` keeps the browser from
30-
* adding a second opinion about where the viewport belongs — the viewport
31-
* anchor is the only one.
28+
* The scroller. It spans the full panel width even though message content
29+
* inside it is max-width constrained, and `overflow-anchor: none` keeps the
30+
* browser from adding a second opinion about where the viewport belongs —
31+
* the viewport anchor is the only one.
3232
*/
3333
&__scroller {
3434
--_flow-chat-top-mask-start: transparent 0;

0 commit comments

Comments
 (0)