open-design/apps/web/tests
Bassiiiii 0c4b7e50be
fix(web/router): defer popstate dispatch to microtask (#2490)
* fix(web/router): defer popstate dispatch to microtask

navigate() previously dispatched a synchronous popstate event after
mutating window.history, which caused React 18 to emit:

  Cannot update a component (Router) while rendering a different
  component (App). To locate the bad setState() call inside App,
  follow the stack trace as described in
  https://react.dev/link/setstate-in-render

This happens whenever a caller invokes navigate() from inside a
useState updater (e.g. App.tsx:479 routing first-run users through
the onboarding panel from inside the setConfig() update). The
synchronous popstate dispatch reaches useRoute() subscribers which
then call setRoute() while the parent component is still rendering.

Defer the popstate dispatch to a microtask. The window.history call
itself stays synchronous so the URL bar updates immediately; only
subscriber updates are pushed past the current render commit, which
removes the warning without changing observable behaviour for any
existing caller.

* fix(web/router): cover deferred navigation timing

---------

Co-authored-by: Visionboost <contact@visionboost.fr>
Co-authored-by: Siri-Ray <2667192167@qq.com>
2026-05-29 09:37:55 +00:00
..
analytics feat(analytics): emit file_upload_result from all three upload entries (#2459) 2026-05-21 18:28:56 +08:00
artifacts fix(web): parse ask-question blocks as question-form alias (#1194) (#3053) 2026-05-27 06:34:36 +00:00
components add comment composer keyboard submit shortcut (#2941) 2026-05-29 08:46:15 +00:00
edit-mode feat(web): merge Draw + Screenshot into one Studio mark tool (#3081) (#3277) 2026-05-29 06:51:38 +00:00
helpers refactor(web): split global CSS by ownership (#2609) 2026-05-25 05:48:28 +00:00
hooks fix(web): coalesce chokidar rewrite bursts before refreshing files (#2326) 2026-05-20 11:12:53 +08:00
i18n test(i18n): lock zh-CN to tier-1 explicit translation parity (#2920) 2026-05-25 20:08:41 +08:00
lib fix(web): clarify finalize BYOK requirements for Local CLI users (#3041) 2026-05-27 06:20:33 +00:00
observability feat(observability): web lifecycle telemetry + stable installationId migration (#2527) 2026-05-21 15:37:48 +08:00
providers feat(daemon): add Antigravity agent adapter (#3157) 2026-05-29 05:43:37 +00:00
runtime fix(web): target comment picker elements precisely (#3263) 2026-05-29 07:47:08 +00:00
state fix(web): surface Claude Design zip import failures (#1862) (#3047) 2026-05-27 06:24:38 +00:00
styles fix(web): restore changes silently dropped by PR #2461 sync merge (#3210) 2026-05-28 12:50:05 +00:00
utils fix(web): handle dropped file read failures (#2858) 2026-05-25 06:05:17 +00:00
analytics-app-version.test.tsx fix(analytics): app_version=0.0.0 + media providers clicks + lock run_finished error_code (#2453) 2026-05-20 21:50:11 +08:00
analytics-configure-globals.test.ts feat(analytics): ship PostHog v2 event schema (#2285) 2026-05-20 13:04:20 +08:00
analytics-identity.test.ts feat(analytics): PostHog product analytics (P0 events, consent-gated, packaged) (#1428) 2026-05-12 22:32:42 +08:00
analytics-scrub.test.ts feat(analytics): PostHog product analytics (P0 events, consent-gated, packaged) (#1428) 2026-05-12 22:32:42 +08:00
api-attachment-context.test.ts Inline attached file context for BYOK chats (#1730) 2026-05-15 15:52:15 +08:00
App.test.ts fix(web): suppress autosave indicator for draft-only Connector key edits (#1232) 2026-05-11 20:52:45 +08:00
comments.test.ts feat(comments): add comment attachment API (#2869) 2026-05-25 07:24:21 +00:00
host-boundary.test.ts refactor desktop host bridge (#2246) 2026-05-19 18:27:05 +08:00
quickSwitcherRecents.test.ts feat(web): add Cmd/Ctrl+P quick file switcher (#556) 2026-05-06 10:31:50 +08:00
router-marketplace.test.ts [codex] Add global onboarding flow without AMR (#2272) 2026-05-19 22:00:40 +08:00
router.navigate.test.tsx fix(web/router): defer popstate dispatch to microtask (#2490) 2026-05-29 09:37:55 +00:00
router.test.ts Garnet hemisphere (#1702) 2026-05-14 21:12:50 +08:00
sidecar-proxy.test.ts Enable LAN web dev access (#1947) 2026-05-19 17:50:50 +08:00