Skip to content

Commit d318994

Browse files
authored
Re-land at latest when the initial load completes around a pending kickoff
Greptile P1: submitting a kickoff mid-load mounts the scroller around partial content via the pending escape hatch, consuming the one-shot end scroll; the remaining rows then arrive with no re-scroll. Extend the scroll effect to also fire when isLoading settles, so the feed lands at the latest message in that path too. Generated-By: PostHog Code Task-Id: d887d524-7d87-4d7a-b38c-b20289937ad1
1 parent d3ad504 commit d318994

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

packages/ui/src/features/canvas/components/ChannelFeedView.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -697,11 +697,12 @@ export function ChannelFeedView({
697697
}, [tasks, systemMessages]);
698698

699699
const viewportRef = useRef<HTMLDivElement>(null);
700-
// biome-ignore lint/correctness/useExhaustiveDependencies: channelId is the trigger — switching channels swaps the rows without a remount, so re-land at the latest message
700+
// biome-ignore lint/correctness/useExhaustiveDependencies: channelId is a trigger — switching channels or finishing the initial load swaps/completes the rows without a remount, so re-land at the latest message
701701
useLayoutEffect(() => {
702+
if (isLoading) return;
702703
const viewport = viewportRef.current;
703704
if (viewport) viewport.scrollTop = viewport.scrollHeight;
704-
}, [channelId]);
705+
}, [channelId, isLoading]);
705706

706707
// Wait for the complete feed: the scroller's initial end-scroll fires once,
707708
// so mounting around partial rows would land it short of the latest message.

0 commit comments

Comments
 (0)