Closes #44.
What changes
Channels now have three visibilities:
Workspace # | Private 🔒 | Public 🌐 | |
|---|---|---|---|
| Find / read / join | anyone in the workspace | only the people in it | anyone signed in to g1t (confirmed email) |
| Who makes one | members (unless owners restrict) | members (unless owners restrict) | workspace owners only |
What the old UI called a "public" channel (anyone in the workspace) is now called a Workspace channel.
- Guests. Anyone in a channel who isn't a member of the workspace is marked Guest on messages, in the people list, and in requests and invitations. A guest sees only their channels plus the workspace's public ones: no DMs, no directory, no channel changes.
- Inviting outside collaborators. In a channel's details, Add takes any g1t username. The person gets an invitation in their own Chat sidebar and joins as a guest when they accept. Owners can always invite guests. Members can while Members can invite outside collaborators is on, which is the same setting repositories use.
- Ask to join. A link to a channel you can't open shows "You can't open #x", with Ask to join and an optional note. The page is identical whether or not the channel exists, so it reveals nothing. Requests appear in the channel's details, with a count on its members button. Anyone in the channel can let in a workspace member; only those who may invite guests can let in an outsider.
- @g1t answers workspace members only. Guests can't open a DM with g1t, and
postnever starts an answer for a non-member. - Moderation. Channel owners and workspace owners can take people out. An outsider taken out of a public channel can't rejoin on their own; inviting them again lifts that. Switching a channel from public back to workspace drops the outsiders who joined on their own and keeps the ones who were invited.
- Guests' own sidebar gets an Other workspaces section with unread counts and an Invitations section. Another workspace's chat pages stay in Chat mode instead of Explore.
Where
services/chat/migrations/0007_public_channels.sqladdschannels.publicand the tableschannel_invitations,channel_requestsandchannel_removals. Personal-data erasure covers all of them.- The rules live in
services/chat/src/access.ts, with tests. services/chat/src/index.ts:place/visitWorkspacelet guests in where the rules allow. New RPCs:remove_member,channel_invitations,answer_channel_invitation,request_access,answer_access_request.- The site's chat routes no longer 404 people outside the workspace; the chat service decides what they see. The issue/PR card route (
ref.ts) stays members-only. - Docs: the chat guide covers public channels, guests and asking to join; the permissions page renames the setting to Workspace channels.
Checked
- Chat tests: 83 passing, 7 of them new.
npm test --workspaces: no failures. The web suite is 950 of 951 after rebasing; one test didn't run.scripts/deploytests: 92 passing.tsc -b --forcepasses inapps/web, the mobile app and the chat service.react-router buildsucceeds.- The migration and the new queries were run against a local D1.
Not yet checked live: the guest flow end to end needs a second account outside flagon-io. After deploy, I'll create #community-support in flagon-io as a public channel.