diff --git a/apps/desktop/layer/renderer/src/modules/entry-content/EntryContent.tsx b/apps/desktop/layer/renderer/src/modules/entry-content/EntryContent.tsx index 907962282..3b0eab1f7 100644 --- a/apps/desktop/layer/renderer/src/modules/entry-content/EntryContent.tsx +++ b/apps/desktop/layer/renderer/src/modules/entry-content/EntryContent.tsx @@ -12,6 +12,7 @@ import { useSubscriptionByFeedId } from "@follow/store/subscription/hooks" import { thenable } from "@follow/utils" import { stopPropagation } from "@follow/utils/dom" import { EventBus } from "@follow/utils/event-bus" +import { springScrollTo } from "@follow/utils/scroller" import { cn } from "@follow/utils/utils" import type { JSAnimation } from "motion/react" import { useAnimationControls } from "motion/react" @@ -104,11 +105,16 @@ const EntryContentImpl: Component = ({ useEffect(() => { animationController.set(contentVariants.exit) animationController.start(contentVariants.animate) + + // Scroll to top + if (scrollerRef) { + springScrollTo(0, scrollerRef) + } focusableRef.current?.focus() return () => { animationController.stop() } - }, [animationController, entryId]) + }, [animationController, entryId, scrollerRef]) useEffect(() => { setEntryContentScrollToTop(true) diff --git a/packages/internal/shared/src/bridge.ts b/packages/internal/shared/src/bridge.ts index 875b080e2..9709bc2b7 100644 --- a/packages/internal/shared/src/bridge.ts +++ b/packages/internal/shared/src/bridge.ts @@ -64,9 +64,6 @@ interface RenderGlobalContext { getWebUrl: () => string getApiUrl: () => string - // View - zenMode: () => void - // Utils invalidateQuery: (queryKey: string | string[]) => void navigateEntry: (options: { feedId: string; entryId: string; view: number }) => void