Skip to content

Commit d3ad504

Browse files
authored
Fix Biome exhaustive-deps error and trim comments
CI's biome ci errored on the scroll effect's [channelId] dependency (not referenced in the body — it's the re-run trigger). Suppress with the repo's biome-ignore idiom and cut the added comments down to the essentials. Generated-By: PostHog Code Task-Id: d887d524-7d87-4d7a-b38c-b20289937ad1
1 parent 8db09ef commit d3ad504

2 files changed

Lines changed: 4 additions & 13 deletions

File tree

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

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -696,21 +696,15 @@ export function ChannelFeedView({
696696
return merged;
697697
}, [tasks, systemMessages]);
698698

699-
// Open every channel at its latest message. The scroller handles the first
700-
// mount itself (defaultScrollPosition), but switching channels only swaps
701-
// the rows — no remount — so jump to the bottom before paint whenever the
702-
// channel changes. No-ops while the loading state has the viewport unmounted.
703699
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
704701
useLayoutEffect(() => {
705702
const viewport = viewportRef.current;
706703
if (viewport) viewport.scrollTop = viewport.scrollHeight;
707704
}, [channelId]);
708705

709-
// Hold the loading state even when some entries already exist (the "joined"
710-
// opener renders as soon as the channel resolves, before the task cards):
711-
// mounting the scroller around partial content spends its one-shot initial
712-
// end-scroll on a near-empty list, and it never re-scrolls when the real
713-
// cards arrive. Pending kickoffs bail out so an optimistic post shows now.
706+
// Wait for the complete feed: the scroller's initial end-scroll fires once,
707+
// so mounting around partial rows would land it short of the latest message.
714708
if (isLoading && pending.length === 0) {
715709
return (
716710
<div className="flex flex-1 items-center justify-center">

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,7 @@ export function WebsiteChannelHome({ channelId }: { channelId: string }) {
8080
// query is disabled — which reports isLoading:false, indistinguishable from
8181
// "this channel is empty". useBackendChannel reports loading for the whole
8282
// identity-resolution window (settling if the resolve fails), so fold it in:
83-
// we can't call a channel empty until we know which channel it is. Messages
84-
// loading is included so the scroller mounts once with the complete feed and
85-
// its one-shot initial end-scroll lands at the latest message (it never
86-
// re-fires for late-arriving rows).
83+
// we can't call a channel empty until we know which channel it is.
8784
const isLoading =
8885
isLoadingChannels ||
8986
isResolvingChannel ||

0 commit comments

Comments
 (0)