From 620b12d4b6c9ca1b756e3255a86fc62c7b30dc3b Mon Sep 17 00:00:00 2001 From: opencode Date: Sun, 2 Aug 2026 10:15:43 +0200 Subject: [PATCH] fix: view toggle stuck after selecting table/rows URL param had precedence over the user's toggle choice, so once ?view=table|rows was in the URL the override could never win. User selection now takes precedence; URL param only applies on first load. --- artifacts/toolrate/src/pages/tools-browse.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/artifacts/toolrate/src/pages/tools-browse.tsx b/artifacts/toolrate/src/pages/tools-browse.tsx index cbb9c56..f949b44 100644 --- a/artifacts/toolrate/src/pages/tools-browse.tsx +++ b/artifacts/toolrate/src/pages/tools-browse.tsx @@ -91,9 +91,9 @@ export default function ToolsBrowse() { const urlView = initialParams.get("view"); const urlDensity = initialParams.get("density"); const view: ViewMode = - (isViewMode(urlView) ? urlView : null) ?? overrideView ?? serverView ?? localView ?? "grid"; + overrideView ?? (isViewMode(urlView) ? urlView : null) ?? serverView ?? localView ?? "grid"; const density: Density = - (isDensity(urlDensity) ? urlDensity : null) ?? overrideDensity ?? serverDensity ?? localDensity ?? "cozy"; + overrideDensity ?? (isDensity(urlDensity) ? urlDensity : null) ?? serverDensity ?? localDensity ?? "cozy"; useEffect(() => { const p = new URLSearchParams();