From 8f9ff270343b854669e278675c709110dc35056f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=A8=E9=9C=96=E9=93=83?= Date: Fri, 19 Jun 2026 00:38:01 +0800 Subject: [PATCH] =?UTF-8?q?fix(RouterProvider):=20=E5=B0=86=20goBack=20?= =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=E4=B8=BA=20goHome=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E8=B7=A8=E7=AA=97=E5=90=8C=E6=AD=A5=20merge=20?= =?UTF-8?q?=E4=B8=8D=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit API 命名与实际行为(返回 dashboard)对齐;storage.onChanged 同步 visiblePages/pageOrder 时应用 mergeWithDefaults,与初始化逻辑保持一致。 Co-authored-by: Cursor --- src/components/TopBar.tsx | 6 +-- .../__tests__/RouterContainer.test.tsx | 2 +- src/components/__tests__/TopBar.test.tsx | 10 ++-- src/providers/README.md | 2 +- src/providers/RouterProvider.tsx | 10 ++-- .../__tests__/RouterProvider.test.tsx | 53 +++++++++++++++++++ 6 files changed, 68 insertions(+), 15 deletions(-) diff --git a/src/components/TopBar.tsx b/src/components/TopBar.tsx index 3cca6f3..a943e48 100644 --- a/src/components/TopBar.tsx +++ b/src/components/TopBar.tsx @@ -11,7 +11,7 @@ const SEARCH_HISTORY_LIMIT = 10; const SEARCH_HISTORY_DISPLAY = 5; export default function TopBar() { - const { currentPage, goBack, navigateTo } = useRouter(); + const { currentPage, goHome, navigateTo } = useRouter(); const { mode, setMode } = useThemeMode(); const [searchQuery, setSearchQuery] = useState(''); @@ -138,8 +138,8 @@ export default function TopBar() { {!isDashboard && (