From d0adc8e33e8ea136a27a728cb580df9de7bbd7f5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Nov 2025 14:32:28 +0800 Subject: [PATCH 01/20] build(deps): bump actions/checkout from 5 to 6 (#4747) Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v5...v6) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build-android.yml | 2 +- .github/workflows/build-desktop.yml | 4 ++-- .github/workflows/build-ios-development.yml | 6 +++--- .github/workflows/build-ios.yml | 4 ++-- .github/workflows/build-web.yml | 2 +- .github/workflows/issue-labeler.yml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/similar-issues.yml | 2 +- .github/workflows/sync.yaml | 2 +- .github/workflows/tag.yml | 2 +- .github/workflows/translator.yml | 2 +- 11 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index 2bd681eed..8c57a33ac 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -33,7 +33,7 @@ jobs: steps: - name: 📦 Checkout code - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: 📦 Setup pnpm uses: pnpm/action-setup@v4 diff --git a/.github/workflows/build-desktop.yml b/.github/workflows/build-desktop.yml index 2ec5c5139..7d003eae3 100644 --- a/.github/workflows/build-desktop.yml +++ b/.github/workflows/build-desktop.yml @@ -56,13 +56,13 @@ jobs: steps: - name: Check out Git repository Fully - uses: actions/checkout@v5 + uses: actions/checkout@v6 if: env.PROD == 'true' with: fetch-depth: 0 lfs: true - name: Check out Git repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 if: env.PROD == 'false' with: fetch-depth: 1 diff --git a/.github/workflows/build-ios-development.yml b/.github/workflows/build-ios-development.yml index 65990d6a8..4e7312010 100644 --- a/.github/workflows/build-ios-development.yml +++ b/.github/workflows/build-ios-development.yml @@ -40,7 +40,7 @@ jobs: steps: - name: 📦 Checkout code - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: 📱 Setup EAS uses: expo/expo-github-action@v8 @@ -78,7 +78,7 @@ jobs: steps: - name: 📦 Checkout code - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: 🔧 Setup Xcode uses: ./.github/actions/setup-xcode @@ -122,7 +122,7 @@ jobs: steps: - name: 📦 Checkout code - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: 🔧 Setup Xcode uses: ./.github/actions/setup-xcode diff --git a/.github/workflows/build-ios.yml b/.github/workflows/build-ios.yml index 764f78906..1683ec286 100644 --- a/.github/workflows/build-ios.yml +++ b/.github/workflows/build-ios.yml @@ -47,7 +47,7 @@ jobs: steps: - name: 📦 Checkout code - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: 📱 Setup EAS uses: expo/expo-github-action@v8 @@ -90,7 +90,7 @@ jobs: steps: - name: 📦 Checkout code - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: 🔧 Setup Xcode uses: ./.github/actions/setup-xcode diff --git a/.github/workflows/build-web.yml b/.github/workflows/build-web.yml index 1b61f8d94..322f88c70 100644 --- a/.github/workflows/build-web.yml +++ b/.github/workflows/build-web.yml @@ -17,7 +17,7 @@ jobs: node-version: [lts/*] steps: - name: Checkout code - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: lfs: true - name: Cache turbo build setup diff --git a/.github/workflows/issue-labeler.yml b/.github/workflows/issue-labeler.yml index 25450cbd9..ceaf0d184 100644 --- a/.github/workflows/issue-labeler.yml +++ b/.github/workflows/issue-labeler.yml @@ -19,7 +19,7 @@ jobs: contents: read steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Parse issue form uses: stefanbuck/github-issue-parser@v3 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 20ed03eea..9f5b8ac68 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -22,7 +22,7 @@ jobs: node-version: [lts/*] steps: - name: Checkout code - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: lfs: true - name: Cache turbo build setup diff --git a/.github/workflows/similar-issues.yml b/.github/workflows/similar-issues.yml index d7b60f318..b6bd67673 100644 --- a/.github/workflows/similar-issues.yml +++ b/.github/workflows/similar-issues.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare prompt variables id: prepare_input diff --git a/.github/workflows/sync.yaml b/.github/workflows/sync.yaml index 983e179d9..ee0f9e36c 100644 --- a/.github/workflows/sync.yaml +++ b/.github/workflows/sync.yaml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: fetch-depth: 0 diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml index 99a62cc22..13da44f27 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/tag.yml @@ -16,7 +16,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Setup Node.js uses: actions/setup-node@v6 diff --git a/.github/workflows/translator.yml b/.github/workflows/translator.yml index c10438f96..dea91e207 100644 --- a/.github/workflows/translator.yml +++ b/.github/workflows/translator.yml @@ -17,7 +17,7 @@ jobs: pull-requests: write runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - uses: lizheming/github-translate-action@c55aac477e98562d4faed9f77c54ab8306ae6ebf env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From a52c0473f03408c3b795d7541e54a6874d1d818a Mon Sep 17 00:00:00 2001 From: Innei Date: Mon, 24 Nov 2025 15:18:49 +0800 Subject: [PATCH 02/20] fix: update EntryListHeader styling and enhance FeedItem context menu - Removed conditional class application for feedIcon in EntryListHeader to simplify styling. - Added functionality to the FeedItem context menu to allow users to switch views, integrating a new menu item for changing to another view based on the current subscription. Signed-off-by: Innei --- .../entry-column/layouts/EntryListHeader.tsx | 2 +- .../modules/subscription-column/FeedItem.tsx | 36 ++++++++++++++++++- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/apps/desktop/layer/renderer/src/modules/entry-column/layouts/EntryListHeader.tsx b/apps/desktop/layer/renderer/src/modules/entry-column/layouts/EntryListHeader.tsx index 40b5c07d9..d1ac0df61 100644 --- a/apps/desktop/layer/renderer/src/modules/entry-column/layouts/EntryListHeader.tsx +++ b/apps/desktop/layer/renderer/src/modules/entry-column/layouts/EntryListHeader.tsx @@ -63,7 +63,7 @@ export const EntryListHeader: FC<{
{feedIcon && } diff --git a/apps/desktop/layer/renderer/src/modules/subscription-column/FeedItem.tsx b/apps/desktop/layer/renderer/src/modules/subscription-column/FeedItem.tsx index c38376104..91884f63b 100644 --- a/apps/desktop/layer/renderer/src/modules/subscription-column/FeedItem.tsx +++ b/apps/desktop/layer/renderer/src/modules/subscription-column/FeedItem.tsx @@ -9,7 +9,7 @@ import { TooltipTrigger, } from "@follow/components/ui/tooltip/index.jsx" import { EllipsisHorizontalTextWithTooltip } from "@follow/components/ui/typography/index.js" -import { FeedViewType } from "@follow/constants" +import { FeedViewType, getViewList } from "@follow/constants" import { isOnboardingFeedUrl } from "@follow/store/constants/onboarding" import { useFeedById } from "@follow/store/feed/hooks" import { useInboxById } from "@follow/store/inbox/hooks" @@ -30,6 +30,7 @@ import { useFeedActions, useInboxActions, useListActions } from "~/hooks/biz/use import { useFollow } from "~/hooks/biz/useFollow" import { useNavigateEntry } from "~/hooks/biz/useNavigateEntry" import { useRouteParamsSelector } from "~/hooks/biz/useRouteParams" +import { useBatchUpdateSubscription } from "~/hooks/biz/useSubscriptionActions" import { useContextMenu } from "~/hooks/common/useContextMenu" import { getNewIssueUrl } from "~/lib/issues" import { UrlBuilder } from "~/lib/url-builder" @@ -131,6 +132,8 @@ const FeedItemImpl = ({ view, feedId, className, isPreview }: FeedItemProps) => const whenTrigger = when && isActive useContextMenuActionShortCutTrigger(items, whenTrigger) + const { mutate: changeFeedView } = useBatchUpdateSubscription() + const [isContextMenuOpen, setIsContextMenuOpen] = useState(false) const showContextMenu = useShowContextMenu() const contextMenuProps = useContextMenu({ @@ -138,6 +141,8 @@ const FeedItemImpl = ({ view, feedId, className, isPreview }: FeedItemProps) => const nextItems = items.concat() if (!feed) return + + const isFeed = feed.type === "feed" || !feed.type if (isFeed && feed.errorAt && feed.errorMessage) { nextItems.push( MenuItemSeparator.default, @@ -159,6 +164,35 @@ const FeedItemImpl = ({ view, feedId, className, isPreview }: FeedItemProps) => }), ) } + + // Add "Switch to Another View" menu item + if (subscription && typeof subscription.view === "number") { + nextItems.push( + MenuItemSeparator.default, + new MenuItemText({ + label: t("sidebar.feed_column.context_menu.change_to_other_view"), + submenu: getViewList() + .filter((v) => v.view !== subscription.view && v.switchable) + .map( + (v) => + new MenuItemText({ + label: t(v.name, { ns: "common" }), + shortcut: (v.view + 1).toString(), + icon: v.icon, + click() { + return changeFeedView({ + feedIdList: [feedId], + view: v.view, + }) + }, + requiresLogin: true, + }), + ), + requiresLogin: true, + }), + ) + } + setIsContextMenuOpen(true) await showContextMenu(nextItems, e) setIsContextMenuOpen(false) From 452bb941a99010a39d1080d6e0917a59281fcf37 Mon Sep 17 00:00:00 2001 From: Innei Date: Mon, 24 Nov 2025 15:26:44 +0800 Subject: [PATCH 03/20] fix: entry 404 rendered error, closed #4729 Signed-off-by: Innei --- .../src/modules/entry-content/EntryContent.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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 643d90a31..8841b5cc3 100644 --- a/apps/desktop/layer/renderer/src/modules/entry-content/EntryContent.tsx +++ b/apps/desktop/layer/renderer/src/modules/entry-content/EntryContent.tsx @@ -18,8 +18,10 @@ import * as React from "react" import { memo, useEffect, useRef, useState } from "react" import { useEntryIsInReadability } from "~/atoms/readability" +import { AppErrorBoundary } from "~/components/common/AppErrorBoundary" import { Focusable } from "~/components/common/Focusable" import { m } from "~/components/common/Motion" +import { ErrorComponentType } from "~/components/errors/enum" import { GlassButton } from "~/components/ui/button/GlassButton" import { HotkeyScope } from "~/constants" import { useRouteParamsSelector } from "~/hooks/biz/useRouteParams" @@ -229,9 +231,11 @@ const EntryContentImpl: Component = ({ } export const EntryContent: Component = memo((props) => { return ( - - - + + + + + ) }) From ad8575d7375f2b8248eb2f902f5ef33120a7745c Mon Sep 17 00:00:00 2001 From: Innei Date: Mon, 24 Nov 2025 16:02:17 +0800 Subject: [PATCH 04/20] feat: narrowed responsive layout handling, closed #4370 - Added a renderValue function to the LanguageSelector for improved display of selected language names. - Updated layout component to support responsive behavior based on viewport width. - Refactored setting sync to utilize useMobile hook for better mobile detection. - Enhanced withResponsiveComponent to accept a breakpoint function for more flexible responsive layouts. Signed-off-by: Innei --- .../src/modules/settings/tabs/general.tsx | 3 +++ .../renderer/src/pages/(main)/layout.tsx | 1 + .../renderer/src/providers/setting-sync.tsx | 8 +++---- .../components/src/utils/selector.tsx | 24 +++++++++++++++++-- 4 files changed, 30 insertions(+), 6 deletions(-) diff --git a/apps/desktop/layer/renderer/src/modules/settings/tabs/general.tsx b/apps/desktop/layer/renderer/src/modules/settings/tabs/general.tsx index 99cf00b02..822d0e89a 100644 --- a/apps/desktop/layer/renderer/src/modules/settings/tabs/general.tsx +++ b/apps/desktop/layer/renderer/src/modules/settings/tabs/general.tsx @@ -268,6 +268,9 @@ export const LanguageSelector = ({ setGeneralSetting("language", value as string) dayjs.locale(value) }} + renderValue={useTypeScriptHappyCallback((item) => { + return {defaultResources[item.value].lang.name} + }, [])} renderItem={useTypeScriptHappyCallback((item) => { const lang = item.value const percent = I18N_COMPLETENESS_MAP[lang] diff --git a/apps/desktop/layer/renderer/src/pages/(main)/layout.tsx b/apps/desktop/layer/renderer/src/pages/(main)/layout.tsx index 60b62ca05..3b0263252 100644 --- a/apps/desktop/layer/renderer/src/pages/(main)/layout.tsx +++ b/apps/desktop/layer/renderer/src/pages/(main)/layout.tsx @@ -8,4 +8,5 @@ export const Component = withResponsiveComponent( const { default: DownloadPage } = await import("~/modules/download") return { default: DownloadPage } }, + (w) => w < 768, ) diff --git a/apps/desktop/layer/renderer/src/providers/setting-sync.tsx b/apps/desktop/layer/renderer/src/providers/setting-sync.tsx index d871f4034..42fb30fad 100644 --- a/apps/desktop/layer/renderer/src/providers/setting-sync.tsx +++ b/apps/desktop/layer/renderer/src/providers/setting-sync.tsx @@ -1,4 +1,4 @@ -import { isMobile } from "@follow/components/hooks/useMobile.js" +import { useMobile } from "@follow/components/hooks/useMobile.js" import { useIsDark } from "@follow/hooks" import { getAccentColorValue } from "@follow/shared/settings/constants" import type { UISettings } from "@follow/shared/settings/interface" @@ -47,12 +47,12 @@ const useUpdateDockBadge = (setting: UISettings) => { } const useUISettingSync = () => { const setting = useUISettingValue() - const mobile = isMobile() + const mobile = useMobile() useSyncTheme() useInsertionEffect(() => { const root = document.documentElement - root.style.fontSize = `${setting.uiTextSize * (mobile ? 1.125 : 1)}px` - }, [setting.uiTextSize]) + root.style.fontSize = `${setting.uiTextSize * (mobile ? 0.875 : 1)}px` + }, [setting.uiTextSize, mobile]) const isDark = useIsDark() useInsertionEffect(() => { diff --git a/packages/internal/components/src/utils/selector.tsx b/packages/internal/components/src/utils/selector.tsx index b6d950d9f..e10702eb2 100644 --- a/packages/internal/components/src/utils/selector.tsx +++ b/packages/internal/components/src/utils/selector.tsx @@ -1,4 +1,5 @@ import { useMobile } from "@follow/components/hooks/useMobile.js" +import { useViewport } from "@follow/components/hooks/useViewport.js" import type { ComponentType, ReactNode, RefAttributes } from "react" import { lazy, Suspense } from "react" @@ -6,15 +7,34 @@ export function withResponsiveComponent

( desktopImport: () => Promise<{ default: ComponentType

}>, mobileImport: () => Promise<{ default: ComponentType

}>, fallbackElement?: ReactNode, +): ComponentType

+export function withResponsiveComponent

( + desktopImport: () => Promise<{ default: ComponentType

}>, + mobileImport: () => Promise<{ default: ComponentType

}>, + breakpointFn: (w: number) => boolean, + fallbackElement?: ReactNode, +): ComponentType

+export function withResponsiveComponent

( + desktopImport: () => Promise<{ default: ComponentType

}>, + mobileImport: () => Promise<{ default: ComponentType

}>, + fallbackElementOrBreakpointFn?: ReactNode | ((w: number) => boolean), + fallbackElement?: ReactNode, ) { const LazyDesktopLayout = lazy(desktopImport) as unknown as ComponentType

const LazyMobileLayout = lazy(mobileImport) as unknown as ComponentType

+ // Check if the third parameter is a function (breakpoint function) or ReactNode (fallback) + const isBreakpointFn = typeof fallbackElementOrBreakpointFn === "function" + const breakpointFn = isBreakpointFn ? fallbackElementOrBreakpointFn : undefined + const fallback = isBreakpointFn ? fallbackElement : fallbackElementOrBreakpointFn + return function ResponsiveLayout(props: P) { - const isMobile = useMobile() + const isMobile = useViewport(({ w: viewport }) => + breakpointFn ? breakpointFn(viewport) : viewport < 1024 && viewport !== 0, + ) return ( - + {isMobile ? : } ) From f178f486f81b45e3854e2f68df0ca5ce683a8c3e Mon Sep 17 00:00:00 2001 From: Innei Date: Mon, 24 Nov 2025 16:41:25 +0800 Subject: [PATCH 05/20] feat: implement mobile layout for AIEnhancedTimeline - Added MobileTimelineLayout component to handle mobile-specific rendering. - Integrated useMobile hook for responsive behavior in AIEnhancedTimelineLayout. - Updated layout logic to conditionally render components based on mobile view. - Enhanced dropdown and context menu styles for better visual feedback. Signed-off-by: Innei --- .../ui/dropdown-menu/dropdown-menu.tsx | 2 +- .../AIEnhancedTimelineLayout.tsx | 72 +++++++++----- .../MobileTimelineLayout.tsx | 96 +++++++++++++++++++ .../src/ui/context-menu/context-menu.tsx | 9 +- 4 files changed, 152 insertions(+), 27 deletions(-) create mode 100644 apps/desktop/layer/renderer/src/modules/app-layout/ai-enhanced-timeline/MobileTimelineLayout.tsx 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 = ({ Date: Tue, 25 Nov 2025 01:17:36 +0800 Subject: [PATCH 06/20] chore: modify copy to increase conversion - Updated layout and styling for the LoginModalContent component to improve visual hierarchy and user experience. - Added new benefits and subtitles to the login interface, enhancing clarity for users. - Introduced a quick start hint for new users and a demo view button for better engagement. - Updated localization files for English, Japanese, Simplified Chinese, and Traditional Chinese to reflect new content. Signed-off-by: Innei --- .../src/modules/auth/LoginModalContent.tsx | 94 +++++++++++++------ .../src/modules/subscription-column/index.tsx | 2 +- locales/app/en.json | 10 +- locales/app/ja.json | 10 +- locales/app/zh-CN.json | 10 +- locales/app/zh-TW.json | 11 ++- 6 files changed, 105 insertions(+), 32 deletions(-) diff --git a/apps/desktop/layer/renderer/src/modules/auth/LoginModalContent.tsx b/apps/desktop/layer/renderer/src/modules/auth/LoginModalContent.tsx index 36979684c..e6f891e64 100644 --- a/apps/desktop/layer/renderer/src/modules/auth/LoginModalContent.tsx +++ b/apps/desktop/layer/renderer/src/modules/auth/LoginModalContent.tsx @@ -99,25 +99,44 @@ export const LoginModalContent = (props: LoginModalContentProps) => { )} {/* Header Section */} -
+
- - - - - {isRegister ? t("signin.sign_up_to") : t("signin.sign_in_to")} - - + + {isRegister ? ( + +

{t("login.title")}

+

+ {t("login.subtitle")} +

+ {/* Benefits - single line */} +
+ ✦ + {t("login.benefit_1")} + · + {t("login.benefit_2")} +
+
+ ) : ( + + {t("signin.sign_in_to")} + + + )}
{!IN_ELECTRON && ( ))} + {/* Quick start hint */} + {isRegister && providers.length > 0 && !isLoading && ( + + {t("login.quick_start")} + + )}
{/* Referral Form */} @@ -212,7 +240,7 @@ export const LoginModalContent = (props: LoginModalContentProps) => { )} {/* Footer Links */} -
+
+ ) +} + +export function UnifiedDiscoverForm() { + const [searchParams, setSearchParams] = useSearchParams() + const keywordFromSearch = searchParams.get("keyword") || "" + const { t } = useTranslation() + const isInMASReview = useIsInMASReview() + const { ensureLogin } = useRequireLogin() + const { present, dismissAll } = useModalStack() + const isMobile = useMobile() + const jotaiStore = useStore() + + // Auto-detect input type based on current value + const detectedType = useMemo(() => { + if (keywordFromSearch) { + return detectInputType(keywordFromSearch) + } + return "search" + }, [keywordFromSearch]) + + // Use search form by default, but validate based on detected type + const form = useForm({ + resolver: zodResolver(searchSchema), + defaultValues: { + keyword: keywordFromSearch || "", + target: "feeds", + }, + mode: "all", + }) + + const { watch, trigger } = form + const target = watch("target") + const atomKey = keywordFromSearch + target + + // Validate default value from search params + useEffect(() => { + if (!keywordFromSearch) { + return + } + trigger("keyword") + }, [trigger, keywordFromSearch]) + + const discoverSearchData = useAtomValue(discoverSearchDataAtom)?.[atomKey] || [] + + const mutation = useMutation({ + mutationFn: async ({ keyword, target }: { keyword: string; target: "feeds" | "lists" }) => { + const inputType = detectInputType(keyword) + + // For RSS/RSSHub, validate and show feed form modal directly + if (inputType === "rss") { + const validated = rssSchema.safeParse({ keyword }) + if (!validated.success) { + throw new Error("Invalid RSS URL") + } + present({ + title: t("feed_form.add_feed"), + content: () => , + }) + return [] + } + + if (inputType === "rsshub") { + const validated = rsshubSchema.safeParse({ keyword }) + if (!validated.success) { + throw new Error("Invalid RSSHub route") + } + present({ + title: t("feed_form.add_feed"), + content: () => , + }) + return [] + } + + // For search, perform discovery + let { data } = await followClient.api.discover.discover({ + keyword: keyword.trim(), + target, + }) + if (isInMASReview) { + data = data.filter((item) => !item.list?.fee) + } + + jotaiStore.set(discoverSearchDataAtom, (prev) => ({ + ...prev, + [atomKey]: data, + })) + + return data + }, + }) + + const handleKeywordChange = useCallback( + (event: ChangeEvent) => { + const { value } = event.currentTarget + // During composition, update raw value without validation + if ((event.nativeEvent as InputEvent)?.isComposing) { + form.setValue("keyword", value, { shouldValidate: false }) + return + } + + startTransition(() => { + form.setValue("keyword", value, { shouldValidate: true }) + setSearchParams( + (prev) => { + const newParams = new URLSearchParams(prev) + if (value.trim()) { + newParams.set("keyword", value.trim()) + } else { + newParams.delete("keyword") + } + return newParams + }, + { + replace: true, + }, + ) + }) + }, + [form, setSearchParams], + ) + + const handleCompositionEnd = useCallback( + (event: CompositionEvent) => { + const { value } = event.currentTarget + form.setValue("keyword", value, { shouldValidate: true }) + setSearchParams( + (prev) => { + const newParams = new URLSearchParams(prev) + if (value.trim()) { + newParams.set("keyword", value.trim()) + } else { + newParams.delete("keyword") + } + return newParams + }, + { + replace: true, + }, + ) + }, + [form, setSearchParams], + ) + + const handleSuccess = useCallback( + (item: DiscoveryItem) => { + const currentData = jotaiStore.get(discoverSearchDataAtom) + if (!currentData) return + jotaiStore.set( + discoverSearchDataAtom, + produce(currentData, (draft) => { + const sub = (draft[atomKey] || []).find((i) => { + if (item.feed) { + return i.feed?.id === item.feed.id + } + if (item.list) { + return i.list?.id === item.list.id + } + return false + }) + if (!sub) return + sub.subscriptionCount = -~(sub.subscriptionCount as number) + }), + ) + }, + [atomKey, jotaiStore], + ) + + const handleUnSubscribed = useCallback( + (item: DiscoveryItem) => { + const currentData = jotaiStore.get(discoverSearchDataAtom) + if (!currentData) return + jotaiStore.set( + discoverSearchDataAtom, + produce(currentData, (draft) => { + const sub = (draft[atomKey] || []).find( + (i) => i.feed?.id === item.feed?.id || i.list?.id === item.list?.id, + ) + if (!sub) return + sub.subscriptionCount = Number.isNaN(sub.subscriptionCount) + ? 0 + : (sub.subscriptionCount as number) - 1 + }), + ) + }, + [atomKey, jotaiStore], + ) + + const handleTargetChange = useCallback( + (value: string) => { + form.setValue("target", value as "feeds" | "lists") + }, + [form], + ) + + function onSubmit(values: SearchFormData) { + if (!ensureLogin()) { + return + } + mutation.mutate({ keyword: values.keyword, target: values.target }) + } + + const showTargetSelector = detectedType === "search" + + return ( + <> + + + + + + +
+ {(mutation.isSuccess || !!discoverSearchData?.length) && ( +
+ {t("discover.search.results", { count: discoverSearchData?.length || 0 })} + + {discoverSearchData && discoverSearchData.length > 0 && ( + { + jotaiStore.set(discoverSearchDataAtom, { + ...jotaiStore.get(discoverSearchDataAtom), + [atomKey]: [], + }) + mutation.reset() + }} + > + + + )} +
+ )} +
+ {discoverSearchData?.map((item) => ( + + ))} +
+
+ + ) +} diff --git a/apps/desktop/layer/renderer/src/modules/discover/recommendations.tsx b/apps/desktop/layer/renderer/src/modules/discover/recommendations.tsx index d389532a8..bcb902d30 100644 --- a/apps/desktop/layer/renderer/src/modules/discover/recommendations.tsx +++ b/apps/desktop/layer/renderer/src/modules/discover/recommendations.tsx @@ -1,61 +1,13 @@ import { Card, CardContent } from "@follow/components/ui/card/index.jsx" -import { ResponsiveSelect } from "@follow/components/ui/select/responsive.js" import { CategoryMap, RSSHubCategories } from "@follow/constants" import { useTranslation } from "react-i18next" import { Link } from "react-router" -import { setUISetting, useUISettingKey } from "~/atoms/settings/ui" - -const LanguageOptions = [ - { - label: "words.all", - value: "all", - }, - { - label: "words.english", - value: "eng", - }, - { - label: "words.chinese", - value: "cmn", - }, -] - -type Language = "all" | "eng" | "cmn" - export function Recommendations() { const { t } = useTranslation() - const { t: tCommon } = useTranslation("common") - - const lang = useUISettingKey("discoverLanguage") - - const handleLangChange = (value: string) => { - setUISetting("discoverLanguage", value as Language) - } return (
-
-
- - {t("words.categories")} -
-
-
- {t("words.language")} - tCommon(item.label as any)} - renderValue={(item) => tCommon(item.label as any)} - /> -
-
-
-
{RSSHubCategories.map((cat) => ( diff --git a/apps/desktop/layer/renderer/src/modules/trending/index.tsx b/apps/desktop/layer/renderer/src/modules/trending/index.tsx index bf94e89b4..9fccb5668 100644 --- a/apps/desktop/layer/renderer/src/modules/trending/index.tsx +++ b/apps/desktop/layer/renderer/src/modules/trending/index.tsx @@ -1,10 +1,10 @@ import { useScrollElementUpdate } from "@follow/components/ui/scroll-area/hooks.js" import { ResponsiveSelect } from "@follow/components/ui/select/responsive.js" import { Skeleton } from "@follow/components/ui/skeleton/index.jsx" -import { getViewList } from "@follow/constants" +import { FeedViewType, getView, getViewList } from "@follow/constants" import { cn } from "@follow/utils/utils" import { useQuery } from "@tanstack/react-query" -import { useEffect, useState } from "react" +import { cloneElement, useEffect, useMemo, useState } from "react" import { useTranslation } from "react-i18next" import { setUISetting, useUISettingKey } from "~/atoms/settings/ui" @@ -29,27 +29,36 @@ const LanguageOptions = [ type Language = "all" | "eng" | "cmn" -const viewOptions = [ - { - label: "words.all", - value: "all", - }, - ...getViewList().map((view) => ({ - label: view.name, - value: `${view.view}`, - })), -] +type View = "all" | string -type View = (typeof viewOptions)[number]["value"] +const buildViewOptions = () => { + const allView = getView(FeedViewType.All) + return [ + { + label: "words.all", + value: "all" as const, + icon: allView?.icon, + className: allView?.className, + }, + ...getViewList().map((view) => ({ + label: view.name, + value: `${view.view}`, + icon: view.icon, + className: view.className, + })), + ] +} export function Trending({ limit = 20, narrow, center, + hideHeader = false, }: { limit?: number narrow?: boolean center?: boolean + hideHeader?: boolean }) { const { t } = useTranslation() const { t: tCommon } = useTranslation("common") @@ -57,6 +66,7 @@ export function Trending({ const { onUpdateMaxScroll } = useScrollElementUpdate() const [selectedView, setSelectedView] = useState("all") + const viewOptions = useMemo(() => buildViewOptions(), []) const { data, isLoading } = useQuery({ queryKey: ["trending", lang, selectedView], @@ -80,53 +90,105 @@ export function Trending({ return (
-
+ {!hideHeader && (
- - {t("words.trending")} -
-
-
- {t("words.language")}: +
+ + {t("words.trending")} +
+
+
+ {t("words.language")}: - { - setUISetting("discoverLanguage", value as Language) - }} - triggerClassName="h-8 rounded border-0" - size="sm" - items={LanguageOptions} - renderItem={(item) => tCommon(item.label as any)} - renderValue={(item) => tCommon(item.label as any)} - /> -
-
- {t("words.view")}: - { - setSelectedView(value as View) - }} - triggerClassName="h-8 rounded border-0" - size="sm" - items={viewOptions} - renderItem={(item) => <>{tCommon(item.label as any)}} - /> + { + setUISetting("discoverLanguage", value as Language) + }} + triggerClassName="h-8 rounded border-0" + size="sm" + items={LanguageOptions} + renderItem={(item) => tCommon(item.label as any)} + renderValue={(item) => tCommon(item.label as any)} + /> +
+
+ {t("words.view")}: +
+ {viewOptions.map((option) => { + const isSelected = selectedView === option.value + return ( + + ) + })} +
+
-
+ )} + {hideHeader && ( +
+
+ {viewOptions.map((option) => { + const isSelected = selectedView === option.value + return ( + + ) + })} +
+
+ )}
{isLoading ? ( <> diff --git a/apps/desktop/layer/renderer/src/pages/(main)/(layer)/(subview)/discover/index.tsx b/apps/desktop/layer/renderer/src/pages/(main)/(layer)/(subview)/discover/index.tsx index ebe03351c..4fc51e4f8 100644 --- a/apps/desktop/layer/renderer/src/pages/(main)/(layer)/(subview)/discover/index.tsx +++ b/apps/desktop/layer/renderer/src/pages/(main)/(layer)/(subview)/discover/index.tsx @@ -1,145 +1,63 @@ -import { Divider } from "@follow/components/ui/divider/Divider.js" -import { useScrollElementUpdate } from "@follow/components/ui/scroll-area/hooks.js" -import { ScrollArea } from "@follow/components/ui/scroll-area/index.js" -import { Tabs, TabsContent, TabsList, TabsTrigger } from "@follow/components/ui/tabs/index.jsx" -import { createElement } from "react" +import { cn } from "@follow/utils/utils" +import type { ReactNode } from "react" import { useTranslation } from "react-i18next" import { useSearchParams } from "react-router" import { AppErrorBoundary } from "~/components/common/AppErrorBoundary" import { ErrorComponentType } from "~/components/errors/enum" import { useSubViewTitle } from "~/modules/app-layout/subview/hooks" -import { DiscoverForm } from "~/modules/discover/DiscoverForm" -import { DiscoverImport } from "~/modules/discover/DiscoverImport" -import { DiscoverInboxList } from "~/modules/discover/DiscoverInboxList" -import { DiscoverTransform } from "~/modules/discover/DiscoverTransform" -import { DiscoverUser } from "~/modules/discover/DiscoverUser" -import { Recommendations } from "~/modules/discover/recommendations" -import { Trending } from "~/modules/trending" +import { DiscoveryContent } from "~/modules/discover/DiscoveryContent" +import { UnifiedDiscoverForm } from "~/modules/discover/UnifiedDiscoverForm" -const tabs: { - name: I18nKeys - value: string -}[] = [ - { - name: "words.search", - value: "search", - }, - { - name: "words.rss", - value: "rss", - }, - { - name: "words.rsshub", - value: "rsshub", - }, - { - name: "words.inbox", - value: "inbox", - }, - { - name: "words.user", - value: "user", - }, - { - name: "words.transform", - value: "transform", - }, - { - name: "words.import", - value: "import", - }, -] +// ============================================================================ +// Section Components +// ============================================================================ + +interface SectionProps { + children: ReactNode + className?: string +} + +function Section({ children, className }: SectionProps) { + return
{children}
+} + +// ============================================================================ +// Main Component +// ============================================================================ export function Component() { - const [search, setSearch] = useSearchParams() const { t } = useTranslation() + const [searchParams] = useSearchParams() + const keyword = searchParams.get("keyword") + const isSearching = !!keyword?.trim() useSubViewTitle("words.discover") - const { onUpdateMaxScroll } = useScrollElementUpdate() - return (
- {/* Simple Header */} -
-

{t("words.discover")}

-
- -
- { - setSearch( - (search) => { - search.set("type", val) - search.delete("keyword") - return new URLSearchParams(search) - }, - { replace: true }, - ) - }} - className="w-full" - > - {/* Tab Navigation */} -
- - - {tabs.map((tab) => ( - { - onUpdateMaxScroll?.() - }} - > - {t(tab.name)} - - ))} - - -
- - {/* Tab Content */} -
- {tabs.map((tab) => ( - -
- {createElement(TabComponent[tab.value]! || TabComponent.default, { - type: tab.value, - })} -
-
- ))} -
-
- - {/* Additional Content Sections */} -
- - -
-

Trending

- -
- - - -
-

RSSHub

- - - -
+ {/* Hero Section */} +
+
+

{t("words.discover")}

+

{t("discover.tips.search_keyword")}

-
+ + + {/* Search Section */} +
+
+ +
+
+ + {/* Discovery Section - Hide when searching */} + {!isSearching && ( +
+ + + +
+ )}
) } - -const TabComponent: Record> = { - import: DiscoverImport, - inbox: DiscoverInboxList, - user: DiscoverUser, - default: DiscoverForm, - transform: DiscoverTransform, -} diff --git a/locales/app/en.json b/locales/app/en.json index 3c724dbf2..44141cc77 100644 --- a/locales/app/en.json +++ b/locales/app/en.json @@ -102,6 +102,13 @@ "discover.target.feeds": "Feeds", "discover.target.label": "Search for", "discover.target.lists": "Lists", + "discover.tips.auto_detect": "Auto-detect input type", + "discover.tips.search_keyword": "Search by keyword, URL, RSS feed, or RSSHub route", + "discover.tools.description": "More Tools", + "discover.tools.import": "Import OPML", + "discover.tools.inbox": "Inbox", + "discover.tools.transform": "HTML to RSS", + "discover.tools.user": "Follow User", "entry.click_to_return": "Scroll up or click here to return", "entry.exit_detail": "Return to timeline", "entry.scroll_up_to_exit": "Scroll up to return to timeline", diff --git a/locales/app/ja.json b/locales/app/ja.json index 3a167b62b..13abfd3b7 100644 --- a/locales/app/ja.json +++ b/locales/app/ja.json @@ -101,6 +101,13 @@ "discover.target.feeds": "フィード", "discover.target.label": "検索対象", "discover.target.lists": "リスト", + "discover.tips.auto_detect": "入力タイプを自動検出", + "discover.tips.search_keyword": "キーワード、URL、RSS フィード、または RSSHub ルートで検索", + "discover.tools.description": "その他のツール", + "discover.tools.import": "OPML をインポート", + "discover.tools.inbox": "受信トレイ", + "discover.tools.transform": "HTML を RSS に変換", + "discover.tools.user": "ユーザーをフォロー", "entry.click_to_return": "上にスクロールまたはこの領域をクリックして戻る", "entry.exit_detail": "時間軸に戻る", "entry.scroll_up_to_exit": "上にスクロールして時間軸に戻る", diff --git a/locales/app/zh-CN.json b/locales/app/zh-CN.json index f51d4be23..f285a3c5f 100644 --- a/locales/app/zh-CN.json +++ b/locales/app/zh-CN.json @@ -101,6 +101,13 @@ "discover.target.feeds": "订阅源", "discover.target.label": "搜索", "discover.target.lists": "列表", + "discover.tips.auto_detect": "自动识别输入类型", + "discover.tips.search_keyword": "支持关键词、URL、RSS 订阅源或 RSSHub 路由", + "discover.tools.description": "更多工具", + "discover.tools.import": "导入 OPML", + "discover.tools.inbox": "收件箱", + "discover.tools.transform": "HTML 转 RSS", + "discover.tools.user": "关注用户", "entry.click_to_return": "向上滚动或点击此区域返回", "entry.exit_detail": "返回时间线", "entry.scroll_up_to_exit": "向上滚动返回时间线", From f7460fd7ce5cbfef5d75a9f8b34845b375ba0bd8 Mon Sep 17 00:00:00 2001 From: Innei Date: Wed, 26 Nov 2025 17:17:12 +0800 Subject: [PATCH 13/20] style: adjust unify setting item margin Signed-off-by: Innei --- apps/desktop/layer/renderer/src/modules/settings/control.tsx | 2 +- .../layer/renderer/src/modules/settings/tabs/appearance.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/desktop/layer/renderer/src/modules/settings/control.tsx b/apps/desktop/layer/renderer/src/modules/settings/control.tsx index 6a9e8d762..e6707d5a8 100644 --- a/apps/desktop/layer/renderer/src/modules/settings/control.tsx +++ b/apps/desktop/layer/renderer/src/modules/settings/control.tsx @@ -211,7 +211,7 @@ export const SettingActionItem = ({ action: () => void buttonText: string }) => ( -
+
{typeof label === "string" ? titleCase(label) : label}
diff --git a/apps/desktop/layer/renderer/src/modules/settings/tabs/appearance.tsx b/apps/desktop/layer/renderer/src/modules/settings/tabs/appearance.tsx index c791bb85b..862c79ba2 100644 --- a/apps/desktop/layer/renderer/src/modules/settings/tabs/appearance.tsx +++ b/apps/desktop/layer/renderer/src/modules/settings/tabs/appearance.tsx @@ -376,7 +376,7 @@ const CustomCSS = () => { }} buttonText={t("appearance.custom_css.button")} /> - + {t("appearance.custom_css.description")} From 519d0ba110e48801388412c5ba10d30367e5b689 Mon Sep 17 00:00:00 2001 From: Innei Date: Wed, 26 Nov 2025 17:35:24 +0800 Subject: [PATCH 14/20] feat: enhance feed management with filtering options - Added a responsive select component to filter feeds by type (All, RSSHub). - Implemented logic to count and display RSSHub feeds. - Updated feed selection and sorting functionality to respect the selected filter. - Enhanced localization files to include new filter labels in English, Japanese, Simplified Chinese, and Traditional Chinese. Signed-off-by: Innei --- .../src/modules/settings/tabs/feeds.tsx | 72 +++++++++++++++++-- locales/settings/en.json | 2 + locales/settings/ja.json | 2 + locales/settings/zh-CN.json | 2 + locales/settings/zh-TW.json | 2 + 5 files changed, 73 insertions(+), 7 deletions(-) diff --git a/apps/desktop/layer/renderer/src/modules/settings/tabs/feeds.tsx b/apps/desktop/layer/renderer/src/modules/settings/tabs/feeds.tsx index d820224a4..7d745c87a 100644 --- a/apps/desktop/layer/renderer/src/modules/settings/tabs/feeds.tsx +++ b/apps/desktop/layer/renderer/src/modules/settings/tabs/feeds.tsx @@ -6,6 +6,7 @@ import { LoadingCircle } from "@follow/components/ui/loading/index.jsx" import { RSSHubLogo } from "@follow/components/ui/platform-icon/icons.js" import { useScrollViewElement } from "@follow/components/ui/scroll-area/hooks.js" import { ScrollArea } from "@follow/components/ui/scroll-area/index.js" +import { ResponsiveSelect } from "@follow/components/ui/select/responsive.js" import { Table, TableBody, @@ -33,7 +34,7 @@ import { clsx, formatNumber, sortByAlphabet } from "@follow/utils/utils" import { useVirtualizer } from "@tanstack/react-virtual" import { AnimatePresence, m } from "motion/react" import type { FC } from "react" -import { memo, useCallback, useMemo, useState } from "react" +import { memo, useCallback, useEffect, useMemo, useState } from "react" import { useTranslation } from "react-i18next" import { useIsInMASReview } from "~/atoms/server-configs" @@ -56,6 +57,7 @@ import { Queries } from "~/queries" type SortField = "name" | "view" | "date" | "subscriptionCount" | "updatesPerWeek" type SortDirection = "asc" | "desc" +type FeedFilter = "all" | "rsshub" export const SettingFeeds = () => { const inMas = useIsInMASReview() @@ -75,6 +77,42 @@ const SubscriptionFeedsSection = () => { const [selectedFeeds, setSelectedFeeds] = useState>(() => new Set()) const [sortField, setSortField] = useState("name") const [sortDirection, setSortDirection] = useState("asc") + const [filter, setFilter] = useState("all") + + // Calculate RSSHub feeds count + const rsshubFeedsCount = useMemo(() => { + return allFeeds.filter((feedId) => { + const feed = getFeedById(feedId) + return Boolean(feed?.url?.startsWith("rsshub://")) + }).length + }, [allFeeds]) + + // Filter feeds based on selected filter + const filteredFeeds = useMemo(() => { + if (filter === "all") { + return allFeeds + } + return allFeeds.filter((feedId) => { + const feed = getFeedById(feedId) + return Boolean(feed?.url?.startsWith("rsshub://")) + }) + }, [allFeeds, filter]) + + // Clean up selectedFeeds when filter changes + const filteredFeedsSet = useMemo(() => new Set(filteredFeeds), [filteredFeeds]) + + // Clean selected feeds that are not in current filter + useEffect(() => { + setSelectedFeeds((prev) => { + const cleaned = new Set() + prev.forEach((feedId) => { + if (filteredFeedsSet.has(feedId)) { + cleaned.add(feedId) + } + }) + return cleaned + }) + }, [filteredFeedsSet]) const handleSort = useCallback( (field: SortField) => { @@ -91,12 +129,12 @@ const SubscriptionFeedsSection = () => { const handleSelectAll = useCallback( (checked: boolean) => { if (checked) { - setSelectedFeeds(new Set(allFeeds)) + setSelectedFeeds(new Set(filteredFeeds)) } else { setSelectedFeeds(new Set()) } }, - [allFeeds], + [filteredFeeds], ) const handleSelectFeed = useCallback((feedId: string, checked: boolean) => { @@ -111,7 +149,7 @@ const SubscriptionFeedsSection = () => { }) }, []) - const isAllSelected = allFeeds.length > 0 && selectedFeeds.size === allFeeds.length + const isAllSelected = filteredFeeds.length > 0 && selectedFeeds.size === filteredFeeds.length const presentDeleteSubscription = useConfirmUnsubscribeSubscriptionModal() const handleBatchUnsubscribe = useCallback(() => { @@ -121,9 +159,29 @@ const SubscriptionFeedsSection = () => { return (
-

{t("feeds.subscription")}

+
+

{t("feeds.subscription")}

+ {allFeeds.length > 0 && ( + setFilter(value as FeedFilter)} + items={[ + { + label: t("feeds.filter.all", { count: allFeeds.length }), + value: "all", + }, + { + label: t("feeds.filter.rsshub", { count: rsshubFeedsCount }), + value: "rsshub", + }, + ]} + /> + )} +
- {allFeeds.length > 0 && ( + {filteredFeeds.length > 0 && (
{/* Header - Sticky */}
{ {/* Feed List */}
Date: Thu, 27 Nov 2025 01:08:01 +0800 Subject: [PATCH 15/20] feat: refactor discover module state management - Introduced new atom hooks for managing discover search data, improving state handling in UnifiedDiscoverForm. - Replaced direct atom usage with custom hooks for better abstraction and maintainability. - Updated related components to utilize the new state management approach, enhancing overall code clarity. Signed-off-by: Innei --- .../modules/discover/UnifiedDiscoverForm.tsx | 32 ++++++++----------- .../src/modules/discover/atoms/discover.ts | 15 +++++++++ .../(layer)/(subview)/discover/index.tsx | 9 +++--- 3 files changed, 33 insertions(+), 23 deletions(-) create mode 100644 apps/desktop/layer/renderer/src/modules/discover/atoms/discover.ts diff --git a/apps/desktop/layer/renderer/src/modules/discover/UnifiedDiscoverForm.tsx b/apps/desktop/layer/renderer/src/modules/discover/UnifiedDiscoverForm.tsx index 64f421df6..e625cc296 100644 --- a/apps/desktop/layer/renderer/src/modules/discover/UnifiedDiscoverForm.tsx +++ b/apps/desktop/layer/renderer/src/modules/discover/UnifiedDiscoverForm.tsx @@ -17,7 +17,6 @@ import { zodResolver } from "@hookform/resolvers/zod" import { repository } from "@pkg" import { useMutation } from "@tanstack/react-query" import { produce } from "immer" -import { atom, useAtomValue, useStore } from "jotai" import type { ChangeEvent, CompositionEvent } from "react" import { startTransition, useCallback, useEffect, useMemo } from "react" import { useForm } from "react-hook-form" @@ -30,6 +29,11 @@ import { useModalStack } from "~/components/ui/modal/stacked/hooks" import { useRequireLogin } from "~/hooks/common/useRequireLogin" import { followClient } from "~/lib/api-client" +import { + getDiscoverSearchData, + setDiscoverSearchData, + useDiscoverSearchData, +} from "./atoms/discover" import { DiscoverFeedCard } from "./DiscoverFeedCard" import { DiscoverImport } from "./DiscoverImport" import { DiscoverInboxList } from "./DiscoverInboxList" @@ -37,8 +41,6 @@ import { DiscoverTransform } from "./DiscoverTransform" import { DiscoverUser } from "./DiscoverUser" import { FeedForm } from "./FeedForm" -const discoverSearchDataAtom = atom>() - // Auto-detect input type function detectInputType(value: string): "rss" | "rsshub" | "search" { const trimmed = value.trim() @@ -98,7 +100,6 @@ export function UnifiedDiscoverForm() { const { ensureLogin } = useRequireLogin() const { present, dismissAll } = useModalStack() const isMobile = useMobile() - const jotaiStore = useStore() // Auto-detect input type based on current value const detectedType = useMemo(() => { @@ -130,7 +131,7 @@ export function UnifiedDiscoverForm() { trigger("keyword") }, [trigger, keywordFromSearch]) - const discoverSearchData = useAtomValue(discoverSearchDataAtom)?.[atomKey] || [] + const discoverSearchData = useDiscoverSearchData()?.[atomKey] || [] const mutation = useMutation({ mutationFn: async ({ keyword, target }: { keyword: string; target: "feeds" | "lists" }) => { @@ -170,7 +171,7 @@ export function UnifiedDiscoverForm() { data = data.filter((item) => !item.list?.fee) } - jotaiStore.set(discoverSearchDataAtom, (prev) => ({ + setDiscoverSearchData((prev) => ({ ...prev, [atomKey]: data, })) @@ -233,10 +234,9 @@ export function UnifiedDiscoverForm() { const handleSuccess = useCallback( (item: DiscoveryItem) => { - const currentData = jotaiStore.get(discoverSearchDataAtom) + const currentData = getDiscoverSearchData() if (!currentData) return - jotaiStore.set( - discoverSearchDataAtom, + setDiscoverSearchData( produce(currentData, (draft) => { const sub = (draft[atomKey] || []).find((i) => { if (item.feed) { @@ -252,15 +252,14 @@ export function UnifiedDiscoverForm() { }), ) }, - [atomKey, jotaiStore], + [atomKey], ) const handleUnSubscribed = useCallback( (item: DiscoveryItem) => { - const currentData = jotaiStore.get(discoverSearchDataAtom) + const currentData = getDiscoverSearchData() if (!currentData) return - jotaiStore.set( - discoverSearchDataAtom, + setDiscoverSearchData( produce(currentData, (draft) => { const sub = (draft[atomKey] || []).find( (i) => i.feed?.id === item.feed?.id || i.list?.id === item.list?.id, @@ -272,7 +271,7 @@ export function UnifiedDiscoverForm() { }), ) }, - [atomKey, jotaiStore], + [atomKey], ) const handleTargetChange = useCallback( @@ -471,10 +470,7 @@ export function UnifiedDiscoverForm() { className="flex cursor-button items-center justify-between gap-2 hover:text-accent" type="button" onClick={() => { - jotaiStore.set(discoverSearchDataAtom, { - ...jotaiStore.get(discoverSearchDataAtom), - [atomKey]: [], - }) + setDiscoverSearchData({}) mutation.reset() }} > diff --git a/apps/desktop/layer/renderer/src/modules/discover/atoms/discover.ts b/apps/desktop/layer/renderer/src/modules/discover/atoms/discover.ts new file mode 100644 index 000000000..93651ba20 --- /dev/null +++ b/apps/desktop/layer/renderer/src/modules/discover/atoms/discover.ts @@ -0,0 +1,15 @@ +import { createAtomHooks } from "@follow/utils" +import type { DiscoveryItem } from "@follow-app/client-sdk" +import { atom, useAtomValue } from "jotai" +import { selectAtom } from "jotai/utils" +import { useMemo } from "react" + +const internalAtom = atom>({}) +export const [, , useDiscoverSearchData, , getDiscoverSearchData, setDiscoverSearchData] = + createAtomHooks(internalAtom) + +export const useHasDiscoverSearchData = () => { + return useAtomValue( + useMemo(() => selectAtom(internalAtom, (data) => Object.keys(data).length > 0), []), + ) +} diff --git a/apps/desktop/layer/renderer/src/pages/(main)/(layer)/(subview)/discover/index.tsx b/apps/desktop/layer/renderer/src/pages/(main)/(layer)/(subview)/discover/index.tsx index 4fc51e4f8..35cbae226 100644 --- a/apps/desktop/layer/renderer/src/pages/(main)/(layer)/(subview)/discover/index.tsx +++ b/apps/desktop/layer/renderer/src/pages/(main)/(layer)/(subview)/discover/index.tsx @@ -1,11 +1,11 @@ import { cn } from "@follow/utils/utils" import type { ReactNode } from "react" import { useTranslation } from "react-i18next" -import { useSearchParams } from "react-router" import { AppErrorBoundary } from "~/components/common/AppErrorBoundary" import { ErrorComponentType } from "~/components/errors/enum" import { useSubViewTitle } from "~/modules/app-layout/subview/hooks" +import { useHasDiscoverSearchData } from "~/modules/discover/atoms/discover" import { DiscoveryContent } from "~/modules/discover/DiscoveryContent" import { UnifiedDiscoverForm } from "~/modules/discover/UnifiedDiscoverForm" @@ -28,10 +28,9 @@ function Section({ children, className }: SectionProps) { export function Component() { const { t } = useTranslation() - const [searchParams] = useSearchParams() - const keyword = searchParams.get("keyword") - const isSearching = !!keyword?.trim() + useSubViewTitle("words.discover") + const hasSearchData = useHasDiscoverSearchData() return (
@@ -51,7 +50,7 @@ export function Component() {
{/* Discovery Section - Hide when searching */} - {!isSearching && ( + {!hasSearchData && (
From 07acce799e10fff5abdc0c69bd017b7a3fc79630 Mon Sep 17 00:00:00 2001 From: Konv Suu <2583695112@qq.com> Date: Thu, 27 Nov 2025 01:09:36 +0800 Subject: [PATCH 16/20] fix(discover): prevent empty results when keyword changes without search (#4759) Co-authored-by: Innei --- .../src/modules/discover/UnifiedDiscoverForm.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/apps/desktop/layer/renderer/src/modules/discover/UnifiedDiscoverForm.tsx b/apps/desktop/layer/renderer/src/modules/discover/UnifiedDiscoverForm.tsx index e625cc296..160a69f45 100644 --- a/apps/desktop/layer/renderer/src/modules/discover/UnifiedDiscoverForm.tsx +++ b/apps/desktop/layer/renderer/src/modules/discover/UnifiedDiscoverForm.tsx @@ -18,7 +18,7 @@ import { repository } from "@pkg" import { useMutation } from "@tanstack/react-query" import { produce } from "immer" import type { ChangeEvent, CompositionEvent } from "react" -import { startTransition, useCallback, useEffect, useMemo } from "react" +import { startTransition, useCallback, useEffect, useMemo, useRef } from "react" import { useForm } from "react-hook-form" import { useTranslation } from "react-i18next" import { useSearchParams } from "react-router" @@ -121,7 +121,7 @@ export function UnifiedDiscoverForm() { const { watch, trigger } = form const target = watch("target") - const atomKey = keywordFromSearch + target + const atomKey = useRef(keywordFromSearch + target) // Validate default value from search params useEffect(() => { @@ -173,7 +173,7 @@ export function UnifiedDiscoverForm() { setDiscoverSearchData((prev) => ({ ...prev, - [atomKey]: data, + [atomKey.current]: data, })) return data @@ -238,7 +238,7 @@ export function UnifiedDiscoverForm() { if (!currentData) return setDiscoverSearchData( produce(currentData, (draft) => { - const sub = (draft[atomKey] || []).find((i) => { + const sub = (draft[atomKey.current] || []).find((i) => { if (item.feed) { return i.feed?.id === item.feed.id } @@ -261,7 +261,7 @@ export function UnifiedDiscoverForm() { if (!currentData) return setDiscoverSearchData( produce(currentData, (draft) => { - const sub = (draft[atomKey] || []).find( + const sub = (draft[atomKey.current] || []).find( (i) => i.feed?.id === item.feed?.id || i.list?.id === item.list?.id, ) if (!sub) return @@ -285,6 +285,7 @@ export function UnifiedDiscoverForm() { if (!ensureLogin()) { return } + atomKey.current = values.keyword + values.target mutation.mutate({ keyword: values.keyword, target: values.target }) } From 1aa8b6330558d8bdfd6c1fba25c94ff7491d6b3d Mon Sep 17 00:00:00 2001 From: Stephen Zhou <38493346+hyoban@users.noreply.github.com> Date: Thu, 27 Nov 2025 22:40:37 +0800 Subject: [PATCH 17/20] fix: stable unread sort --- .../sort-by/SortByUnreadList.tsx | 41 ++++++++----------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/apps/desktop/layer/renderer/src/modules/subscription-column/sort-by/SortByUnreadList.tsx b/apps/desktop/layer/renderer/src/modules/subscription-column/sort-by/SortByUnreadList.tsx index b0ae9a8c8..2cb8a998a 100644 --- a/apps/desktop/layer/renderer/src/modules/subscription-column/sort-by/SortByUnreadList.tsx +++ b/apps/desktop/layer/renderer/src/modules/subscription-column/sort-by/SortByUnreadList.tsx @@ -1,7 +1,7 @@ import { isOnboardingFeedUrl } from "@follow/store/constants/onboarding" import { useFeedStore } from "@follow/store/feed/store" import { useSortedCategoriesByUnread } from "@follow/store/unread/hooks" -import { Fragment, useCallback } from "react" +import { Fragment } from "react" import { useFeedListSortSelector } from "../atom" import { FeedCategoryAutoHideUnread } from "../FeedCategory" @@ -12,31 +12,26 @@ export const SortByUnreadFeedList = ({ view, data, categoryOpenStateData }: Feed const sortedByUnread = useSortedCategoriesByUnread(data, isDesc) // Separate categories with onboarding feeds and regular categories - const sortedList = useFeedStore( - useCallback( - (state) => { - if (!sortedByUnread) return [] - const onboardingCategories: [string, string[]][] = [] - const regularCategories: [string, string[]][] = [] + const sortedList = useFeedStore((state) => { + if (!sortedByUnread) return [] + const onboardingCategories: [string, string[]][] = [] + const regularCategories: [string, string[]][] = [] - for (const [category, ids] of sortedByUnread) { - const hasOnboardingFeed = ids.some((id) => { - const feed = state.feeds[id] - return feed && isOnboardingFeedUrl(feed.url) - }) + for (const [category, ids] of sortedByUnread) { + const hasOnboardingFeed = ids.some((id) => { + const feed = state.feeds[id] + return feed && isOnboardingFeedUrl(feed.url) + }) - if (hasOnboardingFeed) { - onboardingCategories.push([category, ids]) - } else { - regularCategories.push([category, ids]) - } - } + if (hasOnboardingFeed) { + onboardingCategories.push([category, ids]) + } else { + regularCategories.push([category, ids]) + } + } - return [...onboardingCategories, ...regularCategories] - }, - [sortedByUnread], - ), - ) + return [...onboardingCategories, ...regularCategories] + }) return ( From d7bc90ba0aa298c5606b1819ab99d2e2091e3bd1 Mon Sep 17 00:00:00 2001 From: Innei Date: Thu, 27 Nov 2025 22:51:05 +0800 Subject: [PATCH 18/20] refactor: optimize SortByUnreadFeedList component and improve state handling - Wrapped SortByUnreadFeedList in memo for performance optimization. - Utilized useCallback for the sortedList computation to prevent unnecessary re-renders. - Enhanced the handling of onboarding and regular categories by ensuring a copy of ids is used. - Minor adjustments in SubscriptionList and hooks for consistency and clarity. Signed-off-by: Innei --- .../sort-by/SortByUnreadList.tsx | 45 ++++++++++--------- .../subscription-list/SubscriptionList.tsx | 1 + .../store/src/modules/unread/hooks.ts | 2 +- 3 files changed, 27 insertions(+), 21 deletions(-) diff --git a/apps/desktop/layer/renderer/src/modules/subscription-column/sort-by/SortByUnreadList.tsx b/apps/desktop/layer/renderer/src/modules/subscription-column/sort-by/SortByUnreadList.tsx index 2cb8a998a..619b8d2e2 100644 --- a/apps/desktop/layer/renderer/src/modules/subscription-column/sort-by/SortByUnreadList.tsx +++ b/apps/desktop/layer/renderer/src/modules/subscription-column/sort-by/SortByUnreadList.tsx @@ -1,37 +1,42 @@ import { isOnboardingFeedUrl } from "@follow/store/constants/onboarding" import { useFeedStore } from "@follow/store/feed/store" import { useSortedCategoriesByUnread } from "@follow/store/unread/hooks" -import { Fragment } from "react" +import { Fragment, memo, useCallback } from "react" import { useFeedListSortSelector } from "../atom" import { FeedCategoryAutoHideUnread } from "../FeedCategory" import type { FeedListProps } from "./types" -export const SortByUnreadFeedList = ({ view, data, categoryOpenStateData }: FeedListProps) => { +export const SortByUnreadFeedList = memo(({ view, data, categoryOpenStateData }: FeedListProps) => { const isDesc = useFeedListSortSelector((s) => s.order === "desc") const sortedByUnread = useSortedCategoriesByUnread(data, isDesc) // Separate categories with onboarding feeds and regular categories - const sortedList = useFeedStore((state) => { - if (!sortedByUnread) return [] - const onboardingCategories: [string, string[]][] = [] - const regularCategories: [string, string[]][] = [] + const sortedList = useFeedStore( + useCallback( + (state) => { + if (!sortedByUnread) return [] + const onboardingCategories: [string, string[]][] = [] + const regularCategories: [string, string[]][] = [] - for (const [category, ids] of sortedByUnread) { - const hasOnboardingFeed = ids.some((id) => { - const feed = state.feeds[id] - return feed && isOnboardingFeedUrl(feed.url) - }) + for (const [category, ids] of sortedByUnread) { + const hasOnboardingFeed = ids.some((id) => { + const feed = state.feeds[id] + return feed && isOnboardingFeedUrl(feed.url) + }) - if (hasOnboardingFeed) { - onboardingCategories.push([category, ids]) - } else { - regularCategories.push([category, ids]) - } - } + if (hasOnboardingFeed) { + onboardingCategories.push([category, ids.concat()]) + } else { + regularCategories.push([category, ids.concat()]) + } + } - return [...onboardingCategories, ...regularCategories] - }) + return [...onboardingCategories, ...regularCategories] + }, + [sortedByUnread], + ), + ) return ( @@ -45,4 +50,4 @@ export const SortByUnreadFeedList = ({ view, data, categoryOpenStateData }: Feed ))} ) -} +}) diff --git a/apps/desktop/layer/renderer/src/modules/subscription-column/subscription-list/SubscriptionList.tsx b/apps/desktop/layer/renderer/src/modules/subscription-column/subscription-list/SubscriptionList.tsx index f11a4915e..1b9902a8a 100644 --- a/apps/desktop/layer/renderer/src/modules/subscription-column/subscription-list/SubscriptionList.tsx +++ b/apps/desktop/layer/renderer/src/modules/subscription-column/subscription-list/SubscriptionList.tsx @@ -49,6 +49,7 @@ import type { SubscriptionProps } from "./SubscriptionListGuard" const SubscriptionImpl = ({ ref, className, view, isSubscriptionLoading }: SubscriptionProps) => { const autoGroup = useGeneralSettingKey("autoGroup") const feedsData = useFeedsGroupedData(view, autoGroup) + const listSubIds = useSubscriptionListIds(view) const inboxSubIds = useInboxList( useCallback( diff --git a/packages/internal/store/src/modules/unread/hooks.ts b/packages/internal/store/src/modules/unread/hooks.ts index 66102e72b..e584f7dda 100644 --- a/packages/internal/store/src/modules/unread/hooks.ts +++ b/packages/internal/store/src/modules/unread/hooks.ts @@ -134,7 +134,7 @@ export const useSortedCategoriesByUnread = ( Object.keys(folderUnread) .sort((a, b) => folderUnread[b]! - folderUnread[a]!) .forEach((key) => { - sortedList.push([key, categories[key]!]) + sortedList.push([key, categories[key]!.concat()]) }) if (!isDesc) { From d45701263cd2117fe11b9d83f8a3cbe9b7544c8d Mon Sep 17 00:00:00 2001 From: Innei Date: Thu, 27 Nov 2025 23:17:45 +0800 Subject: [PATCH 19/20] release(desktop): hotfix to release v1.2.4 --- apps/desktop/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/desktop/package.json b/apps/desktop/package.json index 5e2de2a6e..5154d6f70 100644 --- a/apps/desktop/package.json +++ b/apps/desktop/package.json @@ -1,7 +1,7 @@ { "name": "Folo", "type": "module", - "version": "1.2.3", + "version": "1.2.4", "private": true, "description": "Follow everything in one place", "author": "Folo Team", From 3bab2a5595e4a0701c055fcc3aeba49c0d53ce78 Mon Sep 17 00:00:00 2001 From: Innei Date: Thu, 27 Nov 2025 23:19:35 +0800 Subject: [PATCH 20/20] fix(discover): correct atom key reference in UnifiedDiscoverForm to ensure proper data retrieval Signed-off-by: Innei --- .../layer/renderer/src/modules/discover/UnifiedDiscoverForm.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/desktop/layer/renderer/src/modules/discover/UnifiedDiscoverForm.tsx b/apps/desktop/layer/renderer/src/modules/discover/UnifiedDiscoverForm.tsx index 160a69f45..09f1593cd 100644 --- a/apps/desktop/layer/renderer/src/modules/discover/UnifiedDiscoverForm.tsx +++ b/apps/desktop/layer/renderer/src/modules/discover/UnifiedDiscoverForm.tsx @@ -131,7 +131,7 @@ export function UnifiedDiscoverForm() { trigger("keyword") }, [trigger, keywordFromSearch]) - const discoverSearchData = useDiscoverSearchData()?.[atomKey] || [] + const discoverSearchData = useDiscoverSearchData()?.[atomKey.current] || [] const mutation = useMutation({ mutationFn: async ({ keyword, target }: { keyword: string; target: "feeds" | "lists" }) => {
+ ( + + + {t("discover.any_url_or_keyword")} + + + + + + + + )} + /> + {showTargetSelector && ( + ( + +
+ + {t("discover.target.label")} + + +
+ {isMobile ? ( + + ) : ( + + + + + )} +
+
+
+ +
+ )} + /> + )} +
+ + + {/* Compact Tools */} +
+ { + present({ + title: t("discover.tools.import"), + content: () => , + modalClassName: "max-w-2xl w-full", + }) + }} + /> + { + present({ + title: t("discover.tools.transform"), + content: () => , + modalClassName: "max-w-2xl w-full", + }) + }} + /> + { + present({ + title: t("words.inbox"), + content: () => , + modalClassName: "max-w-2xl w-full", + }) + }} + /> + { + present({ + title: t("words.user"), + content: () => , + modalClassName: "max-w-2xl w-full", + }) + }} + /> +
+
+