From 3afe1e21df6dcc0483e74e0db02d9d82af32ecea Mon Sep 17 00:00:00 2001 From: xuatz Date: Mon, 2 Jun 2025 04:01:26 +0900 Subject: feat: add user customisable default archive display behaviour (#1505) * fix typo * implementation * bug fix and refactoring * Use nuqs for searchParam management * remove the todo about the tests * fix tests --------- Co-authored-by: Mohamed Bassem --- apps/web/app/dashboard/lists/[listId]/page.tsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'apps/web/app/dashboard/lists') diff --git a/apps/web/app/dashboard/lists/[listId]/page.tsx b/apps/web/app/dashboard/lists/[listId]/page.tsx index 6c0bc36c..de0f5054 100644 --- a/apps/web/app/dashboard/lists/[listId]/page.tsx +++ b/apps/web/app/dashboard/lists/[listId]/page.tsx @@ -8,9 +8,14 @@ import { BookmarkListContextProvider } from "@karakeep/shared-react/hooks/bookma export default async function ListPage({ params, + searchParams, }: { params: { listId: string }; + searchParams?: { + includeArchived?: string; + }; }) { + const userSettings = await api.users.settings(); let list; try { list = await api.lists.get({ listId: params.listId }); @@ -23,10 +28,18 @@ export default async function ListPage({ throw e; } + const includeArchived = + searchParams?.includeArchived !== undefined + ? searchParams.includeArchived === "true" + : userSettings.archiveDisplayBehaviour === "show"; + return ( } -- cgit v1.2.3-70-g09d2