fix(web): align chat composer and stabilize running controls

This commit is contained in:
2026-10-20 18:47:56 +01:00
parent 03a508fa2b
commit 7e9b6771ef
3 changed files with 197 additions and 18 deletions
+66 -18
View File
@@ -844,8 +844,18 @@
}
/* The composer at the foot of a conversation (C8/C9). The field grows 1–6 rows;
the primary control turns from Send to Stop while a turn is in flight. */
.chat-composer { flex: 0 0 auto; display: grid; gap: var(--space-xs); padding-top: var(--space-xs); border-top: 1px solid var(--color-divider); }
Stop joins Send while a turn is in flight. */
.chat-composer {
--composer-control: 44px;
--composer-line: 22px;
--composer-padding: 10px;
flex: 0 0 auto;
min-width: 0;
display: grid;
gap: var(--space-xs);
padding-top: var(--space-xs);
border-top: 1px solid var(--color-divider);
}
.chat-queued { font-size: 12px; color: var(--muted); }
.chat-attachment-strip { display: flex; flex-wrap: wrap; gap: 8px; }
@@ -853,6 +863,7 @@
display: inline-flex;
align-items: center;
gap: 8px;
max-width: 100%;
padding: 4px 6px 4px 8px;
border: 1px solid var(--border);
border-radius: var(--radius-control);
@@ -865,7 +876,7 @@
.chat-attachment-thumb { width: 28px; height: 28px; border-radius: 4px; object-fit: cover; }
.chat-attachment-glyph { width: 28px; text-align: center; font-size: 18px; line-height: 1; }
.chat-attachment-body { display: grid; gap: 1px; min-width: 0; max-width: 220px; }
.chat-attachment-name { font-size: 12px; }
.chat-attachment-name { font-size: 12px; overflow-wrap: anywhere; }
.chat-attachment-meta { font-size: 11px; color: var(--muted); }
.chat-attachment-error { color: var(--bad); }
.chat-attachment-remove { padding: 1px 6px; font-size: 12px; line-height: 1; }
@@ -915,29 +926,69 @@
.chat-command-notice-actions { display: flex; gap: 8px; }
.chat-command-notice-actions button { padding: 3px 10px; font-size: 12px; }
.chat-composer-row { display: flex; gap: 8px; align-items: flex-end; }
.chat-composer-row { display: flex; gap: 8px; align-items: flex-end; min-width: 0; }
.chat-file-input { display: none; }
.chat-attach { padding: 6px 10px; font-size: 16px; line-height: 1; }
.chat-attach { color: var(--muted); }
.chat-composer-input {
flex: 1 1 auto;
min-width: 0;
min-height: var(--composer-control);
resize: none;
padding: 8px 12px;
padding: var(--composer-padding) 12px;
background: var(--bg);
color: var(--text);
border: 1px solid var(--border);
border-radius: var(--radius-control);
font: inherit;
line-height: 20px;
max-height: 132px;
overflow-y: hidden;
}
.chat-composer-input:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
.chat-composer-primary { display: inline-flex; align-items: flex-end; gap: 6px; }
.chat-send, .chat-stop {
padding: 8px 12px;
font-size: 16px;
line-height: var(--composer-line);
/* Match growComposerTextarea's six full lines, padding and border. */
max-height: calc(6 * var(--composer-line) + 2 * var(--composer-padding) + 2px);
overflow-y: hidden;
overflow-wrap: anywhere;
}
.chat-composer-input::placeholder { color: var(--muted); opacity: 1; }
.chat-composer-input:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
.chat-composer-primary {
/* Stop is added beside Send, not instead of it. Keep both slots reserved so
a running-state update cannot rewrap a draft or move the caret vertically. */
display: inline-flex;
flex: 0 0 calc(2 * var(--composer-control) + 8px);
align-items: flex-end;
gap: 8px;
}
.chat-attach, .chat-send, .chat-stop {
display: inline-flex;
flex: 0 0 var(--composer-control);
align-items: center;
justify-content: center;
width: var(--composer-control);
height: var(--composer-control);
min-width: var(--composer-control);
min-height: var(--composer-control);
padding: 0;
/* Use monochrome masks rather than platform-dependent emoji/glyph metrics.
The existing button aria-labels and titles remain the accessible names. */
font-size: 0;
line-height: 1;
}
.chat-attach::before, .chat-send::before, .chat-stop::before {
content: "";
width: 20px;
height: 20px;
background: currentColor;
mask: var(--composer-icon) center / contain no-repeat;
}
.chat-attach {
--composer-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m8 13 6-6a3 3 0 0 1 4 4l-8 8a5 5 0 0 1-7-7l9-9a1 1 0 0 1 1.4 1.4l-9 9a3 3 0 0 0 4.2 4.2l8-8a1 1 0 0 0-1.4-1.4l-6 6a1 1 0 0 0 1.4 1.4l5-5 1.4 1.4-5 5a3 3 0 0 1-4.2-4.2Z'/%3E%3C/svg%3E");
}
.chat-send {
--composer-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m3 3 19 9-19 9 3-8 9-1-9-1Z'/%3E%3C/svg%3E");
}
.chat-stop {
--composer-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='5' y='5' width='14' height='14' rx='2'/%3E%3C/svg%3E");
}
.chat-send, .chat-stop {
border: 1px solid var(--border);
border-radius: var(--radius-control);
background: var(--surface-2);
@@ -1139,10 +1190,6 @@
.chat-bar-title { font-size: 18px; }
.chat-model-button { max-width: 118px; min-height: 36px; }
.chat-activity { font-size: 12px; }
.chat-send,
.chat-stop { min-width: 44px; min-height: 44px; font-size: 18px; }
.chat-attach { min-width: 44px; min-height: 44px; }
.chat-composer-input { padding: 10px 12px; font-size: 16px; }
.chat-turn { font-size: 15px; }
}
@@ -1193,6 +1240,7 @@
/* Input capability, not just screen width, selects touch-sized controls. */
@media (any-pointer: coarse) {
.chat-composer { --composer-control: 48px; --composer-padding: 12px; }
.chat-reasoning-toggle, .chat-tool-chip, .chat-group-toggle,
.chat-send, .chat-stop, .chat-attach, .chat-model-button, .chat-model-option,
.chat-new { min-height: 48px; }