Search deep links: same-route query changes do not restore the palette #773

Open
opened 2026-10-02 13:10:17 +00:00 by kayg · 3 comments
Owner

Found during the source review for #427 on origin/dev at c4a61e8cf090170f35b1bed3350d9de20c83ecd5.

Decided behavior

DESIGN §33 requires URL-to-view restoration for cold loads and back/forward, including the search query, scope and expanded state.

Evidence

apps/web/src/routes/search/+page.svelte:20–29 reads page.url.searchParams only in onMount. Its afterNavigate callback at lines 16–18 changes cameFromApp only. apps/web/src/routes/+layout.svelte:840 renders children without a URL-keyed remount. apps/web/src/lib/components/search-dialog.svelte:695 derives the copy URL from window state; it does not restore that state from navigation.

Observed behavior

A cold search URL is restored, but navigation between /search URLs can reuse the page component and leave the prior query, Calendar scope, subfolder setting or expanded state in the palette.

This is a source finding. No production build or live-server run was made in this review job.

Expected

Restore the palette from the current URL on relevant same-route navigation, including Back/Forward. Keep the URL-to-intent path in one place and avoid reopening on ordinary result updates.

Test idea

Visit /search?q=alpha, then navigate to /search?q=beta&view=all&scope=calendar&sub=0 without reloading. Assert query, scope, subfolders and expanded state. Back and Forward must restore each state.

For UI evidence, use a production build at 390, 820 and 1440 px in light and dark, with macOS platform hints. Check pointer, keyboard and touch, plus reduced motion.

Duplicate check

Searched all issue titles and search-link results. #167 is the general deep-link audit; #57 is the original palette feature. No specific same-route search-query restoration ticket found. This is a source finding; the test above must provide browser proof.

Found during the source review for #427 on `origin/dev` at `c4a61e8cf090170f35b1bed3350d9de20c83ecd5`. ## Decided behavior DESIGN §33 requires URL-to-view restoration for cold loads and back/forward, including the search query, scope and expanded state. ## Evidence `apps/web/src/routes/search/+page.svelte:20–29` reads page.url.searchParams only in onMount. Its afterNavigate callback at lines 16–18 changes cameFromApp only. `apps/web/src/routes/+layout.svelte:840` renders children without a URL-keyed remount. `apps/web/src/lib/components/search-dialog.svelte:695` derives the copy URL from window state; it does not restore that state from navigation. ## Observed behavior A cold search URL is restored, but navigation between /search URLs can reuse the page component and leave the prior query, Calendar scope, subfolder setting or expanded state in the palette. This is a source finding. No production build or live-server run was made in this review job. ## Expected Restore the palette from the current URL on relevant same-route navigation, including Back/Forward. Keep the URL-to-intent path in one place and avoid reopening on ordinary result updates. ## Test idea Visit /search?q=alpha, then navigate to /search?q=beta&view=all&scope=calendar&sub=0 without reloading. Assert query, scope, subfolders and expanded state. Back and Forward must restore each state. For UI evidence, use a production build at 390, 820 and 1440 px in light and dark, with macOS platform hints. Check pointer, keyboard and touch, plus reduced motion. ## Duplicate check Searched all issue titles and search-link results. #167 is the general deep-link audit; #57 is the original palette feature. No specific same-route search-query restoration ticket found. This is a source finding; the test above must provide browser proof.
Author
Owner

Additional source check: the route reads query parameters only during onMount; same-route navigation and Back/Forward do not refresh the Search window. I will exercise client-side navigation for query, scope, subfolder and expanded state.

Additional source check: the route reads query parameters only during `onMount`; same-route navigation and Back/Forward do not refresh the Search window. I will exercise client-side navigation for query, scope, subfolder and expanded state.
Author
Owner

Implemented #773 in d1460f667: Search state now restores after every navigation to /search, including same-route query changes and browser Back/Forward. The first external route still determines where closing Search returns. Added a regression that applies alpha → full Calendar-scoped beta in Projects with subfolders off → alpha and checks all URL-backed state. bun run test -- src/lib/search/route.svelte.test.ts: 1 passed. Production browser proof and the required screenshot matrix remain in the final verification pass.

Implemented #773 in `d1460f667`: Search state now restores after every navigation to `/search`, including same-route query changes and browser Back/Forward. The first external route still determines where closing Search returns. Added a regression that applies alpha → full Calendar-scoped beta in Projects with subfolders off → alpha and checks all URL-backed state. `bun run test -- src/lib/search/route.svelte.test.ts`: 1 passed. Production browser proof and the required screenshot matrix remain in the final verification pass.
Author
Owner

The #861 source audit confirms the current Search route still reads URL state only in onMount: apps/web/src/routes/search/+page.svelte:20-28. Its afterNavigate callback at lines 16-18 updates only cameFromApp, so same-route changes to q, view, scope or sub do not reapply the URL intent. This matches the behavior and expected fix already recorded here; no new issue is needed.

The #861 source audit confirms the current Search route still reads URL state only in `onMount`: `apps/web/src/routes/search/+page.svelte:20-28`. Its `afterNavigate` callback at lines 16-18 updates only `cameFromApp`, so same-route changes to `q`, `view`, `scope` or `sub` do not reapply the URL intent. This matches the behavior and expected fix already recorded here; no new issue is needed.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal#773
No description provided.