mirror of
https://github.com/lobehub/lobehub
synced 2026-04-21 17:47:27 +00:00
Per product boundary decision on LOBE-5499, Personal Workspace should
stay in community only as "a rename of the current single-user
experience" — the actual workspace feature surface lives in Cloud. This
cuts away the community-side Personal Workspace shell that was adding
zero value: switching UI for a one-workspace user, a TRPC middleware
that always resolved to the single personal workspace, and a Zustand
store keeping an active-workspace pointer that never needed to change.
Community now ships four empty business slots so Cloud can override:
- `src/business/client/trpc-headers.ts` — injects `X-Workspace-Id` in Cloud
- `src/business/client/WorkspaceContextSlot.tsx` — wraps children, Cloud
hydrates workspace list + restores active workspace from storage
- `src/business/client/features/User/UserPanelWorkspaceSection.tsx` —
user-panel workspace switcher
- `src/business/client/BusinessSettingPages/Workspace.tsx` — settings
body (`WorkspaceSettings` in Cloud)
Plus: settings tab is gated on `enableBusinessFeatures`, so community
builds don't show it. Cloud flips it on via server config.
Deleted:
- `packages/database/src/{schemas,models}/workspace.ts` + workspace-init
migration + `scripts/migrateWorkspace/` + `db:migrate-workspace` npm
script
- `src/libs/trpc/lambda/middleware/workspace.ts`
(`workspaceAuth` / `requireWorkspaceRole`) — Cloud ships its own
`cloudWorkspaceAuth` backed by cloudDB
- `src/server/utils/workspacePermissions.ts` — Cloud already owns this
at the same path
- `src/server/routers/lambda/workspace.ts` — now an empty router stub
under business/
- `src/features/{WorkspaceContext,WorkspaceSwitcher,WorkspaceSettings}/`
- `src/features/User/UserPanel/WorkspaceSection.tsx`
- `src/store/workspace/`
- `src/hooks/useFetchWorkspaces.ts`, `src/services/workspace.ts`
- `src/routes/(main)/settings/workspace/`
Kept (invariants per LOBE-7469 + plan):
- `workspace_id` column on 12 resource tables
- Model constructors' optional `workspaceId` param + `scopeWorkspace()`
- Resource routers still read `ctx.workspaceId` (field retained in
context.ts, header parsing stays as harmless no-op when Cloud isn't
injecting)
Added migration `0100_drop_workspace_tables.sql` (DROP CASCADE on the 4
workspace tables from 0099) + regenerated snapshot/journal via
`bun run db:generate`.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| _shared | ||
| buildSitemapIndex | ||
| cdnWorkflow | ||
| changelogWorkflow | ||
| clerk-to-betterauth | ||
| dbmlWorkflow | ||
| docsWorkflow | ||
| electronWorkflow | ||
| hotfixWorkflow | ||
| i18nWorkflow | ||
| mdxWorkflow | ||
| migrateServerDB | ||
| mobileSpaWorkflow | ||
| nextauth-to-betterauth | ||
| readmeWorkflow | ||
| releaseWorkflow | ||
| serverLauncher | ||
| checkConsoleLog.mts | ||
| copySpaBuild.mts | ||
| countEnWord.ts | ||
| devStartupSequence.mts | ||
| dockerPrebuild.mts | ||
| generate-oidc-jwk.mjs | ||
| generateSpaTemplates.mts | ||
| migrate-spa-navigation.ts | ||
| registerDesktopEnv.cjs | ||
| replaceComponentImports.ts | ||
| runNextDesktop.mts | ||
| setup-test-postgres-db.sh | ||
| vercelIgnoredBuildStep.js | ||