📚 Clarify frontend routing guidance

Use a direct routing memory and record team resolution precedence to
help preserve the team context during navigation.

AI-assisted-by: gpt-6.1-terra
This commit is contained in:
Andrey Antukh 2026-11-24 09:31:00 +00:00
parent 09969d622e
commit 172e70df22
4 changed files with 4 additions and 4 deletions

View File

@ -5,4 +5,4 @@
- `check-nitrate-sso` receives the client route as a query string, not an absolute URL. `build-dest-url` validates parameter keys and builds the destination under `public-uri`; invalid input falls back there. Accept root routes without `screen`, and keep callback revalidation for older state tokens. The state token binds the SSO grant to the profile that initiated it: a different session must not receive that grant.
- A client-supplied organization ID requires `app.nitrate/organization-access?` before SSO; callers without organization access get the no-access short circuit, not an SSO challenge.
- When public registration is disabled, a matching invitation can allow registration. Password registration rechecks the non-expired invitation row under lock. OIDC registration requires `:registration`, `:oidc-registration` or an invitation whose member email matches the provider email after `clean-email`; the callback verifies it and registration revalidates it under lock when the flags are off. Only recognized OIDC provider types take the SSO registration path. Keep invitation identity checks on authenticated login too.
- Test both the root and workspace route forms, malformed redirect targets, changed sessions and invitation email mismatches. Frontend query-string construction: `mem:frontend/routing-app-shell-subtleties`. For test flags and setup see `mem:backend/testing`.
- Test both the root and workspace route forms, malformed redirect targets, changed sessions and invitation email mismatches. Frontend query-string construction: `mem:frontend/routing`. For test flags and setup see `mem:backend/testing`.

View File

@ -19,7 +19,7 @@ Start at `app.main.ui` for Rumext components, `app.main.data` for Potok events,
## App shell
- Router, history, SSO destinations and team context: `mem:frontend/routing-app-shell-subtleties`.
- Router, history, SSO destinations and team context: `mem:frontend/routing`.
- Authentication event sources and invitations: `mem:frontend/auth-events`.
- Error boundary, transport errors and reports: `mem:frontend/error-reporting`.
- WebSocket lifetime, membership revocation, and job progress: `mem:frontend/websocket-notifications`.

View File

@ -4,5 +4,5 @@
- Push of the current token does not write or notify; replace always writes and notifies, even for the same token, so URL corrections reach the router. `app.util.dom/replace-history-state!` intentionally rewrites without routing; do not substitute a notifying replace.
- Route data uses query params. A repeated param can decode as a vector; use `rt/get-query-param` for a scalar. Use `rt/token->query-string` at the SSO boundary: the server owns the destination origin. Use `rt/token->url` for a client-side absolute URL; do not require `screen`, since root flows can carry params such as a template without a route name. See `mem:backend/auth-sso`.
- `rt/nav-raw` exits the router; tests observe its destination by dereferencing the event, not by looking for an app listener. Unknown or empty routes verify the profile and teams before redirecting so root and invitation flows do not race. See `mem:frontend/auth-events` for login and invitations.
- Use the team-scoped navigation helpers in `app.main.data.common` rather than building the route at the call site. Their private `resolve-team-id` considers the team already on screen before the profile default, so the user's personal team does not replace the current team. An invalid team route fails explicitly rather than rendering a blank shell.
- Use the team-scoped navigation helpers in `app.main.data.common` rather than building the route at the call site. Their private `resolve-team-id` chooses the valid explicit ID, then the initialized team, then the current route's team, then the profile default. The route precedes the default so the user's personal team does not replace the team on screen. An invalid team route fails explicitly rather than rendering a blank shell.
- For store exceptions, React boundaries and report limits/classification see `mem:frontend/error-reporting`. For the client reaction to lost membership and job events see `mem:frontend/websocket-notifications`.

View File

@ -4,4 +4,4 @@
- Viewer initialization fetches a view-only bundle and sends all supported features because an anonymous viewer may not know team-enabled features. Comment threads are fetched only for logged-in users.
- The viewer resolves pointer values in file data and `:pages-index` through `app.main.features.pointer-map/resolve-pointer` with share-link scope before storing the bundle. Membership and share-link bundles have different fragment permissions; an unresolvable fragment rejects rather than silently dropping a page. See `mem:backend/permissions`.
- `bundle-fetched` indexes pages, precomputes frames and navigates to the requested or selected frame. Zoom and interaction mode also live in route query params. `update-zoom-querystring` must compare current and expected zoom before replacing the route: otherwise loading and navigation can loop into React's maximum update depth error.
- Dashboard behavior is `mem:frontend/dashboard`; shared routing rules are `mem:frontend/routing-app-shell-subtleties`.
- Dashboard behavior is `mem:frontend/dashboard`; shared routing rules are `mem:frontend/routing`.