@ossy/workspaces
v3.29.0
Published
Workspaces feature package - create, select, and manage workspaces, users, and invitations
Readme
@ossy/workspaces
Workspaces feature package for the Ossy platform — provides workspace creation, selection, user management, and invitation pages that are auto-discovered by @ossy/app when the package is installed.
What's included
Pages
| File | Page id | Default paths |
|---|---|---|
| Invitations.page.jsx | workspace/invitations | /invitations → redirects to Users |
| Invite.page.jsx | workspace/invitations/add | /invitations/add (en), /inbjudningar/lagg-till (sv) |
| Users.page.jsx | workspace/users | /users (en), /anvandare (sv) — members + pending invites |
| WorkspaceSettings.page.jsx | workspace/settings | /settings (en), /installningar (sv) |
Components
| Export | Description |
|---|---|
| CreateWorkspacePage | Form to create a new workspace |
| SelectWorkspacePage | List and switch between workspaces |
| GeneralSettings | Workspace details and services settings |
| Invitations | Legacy list UI (pending invites now live on Users) |
| Invite | Invite a user to the workspace by email |
| Users | List members and pending invitations in a Storage-style list→details panel; remove members |
| AuthenticationGuard | Wraps children, shows error for unauthenticated users |
| patchUserWorkspaceId | Utility to update the active workspace cookie |
| Definition | Feature metadata (id, actions, views) |
| ListWorkspaces, GetWorkspace, … | Platform action POJOs — use with useSdk().read() / invoke() |
Usage
npm install @ossy/workspaces
npm run build@ossy/app discovers the pages automatically by reading the "ossy": { "src": "./src" } field in this package's package.json.
Preview
Workspace pages are exercised in @ossy/app-test on the production build path. Open workspace routes from the sidebar or inspect capabilities at /packages/workspaces. See packages/app-test/README.md.
Peer dependencies
| Package | Version |
|---|---|
| @ossy/design-system | >=1.0.0 |
| @ossy/resources | * (selection via useSelectedResourceId / ?r=) |
| @ossy/router-react | >=1.0.0 |
| @ossy/sdk-react | >=1.0.0 |
| react | >=19.0.0 <20.0.0 |
Select-workspace membership list (#758)
@ossy/workspaces/tasks/list → WorkspacesQueries.getAllByUserIncluded(userId) returns { id, name }[].
| Path | When | Honors UserRemoved? |
|---|---|---|
| UserWorkspacesProjection (@ossy/workspaces/data/user-workspaces) | Primary — ADR 0008 projection folded on Created / UserInvitationAccepted / UserRemoved | Yes |
| Workspace entity snapshots (aggregates where state.users contains the user) | Fallback when the projection is cold (pre-rebuild / lag) | Yes |
Do not re-derive membership from raw eventstore Created + UserInvitationAccepted joins — that ignored removals.
Membership snapshots update asynchronously via the eventstore changestream (ProjectionRebuild + aggregate-rebuild). Create/accept still return View() without a synchronous Aggregate.Save(); create UX selects the new workspace by id from the create response rather than waiting on the list.
Future: workspace integration secrets
Per-workspace third-party credentials (Secrets Manager paths, admin write vs task read, cache rules) are specified in WORKSPACE-INTEGRATION-SECRETS.md. SPEC only — not implemented in this package yet.
