Skip to content

Share & Invite / Projects ​

Path: studio under apps/control-plane/web — components/sharing/, components/projects/, api/sharing.ts, api/projects.ts, api/project-sharing.ts
Status: Open #445 (danfishbein, branch roles-and-permissions). Studio UI runs on adapters that call real endpoints where they exist and mock the rest behind per-method flags, so BE can land one endpoint at a time without UI changes. Projects UI gated off in prod (PROJECTS_UI_ENABLED = NOT_PROD).

Backend landed in #516 (merged 2026-10-06, not deployed yet). Real app and project permissions, invitations, general access, collection approvals and tenant-admin surfaces are on main under apps/control-plane/web/src/components/sharing/, collections/ and projects/. A project is no longer the same thing as a shared container: each app has its own app environment and data is shared through platform collections. Where this page differs, Permissions & app data wins.

Not yet on main. Prefer the product model and contracts below over “what landed”. Branch status docs (do not paste wholesale):

Product model (naming) ​

CodeProduct (UI)Notes
tenantaccountUI: “Everyone at {TenantName}”. Settings → Members = tenant memberships, not per-workspace.
workspace (container / DO)projectBundle of apps that share access and data. No separate projects table today — a project is the workspace.
one-app workspacehidden projectShows as that app in the sidebar.
2+ apps, or “New project”visible project folderFolder with app count; hover menus.

Share & Invite surfaces ​

App Invite dialog (components/sharing/) ​

PieceBehaviour
InviteEmail chips + role User / View only / Builder. User invites send dataRole: "own" (add and edit own), matching signed-in link visitors; View only sends view; Builder flips the builder override and gets User data. Merged #1017; before it every invite was View only. There is still no free-form data-role dropdown (AppSharingPanel / InviteForm is not rendered).
People with accessAbove General access; per-row role + Remove.
General accessEveryone at account / Only invited / Anyone with the link (confirm lists exposed integrations).
Copy link footerInert until published (app.status === "live" / builder isLive). Unpublished: “Link available after publishing”; Copy link aria-disabled + tooltip “Publish the app to get a link”. In the Publish flow the footer can carry Publish.

Members page (Settings → Members) ​

Same body as a page, with Who can join (auto by domain / request / invite only) instead of General access. Visible to every tenant member (read-only unless they can manage); Seats stays admin-only.

  • App: Share → Invite. Project: Share project → Invite to project.
  • Builder top-bar Invite unchanged.

Roles in UI ​

User / Builder / Owner. Today Builder is mocked as an app admin grant (+ builder seat). Real Builder app role still TODO(BE).

Known UX issue: publish under "Draft", long share copy (Daily 2026-11-02) ​

