ubiquitous-invention/apps/web
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
..
app feat(web): land authed users on their oldest workspace home by slug 2026-06-02 00:25:48 -05:00
components feat(web): wire workspace-home dashboard to real tRPC queries 2026-06-02 00:17:29 -05:00
lib auth: case-insensitive emails, Authentik SSO, first-signin workspace provisioning 2026-06-01 23:45:00 -05:00
public docker: ensure apps/web/public exists so web runtime COPY succeeds 2026-04-27 14:46:47 -05:00
server feat(web): wire workspace-home dashboard to real tRPC queries 2026-06-02 00:17:29 -05:00
styles feat: Full project management application scaffold 2026-03-26 22:39:16 -05:00
eslint.config.mjs chore(lint+types): green pnpm lint && pnpm type-check from a clean clone 2026-06-02 00:11:52 -05:00
middleware.ts feat: Full project management application scaffold 2026-03-26 22:39:16 -05:00
next-env.d.ts feat: Full project management application scaffold 2026-03-26 22:39:16 -05:00
next.config.ts fix(web): import @tasks/ai via workspace alias instead of relative path 2026-04-27 12:57:27 -05:00
package.json feat(web): wire AI chat page to streaming /api/chat handler 2026-06-02 00:23:21 -05:00
postcss.config.mjs feat: Full project management application scaffold 2026-03-26 22:39:16 -05:00
tailwind.config.ts feat: Full project management application scaffold 2026-03-26 22:39:16 -05:00
tsconfig.json feat: Full project management application scaffold 2026-03-26 22:39:16 -05:00