fix(chat): keep latest-turn actions under the reply (BUG-1042)

The BUG-930 pin spacer sat on the last assistant row, pushing its sibling
.message-actions (and follow-ups / delivery card) below half a screen of
empty space. Move the same min-height onto the last turn's entry
(`:last-child:has(.message-assistant)`) with align-content: start so the
rectification grid wrap does not stretch its rows. Hook logic unchanged.

Records BUG-1043 / BUG-1044 (pre-existing, investigating) found during
browser verification.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017eEAG8HD3mm8gsKXgk8uU8
This commit is contained in:
Jesse_Chen
2026-09-26 10:19:00 +08:00
co-authored by Claude Opus 5.5
parent ac224cef6a
commit 83cce7ad6a
13 changed files with 189 additions and 7 deletions
@@ -84,8 +84,11 @@ export function lastTurnTail(container: HTMLElement): HTMLElement | null {
export function turnHeadHeightForSpacer(head: HTMLElement | null, tail: HTMLElement | null): number {
if (!head) return 0;
// The last assistant carries the min-height spacer. Measuring it as the turn
// head feeds the spacer back into itself (BUG-931).
// The last turn's entry, which starts at this assistant row, carries the
// min-height spacer (BUG-1042). Subtracting the row's own height would leave
// that entry one row short of the viewport; before BUG-1042 the row itself
// carried the spacer and measuring it fed the spacer back into itself
// (BUG-931). Either way the head-is-tail case subtracts nothing.
if (tail && head === tail) return 0;
return head.offsetHeight;
}