{
  "about": "An entry of UpFork's ledger. Check it by hand as https://upfork.dev/docs/ledger says, or at https://upfork.dev/verify/E-222",
  "entry": {
    "seq": 222,
    "kind": "lesson-version",
    "record": "{\"ai\":{\"apps\":[\"Claude\"],\"models\":[\"Claude Opus 5.5\"]},\"article\":\"parley-a-team-chat-on-shadcn-ui-and-base-ui-and-three-traps-from-next-16-s-u\",\"articleRevision\":1,\"assumed\":\"Next.js keeps `useSearchParams` in step with both `history.pushState` and `history.replaceState`, so the layout could read the open chat from the URL and write it with whichever call fit.\",\"author\":{\"account\":\"a_9d470b566acab5f65bdc\",\"handle\":\"ramin-valadan\"},\"evidence\":\"the build's probes and scripted runs before and after; chat-layout.tsx lines 57–63 and 90–128, with the comment \\\"Next only syncs useSearchParams with history.pushState\\\".\",\"fix\":\"the layout keeps its own copy of the route, set whenever it opens or closes a chat and on `popstate` (Back and Forward), and reads `useSearchParams` only until it has one. The same run then stepped `?c=leadership`, `?c=sales-marketing`, `?c=jessica-martinez`.\",\"happened\":\"a plain `pushState(null, …)` did update it: probed in the browser, the header switched to the chat named in the new URL. But `replaceState(null, …)`, which the layout uses to move from one chat to the next, changed the address bar and left `useSearchParams` with the old value. Alt+↓ (next conversation) worked once and then stuck: in a scripted run the URL went to `?c=leadership` and stayed there on the next two presses, because the layout still thought the first chat was open. The build notes add that handing Next's own `history.state` back to these calls, the first attempt, broke both.\",\"kind\":\"not-in-docs\",\"learnedBy\":\"ai\",\"lesson\":\"L-ZPDX\",\"packages\":\"next@16.4\",\"product\":\"shadcn-chat-app-messenger-react\",\"productRevision\":1,\"publishedAt\":\"2026-10-26T13:35:54.253Z\",\"site\":\"https://upfork.dev\",\"title\":\"In Next 16, history.replaceState changes the URL but not useSearchParams: keep the open route in state of your own\",\"type\":\"lesson-version\",\"url\":\"https://upfork.dev/lessons/L-ZPDX\",\"version\":1,\"why\":\"\"}",
    "recordHash": "dba322e001ab6b72f75a387a8857d438c6fea2ef8335e867609039a8c344b7cb",
    "prevHash": "605154bdaeb24f80f37b3a37b93aebdb311b7223cea9a945d68fd4c724456218",
    "entryHash": "33dbe53a9394714aedd51da8272b4d8ed484ed75409ff12dbdafce83b083b9b4",
    "keyId": "k1",
    "signature": "y3WnoSGN0hU+VAgsfOSmDzLzg8eDnTJCml3YM+BaKAkSICtkjqIbPY67oiYcvx+u1jgPU/4lclPZzxj4rtiNDA==",
    "recordedAt": "2026-10-26T13:36:44.307348+00:00",
    "publicKey": "VuHuHXAtO3XAqgnwvMenp0f/3vTV061hnAIizYvwh40=",
    "algorithm": "Ed25519"
  },
  "path": [],
  "checkpoint": null,
  "keys": "https://upfork.dev/ledger/keys.json"
}