P1 flow fix: register makes a solo user by default, collective creation is an opt-in flag, post-login menu for collective-less accounts

This commit is contained in:
glass beadian 2026-10-12 16:19:08 +00:00
parent 2665f43cc4
commit 2a3a1d79a1
15 changed files with 614 additions and 24 deletions

View file

@ -53,6 +53,18 @@ export class CollectivesController {
);
}
/**
* Count of collectives in MY workspace (roots only) — the post-login router:
* zero => the app shows the "no collectives yet" home menu (create / join /
* solo tools) instead of the streams wall. Cheaper and more stable than the
* full tree for a boolean decision; same permission as the tree read.
*/
@Get("mine/count")
@RequirePermission("workspace.view")
async myCount(@Req() request: AuthedRequest): Promise<{ collectives: number; workspaceKind: "shared" | "personal" }> {
return this.collectives.myCollectiveCount(requireSession(request).workspaceId);
}
/** The workspace's collective tree: collectives as roots, subcollectives nested. */
@Get("tree")
@RequirePermission("workspace.view")