fix(chat): open a session already at its end, and keep it there
A session opened from the sidebar could land above the bottom, or show a frame sitting lower and then snap up. The viewport was pinned before the content was final: the recap note renders once the session record arrives and grew the footer under the pinned viewport, and on large sessions subagent task cards grow when their child sessions load, moving everything above the viewport. - The recap note holds the timeline reveal until the session record is in memory, so it is part of the first finished picture. - The scroll hook holds the reveal until the viewport is pinned; the reveal itself runs once the content height has held still for two frames, with one exact pin against the final height (bounded at 300ms). - Sitting on the end of a session that is not producing output is an invariant: content growth re-pins from a MutationObserver in the same frame the list writes its layout, so no frame paints with the end out of view. Output growth keeps gliding through followEnd, which now glides only while the session is working.
This commit is contained in:
@@ -13,7 +13,7 @@ import React from 'react';
|
||||
* A hold that never releases must not hide the chat forever, so the owner
|
||||
* reveals after `TIMELINE_REVEAL_CAP_MS` regardless.
|
||||
*/
|
||||
type TimelineRevealGate = {
|
||||
export type TimelineRevealGate = {
|
||||
/** Take a hold; returns the release. Returns null once the gate is closed. */
|
||||
hold: () => (() => void) | null;
|
||||
/** Stops accepting holds. Existing holds still count. */
|
||||
|
||||
Reference in New Issue
Block a user