Align user message actions beneath the bubble

This commit is contained in:
QQ 2026-11-28 14:56:21 +08:00
parent 54d8099004
commit 4d071ffa66
3 changed files with 8 additions and 10 deletions

File diff suppressed because one or more lines are too long

View File

@ -51,10 +51,9 @@
The host .userStack is left alone. Pending bubbles are not that row, so they The host .userStack is left alone. Pending bubbles are not that row, so they
carry the same cap themselves. */ carry the same cap themselves. */
.userCluster { display: flex; flex-direction: column; align-self: stretch; align-items: flex-end; width: 100%; max-width: 100%; gap: 8px; min-width: 0; margin-bottom: 4px; } .userCluster { display: flex; flex-direction: column; align-self: stretch; align-items: flex-end; width: 100%; max-width: 100%; gap: 8px; min-width: 0; margin-bottom: 4px; }
/* Stretch the official message row, never our own bubble: `.user` is also a /* The host row needs the full axis. The fallback renders its bubble, images
direct child of the slot outlet in the fallback path, and giving it 100% and actions as separate children of the same slot outlet. */
width overrides its fit-content sizing and fills the transcript. */ .userCluster > [data-slot] > :not(.user, .userImages, .userActions) { align-self: stretch; width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; }
.userCluster > [data-slot] > :not(.user) { align-self: stretch; width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; }
.userImages { display: flex; flex-direction: column; align-items: flex-end; align-self: flex-end; width: fit-content; max-width: 100%; min-width: 0; } .userImages { display: flex; flex-direction: column; align-items: flex-end; align-self: flex-end; width: fit-content; max-width: 100%; min-width: 0; }
.userImages .imageFigure { align-self: flex-end; } .userImages .imageFigure { align-self: flex-end; }
.user { align-self: flex-end; width: fit-content; max-width: min(calc(var(--dsh-chat-content-width, 748px) * 0.702), 82%); margin-left: auto; padding: 10px 16px; border-radius: var(--dsw-radius-xl, 22px); background: var(--dsw-specific-bubble); color: var(--dsw-alias-label-primary); font-size: var(--dsh-content-font-size, 14px); line-height: calc(22px + var(--dsh-content-font-delta, 0px)); font-weight: 400; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; box-sizing: border-box; } .user { align-self: flex-end; width: fit-content; max-width: min(calc(var(--dsh-chat-content-width, 748px) * 0.702), 82%); margin-left: auto; padding: 10px 16px; border-radius: var(--dsw-radius-xl, 22px); background: var(--dsw-specific-bubble); color: var(--dsw-alias-label-primary); font-size: var(--dsh-content-font-size, 14px); line-height: calc(22px + var(--dsh-content-font-delta, 0px)); font-weight: 400; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; box-sizing: border-box; }
@ -480,7 +479,7 @@
.historyButton:disabled { opacity: .55; cursor: default; } .historyButton:disabled { opacity: .55; cursor: default; }
.empty { padding: 40px 0; color: var(--dsw-alias-label-tertiary); text-align: center; } .empty { padding: 40px 0; color: var(--dsw-alias-label-tertiary); text-align: center; }
.answerActions { display: flex; align-items: center; gap: 8px; margin: 13px 0 0 -6px; min-height: 28px; } .answerActions { display: flex; align-items: center; gap: 8px; margin: 13px 0 0 -6px; min-height: 28px; }
.userActions { display: flex; align-items: center; gap: 8px; min-height: 28px; } .userActions { display: flex; align-items: center; align-self: flex-end; justify-content: flex-end; width: fit-content; max-width: 100%; gap: 8px; min-height: 28px; }
.messageClock { font-size: 13px; line-height: 24px; color: var(--dsw-alias-label-tertiary); white-space: nowrap; font-variant-numeric: tabular-nums; } .messageClock { font-size: 13px; line-height: 24px; color: var(--dsw-alias-label-tertiary); white-space: nowrap; font-variant-numeric: tabular-nums; }
.iconButton { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 6px; padding: 6px; background: transparent; color: var(--dsw-alias-label-tertiary); } .iconButton { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 6px; padding: 6px; background: transparent; color: var(--dsw-alias-label-tertiary); }
.iconButton svg { fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; } .iconButton svg { fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }

View File

@ -35,10 +35,9 @@ test('the official ChatView row stays live; only its tab id is hidden', () => {
assert.match(seat, /ACTIVE\.set\(ledger, restore\)/u); assert.match(seat, /ACTIVE\.set\(ledger, restore\)/u);
}); });
test('the reader bubble keeps its fit-content width', () => { test('the reader bubble and actions stay right-aligned under the user message', () => {
// The slot-row stretch rule must not match our own `.user` bubble, or short assert.match(readerCss, /\.userCluster > \[data-slot\] > :not\(\.user, \.userImages, \.userActions\)/u);
// messages render as a full-width band. assert.match(readerCss, /\.userActions \{[^}]*align-self: flex-end;[^}]*width: fit-content/u);
assert.match(readerCss, /\.userCluster > \[data-slot\] > :not\(\.user\)/u);
assert.doesNotMatch(readerCss, /\.userCluster > \[data-slot\] > \*/u); assert.doesNotMatch(readerCss, /\.userCluster > \[data-slot\] > \*/u);
}); });