diff --git a/apps/desktop/layer/renderer/src/modules/entry-column/AIEntryLayout.tsx b/apps/desktop/layer/renderer/src/modules/entry-column/AIEntryLayout.tsx index 276df7b9a..589c6c42a 100644 --- a/apps/desktop/layer/renderer/src/modules/entry-column/AIEntryLayout.tsx +++ b/apps/desktop/layer/renderer/src/modules/entry-column/AIEntryLayout.tsx @@ -1,3 +1,4 @@ +import { Spring } from "@follow/components/constants/spring.js" import { Button } from "@follow/components/ui/button/index.js" import { PanelSplitter } from "@follow/components/ui/divider/index.js" import { defaultUISettings } from "@follow/shared/settings/defaults" @@ -144,12 +145,7 @@ const AIEntryLayoutImpl = () => { initial={{ y: "100%" }} animate={{ y: 0 }} exit={{ y: "100%" }} - transition={{ - type: "spring", - damping: 30, - stiffness: 400, - duration: 0.3, - }} + transition={Spring.presets.smooth} className="bg-theme-background absolute inset-0 z-10 border-l" > {/* Scroll hint indicator */} diff --git a/apps/desktop/layer/renderer/src/modules/entry-content/components/entry-content/EntryContent.ai.tsx b/apps/desktop/layer/renderer/src/modules/entry-content/components/entry-content/EntryContent.ai.tsx index c4a98afff..4b032bb57 100644 --- a/apps/desktop/layer/renderer/src/modules/entry-content/components/entry-content/EntryContent.ai.tsx +++ b/apps/desktop/layer/renderer/src/modules/entry-content/components/entry-content/EntryContent.ai.tsx @@ -1,4 +1,3 @@ -import { Spring } from "@follow/components/constants/spring.js" import { MotionButtonBase } from "@follow/components/ui/button/index.js" import { RootPortal } from "@follow/components/ui/portal/index.js" import { ScrollArea } from "@follow/components/ui/scroll-area/index.js" @@ -9,11 +8,10 @@ import { useEntry } from "@follow/store/entry/hooks" import { useFeedById } from "@follow/store/feed/hooks" import { useIsInbox } from "@follow/store/inbox/hooks" import { thenable } from "@follow/utils" -import { nextFrame, stopPropagation } from "@follow/utils/dom" +import { stopPropagation } from "@follow/utils/dom" import { EventBus } from "@follow/utils/event-bus" import { clsx, cn } from "@follow/utils/utils" -import type { JSAnimation, Variants } from "motion/react" -import { m, useAnimationControls } from "motion/react" +import type { JSAnimation } from "motion/react" import * as React from "react" import { memo, useEffect, useRef, useState } from "react" @@ -40,12 +38,6 @@ import { EntryNoContent } from "./EntryNoContent" import { EntryScrollingAndNavigationHandler } from "./EntryScrollingAndNavigationHandler.js" import type { EntryContentProps } from "./types" -const pageMotionVariants = { - initial: { opacity: 0, y: 25 }, - animate: { opacity: 1, y: 0 }, - exit: { opacity: 0, y: 25, transition: { duration: 0 } }, -} satisfies Variants - const EntryContentImpl: Component = ({ entryId, noMedia, @@ -78,21 +70,7 @@ const EntryContentImpl: Component = ({ const [panelPortalElement, setPanelPortalElement] = useState(null) - const animationController = useAnimationControls() - const prevEntryId = useRef(undefined) const scrollAnimationRef = useRef | null>(null) - useEffect(() => { - if (prevEntryId.current !== entryId) { - scrollAnimationRef.current?.stop() - nextFrame(() => { - scrollerRef.current?.scrollTo({ top: 0 }) - }) - animationController.start(pageMotionVariants.exit).then(() => { - animationController.start(pageMotionVariants.animate) - }) - prevEntryId.current = entryId - } - }, [animationController, entryId]) const isInHasTimelineView = ![ FeedViewType.Pictures, @@ -138,12 +116,7 @@ const EntryContentImpl: Component = ({ {/* Indicator for the entry */} - +
{!isZenMode && isInHasTimelineView && !isInPeekModal && ( <>
@@ -208,7 +181,7 @@ const EntryContentImpl: Component = ({ /> )} - +
diff --git a/apps/desktop/layer/renderer/src/modules/entry-content/components/layouts/ArticleLayout.tsx b/apps/desktop/layer/renderer/src/modules/entry-content/components/layouts/ArticleLayout.tsx index 7b0a588d2..cedb6f1b9 100644 --- a/apps/desktop/layer/renderer/src/modules/entry-content/components/layouts/ArticleLayout.tsx +++ b/apps/desktop/layer/renderer/src/modules/entry-content/components/layouts/ArticleLayout.tsx @@ -72,7 +72,7 @@ export const ArticleLayout: React.FC = ({ if (!entry) return null return ( -
+