Raised in the Brilliant Daily on 2026-11-02 (Slack #brilliant-ai meeting summary "Brilliant Daily, Nov 2, 2026" (ts 1793611281.823869)): the publish/share flow is confusing because publish lives under "Draft", and the share copy is too long. A fix to clarify the flow and shorten the copy is owned by Dan. See Product & growth decisions: publish and share UX.

Projects surfaces (non-prod) ​

SurfaceBehaviour
SidebarSingle-app collapse vs folders with counts; hover menus. Projects, and apps inside each project, sort by latest server edit once #986 merges (open; today still browser-local per #933) — #986 details. App row menu includes Delete app… for owners (since #950).
Add to projectPicker (projects, single apps, New project) → consent (tables with collision renames; who gains / loses / keeps access). Button off until acknowledge. Async move job + failure toast / Retry.
Project Invite + settingsProject Invite dialog; Users and roles at /w/$workspaceId/settings. Project people, “People with access to single apps here” rollup, project General access (no link option at project level).
App inside a project“Follows {project}” option; restrict confirms dropping project people.
HomeSince #556 (merged 2026-10-07), Home has no project picker: every app made from Home gets a new project named after the app by the model. See Control plane — Home always makes a new project. A Browse modal to replace Home's project search (AppSearchDialog) was proposed in #558 but dropped before it merged, so Home keeps AppSearchDialog; see Control plane — Desktop polish and explicit Plan/Build mode.

Projects UI batch (#507, open) ​

Open #507 (danfishbein, branch Genreral-updates) is the next projects UI batch on top of the model above. Same rule: projects and sharing still run on mocked adapters (projectsApi, projectSharingApi), screens never call fetch, and the branch PROJECTS_MOCKS.md lists each mocked method and the request it sends once its flag flips. The PR says it will be rebased onto Roles v2. Not live-verified on a side env or staging yet.

PieceDesign
Left panelSplit into Projects (folders) and Apps. Each folder has a 5px Live/Draft dot on its corner; hovering a row opens a preview card.
One card metaHover preview and gallery card both render ProjectCardMeta: name, “Builder · time” (from updatedAt), “N app(s)”, status. A test asserts the two match.
All projects launcher (/projects)Recents (8 per page, prev/next arrows), then the gallery. ?filter=my|team switches to one flat grid, newest first; My leads with a New project tile and only shows apps I built.
<ProjectThumbnail>One component for card (230×129) and mini (56×40). One app gives a single tile; more gives a three-layer stack with the newest app in front. 1px line border, no shadow, background --color-card-hover (same token as card hover).
Shared menusOne action source for row and card menus: rename, invite, new app in this project, add to project, settings, delete.
AlsoMain project model, “New app in this project” flyout, a Browse modal replacing Home's project search, Share & Invite dialog sections keep their layout while loading.

Shared UI pieces added on the branch: FilterChip in packages/studio-ui, and an outline variant on Button. The branch also adds /projects to STUDIO_PATH_PREFIXES (it was missing, so the apex would 404 a /projects link; see Marketing site).

Loading / error convention ​

One helper: loadStateOf(...queries) in sharing/load-state.tsx.

StateUI
No data, not erroredSkeleton sized like the real element (people rows, access trigger, footer, rollup, sidebar, picker, consent, settings header).
Errored, no dataInline message + Try again in that section (not a silent “empty” / “doesn’t exist”).
Loaded dataWins over a failed background refetch — never blank a loaded section.

Invite / Add to project / Copy link stay disabled until their data is ready. The email field stays typeable while loading.

Mock adapters & BE contracts (infra checklist) ​

Screens never call fetch directly — only sharingApi / projectsApi / projectSharingApi. Flipping a flag to false is the whole client change once the endpoint exists. Full shapes: branch docs linked above.

Sharing (api/sharing.ts → SHARING_MOCK) ​

Already real

MethodRoute
getAccessGET /apps/:id/access + new GET /apps/:id/people
invitePOST /apps/:id/users
changeRolenew PATCH /apps/:id/users/:userId (direct grant); POST for inherited → direct
removeDELETE /apps/:id/users/:userId
setGeneralAccessPATCH /apps/:id/access
listMembersGET /me/members + GET /tenants/:id/seats

Still mocked

MethodProposed endpoint
inviteMemberPOST /tenants/:id/members
changeMemberRolePATCH /tenants/:id/members/:userId
removeMemberDELETE /tenants/:id/members/:userId
setJoinPolicyGET/PATCH /tenants/:id/join-policy (auto | request | invite_only)
canManageApp-level manage permission (today: tenant admin, or non-admin overlay outside prod)

Smaller TODOs: invite email; real Builder app role; app owner field; membership pending status; account invite link; drop legacy /people fallback (GET /me/members + GET /apps/:id/users).

Access policy mapping used by UI: private → invited, everyone → members, link → public.

Known semantic gap: dispatch invited still admits all tenant members (not invitees-only). Either copy changes or dispatch needs a true invitees-only policy.

Projects (api/projects.ts → PROJECTS_MOCK; mocked=true unless noted) ​

FlagStands in for
listProjectsGET /projects (today: GET /workspaces + overlay)
tablesPer-app table usage
createProjectPOST /projects { name }
renameProjectPATCH /projects/:id { name } (visible only; hidden already renames via workspace)
renameAppPATCH /apps/:id { name } (visible project; must not rename the project)
previewAddToProjectPOST /projects/:id/add-app/preview
addToProjectPOST /projects/:id/add-app → { jobId, projectId }
getMoveStatusGET /project-moves/:jobId
demoProjectSeeded 2-app demo (non-prod)
createAppInProject = falseAlready real: POST /workspaces/:id/apps

Project access (api/project-sharing.ts → sharing.mock.projectAccess) ​

MethodProposed
get / set generalGET/PATCH /projects/:id/access
invite / change / removePOST/PATCH/DELETE /projects/:id/users…
setAppInheritsPATCH /apps/:id/access { inherit_project }

Studio shell path gotcha ​

SymptomLayout jump / re-pad / re-animate when opening an app or going Home.
CauseShell keyed layout on TanStack state.location, which moves on click while the old page stays until the next chunk and loaders resolve.
FixKey shell on useShellPath() / deepest rendered match (lib/shell-route-key.ts). resolvedLocation lags the other way — do not use it for this. #558 (merged 2026-10-08) brought this onto main (Desktop polish and explicit Plan/Build mode).

Also on the branch: gotchas/studio-frontend.md. See Troubleshooting.

App counts and deletion (#633, merged) ​

#633 (merged 2026-10-08 19:26 IDT) makes the server the only authority on how many apps a project has and on deleting a project with its last app. The UI no longer compares names, couples renames, or decides deletions from a filtered client list.

PieceBehaviour
appCountProjects carry a server-authoritative app count. A one-app project is shown as its app.
DELETE /apps/:idBody { expectedRevision, deleteParentProject? } (strict: an unknown body is 400). Returns { deleted, deletedProjectId | null }. Without the flag only the app is deleted and deletedProjectId is null.
Flagged delete (deleteParentProject: true)Needs ownership of both the app and the project, and the project must have exactly one app; all of that is checked before anything changes, otherwise 409 and the app is untouched. The final app and project removal is one DB transaction, and no transaction spans remote calls. The studio offers it only when appCount === 1 and the signed-in user owns the project.
SharingLeaving project inheritance is one write (race fixed). App Invite needs 5 requests instead of 19 at 12 apps.

One-way door: reverting the code does not restore apps or projects removed by a flagged delete. The new API fields are additive and the old SPA ignores them, so ship the control plane first as usual. Server sharing authority is unchanged; open policy questions (User downgrade, owner-retention copy, non-owner project roster) are tracked in #670, and telling the user when a flagged delete kept the project is #672. Studio side of the same PR: Control plane & studio.

View-only app entry points (#801, merged) ​

Merged to main 2026-10-11 21:17 IDT (#801). One authority resolver now drives app cards and menus; directory authority wins over stale cached builder details.

  • Builder access: app appears in the editor sidebar, menu offers editor Open, and the draft screenshot is shown.
  • Runtime-only (viewer) access: app and its folders are filtered out of the editor sidebar (owned empty projects stay). The menu offers only the published app Open link, on desktop and phone, with no editor actions.
  • Screenshots: by explicit owner policy, anyone with app access sees the published screenshot (shared app metadata, including the publisher's rendered data). Draft screenshots stay builder-only. A missing published image returns 404 and never falls back to the draft, so a newly published app can look blank until capture succeeds.
  • Thumbnail signing: needs a scoped proof for the exact app and environment, with the screenshot kind cryptographically bound. Existing draft URLs keep working; signed URL expiry (1 to 2 hours) is unchanged.

Two-way door, blast radius: app entry points.

Default project per user (#805, merged) ​

#805 (merged 2026-10-12 00:04 IDT) adds one persistent default project per tenant and user (migration 0043). Moving apps between projects is gated closed for now; migration 0044 only records move intents. Automatic publish runs only while an app is restricted, and a first share waits for or joins that publish. Full launch flow: Control plane — New-app launch flow.

Studio sidebar: order by latest edit (#933, merged) ​

#933 (merged 2026-10-15 09:56 IDT, 925ae6c7) sorts the studio sidebar by the latest change: projects, and the apps inside each project, newest first, then by name. An edit inside a project lifts the project too. Times are stamped in this browser (localStorage brilliant_project_opened_at) when you open an app from the sidebar or a builder turn finishes; the server has no edit timestamp, so another browser or a private window can show a different order, and with no stamps the order is by name. Rows move without a refetch. Open #986 moves order to server last_edited_at so opens no longer reorder. Details: Control plane — Studio sidebar order; Troubleshooting.

Studio sidebar: server last-edited order (#986, open) ​

#986 (open, opened 2026-10-16 ~11:07 IDT by Brilliant Fixer / monday-sphera-ai[bot], branch fix-sidebar-last-edited, head db0961b35c57339ad48682ce5390b59914bdb3a4) replaces the browser-local stamps from #933 with server apps.last_edited_at, stamped on /ingest/turn builder steps. Once merged: sidebar, All-projects gallery, and "edited … ago" bylines order by last builder turn; opening an app no longer moves it (Recents still use opens); no backfill (existing apps sort by creation until the next turn); re-sort on project-list refetch, not live mid-turn. Details: Control plane — server last-edited order; Troubleshooting.

  • Control plane & studio (header Invite / Publish) · Glossary · Troubleshooting · Dispatch (access policies / callerFitsPolicy)
  • Source PRs: #445 (open) · #507 (open, projects UI batch) · #558 (open, desktop polish: Browse modal, shell path) · #633 (merged, app counts and flagged delete) · #801 (merged, view-only entry points and screenshot access) · #933 (merged, sidebar order by latest edit) · #986 (open, server last-edited sidebar order) · #950 (merged, Delete app in sidebar/gallery) · #1017 (open, User invite dataRole own)

App made public → Slack alert (#946, merged) ​

PR #946 (merged 2026-10-15 12:13 IDT, 90294b31) posts a production Slack alert when an app first becomes reachable without sign-in. "Public" here means general access mode: "link" with requireSignIn: false — the same rule as allowsAnonymous. Sign-in-required link access and role changes on an already-public app do not alert. New apps start restricted, so the alert is always a later PATCH .../general-access. Details: Control plane — Prod Slack app alerts.

PR #950 (merged 2026-10-15 12:15 IDT, 083106ce) adds Delete app… to the shared app action list used by the left-pane sidebar row and the gallery card (below a divider, in red). Previously delete lived only on the editor's app-name pill.

Product behaviour

  • Owner only — the row appears only when roleOf(app) === "owner". Non-owner builders, viewers, and demo apps (no builder) never see it. The server still requires app_owner on DELETE /apps/:id.
  • While building — the row stays but is disabled ("Can't delete while the app is building"). Client-side only; same as the editor.
  • Confirm — AppDeleteConfirm reuses the editor dialogs (DeleteConfirmDialog / phone BottomSheet with MobileDeleteAppView, sheet id app-card-delete).
  • Optional Delete project — offered when this is the project's only app and the viewer owns the project (appCount === 1, ownerId === viewerId), sending deleteParentProject: true. Same rule as #633.
  • Optimistic since #985 (merged 2026-10-16 16:45 IDT, ced4abf5): on confirm the dialog closes and the app (or, with Delete project, the project) disappears from the sidebar and gallery right away. If the server refuses, the list refetches so the app comes back, and a toast says Couldn't delete <name>. <server reason> (for example "Shared with 2 apps — stop sharing first"). The editor's own delete is not optimistic.
  • If that app was open in the editor, the SPA navigates to /projects only after the server confirms the delete.

API details (revision, flagged project delete, response shape): App counts and deletion (#633). Studio action-list details: Control plane — Delete app from the left pane and gallery.

User invite sends add-and-edit-own; View only is a role choice (#1017, merged) ​

PR #1017 "Invite app Users with add-and-edit-own data, not View only" (opened 2026-10-18 16:40 IDT by monday-sphera-ai[bot] / Brilliant Fixer, branch fix-app-user-invite-edit; merged 2026-10-19 08:16 IDT / 2026-10-19T05:16:21Z by yoni-monday, merge 0bed6bed, head fe6363dd, 8 commits, +355/−87 in 28 files). The PR grew after it opened: besides the invite default it adds an explicit View only role and fixes Everyone-at-account and project defaults.

Symptom it fixed. An invited app User could open the published app, but every save failed with forbidden (e.g. service-portal app e6b08476: "You don't have permission to open tickets … Reason code: forbidden").

Cause. sharingApi.invite always sent dataRole: "view". The Invite modal only offered User / Builder, which only flips the builder override, and the panel with a data-role dropdown (AppSharingPanel / InviteForm) isn't rendered anywhere.

What landed.

  • Invite default. A User invite sends DEFAULT_INVITATION_ROLE, now "own" (add records, edit their own), the same role a signed-in link visitor gets. It's a typed DataRole in @brilliant/service-contracts/permissions, and the studio's DEFAULT_INVITE reads from it. A Builder gets the User's data role.
  • View only role. The app and project Invite role menus now offer User, View only ("Can see the app and its data, not change it") and Builder. It isn't in the account sheet, where roles are seats. Picking it sets the data role to view. A person row shows View only when their own grant, their invitation, or Everyone at the account is View.
  • Builder seat. Only Owner and Builder hold a builder seat (holdsBuilderSeat). View only is a User, so inviting a View only person as Builder still warns "Adds a builder seat to your account."
  • Role changes (roleChange). Entering View only writes view. Leaving it for User or Builder lifts the data role to own, so View only → Builder → User doesn't land back on View. Any other change sends only the builder override, because an app-scope person data role replaces inherited project/tenant data instead of adding to it.
  • Everyone at the account (app). Opening it from another mode writes User (own). Re-saving an app that's already open keeps its role, so View stays View and all stays all. The General access row names the role everyone joins as, e.g. "joins as View only".
  • Projects. projectGeneralFor: View only forces view; User and Builder keep an existing own or all; Add only is weaker than the default and becomes own. Project invites send the role's data role.
  • Invitation copy. The invitation page (offeredRole) and invitation email (offeredAccess) use offeredAppAccess: View only stands alone ("View only"), other roles read "User · Add and edit their own", "Builder · View only", and so on. DATA_ROLE_LABEL moved to service-contracts so the studio and server share one set of labels.

Not changed. People invited earlier, and pending invitations sent before deploy, stay on View when they accept. They now show as View only in the modal, and picking User moves them to own. Apps and projects already open to the account at View stay on View until someone picks a different role.

Verification in the PR. control-plane 2141 pass / 0 fail; service-contracts 98 pass (incl. offered-app-access.test.ts); web shards 2766 pass / 0 fail (one unrelated timeout passed on rerun); design-suite invite-dialog and related pass; tsc and Biome clean. Not live-checked on a side env (needs a second real login to accept an invite).

Cross-links: Permissions & app data — default invite data role; Troubleshooting — invited User save forbidden.

Owners and admins assign a builder seat on Members (#1020, open) ​

PR #1020 "Let owners and admins assign a builder seat" (open, opened 2026-10-19 08:52 IDT / 2026-10-19T05:52:28Z by yoni-monday, branch member-builder-seat, head 5cbe5539, 1 commit, +327/−18 in 13 files). Not merged yet, so this is the proposed behaviour.

What it changes. A member's billing seat (User or Builder) becomes editable. Before this, seats were read-only (GET /tenants/:id/seats) and the studio's changeMemberRole on the Members page always failed as unavailable.

  • New route. PATCH /tenants/:tenantId/members/:userId/seat with { seat: "builder" | "user", expectedRevision }. Owner or admin only (tenant_permissions write). It changes the seat only; the company role (Member, Admin) stays on the admin page.
  • Plan cap. Promoting to Builder is refused with "This account has no builder seats left." when the builder seats already in use reach the plan's cap (limits.builders from the billing snapshot). No cap applies when the plan doesn't cap builders or the tenant has no billing account yet (trial). If the account's offer isn't in the catalog, the call fails with billing_unavailable rather than guessing a cap. Dropping to User never needs a free seat.
  • Owner. The owner's seat stays with ownership ("The owner's seat stays with ownership."), and the owner's row has no seat menu.
  • Side effects. Dropping a builder seat doesn't remove that person's app grants. The change bumps the tenant rules revision, writes a permission.member.seat audit row, and sends the usual direct-access change email.
  • Studio. The Members page now offers User ("Uses apps in this account. Does not take a builder seat.") and Builder ("Can build apps. Uses one builder seat.") for people already in the account. A pending invitation can't be given a builder seat ("An invitation joins as a member, without a builder seat."), and inviting someone straight in as a Builder is still unavailable. Server reasons for a refused change are shown as-is.

Related: Subscriptions, credits & access — users and builders, User invite and View only (#1017).