From 8cebbc6f0147c76b3b1eae609c69dad7a01da8c9 Mon Sep 17 00:00:00 2001 From: Innei Date: Fri, 12 Sep 2025 02:02:48 +0800 Subject: [PATCH] refactor: enhance navigation by integrating view parameter retrieval - Updated EntryColumnShortcutHandler to utilize getRouteParams for retrieving the view parameter during navigation. - Ensured that the view parameter is passed correctly when navigating to the next entry, improving the consistency of navigation behavior. These changes aim to enhance the clarity and functionality of the entry column navigation logic. Signed-off-by: Innei --- .../modules/entry-column/EntryColumnShortcutHandler.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/desktop/layer/renderer/src/modules/entry-column/EntryColumnShortcutHandler.tsx b/apps/desktop/layer/renderer/src/modules/entry-column/EntryColumnShortcutHandler.tsx index 623220367..c7a8332c7 100644 --- a/apps/desktop/layer/renderer/src/modules/entry-column/EntryColumnShortcutHandler.tsx +++ b/apps/desktop/layer/renderer/src/modules/entry-column/EntryColumnShortcutHandler.tsx @@ -12,7 +12,7 @@ import { toast } from "sonner" import { FocusablePresets } from "~/components/common/Focusable" import { useNavigateEntry } from "~/hooks/biz/useNavigateEntry" -import { useRouteEntryId } from "~/hooks/biz/useRouteParams" +import { getRouteParams, useRouteEntryId } from "~/hooks/biz/useRouteParams" import { COMMAND_ID } from "../command/commands/id" import { useCommandBinding } from "../command/hooks/use-command-binding" @@ -71,9 +71,11 @@ export const EntryColumnShortcutHandler: FC<{ handleScrollTo(nextIndex) const nextId = data![nextIndex] + const { view } = getRouteParams() navigate({ entryId: nextId, + view, }) }) }, [currentEntryIdRef, dataRef, handleScrollTo, navigate, when]) @@ -94,8 +96,11 @@ export const EntryColumnShortcutHandler: FC<{ handleScrollTo(nextIndex) const nextId = data![nextIndex] + const { view } = getRouteParams() + navigate({ entryId: nextId, + view, }) }) }, [currentEntryIdRef, dataRef, handleScrollTo, navigate])