From 6e028b3e68661b494b73e790f9adbf065d230f47 Mon Sep 17 00:00:00 2001 From: Innei Date: Fri, 12 Sep 2025 20:47:07 +0800 Subject: [PATCH] chore: remove zen and wider mode Signed-off-by: Innei --- .../layer/renderer/src/atoms/settings/ui.ts | 29 ------------ .../layer/renderer/src/atoms/sidebar.ts | 8 +--- .../components/ui/markdown/components/Toc.tsx | 3 +- .../entry-content/EntryLayoutContent.tsx | 7 ++- .../SubscriptionColumn.tsx | 4 +- .../timeline-column/TimelineColumnLayout.tsx | 11 +---- .../src/modules/command/commands/id.ts | 2 - .../src/modules/command/commands/layout.tsx | 36 -------------- .../command/hooks/use-command-binding.ts | 4 -- .../EntryColumnWrapper.tsx | 5 +- .../layouts/buttons/WideModeButton.tsx | 47 +------------------ .../templates/list-item-template.legacy.tsx | 4 +- .../components/EntryTimelineSidebar.tsx | 19 +++----- .../entry-content/EntryContent.ai.tsx | 5 +- .../entry-content/EntryContent.legacy.tsx | 8 ++-- .../src/modules/settings/tabs/appearance.tsx | 28 +---------- .../SubscriptionColumnHeader.tsx | 32 ++++--------- .../src/modules/user/ProfileButton.tsx | 20 -------- .../providers/extension-expose-provider.tsx | 9 +--- .../src/providers/global-hotkeys-provider.tsx | 5 -- .../renderer/src/providers/setting-sync.tsx | 6 +-- apps/desktop/tailwind.config.ts | 4 -- locales/app/en.json | 6 +-- locales/app/ja.json | 6 +-- locales/app/zh-CN.json | 6 +-- locales/app/zh-TW.json | 6 +-- locales/native/en.json | 1 - locales/native/ja.json | 1 - locales/native/zh-CN.json | 1 - locales/native/zh-TW.json | 1 - locales/settings/en.json | 3 -- locales/settings/ja.json | 3 -- locales/settings/zh-CN.json | 3 -- locales/settings/zh-TW.json | 3 -- locales/shortcuts/en.json | 4 -- locales/shortcuts/ja.json | 4 -- locales/shortcuts/zh-CN.json | 4 -- locales/shortcuts/zh-TW.json | 4 -- 38 files changed, 43 insertions(+), 309 deletions(-) diff --git a/apps/desktop/layer/renderer/src/atoms/settings/ui.ts b/apps/desktop/layer/renderer/src/atoms/settings/ui.ts index 767b911b4..8a268142e 100644 --- a/apps/desktop/layer/renderer/src/atoms/settings/ui.ts +++ b/apps/desktop/layer/renderer/src/atoms/settings/ui.ts @@ -2,9 +2,6 @@ import { createSettingAtom } from "@follow/atoms/helper/setting.js" import { defaultUISettings } from "@follow/shared/settings/defaults" import { enhancedUISettingKeys } from "@follow/shared/settings/enhanced" import type { UISettings } from "@follow/shared/settings/interface" -import { jotaiStore } from "@follow/utils/jotai" -import { atom, useAtomValue } from "jotai" -import { useEventCallback } from "usehooks-ts" import { getDefaultLanguage } from "~/lib/language" import { DEFAULT_ACTION_ORDER } from "~/modules/customize-toolbar/constant" @@ -20,8 +17,6 @@ export const createDefaultUISettings = (): UISettings => ({ accentColor: "orange", }) -const zenModeAtom = atom(false) - const { useSettingKey: useUISettingKeyInternal, useSettingSelector: useUISettingSelectorInternal, @@ -64,27 +59,3 @@ export const uiServerSyncWhiteListKeys: (keyof UISettings)[] = [ "accentColor", // "customCSS", ] - -export const useIsZenMode = () => useAtomValue(zenModeAtom) -export const getIsZenMode = () => jotaiStore.get(zenModeAtom) - -export const useSetZenMode = () => { - return setZenMode -} -export const setZenMode = (checked: boolean) => { - jotaiStore.set(zenModeAtom, checked) -} - -export const useToggleZenMode = () => { - const setZenMode = useSetZenMode() - const isZenMode = useIsZenMode() - return useEventCallback(() => { - setZenMode(!isZenMode) - }) -} - -export const useRealInWideMode = () => { - const wideMode = useUISettingKey("wideMode") - const isZenMode = useIsZenMode() - return wideMode || isZenMode -} diff --git a/apps/desktop/layer/renderer/src/atoms/sidebar.ts b/apps/desktop/layer/renderer/src/atoms/sidebar.ts index e4e678877..1a6950a46 100644 --- a/apps/desktop/layer/renderer/src/atoms/sidebar.ts +++ b/apps/desktop/layer/renderer/src/atoms/sidebar.ts @@ -2,8 +2,6 @@ import { atom } from "jotai" import { createAtomHooks } from "~/lib/jotai" -import { getIsZenMode, useIsZenMode } from "./settings/ui" - const [ , , @@ -14,13 +12,11 @@ const [ ] = createAtomHooks(atom(true)) export const useSubscriptionColumnShow = () => { - const isZenMode = useIsZenMode() - return internal_useSubscriptionColumnShow() && !isZenMode + return internal_useSubscriptionColumnShow() } export const getSubscriptionColumnShow = () => { - const isZenMode = getIsZenMode() - return internal_getSubscriptionShow() && !isZenMode + return internal_getSubscriptionShow() } export { setTimelineColumnShow } diff --git a/apps/desktop/layer/renderer/src/components/ui/markdown/components/Toc.tsx b/apps/desktop/layer/renderer/src/components/ui/markdown/components/Toc.tsx index f44a3c764..515f65599 100644 --- a/apps/desktop/layer/renderer/src/components/ui/markdown/components/Toc.tsx +++ b/apps/desktop/layer/renderer/src/components/ui/markdown/components/Toc.tsx @@ -7,7 +7,6 @@ import * as HoverCard from "@radix-ui/react-hover-card" import { AnimatePresence, m } from "motion/react" import { memo, use, useCallback, useEffect, useImperativeHandle, useRef, useState } from "react" -import { useRealInWideMode } from "~/atoms/settings/ui" import { COMMAND_ID } from "~/modules/command/commands/id" import { useWrappedElementPosition, @@ -60,7 +59,7 @@ export const Toc = ({ const renderContentElementPosition = useWrappedElementPosition() const renderContentElementSize = useWrappedElementSize() - const entryContentInWideMode = useRealInWideMode() + const entryContentInWideMode = false const shouldShowTitle = useViewport((v) => { if (!entryContentInWideMode) return false const { w } = v diff --git a/apps/desktop/layer/renderer/src/modules/app-layout/entry-content/EntryLayoutContent.tsx b/apps/desktop/layer/renderer/src/modules/app-layout/entry-content/EntryLayoutContent.tsx index 1eed2afad..16b6c73f5 100644 --- a/apps/desktop/layer/renderer/src/modules/app-layout/entry-content/EntryLayoutContent.tsx +++ b/apps/desktop/layer/renderer/src/modules/app-layout/entry-content/EntryLayoutContent.tsx @@ -8,7 +8,6 @@ import { useResizable } from "react-resizable-layout" import { useParams } from "react-router" import { AIChatPanelStyle, useAIChatPanelStyle } from "~/atoms/settings/ai" -import { useRealInWideMode } from "~/atoms/settings/ui" import { useSubscriptionColumnShow, useSubscriptionColumnTempShow } from "~/atoms/sidebar" import { m } from "~/components/common/Motion" import { FixedModalCloseButton } from "~/components/ui/modal/components/close" @@ -26,7 +25,7 @@ const EntryLayoutContentLegacy = () => { const { view } = useRouteParams() const navigate = useNavigateEntry() - const settingWideMode = useRealInWideMode() + const settingWideMode = false const realEntryId = entryId === ROUTE_ENTRY_PENDING ? "" : entryId const showEntryContent = !( @@ -73,7 +72,7 @@ export const EntryLayoutContentWithAI = () => { const { entryId, view } = useRouteParams() const navigate = useNavigateEntry() - const settingWideMode = useRealInWideMode() + const settingWideMode = false const realEntryId = entryId === ROUTE_ENTRY_PENDING ? "" : entryId const wideMode = !!(settingWideMode && realEntryId) @@ -101,7 +100,7 @@ export const EntryLayoutContent = () => { return } const Grid = ({ entryId }) => { - const settingWideMode = useRealInWideMode() + const settingWideMode = false const wideMode = !!(settingWideMode && entryId) const feedColumnTempShow = useSubscriptionColumnTempShow() diff --git a/apps/desktop/layer/renderer/src/modules/app-layout/subscription-column/SubscriptionColumn.tsx b/apps/desktop/layer/renderer/src/modules/app-layout/subscription-column/SubscriptionColumn.tsx index 4b6976d3c..40c9e5e50 100644 --- a/apps/desktop/layer/renderer/src/modules/app-layout/subscription-column/SubscriptionColumn.tsx +++ b/apps/desktop/layer/renderer/src/modules/app-layout/subscription-column/SubscriptionColumn.tsx @@ -14,7 +14,7 @@ import { useEffect, useRef, useState } from "react" import { Trans } from "react-i18next" import { useResizable } from "react-resizable-layout" -import { getIsZenMode, getUISettings, setUISetting } from "~/atoms/settings/ui" +import { getUISettings, setUISetting } from "~/atoms/settings/ui" import { getSubscriptionColumnTempShow, setSubscriptionColumnTempShow, @@ -117,7 +117,7 @@ const FeedResponsiveResizerContainer = ({ const uiSettings = getUISettings() const feedColumnTempShow = getSubscriptionColumnTempShow() - const isInEntryContentWideMode = uiSettings.wideMode || getIsZenMode() + const isInEntryContentWideMode = false const feedWidth = uiSettings.feedColWidth if (mouseY < 200 && isInEntryContentWideMode && mouseX < feedWidth) return const threshold = feedColumnTempShow ? uiSettings.feedColWidth : 100 diff --git a/apps/desktop/layer/renderer/src/modules/app-layout/timeline-column/TimelineColumnLayout.tsx b/apps/desktop/layer/renderer/src/modules/app-layout/timeline-column/TimelineColumnLayout.tsx index b490e994b..c62f25639 100644 --- a/apps/desktop/layer/renderer/src/modules/app-layout/timeline-column/TimelineColumnLayout.tsx +++ b/apps/desktop/layer/renderer/src/modules/app-layout/timeline-column/TimelineColumnLayout.tsx @@ -6,12 +6,7 @@ import { useMemo, useRef } from "react" import { useResizable } from "react-resizable-layout" import { Outlet } from "react-router" -import { - getUISettings, - setUISetting, - useRealInWideMode, - useUISettingKey, -} from "~/atoms/settings/ui" +import { getUISettings, setUISetting, useUISettingKey } from "~/atoms/settings/ui" import { useRouteParams } from "~/hooks/biz/useRouteParams" import { EntryColumn } from "~/modules/entry-column" import { AppLayoutGridContainerProvider } from "~/providers/app-grid-layout-container-provider" @@ -21,11 +16,9 @@ export function TimelineColumnLayout() { // Memo this initial value to avoid re-render - const settingWideMode = useRealInWideMode() const entryColWidth = useMemo(() => getUISettings().entryColWidth, []) const { view } = useRouteParams() - const inWideMode = - (view ? views.find((v) => v.view === view)?.wideMode : false) || settingWideMode + const inWideMode = (view ? views.find((v) => v.view === view)?.wideMode : false) || false const feedColumnWidth = useUISettingKey("feedColWidth") const startDragPosition = useRef(0) const { position, separatorProps, isDragging, separatorCursor, setPosition } = useResizable({ diff --git a/apps/desktop/layer/renderer/src/modules/command/commands/id.ts b/apps/desktop/layer/renderer/src/modules/command/commands/id.ts index 29e3f3a72..fa5d0894c 100644 --- a/apps/desktop/layer/renderer/src/modules/command/commands/id.ts +++ b/apps/desktop/layer/renderer/src/modules/command/commands/id.ts @@ -57,8 +57,6 @@ export const COMMAND_ID = { focusToTimeline: "layout:focus-to-timeline", focusToSubscription: "layout:focus-to-subscription", focusToEntryRender: "layout:focus-to-entry-render", - toggleWideMode: "layout:toggle-wide-mode", - toggleZenMode: "layout:toggle-zen-mode", }, timeline: { switchToNext: "timeline:switch-to-next", diff --git a/apps/desktop/layer/renderer/src/modules/command/commands/layout.tsx b/apps/desktop/layer/renderer/src/modules/command/commands/layout.tsx index 1c4dd0b5c..43e9b7311 100644 --- a/apps/desktop/layer/renderer/src/modules/command/commands/layout.tsx +++ b/apps/desktop/layer/renderer/src/modules/command/commands/layout.tsx @@ -1,7 +1,6 @@ import { EventBus } from "@follow/utils/event-bus" import { useTranslation } from "react-i18next" -import { getIsZenMode, getUISettings, setUISetting, setZenMode } from "~/atoms/settings/ui" import { setTimelineColumnShow } from "~/atoms/sidebar" import { useRegisterCommandEffect } from "../hooks/use-register-command" @@ -58,29 +57,6 @@ export const useRegisterLayoutCommands = () => { EventBus.dispatch(COMMAND_ID.layout.focusToEntryRender, { highlightBoundary: true }) }, }, - { - id: COMMAND_ID.layout.toggleWideMode, - label: { - title: t("command.layout.toggle_wide_mode.title"), - description: t("command.layout.toggle_wide_mode.description"), - }, - category, - run: () => { - const { wideMode } = getUISettings() - setUISetting("wideMode", !wideMode) - }, - }, - { - id: COMMAND_ID.layout.toggleZenMode, - label: { - title: t("command.layout.toggle_zen_mode.title"), - description: t("command.layout.toggle_zen_mode.description"), - }, - category, - run: () => { - setZenMode(!getIsZenMode()) - }, - }, ]) } @@ -103,20 +79,8 @@ export type FocusToEntryRenderCommand = Command<{ fn: () => void }> -export type ToggleWideModeCommand = Command<{ - id: typeof COMMAND_ID.layout.toggleWideMode - fn: () => void -}> - -export type ToggleZenModeCommand = Command<{ - id: typeof COMMAND_ID.layout.toggleZenMode - fn: () => void -}> - export type LayoutCommand = | ToggleTimelineColumnCommand | FocusToTimelineCommand | FocusToSubscriptionCommand | FocusToEntryRenderCommand - | ToggleWideModeCommand - | ToggleZenModeCommand diff --git a/apps/desktop/layer/renderer/src/modules/command/hooks/use-command-binding.ts b/apps/desktop/layer/renderer/src/modules/command/hooks/use-command-binding.ts index 43cdd485f..f7928f5e2 100644 --- a/apps/desktop/layer/renderer/src/modules/command/hooks/use-command-binding.ts +++ b/apps/desktop/layer/renderer/src/modules/command/hooks/use-command-binding.ts @@ -13,8 +13,6 @@ import { useCommandHotkey } from "./use-register-hotkey" export const defaultCommandShortcuts = { // Layout commands [COMMAND_ID.layout.toggleSubscriptionColumn]: transformShortcut("$mod+B"), - [COMMAND_ID.layout.toggleWideMode]: transformShortcut("$mod+["), - [COMMAND_ID.layout.toggleZenMode]: transformShortcut("Shift+$mod+Z"), // Subscription commands [COMMAND_ID.subscription.markAllAsRead]: transformShortcut("Shift+$mod+A"), @@ -83,8 +81,6 @@ export const useCommandShortcutItems = () => { } export const allowCustomizeCommands = new Set([ COMMAND_ID.layout.toggleSubscriptionColumn, - COMMAND_ID.layout.toggleWideMode, - COMMAND_ID.layout.toggleZenMode, COMMAND_ID.subscription.markAllAsRead, diff --git a/apps/desktop/layer/renderer/src/modules/entry-column/components/entry-column-wrapper/EntryColumnWrapper.tsx b/apps/desktop/layer/renderer/src/modules/entry-column/components/entry-column-wrapper/EntryColumnWrapper.tsx index d2ccf3752..e23cf9b66 100644 --- a/apps/desktop/layer/renderer/src/modules/entry-column/components/entry-column-wrapper/EntryColumnWrapper.tsx +++ b/apps/desktop/layer/renderer/src/modules/entry-column/components/entry-column-wrapper/EntryColumnWrapper.tsx @@ -2,7 +2,6 @@ import { ScrollArea } from "@follow/components/ui/scroll-area/ScrollArea.js" import { views } from "@follow/constants" import { cn } from "@follow/utils/utils" -import { useIsZenMode } from "~/atoms/settings/ui" import { useRouteParamsSelector } from "~/hooks/biz/useRouteParams" import type { EntryColumnWrapperProps } from "./types" @@ -13,8 +12,6 @@ const animationStyles = tw`duration-300 ease-in-out animate-in fade-in slide-in- export const EntryColumnWrapper = ({ ref, children, onScroll }: EntryColumnWrapperProps) => { const view = useRouteParamsSelector((state) => state.view) - const isZenMode = useIsZenMode() - return (
div]:grow flex"} onScroll={onScroll} > diff --git a/apps/desktop/layer/renderer/src/modules/entry-column/layouts/buttons/WideModeButton.tsx b/apps/desktop/layer/renderer/src/modules/entry-column/layouts/buttons/WideModeButton.tsx index 449840756..3145fdfc9 100644 --- a/apps/desktop/layer/renderer/src/modules/entry-column/layouts/buttons/WideModeButton.tsx +++ b/apps/desktop/layer/renderer/src/modules/entry-column/layouts/buttons/WideModeButton.tsx @@ -1,48 +1,3 @@ -import { MdiMeditation } from "@follow/components/icons/Meditation.js" -import { ActionButton } from "@follow/components/ui/button/index.js" -import { tracker } from "@follow/tracker" -import { cn } from "@follow/utils/utils" -import { useTranslation } from "react-i18next" - -import { setUISetting, useIsZenMode, useRealInWideMode, useSetZenMode } from "~/atoms/settings/ui" -import { COMMAND_ID } from "~/modules/command/commands/id" -import { useCommandShortcuts } from "~/modules/command/hooks/use-command-binding" - export const WideModeButton = () => { - const isWideMode = useRealInWideMode() - const isZenMode = useIsZenMode() - const { t } = useTranslation() - - const setIsZenMode = useSetZenMode() - const shortcuts = useCommandShortcuts() - return ( - { - if (isZenMode) { - setIsZenMode(false) - } else { - setUISetting("wideMode", !isWideMode) - // TODO: Remove this after useMeasure can get bounds in time - window.dispatchEvent(new Event("resize")) - } - tracker.wideMode({ mode: isWideMode ? "wide" : "normal" }) - }} - tooltip={ - isZenMode - ? t("zen.exit") - : !isWideMode - ? t("entry_list_header.switch_to_widemode") - : t("entry_list_header.switch_to_normalmode") - } - > - {isZenMode ? ( - - ) : ( - - )} - - ) + return null } diff --git a/apps/desktop/layer/renderer/src/modules/entry-column/templates/list-item-template.legacy.tsx b/apps/desktop/layer/renderer/src/modules/entry-column/templates/list-item-template.legacy.tsx index 4c66fe7c2..b3daed23f 100644 --- a/apps/desktop/layer/renderer/src/modules/entry-column/templates/list-item-template.legacy.tsx +++ b/apps/desktop/layer/renderer/src/modules/entry-column/templates/list-item-template.legacy.tsx @@ -11,7 +11,7 @@ import { titleCase } from "title-case" import { AudioPlayer, useAudioPlayerAtomSelector } from "~/atoms/player" import { useGeneralSettingKey } from "~/atoms/settings/general" -import { useRealInWideMode, useUISettingKey } from "~/atoms/settings/ui" +import { useUISettingKey } from "~/atoms/settings/ui" import { RelativeTime } from "~/components/ui/datetime" import { Media } from "~/components/ui/media/Media" import { FEED_COLLECTION_LIST } from "~/constants" @@ -86,7 +86,7 @@ export function ListItem({ const inbox = useInboxById(entry?.inboxId) - const settingWideMode = useRealInWideMode() + const settingWideMode = false const thumbnailRatio = useUISettingKey("thumbnailRatio") const rid = `list-item-${entryId}` diff --git a/apps/desktop/layer/renderer/src/modules/entry-content/components/EntryTimelineSidebar.tsx b/apps/desktop/layer/renderer/src/modules/entry-content/components/EntryTimelineSidebar.tsx index 684f088b0..e6968c189 100644 --- a/apps/desktop/layer/renderer/src/modules/entry-content/components/EntryTimelineSidebar.tsx +++ b/apps/desktop/layer/renderer/src/modules/entry-content/components/EntryTimelineSidebar.tsx @@ -4,23 +4,18 @@ import { cn } from "@follow/utils/utils" import type { TargetAndTransition } from "motion/react" import { m } from "motion/react" -import { useIsZenMode } from "~/atoms/settings/ui" import { useEntryIsRead } from "~/hooks/biz/useAsRead" import { useNavigateEntry } from "~/hooks/biz/useNavigateEntry" import { useRouteParamsSelector } from "~/hooks/biz/useRouteParams" import { useGetEntryIdInRange } from "~/modules/entry-column/hooks/useEntryIdListSnap" -export const EntryTimelineSidebar = ({ entryId }: { entryId: string }) => { - const isZenMode = useIsZenMode() - - if (!isZenMode) { - return null - } - - return -} - -export const EntryTimeline = ({ entryId, className }: { entryId: string; className?: string }) => { +export const EntryTimelineSidebar = ({ + entryId, + className, +}: { + entryId: string + className?: string +}) => { const entryIds = useGetEntryIdInRange(entryId, [5, 5]) return ( 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 ba6a22d55..5369c1d8d 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 @@ -19,7 +19,6 @@ import * as React from "react" import { memo, useEffect, useRef, useState } from "react" import { useEntryIsInReadability } from "~/atoms/readability" -import { useIsZenMode } from "~/atoms/settings/ui" import { Focusable } from "~/components/common/Focusable" import { m } from "~/components/common/Motion" import { HotkeyScope } from "~/constants" @@ -77,8 +76,6 @@ const EntryContentImpl: Component = ({ const [scrollerRef, setScrollerRef] = useState(null) const safeUrl = useFeedSafeUrl(entryId) - const isZenMode = useIsZenMode() - const [panelPortalElement, setPanelPortalElement] = useState(null) const scrollAnimationRef = useRef | null>(null) @@ -152,7 +149,7 @@ const EntryContentImpl: Component = ({ {/* */} {/* Indicator for the entry */} - {!isZenMode && isInHasTimelineView && ( + {isInHasTimelineView && ( <>
= ({ const customCSS = useUISettingKey("customCSS") const isInPeekModal = useInPeekModal() - const isZenMode = useIsZenMode() const [panelPortalElement, setPanelPortalElement] = useState(null) @@ -141,7 +139,7 @@ const EntryContentImpl: Component = ({ scrollerRef={scrollerRef} /> - + {/* Indicator for the entry */} @@ -151,7 +149,7 @@ const EntryContentImpl: Component = ({ transition={Spring.presets.bouncy} className="select-text" > - {!isZenMode && isInHasTimelineView && !isInPeekModal && ( + {isInHasTimelineView && !isInPeekModal && ( <>
{ value: t("appearance.reading_view.title"), }, - !isMobile && ZenMode, - { type: "title", value: t("appearance.interface_window.title"), @@ -317,23 +308,6 @@ export const AppThemeSegment = () => { ) } -const ZenMode = () => { - const { t } = useTranslation("settings") - const isZenMode = useIsZenMode() - const toggleZenMode = useToggleZenMode() - return ( - - - {t("appearance.zen_mode.description_simple")} - - ) -} - const ThumbnailRatio = () => { const { t } = useTranslation("settings") diff --git a/apps/desktop/layer/renderer/src/modules/subscription-column/SubscriptionColumnHeader.tsx b/apps/desktop/layer/renderer/src/modules/subscription-column/SubscriptionColumnHeader.tsx index fcabd74aa..d56ab30a5 100644 --- a/apps/desktop/layer/renderer/src/modules/subscription-column/SubscriptionColumnHeader.tsx +++ b/apps/desktop/layer/renderer/src/modules/subscription-column/SubscriptionColumnHeader.tsx @@ -1,6 +1,5 @@ import { Folo } from "@follow/components/icons/folo.js" import { Logo } from "@follow/components/icons/logo.jsx" -import { MdiMeditation } from "@follow/components/icons/Meditation.js" import { ActionButton } from "@follow/components/ui/button/index.js" import { stopPropagation } from "@follow/utils/dom" import { cn } from "@follow/utils/utils" @@ -11,7 +10,6 @@ import { useTranslation } from "react-i18next" import { Link } from "react-router" import { toast } from "sonner" -import { useIsZenMode, useSetZenMode } from "~/atoms/settings/ui" import { setTimelineColumnShow, useSubscriptionColumnShow } from "~/atoms/sidebar" import { DropdownMenu, @@ -71,8 +69,6 @@ const LayoutActionButton = () => { const feedColumnShow = useSubscriptionColumnShow() const [animation, setAnimation] = useState({ width: !feedColumnShow ? "auto" : 0 }) - const isZenMode = useIsZenMode() - const setIsZenMode = useSetZenMode() useEffect(() => { setAnimation({ width: !feedColumnShow ? "auto" : 0 }) }, [feedColumnShow]) @@ -84,27 +80,19 @@ const LayoutActionButton = () => { return ( - ) : ( - - ) + } onClick={() => { - if (isZenMode) { - setIsZenMode(false) - } else { - setTimelineColumnShow(!feedColumnShow) - } + setTimelineColumnShow(!feedColumnShow) }} /> diff --git a/apps/desktop/layer/renderer/src/modules/user/ProfileButton.tsx b/apps/desktop/layer/renderer/src/modules/user/ProfileButton.tsx index fd3fab2ce..7e15e6e49 100644 --- a/apps/desktop/layer/renderer/src/modules/user/ProfileButton.tsx +++ b/apps/desktop/layer/renderer/src/modules/user/ProfileButton.tsx @@ -1,4 +1,3 @@ -import { MdiMeditation } from "@follow/components/icons/Meditation.js" import { ActionButton } from "@follow/components/ui/button/index.js" import { RSSHubLogo } from "@follow/components/ui/platform-icon/icons.js" import { RootPortal } from "@follow/components/ui/portal/index.js" @@ -14,7 +13,6 @@ import { useTranslation } from "react-i18next" import { useNavigate } from "react-router" import { useIsInMASReview, useServerConfigs } from "~/atoms/server-configs" -import { useIsZenMode, useSetZenMode } from "~/atoms/settings/ui" import { DropdownMenu, DropdownMenuContent, @@ -30,8 +28,6 @@ import { useSettingModal } from "~/modules/settings/modal/use-setting-modal-hack import { signOut, useSession } from "~/queries/auth" import { useActivationModal } from "../activation" -import { COMMAND_ID } from "../command/commands/id" -import { useCommandShortcuts } from "../command/hooks/use-command-binding" import type { LoginProps } from "./LoginButton" import { LoginButton } from "./LoginButton" import { UserAvatar } from "./UserAvatar" @@ -56,12 +52,8 @@ export const ProfileButton: FC = memo((props) => { const role = useUserRole() const presentActivationModal = useActivationModal() - const zenModeSetting = useIsZenMode() - const setZenMode = useSetZenMode() const isInMASReview = useIsInMASReview() - const shortcuts = useCommandShortcuts() - if (status === "unauthenticated") { return } @@ -162,18 +154,6 @@ export const ProfileButton: FC = memo((props) => { - {!zenModeSetting && ( - { - setZenMode(true) - }} - icon={} - shortcut={shortcuts[COMMAND_ID.layout.toggleZenMode]} - > - {t("user_button.zen_mode")} - - )} { diff --git a/apps/desktop/layer/renderer/src/providers/extension-expose-provider.tsx b/apps/desktop/layer/renderer/src/providers/extension-expose-provider.tsx index a039d437e..472b4f253 100644 --- a/apps/desktop/layer/renderer/src/providers/extension-expose-provider.tsx +++ b/apps/desktop/layer/renderer/src/providers/extension-expose-provider.tsx @@ -9,7 +9,7 @@ import { toast } from "sonner" import { setWindowState } from "~/atoms/app" import { getGeneralSettings } from "~/atoms/settings/general" -import { getUISettings, useToggleZenMode } from "~/atoms/settings/ui" +import { getUISettings } from "~/atoms/settings/ui" import { setUpdaterStatus, useUpdaterStatus } from "~/atoms/updater" import { useDialog, useModalStack } from "~/components/ui/modal/stacked/hooks" import { useDiscoverRSSHubRouteModal } from "~/hooks/biz/useDiscoverRSSHubRoute" @@ -118,13 +118,6 @@ export const ExtensionExposeProvider = () => { }) }, [follow, present, presentDiscoverRSSHubRoute, presentUserProfile, t]) - const toggleZenMode = useToggleZenMode() - useEffect(() => { - registerGlobalContext({ - zenMode: toggleZenMode, - }) - }, [toggleZenMode]) - const dialog = useDialog() useEffect(() => { registerGlobalContext({ diff --git a/apps/desktop/layer/renderer/src/providers/global-hotkeys-provider.tsx b/apps/desktop/layer/renderer/src/providers/global-hotkeys-provider.tsx index c78c56b92..52d1fe940 100644 --- a/apps/desktop/layer/renderer/src/providers/global-hotkeys-provider.tsx +++ b/apps/desktop/layer/renderer/src/providers/global-hotkeys-provider.tsx @@ -72,11 +72,6 @@ export const GlobalHotkeysProvider = () => { preHandler(e) highlightElement(document.activeElement as HTMLElement) }, - [commandShortcuts[COMMAND_ID.layout.toggleZenMode]]: (e) => { - if (!isNormalLayer) return - preHandler(e) - runCommandFn(COMMAND_ID.layout.toggleZenMode, [])() - }, }) }, [commandShortcuts, runCommandFn, isNormalLayer]) diff --git a/apps/desktop/layer/renderer/src/providers/setting-sync.tsx b/apps/desktop/layer/renderer/src/providers/setting-sync.tsx index b3c193d92..d871f4034 100644 --- a/apps/desktop/layer/renderer/src/providers/setting-sync.tsx +++ b/apps/desktop/layer/renderer/src/providers/setting-sync.tsx @@ -8,7 +8,7 @@ import i18next from "i18next" import { useEffect, useInsertionEffect, useLayoutEffect, useRef } from "react" import { useGeneralSettingKey } from "~/atoms/settings/general" -import { useIsZenMode, useUISettingValue } from "~/atoms/settings/ui" +import { useUISettingValue } from "~/atoms/settings/ui" import { useSubscriptionColumnShow } from "~/atoms/sidebar" import { I18N_LOCALE_KEY } from "~/constants" import { useReduceMotion } from "~/hooks/biz/useReduceMotion" @@ -83,12 +83,10 @@ const useUISettingSync = () => { } const useDataAttrSync = () => { - const isZenMode = useIsZenMode() const columnShow = useSubscriptionColumnShow() useEffect(() => { - document.documentElement.dataset.zenMode = isZenMode.toString() document.documentElement.dataset.leftColumnHidden = (!columnShow).toString() - }, [isZenMode, columnShow]) + }, [columnShow]) } const useUXSettingSync = () => { diff --git a/apps/desktop/tailwind.config.ts b/apps/desktop/tailwind.config.ts index 5bc9327f6..e84be7e84 100644 --- a/apps/desktop/tailwind.config.ts +++ b/apps/desktop/tailwind.config.ts @@ -104,16 +104,12 @@ export default extendConfig({ addVariant("group-motion-reduce", ':merge(.group)[data-motion-reduce="true"] &') addVariant("peer-motion-reduce", ':merge(.peer)[data-motion-reduce="true"] ~ &') - addVariant("zen-mode-macos", "html[data-zen-mode='true'][data-os='macOS'] &") - addVariant("zen-mode-windows", "html[data-zen-mode='true'][data-os='Windows'] &") - addVariant("left-column-hidden", "html[data-left-column-hidden='true'] &") addVariant( "macos-left-column-hidden", "html[data-os='macOS'][data-left-column-hidden='true'] &", ) - addVariant("zen-mode", "html[data-zen-mode='true'] &") addVariant("macos", "html[data-os='macOS'] &") addVariant("windows", "html[data-os='Windows'] &") }), diff --git a/locales/app/en.json b/locales/app/en.json index ec0efe604..47bdc8776 100644 --- a/locales/app/en.json +++ b/locales/app/en.json @@ -195,8 +195,6 @@ "entry_list_header.refresh": "Refresh", "entry_list_header.show_all": "Show all", "entry_list_header.show_unread_only": "Show unread Only", - "entry_list_header.switch_to_normalmode": "Switch to Double Column Mode", - "entry_list_header.switch_to_widemode": "Switch to Wide Mode", "entry_list_header.unread": "unread", "feed.actions.follow": "Follow", "feed.actions.followed": "Followed", @@ -448,7 +446,6 @@ "user_button.power": "Power", "user_button.preferences": "Preferences", "user_button.profile": "Profile", - "user_button.zen_mode": "Zen Mode", "user_profile.about": "About", "user_profile.close": "Close", "user_profile.created_lists": "Created Lists", @@ -493,6 +490,5 @@ "words.user": "User", "words.view": "View", "words.which.all": "all", - "words.zero_items": "Zero items", - "zen.exit": "Exit Zen Mode" + "words.zero_items": "Zero items" } diff --git a/locales/app/ja.json b/locales/app/ja.json index c974cee2c..17cdff899 100644 --- a/locales/app/ja.json +++ b/locales/app/ja.json @@ -193,8 +193,6 @@ "entry_list_header.refresh": "更新", "entry_list_header.show_all": "すべて表示", "entry_list_header.show_unread_only": "未読のみ表示", - "entry_list_header.switch_to_normalmode": "2 列モードに切り替え", - "entry_list_header.switch_to_widemode": "ワイドモードに切り替え", "entry_list_header.unread": "未読", "feed.actions.follow": "フォロー", "feed.actions.followed": "フォロー済み", @@ -443,7 +441,6 @@ "user_button.power": "Power", "user_button.preferences": "設定", "user_button.profile": "プロフィール", - "user_button.zen_mode": "Zen モード", "user_profile.about": "About", "user_profile.close": "閉じる", "user_profile.created_lists": "作成したリスト", @@ -488,6 +485,5 @@ "words.user": "ユーザー", "words.view": "表示", "words.which.all": "すべて", - "words.zero_items": "アイテムがありません", - "zen.exit": "Zen モードを終了" + "words.zero_items": "アイテムがありません" } diff --git a/locales/app/zh-CN.json b/locales/app/zh-CN.json index 9734ac9c5..0a3d675bc 100644 --- a/locales/app/zh-CN.json +++ b/locales/app/zh-CN.json @@ -193,8 +193,6 @@ "entry_list_header.refresh": "刷新", "entry_list_header.show_all": "显示全部", "entry_list_header.show_unread_only": "仅显示未读", - "entry_list_header.switch_to_normalmode": "切换到双列模式", - "entry_list_header.switch_to_widemode": "切换到宽屏模式", "entry_list_header.unread": "未读", "feed.actions.follow": "订阅", "feed.actions.followed": "已订阅", @@ -445,7 +443,6 @@ "user_button.power": "Power", "user_button.preferences": "设置", "user_button.profile": "个人资料", - "user_button.zen_mode": "禅定模式", "user_profile.about": "关于", "user_profile.close": "关闭", "user_profile.created_lists": "创建的列表", @@ -490,6 +487,5 @@ "words.user": "用户", "words.view": "视图", "words.which.all": "全部", - "words.zero_items": "没有内容", - "zen.exit": "退出禅定模式" + "words.zero_items": "没有内容" } diff --git a/locales/app/zh-TW.json b/locales/app/zh-TW.json index 8ecd1db45..945567220 100644 --- a/locales/app/zh-TW.json +++ b/locales/app/zh-TW.json @@ -178,8 +178,6 @@ "entry_list_header.refresh": "重新整理", "entry_list_header.show_all": "顯示全部", "entry_list_header.show_unread_only": "僅顯示未讀", - "entry_list_header.switch_to_normalmode": "切換到正常模式", - "entry_list_header.switch_to_widemode": "切換到寬螢幕模式", "entry_list_header.unread": "未讀", "feed.actions.follow": "跟隨", "feed.actions.followed": "已跟隨", @@ -409,7 +407,6 @@ "user_button.power": "Power", "user_button.preferences": "偏好設定", "user_button.profile": "個人檔案", - "user_button.zen_mode": "禪定模式", "user_profile.close": "關閉", "user_profile.edit": "編輯", "user_profile.loading": "載入中", @@ -451,6 +448,5 @@ "words.user": "使用者", "words.view": "視圖", "words.which.all": "全部", - "words.zero_items": "沒有內容", - "zen.exit": "退出禪定模式" + "words.zero_items": "沒有內容" } diff --git a/locales/native/en.json b/locales/native/en.json index b7dd0d843..184442b56 100644 --- a/locales/native/en.json +++ b/locales/native/en.json @@ -68,7 +68,6 @@ "menu.unread": "Unread", "menu.view": "View", "menu.window": "Window", - "menu.zenMode": "Zen Mode", "menu.zoom": "Zoom", "menu.zoomIn": "Zoom In", "menu.zoomOut": "Zoom Out" diff --git a/locales/native/ja.json b/locales/native/ja.json index 2bd929951..0ba700298 100644 --- a/locales/native/ja.json +++ b/locales/native/ja.json @@ -68,7 +68,6 @@ "menu.unread": "未読", "menu.view": "表示", "menu.window": "ウィンドウ", - "menu.zenMode": "Zen モード", "menu.zoom": "ズーム", "menu.zoomIn": "拡大", "menu.zoomOut": "縮小" diff --git a/locales/native/zh-CN.json b/locales/native/zh-CN.json index 45c79f848..c6baaeccd 100644 --- a/locales/native/zh-CN.json +++ b/locales/native/zh-CN.json @@ -68,7 +68,6 @@ "menu.unread": "未读", "menu.view": "视图", "menu.window": "窗口", - "menu.zenMode": "禅定模式", "menu.zoom": "缩放", "menu.zoomIn": "放大", "menu.zoomOut": "缩小" diff --git a/locales/native/zh-TW.json b/locales/native/zh-TW.json index 33c89d8c1..cd711afab 100644 --- a/locales/native/zh-TW.json +++ b/locales/native/zh-TW.json @@ -68,7 +68,6 @@ "menu.unread": "未讀", "menu.view": "檢視", "menu.window": "視窗", - "menu.zenMode": "禪定模式", "menu.zoom": "縮放", "menu.zoomIn": "放大", "menu.zoomOut": "縮小" diff --git a/locales/settings/en.json b/locales/settings/en.json index 6a8e98bef..26cd3fe10 100644 --- a/locales/settings/en.json +++ b/locales/settings/en.json @@ -190,9 +190,6 @@ "appearance.unread_count.view_and_subscription.label": "Show in View and Subscription", "appearance.use_pointer_cursor.description": "When the mouse hovers over any interactive element, the cursor appears as a hand.", "appearance.use_pointer_cursor.label": "Use Hand Cursor", - "appearance.zen_mode.description": "Zen mode is an undisturbed reading mode that allows you to focus on the content without any interference. Enabling Zen mode will hide the sidebar.", - "appearance.zen_mode.description_simple": "Undisturbed reading mode (hides sidebar)", - "appearance.zen_mode.label": "Zen Mode", "common.give_star": "Love our product? Give us a star on GitHub!", "customizeToolbar.more_actions.description": "Will be shown in the dropdown menu", "customizeToolbar.more_actions.title": "More Actions", diff --git a/locales/settings/ja.json b/locales/settings/ja.json index ddf775eb3..f456ebb38 100644 --- a/locales/settings/ja.json +++ b/locales/settings/ja.json @@ -190,9 +190,6 @@ "appearance.unread_count.view_and_subscription.label": "サイドバーに表示", "appearance.use_pointer_cursor.description": "マウスがインタラクティブな要素の上にあるとき、カーソルは手の形になります。", "appearance.use_pointer_cursor.label": "手の形のカーソルを使用する", - "appearance.zen_mode.description": "Zen モードは、邪魔されることなくコンテンツに集中できる読書モードです。Zenモードを有効にすると、サイドバーが非表示になります。", - "appearance.zen_mode.description_simple": "邪魔されない読書モード(サイドバーを非表示)", - "appearance.zen_mode.label": "Zen モード", "common.give_star": "私たちの製品が好きですか?GitHub で Star を付けましょう!", "customizeToolbar.more_actions.description": "ドロップダウンメニューに表示されます", "customizeToolbar.more_actions.title": "その他のアクション", diff --git a/locales/settings/zh-CN.json b/locales/settings/zh-CN.json index 85bf10840..f4f8d5cb3 100644 --- a/locales/settings/zh-CN.json +++ b/locales/settings/zh-CN.json @@ -190,9 +190,6 @@ "appearance.unread_count.view_and_subscription.label": "在视图和订阅源上显示", "appearance.use_pointer_cursor.description": "当鼠标悬停在任何可交互元素上时,光标会显示为手型光标。", "appearance.use_pointer_cursor.label": "使用手型光标", - "appearance.zen_mode.description": "禅定模式是一种不受干扰的阅读模式,让你能够专注于内容而不受任何干扰。启用禅定模式将会隐藏侧边栏。", - "appearance.zen_mode.description_simple": "不受干扰的阅读模式(隐藏侧边栏)", - "appearance.zen_mode.label": "禅定模式", "common.give_star": "喜欢我们的产品吗? 在 GitHub 上给我们「Star」吧!", "customizeToolbar.more_actions.description": "将显示在下拉菜单中", "customizeToolbar.more_actions.title": "更多操作", diff --git a/locales/settings/zh-TW.json b/locales/settings/zh-TW.json index f4d684e65..2bd926f66 100644 --- a/locales/settings/zh-TW.json +++ b/locales/settings/zh-TW.json @@ -172,9 +172,6 @@ "appearance.unread_count.view_and_subscription.label": "在側邊欄中顯示", "appearance.use_pointer_cursor.description": "當滑鼠懸停在任何互動元素上時,游標會顯示為手型游標。", "appearance.use_pointer_cursor.label": "使用手型游標", - "appearance.zen_mode.description": "禪定模式是一種防干擾的閱讀模式,你可以專注於內容而不受其他干擾。啟用禪定模式將會隱藏側邊欄。", - "appearance.zen_mode.description_simple": "防干擾的閱讀模式(隱藏側邊欄)", - "appearance.zen_mode.label": "禪定模式", "common.give_star": "喜歡我們的產品嗎? 在 GitHub 上給我們 Star 吧!", "customizeToolbar.more_actions.description": "將顯示在下拉選單中", "customizeToolbar.more_actions.title": "更多操作", diff --git a/locales/shortcuts/en.json b/locales/shortcuts/en.json index 7c6862bcf..6af67f81b 100644 --- a/locales/shortcuts/en.json +++ b/locales/shortcuts/en.json @@ -31,10 +31,6 @@ "command.layout.focus_to_timeline.title": "Focus to Timeline", "command.layout.toggle_subscription_column.description": "Show/Hide the Subscription column in the layout", "command.layout.toggle_subscription_column.title": "Toggle Subscription Column", - "command.layout.toggle_wide_mode.description": "Enable/Disable the wide mode in the layout", - "command.layout.toggle_wide_mode.title": "Toggle Wide Mode", - "command.layout.toggle_zen_mode.description": "Enable/Disable the zen mode in the layout", - "command.layout.toggle_zen_mode.title": "Toggle Zen Mode", "command.subscription.mark_all_as_read.title": "Mark All as Read", "command.subscription.next_subscription.description": "Next Subscription", "command.subscription.next_subscription.title": "Next Subscription", diff --git a/locales/shortcuts/ja.json b/locales/shortcuts/ja.json index d69e69b73..6b8769142 100644 --- a/locales/shortcuts/ja.json +++ b/locales/shortcuts/ja.json @@ -29,10 +29,6 @@ "command.layout.focus_to_timeline.title": "タイムラインにフォーカス", "command.layout.toggle_subscription_column.description": "レイアウト内のサブスクリプション列を表示/非表示にします", "command.layout.toggle_subscription_column.title": "サブスクリプション列の切り替え", - "command.layout.toggle_wide_mode.description": "レイアウト内のワイドモードを有効/無効にします", - "command.layout.toggle_wide_mode.title": "ワイドモードの切り替え", - "command.layout.toggle_zen_mode.description": "レイアウト内の禅モードを有効/無効にします", - "command.layout.toggle_zen_mode.title": "禅モードの切り替え", "command.subscription.mark_all_as_read.title": "すべてを既読にマーク", "command.subscription.next_subscription.description": "次のサブスクリプション", "command.subscription.next_subscription.title": "次のサブスクリプション", diff --git a/locales/shortcuts/zh-CN.json b/locales/shortcuts/zh-CN.json index 5d6a760bc..1731ef683 100644 --- a/locales/shortcuts/zh-CN.json +++ b/locales/shortcuts/zh-CN.json @@ -27,10 +27,6 @@ "command.layout.focus_to_timeline.title": "聚焦到时间线", "command.layout.toggle_subscription_column.description": "在布局中显示或隐藏订阅栏。", "command.layout.toggle_subscription_column.title": "切换订阅栏", - "command.layout.toggle_wide_mode.description": "在布局中启用或停用宽屏模式。", - "command.layout.toggle_wide_mode.title": "切换宽屏模式", - "command.layout.toggle_zen_mode.description": "在布局中启用或停用禅定模式。", - "command.layout.toggle_zen_mode.title": "切换禅定模式", "command.subscription.mark_all_as_read.title": "全部标记为已读", "command.subscription.next_subscription.description": "切换到下一个订阅。", "command.subscription.next_subscription.title": "下一个订阅", diff --git a/locales/shortcuts/zh-TW.json b/locales/shortcuts/zh-TW.json index 432decb9c..2d412d595 100644 --- a/locales/shortcuts/zh-TW.json +++ b/locales/shortcuts/zh-TW.json @@ -27,10 +27,6 @@ "command.layout.focus_to_timeline.title": "聚焦到時間軸", "command.layout.toggle_subscription_column.description": "在版面配置中顯示或隱藏訂閱欄。", "command.layout.toggle_subscription_column.title": "切換訂閱欄", - "command.layout.toggle_wide_mode.description": "在版面配置中啟用或停用寬螢幕模式。", - "command.layout.toggle_wide_mode.title": "切換寬螢幕模式", - "command.layout.toggle_zen_mode.description": "在版面配置中啟用或停用禪定模式。", - "command.layout.toggle_zen_mode.title": "切換禪定模式", "command.subscription.mark_all_as_read.title": "全部標記為已讀", "command.subscription.next_subscription.description": "切換到下一個訂閱。", "command.subscription.next_subscription.title": "下一個訂閱",