From 51cc6be16d1b3dd5b15387176b19b771fba31429 Mon Sep 17 00:00:00 2001 From: klopez4212 Date: Mon, 29 Jun 2026 21:51:49 +0100 Subject: [PATCH] Fix profile agent huddle routing --- desktop/src/features/messages/ui/useAnchoredScroll.ts | 3 +-- desktop/src/features/profile/ui/UserProfilePopover.tsx | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/desktop/src/features/messages/ui/useAnchoredScroll.ts b/desktop/src/features/messages/ui/useAnchoredScroll.ts index 0469d4247..1ebafcb9c 100644 --- a/desktop/src/features/messages/ui/useAnchoredScroll.ts +++ b/desktop/src/features/messages/ui/useAnchoredScroll.ts @@ -274,7 +274,6 @@ export function useAnchoredScroll({ // Reset everything when the route's scroll identity changes — the layout // effect that runs immediately after this reset is responsible for either // jumping to bottom or to the target message for the new view. - // biome-ignore lint/correctness/useExhaustiveDependencies: resetKey is intentionally the sole trigger — it includes channel identity plus route-specific layout state. React.useLayoutEffect(() => { messagesRef.current = messages; }, [messages]); @@ -289,6 +288,7 @@ export function useAnchoredScroll({ } }, [isHistoryPrependPending, scrollContainerRef]); + // biome-ignore lint/correctness/useExhaustiveDependencies: resetKey is intentionally the sole trigger — it includes channel identity plus route-specific layout state. React.useLayoutEffect(() => { anchorRef.current = { kind: "at-bottom" }; setIsAtBottom(true); @@ -598,7 +598,6 @@ export function useAnchoredScroll({ // --------------------------------------------------------------------------- // biome-ignore lint/correctness/useExhaustiveDependencies: resetKey is a deliberate re-subscription trigger — the effect body reads only the stable refs, but on route identity changes the keyed scroll container remounts and contentRef.current becomes a fresh node, so the observer must disconnect from the previous route's detached node and re-observe the live one. React.useEffect(() => { - void scrollScopeKey; const content = contentRef.current; if (!content || typeof ResizeObserver === "undefined") return; const observer = new ResizeObserver(() => { diff --git a/desktop/src/features/profile/ui/UserProfilePopover.tsx b/desktop/src/features/profile/ui/UserProfilePopover.tsx index f1d99a126..d1c624a0f 100644 --- a/desktop/src/features/profile/ui/UserProfilePopover.tsx +++ b/desktop/src/features/profile/ui/UserProfilePopover.tsx @@ -348,7 +348,7 @@ export function UserProfilePopover({ try { const dm = await openDmMutation.mutateAsync({ pubkeys: [pubkey] }); await goChannel(dm.id); - await startHuddle(dm.id, isBotProfile ? [pubkey] : []); + await startHuddle(dm.id, isAgentTarget ? [pubkey] : []); await queryClient.invalidateQueries({ queryKey: channelsQueryKey }); if (isMountedRef.current) { setOpen(false); @@ -366,7 +366,7 @@ export function UserProfilePopover({ clearHoverTimer, goChannel, isAgentClassificationPending, - isBotProfile, + isAgentTarget, isStartingHuddle, openDmMutation, pendingAction,