Skip to content

feat(workspaces): auto-create default workspace for new accounts - #22

Merged
realcodesiman merged 1 commit into
mainfrom
feat/auto-create-default-workspace
Nov 13, 2026
Merged

realcodesiman merged 1 commit into
mainfrom
feat/auto-create-default-workspace

Conversation

@realcodesiman

Copy link
Copy Markdown
Contributor

Summary

  • New accounts have no workspace membership, so the workspace picker was empty with no way forward.
  • When the workspace list resolves empty, call the idempotent POST /v1/me/workspaces/default (same lazy creation web does on its home page) and switch into the result.

Changes

  • src/features/workspaces/api/use-ensure-default-workspace.ts (+ test): mutation hook; handles a null result (already a member / plan limit) and invalidates the workspaces query.
  • src/app/(app)/workspace-picker.tsx: triggers creation once on empty list, shows skeleton while pending, error banner with retry on failure.
  • src/api/generated/schema.ts: regenerated with the new endpoint.
  • src/i18n/locales/*.json: new workspaces.defaultName string in all locales.

Test plan

  • pnpm typecheck / lint / format:check (passed in pre-commit)
  • Sign in with a brand-new account: a workspace is created and the app navigates into it
  • Existing account with workspaces: picker behaves as before
  • Simulate API failure: error banner appears and Retry works

A brand-new account has no workspace membership, leaving the picker empty.
Call the idempotent POST /v1/me/workspaces/default when the list resolves
empty (as web does on its home page), then switch into the new workspace.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@realcodesiman
realcodesiman merged commit bf827a6 into main Nov 13, 2026
1 check passed
@realcodesiman
realcodesiman deleted the feat/auto-create-default-workspace branch November 13, 2026 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant