Skip to content

Commit 249e1bf

Browse files
clawsweeperroboclaw-botTakhoffman
authored
fix(ui): align narrow chat composer spacing (#127717)
* fix(ui): align narrow chat composer spacing * test(ui): cover short-landscape composer spacing Co-authored-by: Tak Hoffman <[email protected]> --------- Co-authored-by: RoboClaw <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
1 parent fc5cb9e commit 249e1bf

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

‎ui/src/pages/chat/chat-responsive.browser.test.ts‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2067,6 +2067,7 @@ describeBrowserLayout.concurrent("chat responsive browser layout", () => {
20672067

20682068
it.each([
20692069
[393, 852],
2070+
[900, 500],
20702071
[1366, 900],
20712072
[1920, 1080],
20722073
] as const)("uses compact radii and optical chat-box insets at %sx%s", async (width, height) => {
@@ -2118,14 +2119,17 @@ describeBrowserLayout.concurrent("chat responsive browser layout", () => {
21182119
expect(geometry.assistantBubble?.paddingRight).toBe(0);
21192120
expect(geometry.composer?.borderRadius).toBe(mediumRadius);
21202121

2121-
const composerInset = width <= 768 ? 4 : 8;
2122-
const textareaBlockInset = width <= 768 ? 10 : composerInset;
2122+
const usesCompactComposer = width <= 768 || (width <= 932 && height <= 500 && width > height);
2123+
const composerInset = usesCompactComposer ? 4 : 8;
2124+
const textareaBlockInset = usesCompactComposer ? 10 : composerInset;
21232125
expect(geometry.textarea?.paddingTop).toBe(textareaBlockInset);
21242126
expect(geometry.textarea?.paddingRight).toBe(composerInset);
21252127
expect(geometry.textarea?.paddingBottom).toBe(textareaBlockInset);
2126-
expect(geometry.textarea?.paddingLeft).toBe(composerInset - 4);
2127-
expect(geometry.footer?.paddingLeft).toBe(composerInset);
2128-
expect(geometry.footer?.paddingRight).toBe(composerInset);
2128+
expect(geometry.textarea?.paddingLeft).toBe(
2129+
usesCompactComposer ? composerInset : composerInset - 4,
2130+
);
2131+
expect(geometry.footer?.paddingLeft).toBe(8);
2132+
expect(geometry.footer?.paddingRight).toBe(8);
21292133
// #105866 splits the block inset evenly around the footer so the
21302134
// settings chip centers between the divider and the card edge.
21312135
expect(geometry.footer?.paddingTop).toBe(composerInset / 2);

‎ui/src/styles/chat/layout.css‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3098,7 +3098,7 @@ button.chat-pr__diff {
30983098
border-top: 1px solid color-mix(in srgb, var(--border) 64%, transparent);
30993099
/* Split the inset evenly so the settings chip sits centered between the
31003100
divider and the card edge instead of hugging the divider. */
3101-
padding: calc(var(--chat-box-inset) / 2) var(--chat-box-inset);
3101+
padding: calc(var(--chat-box-inset) / 2) max(var(--chat-box-inset), 8px);
31023102
}
31033103

31043104
.agent-chat__composer-meta,
@@ -4120,6 +4120,7 @@ button.chat-pr__diff {
41204120
max-height: calc(7em + var(--chat-box-inset) + var(--chat-box-inset));
41214121
padding-top: 10px;
41224122
padding-bottom: 10px;
4123+
padding-left: var(--chat-box-inset);
41234124
font-size: var(--control-ui-input-text-size);
41244125
}
41254126

0 commit comments

Comments
 (0)