diff --git a/apps/desktop/layer/renderer/src/components/ui/dropdown-menu/dropdown-menu.tsx b/apps/desktop/layer/renderer/src/components/ui/dropdown-menu/dropdown-menu.tsx index 10ca607e7..f3f1b1a5f 100644 --- a/apps/desktop/layer/renderer/src/components/ui/dropdown-menu/dropdown-menu.tsx +++ b/apps/desktop/layer/renderer/src/components/ui/dropdown-menu/dropdown-menu.tsx @@ -171,7 +171,7 @@ const DropdownMenuItem = ({ ref={ref} className={cn( "relative flex cursor-menu select-none items-center rounded-[5px] px-2.5 py-1 outline-none focus:bg-accent/30 data-[disabled]:pointer-events-none data-[disabled]:opacity-50", - "focus-within:outline-transparent data-[highlighted]:bg-mix-background/accent-5/1", + "focus-within:outline-transparent data-[highlighted]:text-accent data-[highlighted]:bg-mix-background/accent-9/1", "h-[28px]", inset && "pl-8", className, diff --git a/apps/desktop/layer/renderer/src/modules/app-layout/ai-enhanced-timeline/AIEnhancedTimelineLayout.tsx b/apps/desktop/layer/renderer/src/modules/app-layout/ai-enhanced-timeline/AIEnhancedTimelineLayout.tsx index 8a5a318e7..551a39307 100644 --- a/apps/desktop/layer/renderer/src/modules/app-layout/ai-enhanced-timeline/AIEnhancedTimelineLayout.tsx +++ b/apps/desktop/layer/renderer/src/modules/app-layout/ai-enhanced-timeline/AIEnhancedTimelineLayout.tsx @@ -1,4 +1,5 @@ import { Spring } from "@follow/components/constants/spring.js" +import { useMobile } from "@follow/components/hooks/useMobile.js" import { PanelSplitter } from "@follow/components/ui/divider/index.js" import { FeedViewType } from "@follow/constants" import { defaultUISettings } from "@follow/shared/settings/defaults" @@ -25,6 +26,8 @@ import { AIEntryHeader } from "~/modules/entry-content/components/entry-header" import { AppLayoutGridContainerProvider } from "~/providers/app-grid-layout-container-provider" import { MainViewHotkeysProvider } from "~/providers/main-view-hotkeys-provider" +import { MobileTimelineLayout } from "./MobileTimelineLayout" + const MIN_ENTRY_WIDTH = isSafari() ? 356 : 300 const AIEnhancedTimelineLayoutImpl = () => { @@ -38,6 +41,19 @@ const AIEnhancedTimelineLayoutImpl = () => { const aiPanelStyle = useAIChatPanelStyle() const isAIPanelVisible = useAIPanelVisibility() const hasSelectedEntry = Boolean(realEntryId) + const isMobile = useMobile() + + // Compute derived values first + const showEntryContentOnRight = showEntryDetailsColumn && hasSelectedEntry + const isFixedPanelStyle = aiPanelStyle === AIChatPanelStyle.Fixed + const shouldShowFixedAI = isFixedPanelStyle && isAIPanelVisible + const showEntryContentOnLeft = !showEntryDetailsColumn && hasSelectedEntry + const shouldRenderRightColumn = showEntryDetailsColumn || shouldShowFixedAI + const shouldShowEntryBorder = showEntryDetailsColumn || shouldShowFixedAI + + // Mobile-specific logic: disable resizing and hide splitters + const shouldDisableResize = isMobile + const shouldShowSplitter = !isMobile && shouldRenderRightColumn const layoutContainerRef = useRef(null) const feedColumnWidth = useUISettingKey("feedColWidth") @@ -62,6 +78,7 @@ const AIEnhancedTimelineLayoutImpl = () => { max: timelineMaxWidth, initial: entryColumnInitialWidth, containerRef: layoutContainerRef as React.RefObject, + disabled: shouldDisableResize, onResizeStart({ position }) { timelineStartDragPosition.current = position }, @@ -101,6 +118,7 @@ const AIEnhancedTimelineLayoutImpl = () => { initial: resolvePreferredWidth(), reverse: true, containerRef: layoutContainerRef as React.RefObject, + disabled: shouldDisableResize, onResizeStart({ position }) { aiPanelStartDragPosition.current = position }, @@ -117,32 +135,36 @@ const AIEnhancedTimelineLayoutImpl = () => { window.dispatchEvent(new Event("resize")) }, [resolvePreferredWidth, setAiPanelWidth]) - const showEntryContentOnRight = showEntryDetailsColumn && hasSelectedEntry - const isFixedPanelStyle = aiPanelStyle === AIChatPanelStyle.Fixed - const shouldShowFixedAI = isFixedPanelStyle && isAIPanelVisible - const showEntryContentOnLeft = !showEntryDetailsColumn && hasSelectedEntry - - const shouldRenderRightColumn = showEntryDetailsColumn || shouldShowFixedAI - const shouldShowEntryBorder = showEntryDetailsColumn || shouldShowFixedAI - - const entryColumnStyle: CSSProperties = showEntryDetailsColumn + const entryColumnStyle: CSSProperties = isMobile ? { - flexBasis: timelineColumnWidth, - minWidth: MIN_ENTRY_WIDTH, - } - : { - minWidth: MIN_ENTRY_WIDTH, + width: "100%", + minWidth: "100%", + flexBasis: "100%", } + : showEntryDetailsColumn + ? { + flexBasis: timelineColumnWidth, + minWidth: MIN_ENTRY_WIDTH, + } + : { + minWidth: MIN_ENTRY_WIDTH, + } - const rightColumnStyle: CSSProperties = showEntryDetailsColumn + const rightColumnStyle: CSSProperties = isMobile ? { - minWidth: 0, - } - : { - width: aiPanelWidth, - minWidth: 0, - flexBasis: aiPanelWidth, + width: "100%", + minWidth: "100%", + flexBasis: "100%", } + : showEntryDetailsColumn + ? { + minWidth: 0, + } + : { + width: aiPanelWidth, + minWidth: 0, + flexBasis: aiPanelWidth, + } const resetTimelineWidth = useCallback(() => { setUISetting("entryColWidth", defaultUISettings.entryColWidth) @@ -157,7 +179,7 @@ const AIEnhancedTimelineLayoutImpl = () => { window.dispatchEvent(new Event("resize")) }, [clampWidth, setAiPanelWidth]) - const splitter = + const splitter = shouldShowSplitter ? ( shouldRenderRightColumn && showEntryDetailsColumn ? ( { onDoubleClick={resetAiWidth} /> ) : null + ) : null + + // Mobile layout: stacked with view switching + if (isMobile) { + return + } return (
("list") + const navigate = useNavigateEntry() + const { view } = useRouteParamsSelector((state) => ({ + view: state.view, + })) + const showEntryDetailsColumn = useShowEntryDetailsColumn() + // Auto-switch to entry view when entry is selected + useEffect(() => { + if (hasSelectedEntry && mobileView === "list") { + setMobileView("entry") + } else if (!hasSelectedEntry && mobileView === "entry") { + setMobileView("list") + } + }, [hasSelectedEntry, mobileView]) + + return ( +
+ +
+ {/* List View */} + + {mobileView === "list" && ( + + + + )} + + {/* Entry View */} + {mobileView === "entry" && entryId && ( + +
+
+ {/* Mobile back button - only show when EntryHeaderBreadcrumb doesn't show close button */} + {showEntryDetailsColumn && ( + + )} +
+ +
+
+
+
+ +
+
+ )} +
+
+
+
+ ) +}) diff --git a/packages/internal/components/src/ui/context-menu/context-menu.tsx b/packages/internal/components/src/ui/context-menu/context-menu.tsx index e42e4256b..459d6601d 100644 --- a/packages/internal/components/src/ui/context-menu/context-menu.tsx +++ b/packages/internal/components/src/ui/context-menu/context-menu.tsx @@ -36,7 +36,8 @@ const ContextMenuSubTrigger = ({