You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- buildRequestKey: add "user" to the type union and a userSlug? parameter
so /users/:slug routes get a per-slug request key. Without this, every
user-profile resolution dedupes to the same "user" key and rapid profile
switches silently drop all but the first request. The CentralRouteManager
call site now passes route.userSlug explicitly.
- User not-found path now clears the residual entity vars (openedCorpus,
openedDocument, openedExtract, openedThread, openedLabelset, openedUser).
The corpus/document/extract paths redirect to /404 which clears via the
browse-route handler, but the user error path stays on the URL so the
visitor can fix the slug — meaning cleanup is the manager's job.
- OpenedUserProfile is now derived from GetUserOutput["userBySlug"] so the
type tracks the GraphQL schema automatically and the unsafe `as` cast in
the user-resolution branch goes away.
- ProfileRedirect now waits for authStatusVar !== "LOADING" and
authInitCompleteVar before redirecting. Previously a cold load of
/profile by an authenticated user would briefly redirect to /login while
Auth0 was still resolving.
- Added two ProfileRedirect tests that lock in the auth-gate behavior.
- routing_system.md: collapse the historical violations bullet list into a
single sentence — Corpuses.tsx is no longer a violator and the static
centralRouteDiscipline test now enforces zero violations.
Copy file name to clipboardExpand all lines: docs/frontend/routing_system.md
+1-7Lines changed: 1 addition & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,13 +57,7 @@ The OpenContracts routing system follows a **centralized architecture** where **
57
57
**The Correct Pattern:**
58
58
Components wanting to change URL-driven state must use utility functions that update the URL. CentralRouteManager Phase 2 will detect the URL change and set the reactive var. This maintains unidirectional data flow: Component → URL → CentralRouteManager → Reactive Var → Component.
59
59
60
-
This is non-negotiable. Violations cause infinite loops, route jittering, competing state updates, and unpredictable behavior. During development, we systematically removed all violations from:
-`NavMenu.tsx` / `MobileNavMenu.tsx` (clearing on menu clicks)
65
-
-`CorpusBreadcrumbs.tsx` (manual clearing)
66
-
-`Corpuses.tsx` (3 violations)
60
+
This is non-negotiable. Violations cause infinite loops, route jittering, competing state updates, and unpredictable behavior. The static `centralRouteDiscipline.test.ts` regression guard enforces this rule today, and the historical violations it was built to prevent (URL bypasses in `CorpusDocumentCards.tsx`, `DocumentKnowledgeBase.tsx`, `FloatingDocumentControls.tsx`, `NavMenu.tsx`/`MobileNavMenu.tsx`, `CorpusBreadcrumbs.tsx`, and `Corpuses.tsx`) have all been removed.
67
61
68
62
**If you find yourself writing `openedCorpus(someValue)`, `openedDocument(someValue)`, `openedExtract(someValue)`, `openedThread(someValue)`, `openedLabelset(someValue)`, or `openedUser(someValue)` anywhere except `CentralRouteManager.tsx`, STOP. You are introducing a bug.**
0 commit comments