ubiquitous-invention/plans/Plan-daily-driver-finish/Epic-shipping-the-shell
Randall Stillwell 7ec2ede7ca feat(web): land authed users on their oldest workspace home by slug
Path-A task 4/5. The root landing logic in apps/web/app/page.tsx was
redirecting to `/${workspaceId}` (UUID, ugly) and using no ORDER BY
(so two sessions could land on different workspaces). It also looped
zero-workspace users through `/sign-in`.

Changes:

* Inner-join workspaceMembers with workspaces to fetch the slug, not
  just the id. Order by membership createdAt ascending so users
  consistently hit their oldest workspace.
* Redirect to /{slug} (slug, not UUID).
* Removed the unused `objects` / `and` imports that were lint
  warnings.
* Zero-workspace branch redirects to /sign-in?error=no_workspace as a
  defensive fallback; documented inline that this is unreachable for
  fresh sign-ins post `ensureUserHasWorkspace` in apps/web/lib/auth.ts.

The dashboard at /{slug}/ is no longer a mockup (post commit f64d307
which wired it to objects.stats and objects.listRecent), so landing
there now shows real state.

Filed plans/Plan-daily-driver-finish/Epic-shipping-the-shell/
Task-onboarding-zero-workspace-flow.md (P2) as the follow-up that
turns the defensive fallback into a proper welcome flow with a
shared workspace-provisioning helper.

`pnpm lint && pnpm type-check` clean. Closes
plans/Plan-daily-driver-finish/Epic-shipping-the-shell/
Task-pick-workspace-landing-route.md.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 00:25:48 -05:00
..
Epic-shipping-the-shell.md plans: scaffold daily-driver-finish, saas-hardening, agent-coordination 2026-06-01 23:52:22 -05:00
Task-fix-lint-and-shared-types.md chore(lint+types): green pnpm lint && pnpm type-check from a clean clone 2026-06-02 00:11:52 -05:00
Task-onboarding-zero-workspace-flow.md feat(web): land authed users on their oldest workspace home by slug 2026-06-02 00:25:48 -05:00
Task-pick-workspace-landing-route.md feat(web): land authed users on their oldest workspace home by slug 2026-06-02 00:25:48 -05:00
Task-smoke-test-collab-editor.md plans: scaffold daily-driver-finish, saas-hardening, agent-coordination 2026-06-01 23:52:22 -05:00
Task-wire-ai-chat-to-trpc.md feat(web): wire AI chat page to streaming /api/chat handler 2026-06-02 00:23:21 -05:00
Task-wire-workspace-home-dashboard.md feat(web): wire workspace-home dashboard to real tRPC queries 2026-06-02 00:17:29 -05:00