diff --git a/src/renderer/src/App.tsx b/src/renderer/src/App.tsx index c37effa07..6dae93fbd 100644 --- a/src/renderer/src/App.tsx +++ b/src/renderer/src/App.tsx @@ -74,9 +74,15 @@ const AppLayer = () => { const AppSkeleton = () => { const entryColWidth = useUISettingKey("entryColWidth") + const feedColWidth = useUISettingKey("feedColWidth") return (
-
+
({ // Sidebar entryColWidth: 340, + feedColWidth: 256, + opaqueSidebar: false, sidebarShowUnreadCount: true, diff --git a/src/renderer/src/components/ui/divider/PanelSpliter.tsx b/src/renderer/src/components/ui/divider/PanelSpliter.tsx new file mode 100644 index 000000000..d86f867de --- /dev/null +++ b/src/renderer/src/components/ui/divider/PanelSpliter.tsx @@ -0,0 +1,15 @@ +import * as React from "react" + +export const PanelSplitter = ( + props: React.DetailedHTMLProps< + React.HTMLAttributes, + HTMLDivElement + >, +) => ( +
+
+
+) diff --git a/src/renderer/src/components/ui/divider/index.ts b/src/renderer/src/components/ui/divider/index.ts index a40b3411a..7100cf8c5 100644 --- a/src/renderer/src/components/ui/divider/index.ts +++ b/src/renderer/src/components/ui/divider/index.ts @@ -1 +1,2 @@ export * from "./Divider" +export * from "./PanelSpliter" diff --git a/src/renderer/src/modules/entry-content/index.tsx b/src/renderer/src/modules/entry-content/index.tsx index 0d800c5e6..575c893e9 100644 --- a/src/renderer/src/modules/entry-content/index.tsx +++ b/src/renderer/src/modules/entry-content/index.tsx @@ -47,9 +47,6 @@ function EntryContentRender({ entryId }: { entryId: string }) { const { error, data } = useAuthQuery(Queries.entries.byId(entryId), { staleTime: 300_000, - meta: { - persist: true, - }, }) const entry = useEntry(entryId) diff --git a/src/renderer/src/modules/feed-column/index.tsx b/src/renderer/src/modules/feed-column/index.tsx index 462b7cd61..a1353e36d 100644 --- a/src/renderer/src/modules/feed-column/index.tsx +++ b/src/renderer/src/modules/feed-column/index.tsx @@ -235,7 +235,7 @@ export function FeedColumn({ children }: PropsWithChildren) { {views.map((item, index) => (
{active === index && ( - +
- {!inWideMode && ( -
- )} + {!inWideMode && }
) diff --git a/src/renderer/src/pages/(main)/layout.tsx b/src/renderer/src/pages/(main)/layout.tsx index 1cbbc37eb..f4563b6b4 100644 --- a/src/renderer/src/pages/(main)/layout.tsx +++ b/src/renderer/src/pages/(main)/layout.tsx @@ -1,5 +1,7 @@ import { setMainContainerElement } from "@renderer/atoms/dom" +import { getUISettings, setUISetting } from "@renderer/atoms/settings/ui" import { useLoginModalShow, useMe } from "@renderer/atoms/user" +import { PanelSplitter } from "@renderer/components/ui/divider" import { DeclarativeModal } from "@renderer/components/ui/modal/stacked/declarative-modal" import { NoopChildren } from "@renderer/components/ui/modal/stacked/utils" import { RootPortal } from "@renderer/components/ui/portal" @@ -10,15 +12,40 @@ import { LoginModalContent } from "@renderer/modules/auth/LoginModalContent" import { FeedColumn } from "@renderer/modules/feed-column" import { AutoUpdater } from "@renderer/modules/feed-column/auto-updater" import { SearchCmdK } from "@renderer/modules/search/cmdk" +import { useRef } from "react" +import { useResizable } from "react-resizable-layout" import { Outlet } from "react-router-dom" export function Component() { const isAuthFail = useLoginModalShow() const user = useMe() + const containerRef = useRef(null) + const { position, separatorProps } = useResizable({ + axis: "x", + min: 256, + max: 300, + initial: getUISettings().feedColWidth, + containerRef, + onResizeEnd({ position }) { + setUISetting("feedColWidth", position) + }, + }) + return ( -
-
+
+
{APP_VERSION?.[0] === "0" && (
@@ -36,6 +63,8 @@ export function Component() {
{/* NOTE: tabIndex for main element can get by `document.activeElement` */} + +
- + )}