fix(desktop): route organization members to their organization and settings

Merged
WA
4d ago
+265-13

Summary

  • GET /api/workspaces now returns forwardOrganizationId when a viewer has no workspace, can't create one, and belongs to an organization whose surface can serve them. /workspace forwards them there instead of showing "No workspace access yet", and ?redirect=settings lands on the organization's general settings. Ships with the web release, so installed desktop apps and their saved /workspace route recover without an update
  • Forwarding only happens when the organization's rollout is on, the same condition that stops the organization surface sending viewers back to /workspace, so the two can't loop
  • The decision lives in the branch that already computes the blocked state, so it can't disagree with the card. A failed lookup leaves the existing card in place rather than failing the list
  • Desktop browser sign-in now lands on /home instead of /workspace
  • Desktop "Settings…" now opens /o/<id>/settings/general from the organization view. Without a workspace or organization in the last route it uses /workspace?redirect=settings. It used to fall back to /home, which has no settings, so the menu item appeared to do nothing

Not changed: Desktop, Browser, and Terminal settings are still workspace-bound, so members without a workspace can't reach them.

Type of Change

  • Bug fix

Testing

  • New failure-mode tests in workspaces/route.test.ts, workspace/page.test.tsx, resolve-app-entry.test.ts, app-routes.test.ts, handoff.test.ts. Reverted each guard (client forward, card suppression, settings destination, route field, lookup failure, rollout, org route, fallback, handoff landing) and watched its test go red
  • bun run type-check, biome on changed files, check:tool-registry-boundary, check:api-validation:strict, check:api-contract-routes, check:test-patterns, check:source-conventions, check:client-boundary, check:boundaries, check:application-graph, check:comment-hygiene, check:utils, check:file-names
  • check:audits and the full test suite left to CI
  • Not exercised in a packaged desktop app against a real organization account

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)