Bug: Dashboard Quick Actions don't prefill type/occasion on /log #161

Closed
opened 2026-09-08 19:33:05 +00:00 by Mark · 1 comment
Owner

Bug

Clicking any of the six Quick Action buttons on the Dashboard (Quick Call, Send Text, Plan Meetup, Gift Idea, Add Note) lands on the LogInteraction page with no prefill — the page stays on step 1 ("Who did you connect with?") and the type/occasion query params are silently dropped.

Quick Log (no params) works because it has nothing to lose.

Repro

  1. Start dev server, navigate to http://localhost:3000
  2. Click Quick Call on the dashboard
  3. Observe: URL becomes #/log, page shows step 1 "Who did you connect with?", no type=Call applied

Expected: lands on step 3 (Details) with type=Call pre-selected.

Root cause

src/pages/Home.tsx:101-110 navigates with a query string:

navigate("/log?type=Call")
navigate("/log?type=Text")
navigate("/log?type=In-Person")
navigate("/log?type=Other&occasion=Gift")
navigate("/log?type=Other&occasion=Note")
navigate("/log")  // Quick Log - only one that works

The browser stores the query inside the URL hash (#/log?type=Call), not in the URL search string.

src/pages/LogInteraction.tsx:284 reads it via:

const params = new URLSearchParams(location.search);

But under HashRouter, location.search is always "" - the ?type=Call lives inside location.hash. params.get("type") returns null, the prefill branch never fires, the page stays on step 1.

Suggested fix

Either:

  • Use react-router's useSearchParams() hook (which reads from inside the hash correctly under HashRouter), OR
  • Replace URLSearchParams(location.search) with URLSearchParams(location.hash.split("?")[1] || "")

Severity

Functional. The six Quick Actions on the dashboard are silent no-ops - they navigate but don't prefill. This is the historic #147 shape and looks like a regression or one that was never fully fixed for the param case.

Verification

  • Dev server: npm run dev (port 3000)
  • Manually verified: setting history.replaceState(null,'','#/log?type=Call') produces location.hash = "#/log?type=Call", location.search = "", and LogInteraction stays on step 1.
## Bug Clicking any of the six Quick Action buttons on the Dashboard (Quick Call, Send Text, Plan Meetup, Gift Idea, Add Note) lands on the LogInteraction page with **no prefill** — the page stays on step 1 ("Who did you connect with?") and the type/occasion query params are silently dropped. Quick Log (no params) works because it has nothing to lose. ## Repro 1. Start dev server, navigate to http://localhost:3000 2. Click **Quick Call** on the dashboard 3. Observe: URL becomes `#/log`, page shows step 1 "Who did you connect with?", no type=Call applied Expected: lands on step 3 (Details) with type=Call pre-selected. ## Root cause `src/pages/Home.tsx:101-110` navigates with a query string: ```js navigate("/log?type=Call") navigate("/log?type=Text") navigate("/log?type=In-Person") navigate("/log?type=Other&occasion=Gift") navigate("/log?type=Other&occasion=Note") navigate("/log") // Quick Log - only one that works ``` The browser stores the query inside the URL hash (`#/log?type=Call`), not in the URL search string. `src/pages/LogInteraction.tsx:284` reads it via: ```js const params = new URLSearchParams(location.search); ``` But under HashRouter, **`location.search` is always `""`** - the `?type=Call` lives inside `location.hash`. `params.get("type")` returns `null`, the prefill branch never fires, the page stays on step 1. ## Suggested fix Either: - Use react-router's `useSearchParams()` hook (which reads from inside the hash correctly under HashRouter), OR - Replace `URLSearchParams(location.search)` with `URLSearchParams(location.hash.split("?")[1] || "")` ## Severity Functional. The six Quick Actions on the dashboard are silent no-ops - they navigate but don't prefill. This is the historic #147 shape and looks like a regression or one that was never fully fixed for the param case. ## Verification - Dev server: `npm run dev` (port 3000) - Manually verified: setting `history.replaceState(null,'','#/log?type=Call')` produces `location.hash = "#/log?type=Call"`, `location.search = ""`, and LogInteraction stays on step 1.
Author
Owner

Fixed by kilo-gsd.py in commit 6d4699c (was 1c91a2f before rebase to resolve origin/main divergence).

Bug: HashRouter stores ?type=Call inside location.hash, not location.search. URLSearchParams(location.search) was always empty, so the prefill silently dropped and /log stayed on step 1.

Fix: swap to react-router's useSearchParams(), which reads the hash-stored query under both HashRouter and MemoryRouter. Updated re-run deps; location.state and location.pathname unchanged.

Verification: new regression test mounts LogInteraction under HashRouter with ?type=Call, ?type=Other&occasion=Gift, and a non-canonical type guard (src/pages/tests/LogInteraction.queryPrefill.test.tsx). Full npm run test:unit + lint + tsc clean. Pushed to main.

Watcher recovery: kilo-gsd.py exited 2 (PARTIAL) because origin/main had moved between run start and push. Watcher did fetch+rebase+push, landed on main as 6d4699c alongside sibling #162's 946ae4b.

Fixed by kilo-gsd.py in commit 6d4699c (was 1c91a2f before rebase to resolve origin/main divergence). Bug: HashRouter stores `?type=Call` inside `location.hash`, not `location.search`. `URLSearchParams(location.search)` was always empty, so the prefill silently dropped and /log stayed on step 1. Fix: swap to react-router's `useSearchParams()`, which reads the hash-stored query under both HashRouter and MemoryRouter. Updated re-run deps; location.state and location.pathname unchanged. Verification: new regression test mounts LogInteraction under HashRouter with ?type=Call, ?type=Other&occasion=Gift, and a non-canonical type guard (src/pages/__tests__/LogInteraction.queryPrefill.test.tsx). Full `npm run test:unit` + lint + tsc clean. Pushed to main. Watcher recovery: kilo-gsd.py exited 2 (PARTIAL) because origin/main had moved between run start and push. Watcher did fetch+rebase+push, landed on main as 6d4699c alongside sibling #162's 946ae4b.
Mark 2026-09-08 19:50:59 +00:00
Sign in to join this conversation.
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
Mark/kimi_agent_kin_app_sync#161
No description provided.