Skip to content

armgit / alook

Public Imported from GitHub
0

Multi-Agent Collaboration for Team and Friends

refactor(community): rename web page path /community → /c (#374)

Generef5352012ec2
diff --git a/src/daemon/src/cli/index.test.ts b/src/daemon/src/cli/index.test.ts
index ed8da9aa2..a88adff7c 100644
--- a/src/daemon/src/cli/index.test.ts
+++ b/src/daemon/src/cli/index.test.ts
@@ -201,7 +201,7 @@ describe("server join", () => {
it("extracts the token from a full URL and calls joinServer with the bare token only", async () => {
const joinServerSpy = vi.fn(async () => ({ server: { id: "srv_1", name: "Design Studio" } }));
setApiForTesting(stubApi({ joinServer: joinServerSpy }));
- await main(["server", "join", "--invite", "https://alook.dev/community/invite/AbC123XyZ0"]);
+ await main(["server", "join", "--invite", "https://alook.dev/c/invite/AbC123XyZ0"]);
expect(joinServerSpy).toHaveBeenCalledWith(expect.objectContaining({ invite: "AbC123XyZ0" }));
});
diff --git a/src/daemon/src/drivers/systemPrompt.test.ts b/src/daemon/src/drivers/systemPrompt.test.ts
index f70acb9f8..25a0084d7 100644
--- a/src/daemon/src/drivers/systemPrompt.test.ts
+++ b/src/daemon/src/drivers/systemPrompt.test.ts
@@ -96,9 +96,9 @@ describe("buildCliSystemPrompt", () => {
expect(prompt).toContain("server join");
});
- it("instructs the agent to act on /community/invite/ links", () => {
+ it("instructs the agent to act on /c/invite/ links", () => {
const prompt = buildCliSystemPrompt(baseConfig, { lifecycleKind: "persistent" });
- expect(prompt).toContain("/community/invite/");
+ expect(prompt).toContain("/c/invite/");
});
it("tells the agent that refs also render as clickable links when written inline in message text", () => {
diff --git a/src/daemon/src/drivers/systemPrompt.ts b/src/daemon/src/drivers/systemPrompt.ts
index 5400e5d96..86a45a0d1 100644
--- a/src/daemon/src/drivers/systemPrompt.ts
+++ b/src/daemon/src/drivers/systemPrompt.ts
@@ -213,7 +213,7 @@ function serversSection(): string {
return [
"## Servers",
"",
- `If a message contains a \`/community/invite/...\` link, just run \`${CLI} server join --invite <link>\`. ` +
+ `If a message contains a \`/c/invite/...\` link, just run \`${CLI} server join --invite <link>\`. ` +
"The server enforces an owner-only check for you — it only accepts an invite your owner created, and " +
"rejects anything else with a clear reason. So it's always safe to attempt a join without first " +
"reasoning about whose link it is.",
diff --git a/src/shared/src/lib/invite-link.test.ts b/src/shared/src/lib/invite-link.test.ts
index c9b703861..43969c755 100644
--- a/src/shared/src/lib/invite-link.test.ts
+++ b/src/shared/src/lib/invite-link.test.ts
@@ -3,11 +3,11 @@ import { parseInviteToken } from "./invite-link";
describe("parseInviteToken", () => {
it("extracts the token from a full URL with an origin", () => {
- expect(parseInviteToken("https://alook.dev/community/invite/AbC123XyZ0")).toBe("AbC123XyZ0");
+ expect(parseInviteToken("https://alook.dev/c/invite/AbC123XyZ0")).toBe("AbC123XyZ0");
});
it("extracts the token from a path-only URL (no origin)", () => {
- expect(parseInviteToken("/community/invite/AbC123XyZ0")).toBe("AbC123XyZ0");
+ expect(parseInviteToken("/c/invite/AbC123XyZ0")).toBe("AbC123XyZ0");
});
it("extracts the token from a bare token", () => {
diff --git a/src/shared/src/lib/invite-link.ts b/src/shared/src/lib/invite-link.ts
index 6b62c64d0..2b87d9821 100644
--- a/src/shared/src/lib/invite-link.ts
+++ b/src/shared/src/lib/invite-link.ts
@@ -1,10 +1,10 @@
-// Extracts a bare invite token from either a full `.../community/invite/<token>`
+// Extracts a bare invite token from either a full `.../c/invite/<token>`
// URL (with or without an origin) or a bare token. Kept as an independent copy
// of `INVITE_URL_RE` in `src/web/src/components/community/message-markdown.tsx`
// (that file is UI-only, rendering invite links inline in message bodies, and
// is out of scope for this CLI feature) — a future drift between the two is at
// least discoverable via this cross-reference comment, not silently divergent.
-const INVITE_URL_RE = /(?:https?:\/\/[^\s/]+)?\/community\/invite\/([A-Za-z0-9_-]{6,64})/;
+const INVITE_URL_RE = /(?:https?:\/\/[^\s/]+)?\/c\/invite\/([A-Za-z0-9_-]{6,64})/;
const BARE_TOKEN_RE = /^[A-Za-z0-9_-]{6,64}$/;
/**
diff --git a/src/web/src/app/api/community/servers/[id]/route.ts b/src/web/src/app/api/community/servers/[id]/route.ts
index 9bec71473..cab852a9a 100644
--- a/src/web/src/app/api/community/servers/[id]/route.ts
+++ b/src/web/src/app/api/community/servers/[id]/route.ts
@@ -62,8 +62,7 @@ export const GET = withAuth(async (_req, ctx) => {
serverId: server.id,
// Empty name is load-bearing: the sidebar detects the uncategorized
// bucket by `name === ""` (renders its channels as the bare top list, and
- // maps a drag INTO it back to `categoryId: null`). Must match the mock in
- // preview/_mock.ts.
+ // maps a drag INTO it back to `categoryId: null`).
name: "",
position: -1,
private: 0,
diff --git a/src/web/src/app/community/QueryProvider.tsx b/src/web/src/app/c/QueryProvider.tsx
similarity index 100%
rename from src/web/src/app/community/QueryProvider.tsx
rename to src/web/src/app/c/QueryProvider.tsx
diff --git a/src/web/src/app/community/channels/[serverId]/[channelId]/page.tsx b/src/web/src/app/c/channels/[serverId]/[channelId]/page.tsx
similarity index 98%
rename from src/web/src/app/community/channels/[serverId]/[channelId]/page.tsx
rename to src/web/src/app/c/channels/[serverId]/[channelId]/page.tsx
index 8ce97e30b..64c3dcdf6 100644
--- a/src/web/src/app/community/channels/[serverId]/[channelId]/page.tsx
+++ b/src/web/src/app/c/channels/[serverId]/[channelId]/page.tsx
@@ -65,7 +65,7 @@ import {
} from "@/hooks/community/use-community-ws"
/**
- * /community/channels/:serverId/:channelId
+ * /c/channels/:serverId/:channelId
*
* - Forum channel: ForumView
* - Text channel: MessageList + Composer + right panels
@@ -440,7 +440,7 @@ function ChannelView() {
// on a dead URL with a misleading "thread" error — bounce to the server
// root, which forwards to the first remaining channel.
if (e instanceof ApiError && e.status === 404) {
- router.replace(`/community/channels/${params.serverId}`)
+ router.replace(`/c/channels/${params.serverId}`)
return
}
toastApiError(e, "Failed to load thread")
@@ -472,7 +472,7 @@ function ChannelView() {
// still drive this mount's anchor and scroll; this only cleans the address.
useEffect(() => {
if (!jumpTargetId) return
- router.replace(`/community/channels/${params.serverId}/${channelId}`, { scroll: false })
+ router.replace(`/c/channels/${params.serverId}/${channelId}`, { scroll: false })
// eslint-disable-next-line react-hooks/exhaustive-deps -- run once for this mount's jump
}, [])
@@ -552,7 +552,7 @@ function ChannelView() {
// No eager read PUT here — the thread page's `useEagerChannelRead` fires it
// on mount AFTER its read-state snapshot latches, so the "New" divider
// still anchors to the pre-open pointer. A PUT here would race the snapshot.
- router.push(`/community/channels/${params.serverId}/${id}`)
+ router.push(`/c/channels/${params.serverId}/${id}`)
}
const openProfile: OpenProfile = (name, e, discriminator, userId) => {
@@ -619,7 +619,7 @@ function ChannelView() {
const name = deriveThreadName(m?.content, channelName)
try {
const data = await createThreadMut.mutateAsync({ channelId, messageId: id, name })
- router.push(`/community/channels/${params.serverId}/${data.id}`)
+ router.push(`/c/channels/${params.serverId}/${data.id}`)
} catch (e) {
toastApiError(e, "Failed to create thread")
}
@@ -867,7 +867,7 @@ function ChannelView() {
parentId
? () =>
router.push(
- `/community/channels/${params.serverId}/${parentId}?msg=${parentMessageId}`,
+ `/c/channels/${params.serverId}/${parentId}?msg=${parentMessageId}`,
)
: undefined
}
@@ -885,7 +885,7 @@ function ChannelView() {
tools={{ threads: false }}
breadcrumb={{
label: channelName,
- onNavigateBack: () => { if (parentId) router.push(`/community/channels/${params.serverId}/${parentId}`); else router.back() },
+ onNavigateBack: () => { if (parentId) router.push(`/c/channels/${params.serverId}/${parentId}`); else router.back() },
onRename: canManageServer(myRole) ? async (name) => {
try {
await apiFetch(`/api/community/channels/${channelId}`, {
diff --git a/src/web/src/app/community/channels/[serverId]/page.tsx b/src/web/src/app/c/channels/[serverId]/page.tsx
similarity index 95%
rename from src/web/src/app/community/channels/[serverId]/page.tsx
rename to src/web/src/app/c/channels/[serverId]/page.tsx
index 6f9d33153..d1813a9c9 100644
--- a/src/web/src/app/community/channels/[serverId]/page.tsx
+++ b/src/web/src/app/c/channels/[serverId]/page.tsx
@@ -7,7 +7,7 @@ import { Skeleton } from "@/components/ui/skeleton"
import { useServer } from "@/hooks/community/use-servers"
/**
- * /community/channels/:serverId
+ * /c/channels/:serverId
*
* Redirects to the first channel by position. Shows a channel-shell skeleton
* while waiting for the server detail so the transition feels like a reveal
@@ -24,7 +24,7 @@ export default function ServerDefaultPage() {
const allChannels = currentServer.categories.flatMap((cat) => cat.channels)
const first = allChannels[0]
if (first) {
- router.replace(`/community/channels/${serverId}/${first.id}`)
+ router.replace(`/c/channels/${serverId}/${first.id}`)
}
}, [currentServer, serverId, router])
diff --git a/src/web/src/app/community/channels/[serverId]/settings/page.tsx b/src/web/src/app/c/channels/[serverId]/settings/page.tsx
similarity index 80%
rename from src/web/src/app/community/channels/[serverId]/settings/page.tsx
rename to src/web/src/app/c/channels/[serverId]/settings/page.tsx
index 35a7ec4c8..06f567377 100644
--- a/src/web/src/app/community/channels/[serverId]/settings/page.tsx
+++ b/src/web/src/app/c/channels/[serverId]/settings/page.tsx
@@ -7,7 +7,7 @@ export default function ServerSettingsRedirect() {
const params = useParams<{ serverId: string }>()
const router = useRouter()
useEffect(() => {
- router.replace(`/community/channels/${params.serverId}?settings=1`)
+ router.replace(`/c/channels/${params.serverId}?settings=1`)
}, [params.serverId, router])
return null
}
diff --git a/src/web/src/app/community/channels/layout.tsx b/src/web/src/app/c/channels/layout.tsx
similarity index 98%
rename from src/web/src/app/community/channels/layout.tsx
rename to src/web/src/app/c/channels/layout.tsx
index 160e4915e..9c6c1cec0 100644
--- a/src/web/src/app/community/channels/layout.tsx
+++ b/src/web/src/app/c/channels/layout.tsx
@@ -199,7 +199,7 @@ export default function ServerLayout({ children }: { children: ReactNode }) {
const wantsInvite = searchParams.get("invite") === "1"
if (!wantsSettings && !wantsInvite) return
- // These flags land on the bare `/community/channels/:serverId` URL
+ // These flags land on the bare `/c/channels/:serverId` URL
// (e.g. right-click a rail server → "Server settings"/"Invite to
// Server"), which is also the URL the sibling default-channel page
// redirects away from once it knows the server's first channel. When
@@ -216,7 +216,7 @@ export default function ServerLayout({ children }: { children: ReactNode }) {
if (stillRedirecting) return
router.replace(
- hasChannel ? `/community/channels/${serverId}/${params.channelId}` : `/community/channels/${serverId}`,
+ hasChannel ? `/c/channels/${serverId}/${params.channelId}` : `/c/channels/${serverId}`,
)
}, [searchParams, serverId, router, hasChannel, currentServer, params.channelId])
@@ -225,7 +225,7 @@ export default function ServerLayout({ children }: { children: ReactNode }) {
const goHome = useCallback(() => {
setMobileZone("nav")
- router.push("/community/me")
+ router.push("/c/me")
}, [router])
const goServer = useCallback(() => { setMobileZone("nav") }, [])
@@ -258,7 +258,7 @@ export default function ServerLayout({ children }: { children: ReactNode }) {
// unrelated sibling-channel WS patch would resurrect the just-cleared dot
// before the user even navigates away — `useChannelTree`'s metadata merge
// trusts the cache unconditionally, so both directions must write to it.
- router.push(`/community/channels/${serverId}/${id}`)
+ router.push(`/c/channels/${serverId}/${id}`)
channelTree.markRead(id)
queryClient.setQueryData<ServerDetail | undefined>(
communityKeys.server(serverId),
@@ -414,14 +414,14 @@ export default function ServerLayout({ children }: { children: ReactNode }) {
onSuccess: () => toast("Invite revoked"),
onError: (e) => toastApiError(e, "Failed to revoke invite"),
})}
- onCopyInvite={(code) => { navigator.clipboard?.writeText(`${window.location.origin}/community/invite/${code}`); toast("Invite copied") }}
+ onCopyInvite={(code) => { navigator.clipboard?.writeText(`${window.location.origin}/c/invite/${code}`); toast("Invite copied") }}
onDeleteServer={async () => {
closeSettings()
deleteServerMut.mutate({ serverId }, {
onSuccess: () => {
toast("Server deleted")
useCommunityStore.getState().setCurrentServerId(null)
- router.push("/community/me")
+ router.push("/c/me")
},
onError: (e) => toastApiError(e, "Failed to delete server"),
})
diff --git a/src/web/src/app/community/community-shell.tsx b/src/web/src/app/c/community-shell.tsx
similarity index 100%
rename from src/web/src/app/community/community-shell.tsx
rename to src/web/src/app/c/community-shell.tsx
diff --git a/src/web/src/app/community/invite/[token]/invite-accept-client.tsx b/src/web/src/app/c/invite/[token]/invite-accept-client.tsx
similarity index 97%
rename from src/web/src/app/community/invite/[token]/invite-accept-client.tsx
rename to src/web/src/app/c/invite/[token]/invite-accept-client.tsx
index a77f8429e..aa477249b 100644
--- a/src/web/src/app/community/invite/[token]/invite-accept-client.tsx
+++ b/src/web/src/app/c/invite/[token]/invite-accept-client.tsx
@@ -53,7 +53,7 @@ export function InviteAcceptClient({ token }: { token: string }) {
// Refresh the server list before navigating so the rail shows the newly
// joined server on arrival instead of the user having to refresh.
await queryClient.invalidateQueries({ queryKey: communityKeys.servers() })
- router.push(`/community/channels/${result.serverId}`)
+ router.push(`/c/channels/${result.serverId}`)
} catch (err: unknown) {
const message = err instanceof Error ? err.message : "Couldn't join the server — try the invite again"
toast(message)
@@ -85,7 +85,7 @@ export function InviteAcceptClient({ token }: { token: string }) {
<Button
className="mt-6"
variant="secondary"
- onClick={() => router.push("/community/me")}
+ onClick={() => router.push("/c/me")}
>
Back to community
</Button>
diff --git a/src/web/src/app/community/invite/[token]/page.tsx b/src/web/src/app/c/invite/[token]/page.tsx
similarity index 95%
rename from src/web/src/app/community/invite/[token]/page.tsx
rename to src/web/src/app/c/invite/[token]/page.tsx
index 762110f72..6660e8d37 100644
--- a/src/web/src/app/community/invite/[token]/page.tsx
+++ b/src/web/src/app/c/invite/[token]/page.tsx
@@ -2,7 +2,7 @@ import type { Metadata } from "next"
import { InviteAcceptClient } from "./invite-accept-client"
/**
- * /community/invite/:token
+ * /c/invite/:token
*
* Accept-invite page. Shows server name/icon and a "Join" button.
* Sets Referrer-Policy: no-referrer to prevent token leakage.
diff --git a/src/web/src/app/community/layout.tsx b/src/web/src/app/c/layout.tsx
similarity index 100%
rename from src/web/src/app/community/layout.tsx
rename to src/web/src/app/c/layout.tsx
diff --git a/src/web/src/app/community/me/[dmId]/page.tsx b/src/web/src/app/c/me/[dmId]/page.tsx
similarity index 100%
rename from src/web/src/app/community/me/[dmId]/page.tsx
rename to src/web/src/app/c/me/[dmId]/page.tsx
diff --git a/src/web/src/app/community/me/bots/page.tsx b/src/web/src/app/c/me/bots/page.tsx
similarity index 100%
rename from src/web/src/app/community/me/bots/page.tsx
rename to src/web/src/app/c/me/bots/page.tsx
diff --git a/src/web/src/app/community/me/layout.tsx b/src/web/src/app/c/me/layout.tsx
similarity index 94%
rename from src/web/src/app/community/me/layout.tsx
rename to src/web/src/app/c/me/layout.tsx
index 766ab471f..2ebcf16e2 100644
--- a/src/web/src/app/community/me/layout.tsx
+++ b/src/web/src/app/c/me/layout.tsx
@@ -55,8 +55,8 @@ export default function MeLayout({ children }: { children: ReactNode }) {
}, [onlineFriendIds])
const hasDm = !!params.dmId
- const machinesActive = pathname === "/community/me/machines"
- const botsActive = pathname === "/community/me/bots"
+ const machinesActive = pathname === "/c/me/machines"
+ const botsActive = pathname === "/c/me/bots"
const friendsActive = !hasDm && !machinesActive && !botsActive
const [mobileZone, setMobileZone] = useState<MobileZone>(() => (hasDm ? "messages" : "nav"))
@@ -82,31 +82,31 @@ export default function MeLayout({ children }: { children: ReactNode }) {
? { ...prev, conversations: prev.conversations.map((d) => (d.id === id ? { ...d, unread: false } : d)) }
: prev,
)
- router.push(`/community/me/${id}`)
+ router.push(`/c/me/${id}`)
if (bp === "mobile") setMobileZone("messages")
}, [queryClient, router, bp])
const onShowFriends = useCallback(() => {
useCommunityStore.getState().setCurrentChannelId(null)
- router.push("/community/me")
+ router.push("/c/me")
if (bp === "mobile") setMobileZone("messages")
}, [router, bp])
const onShowMachines = useCallback(() => {
useCommunityStore.getState().setCurrentChannelId(null)
- router.push("/community/me/machines")
+ router.push("/c/me/machines")
if (bp === "mobile") setMobileZone("messages")
}, [router, bp])
const onShowBots = useCallback(() => {
useCommunityStore.getState().setCurrentChannelId(null)
- router.push("/community/me/bots")
+ router.push("/c/me/bots")
if (bp === "mobile") setMobileZone("messages")
}, [router, bp])
const goHome = useCallback(() => {
setMobileZone("nav")
- router.push("/community/me")
+ router.push("/c/me")
}, [router])
const goServer = useCallback(() => { setMobileZone("nav") }, [])
diff --git a/src/web/src/app/community/me/machines/page.tsx b/src/web/src/app/c/me/machines/page.tsx
similarity index 100%
rename from src/web/src/app/community/me/machines/page.tsx
rename to src/web/src/app/c/me/machines/page.tsx
diff --git a/src/web/src/app/community/me/page.tsx b/src/web/src/app/c/me/page.tsx
similarity index 97%
rename from src/web/src/app/community/me/page.tsx
rename to src/web/src/app/c/me/page.tsx
index d984340d9..dcfcb5e67 100644
--- a/src/web/src/app/community/me/page.tsx
+++ b/src/web/src/app/c/me/page.tsx
@@ -115,7 +115,7 @@ export default function MeFriendsPage() {
onDm={async (userId) => {
try {
const data = await createOrGetDm.mutateAsync({ userId })
- if (data.conversation.id) router.push(`/community/me/${data.conversation.id}`)
+ if (data.conversation.id) router.push(`/c/me/${data.conversation.id}`)
} catch (e) {
toastApiError(e, "Failed to open DM")
}
diff --git a/src/web/src/app/community/page.tsx b/src/web/src/app/c/page.tsx
similarity index 73%
rename from src/web/src/app/community/page.tsx
rename to src/web/src/app/c/page.tsx
index 7936fafd1..046a74921 100644
--- a/src/web/src/app/community/page.tsx
+++ b/src/web/src/app/c/page.tsx
@@ -5,6 +5,6 @@ import { useEffect } from "react"
export default function CommunityIndex() {
const router = useRouter()
- useEffect(() => { router.replace("/community/me") }, [router])
+ useEffect(() => { router.replace("/c/me") }, [router])
return null
}
diff --git a/src/web/src/app/community/preview/_mock.ts b/src/web/src/app/community/preview/_mock.ts
deleted file mode 100644
index 6a0692dbe..000000000
--- a/src/web/src/app/community/preview/_mock.ts
+++ /dev/null
@@ -1,382 +0,0 @@
-/**
- * Mock data for the /d-preview scaffolding page.
- *
- * This file is DISPOSABLE — it exists only to feed the reusable
- * `@/components/community/*` components in the preview. Once the real
- * `/community` app ships, the query layer returns these same view-model
- * shapes from `community_*` rows and this file (plus the preview page) is deleted.
- *
- * Field names match `@/components/community/_types` (schema-aligned), e.g.
- * `content`/`authorName`/`authorAvatar`/`createdAt`/`embeds[]`/`replyTo`/
- * `messageCount`/`lastMessageAt`.
- */
-
-import type {
- Server,
- CommunityFolder,
- Category,
- Msg,
- Thread,
- ForumPost,
- Member,
- Friend,
- PendingRequest,
- BlockedUser,
- DM,
- Profile,
- InviteRow,
- AuditEntry,
- Mention,
- UnreadServer,
-} from "@/components/community/_types"
-
-export const SERVERS: Server[] = [
- { id: "sv_alook", name: "Alook", initial: "A", active: true, mentions: 0 },
- { id: "sv_cf", name: "Cloudflare", initial: "CF", active: false, mentions: 3 },
- { id: "sv_oss", name: "OSS Club", initial: "OS", active: false, mentions: 0 },
-]
-
-export const CATEGORIES: Category[] = [
- {
- // empty name = uncategorized: top-level channels render above all categories, no header.
- // Every server has a default top-level "all" channel.
- id: "cat_none",
- name: "",
- channels: [
- { id: "all", name: "all", active: false, unread: false },
- ],
- },
- {
- id: "cat_info",
- name: "WELCOME",
- channels: [
- { id: "welcome", name: "welcome", active: true, unread: false },
- { id: "rules", name: "rules", active: false, unread: false },
- ],
- },
- {
- id: "cat_community",
- name: "COMMUNITY",
- channels: [
- { id: "general", name: "general", active: false, unread: false },
- { id: "show-and-tell", name: "show-and-tell", active: false, unread: true },
- { id: "ideas-feedback", name: "ideas-feedback", active: false, unread: false },
- { id: "help-forum", name: "help-forum", active: false, unread: false, type: "forum" },
- ],
- },
- {
- id: "cat_dev",
- name: "DEVELOPERS",
- channels: [
- { id: "dev-chat", name: "dev-chat", active: false, unread: false },
- { id: "api", name: "api-integrations", active: false, unread: false },
- { id: "off-topic", name: "off-topic", active: false, unread: true, muted: true },
- ],
- },
-]
-
-export const MESSAGES: Msg[] = [
- {
- id: "m1", type: "chat", authorName: "Gener", color: "var(--foreground)", createdAt: "2026-06-24T21:27:00Z",
- authorAvatar: "G",
- content: "👋 Welcome to the Alook Community!\n\nAlook lets you run your own AI-powered personal company — agents that collaborate, stay always on, and learn from every task.",
- embeds: [{
- provider: "alook.ai",
- url: "https://alook.ai",
- title: "Alook — Personal Company",
- desc: "Your AI agents, always on. Give them an email, let them work for you around the clock.",
- image: { url: "https://images.unsplash.com/photo-1677442136019-21780ecad995?w=600&q=80" },
- }],
- reactions: [{ emoji: "👍", count: 3, me: true, userIds: ["u_gener", "u_gus", "u_lindsay"] }],
- thread: { id: "thr_research", name: "Research team setup", messageCount: 3 },
- },
- {
- id: "m2", type: "chat", authorName: "Gus", createdAt: "2026-06-24T21:31:00Z", authorAvatar: "Gu",
- content: "this is exactly what I needed — the email-per-agent thing is wild",
- },
- {
- id: "m3", type: "chat", authorName: "Gus", createdAt: "2026-06-24T21:31:30Z", authorAvatar: "Gu",
- content: "is there a template for a research team?",
- },
- {
- id: "m4", type: "chat", authorName: "Lindsay", createdAt: "2026-06-24T21:42:00Z", authorAvatar: "L",
- replyTo: { id: "m3", authorName: "Gus", text: "is there a template for a research team?" },
- content: "Yes — check the Templates page, there's a Research Analyst preset. Deploys in a minute.",
- reactions: [{ emoji: "🔥", count: 2, me: false, userIds: ["u_gus", "u_tomy"] }, { emoji: "🙏", count: 1, me: false, userIds: ["u_gus"] }],
- },
- {
- id: "m5", type: "chat", authorName: "Gener", createdAt: "2026-06-24T21:45:00Z", authorAvatar: "G",
- content: "Here's the **setup** in *three* steps:\n> Clone the repo first\n`pnpm install`\n```\npnpm dev --filter web\n```\nThat's it ~~maybe~~ ||it just works||",
- },
- {
- // Mirrors what a live thread-creation system message looks like (see
- // `POST /api/community/messages/[id]/threads` → `mapMessageForWs`'s
- // `splitType`) — `systemKind: "join"` was removed from `Msg`'s type
- // entirely (#12/#5) since no path has ever produced it; this fixture
- // now demonstrates the one kind that's actually wired up.
- id: "ms1", type: "system", systemKind: "thread", createdAt: "2026-06-25T10:00:00Z",
- content: "A thread was created from this message.",
- },
- {
- id: "m6", type: "chat", authorName: "Gus", createdAt: "2026-06-25T10:02:00Z", authorAvatar: "Gu",
- content: "thanks @Lindsay — can you cross-post this in #general? cc @everyone",
- },
- {
- id: "m7", type: "chat", authorName: "Lindsay", createdAt: "2026-06-25T10:05:00Z", authorAvatar: "L",
- content: "here's the preset config + a screenshot of the result",
- attachments: [
- { kind: "image", name: "research-preset.png", url: "https://images.unsplash.com/photo-1555066931-4365d14bab8c?w=800&q=80", width: 800, height: 533 },
- { kind: "file", name: "research-team.json", url: "#", size: "4.2 KB" },
- ],
- },
- {
- id: "m8", type: "chat", authorName: "Release Notes", createdAt: "2026-06-25T10:10:00Z", authorAvatar: "RN",
- embeds: [{
- provider: "GitHub",
- url: "https://github.com/alookai/alook/releases/tag/v0.1.0",
- title: "alook v0.1.0",
- color: "var(--primary)",
- author: { name: "alookai/alook", iconUrl: "https://github.githubassets.com/favicons/favicon-dark.svg" },
- desc: "Threads, forum channels, DMs, and emoji reactions are live. Full changelog below.",
- thumbnail: { url: "https://github.githubassets.com/assets/GitHub-Mark-ea2971cee799.png" },
- fields: [
- { name: "Added", value: "Threads, Forum channels, DMs", inline: true },
- { name: "Fixed", value: "SMTP timeout, hydration warnings", inline: true },
- { name: "Contributors", value: "@Gener, @Lindsay, @Gus", inline: false },
- ],
- footer: { text: "Released 6/24/26 · 142 commits" },
- }],
- },
- {
- id: "m9", type: "chat", authorName: "Gener", createdAt: "2026-06-25T10:15:00Z", authorAvatar: "G",
- content: "trying the new preset now…", failed: true,
- },
-]
-
-// index in MESSAGES where the "NEW" unread divider sits (before this message)
-export const NEW_DIVIDER_BEFORE = "m6"
-
-export const PINNED: Msg[] = [MESSAGES[0], MESSAGES[3]]
-
-export const SEARCH_RESULTS: Msg[] = [MESSAGES[3], MESSAGES[1]]
-
-export const THREADS: Thread[] = [
- {
- id: "thr_research",
- name: "Research team setup",
- messageCount: 3,
- lastMessageAt: "2026-06-24T21:36:00Z",
- parent: { authorName: "Gener", text: "👋 Welcome to the Alook Community!" },
- },
- {
- id: "thr_billing",
- name: "Billing & limits questions",
- messageCount: 5,
- lastMessageAt: "2026-06-24T20:12:00Z",
- parent: { authorName: "jgtech", text: "how do per-agent usage limits work?" },
- },
- {
- id: "thr_selfhost",
- name: "Self-hosting on Cloudflare",
- messageCount: 2,
- lastMessageAt: "2026-06-23T15:30:00Z",
- parent: { authorName: "distagon", text: "anyone running this on their own Workers account?" },
- },
-]
-
-// ── Forum posts (a forum channel is a list of posts; each post is a thread) ──
-export const FORUM_POSTS: Record<string, ForumPost[]> = {
- "help-forum": [
- {
- id: "fp_smtp", name: "Custom SMTP keeps timing out", authorId: "u_jgtech", authorAvatar: "j", messageCount: 6, lastMessageAt: "2026-06-25T09:50:00Z",
- tags: ["email", "bug"], preview: "I set up a custom SMTP relay but sends time out after ~30s…",
- parent: { authorName: "jgtech", text: "I set up a custom SMTP relay but sends time out after ~30s. Anyone seen this?" },
- },
- {
- id: "fp_preset", name: "Share your best agent presets", authorId: "u_lindsay", authorAvatar: "L", messageCount: 23, lastMessageAt: "2026-06-25T09:00:00Z",
- tags: ["showcase"], preview: "Drop your favorite agent setups here — let's build a library.",
- parent: { authorName: "Lindsay", text: "Drop your favorite agent setups here — let's build a library." },
- },
- {
- id: "fp_pricing", name: "How do per-agent limits scale?", authorId: "u_azzo", authorAvatar: "A", messageCount: 4, lastMessageAt: "2026-06-25T07:30:00Z",
- tags: ["question", "billing"], preview: "Trying to understand how message limits work across a team…",
- parent: { authorName: "Azzo", text: "Trying to understand how message limits work across a team of agents." },
- },
- ],
-}
-
-// Mock message streams for threads, forum posts, and DMs. The live app loads
-// these into `ctx.messages` once the user navigates into the surface; the
-// preview keeps them keyed by surface id so the takeover view can read them
-// the same way (look up the active id → get a message list).
-export const THREAD_MESSAGES: Record<string, Msg[]> = {
- thr_research: [
- { id: "t1", type: "chat", authorName: "Gus", createdAt: "2026-06-24T21:33:00Z", authorAvatar: "Gu", content: "what roles should the research team have?" },
- { id: "t2", type: "chat", authorName: "Lindsay", createdAt: "2026-06-24T21:35:00Z", authorAvatar: "L", content: "Analyst, Summarizer, and a Fact-checker works well. Give each its own `@inbox`." },
- { id: "t3", type: "chat", authorName: "Gener", createdAt: "2026-06-24T21:36:00Z", authorAvatar: "G", content: "nice — shipping that preset 🚀" },
- ],
- thr_billing: [
- { id: "b1", type: "chat", authorName: "jgtech", createdAt: "2026-06-24T20:05:00Z", authorAvatar: "j", content: "is there a cap on messages per agent?" },
- { id: "b2", type: "chat", authorName: "Gener", createdAt: "2026-06-24T20:12:00Z", authorAvatar: "G", content: "Soft limits per plan — you can raise them in **Settings → Usage**." },
- ],
- thr_selfhost: [
- { id: "s1", type: "chat", authorName: "lucky tomy", createdAt: "2026-06-23T15:30:00Z", authorAvatar: "t", content: "yep — `wrangler deploy` and point D1 + R2 at your own buckets." },
- ],
- fp_smtp: [
- { id: "fp_smtp_1", type: "chat", authorName: "jgtech", createdAt: "2026-06-25T09:02:00Z", authorAvatar: "j", content: "I set up a custom SMTP relay but sends time out after ~30s. Anyone seen this?" },
- { id: "fp_smtp_2", type: "chat", authorName: "Lindsay", createdAt: "2026-06-25T09:08:00Z", authorAvatar: "L", content: "Check the port — `587` with STARTTLS works, `465` sometimes hangs on Workers." },
- { id: "fp_smtp_3", type: "chat", authorName: "jgtech", createdAt: "2026-06-25T09:14:00Z", authorAvatar: "j", content: "587 fixed it 🙏 thank you!" },
- ],
- fp_preset: [
- { id: "fp_preset_1", type: "chat", authorName: "Lindsay", createdAt: "2026-06-25T07:00:00Z", authorAvatar: "L", content: "Drop your favorite agent setups here — let's build a library." },
- { id: "fp_preset_2", type: "chat", authorName: "Gus", createdAt: "2026-06-25T07:20:00Z", authorAvatar: "Gu", content: "Research Analyst + Fact-checker combo has been 🔥 for me" },
- ],
- fp_pricing: [
- { id: "fp_pricing_1", type: "chat", authorName: "Azzo", createdAt: "2026-06-25T06:30:00Z", authorAvatar: "A", content: "Trying to understand how message limits work across a team of agents." },
- { id: "fp_pricing_2", type: "chat", authorName: "Gener", createdAt: "2026-06-25T06:45:00Z", authorAvatar: "G", content: "Limits are per-workspace, pooled across agents. Raise them in **Settings → Usage**." },
- ],
-}
-
-export const FORUM_TAGS = ["All", "question", "bug", "showcase", "email", "billing"]
-
-// Flat member list with a single role. The member list / settings derive
-// display groups (hoisted role groups, then Online/Offline) from this. Gener is the
-// Owner (server creator) — there is exactly one, and it can't be reassigned via the UI.
-export const MEMBERS: Member[] = [
- { id: "m_gener", userId: "u_gener", name: "Gener", avatar: "G", status: "online", sub: "", role: "owner", statusEmoji: "🎧", statusText: "Vibing" },
- { id: "m_gus", userId: "u_gus", name: "Gus", avatar: "Gu", status: "online", sub: "", role: "admin" },
- { id: "m_lindsay", userId: "u_lindsay", name: "Lindsay", avatar: "L", status: "online", sub: "", role: "admin", statusEmoji: "🎮", statusText: "Gaming" },
- { id: "m_tomy", userId: "u_tomy", name: "lucky tomy", avatar: "t", status: "online", sub: "AI engineer", role: "member" },
- { id: "m_jgtech", userId: "u_jgtech", name: "jgtech", avatar: "j", status: "online", sub: "", role: "member", statusEmoji: null, statusText: "Heads down" },
- { id: "m_azzo", userId: "u_azzo", name: "Azzo", avatar: "A", status: "offline", sub: "", role: "member" },
- { id: "m_distagon", userId: "u_distagon", name: "distagon", avatar: "d", status: "offline", sub: "", role: "member" },
- { id: "m_reece", userId: "u_reece", name: "Reece", avatar: "R", status: "offline", sub: "", role: "member" },
-]
-
-export const FRIENDS: Friend[] = [
- { id: "u_gus", name: "Gus", discriminator: "1337", avatar: "Gu", status: "online", sub: "Playing with agents", statusEmoji: "🦥", statusText: "Chillin'" },
- { id: "u_lindsay", name: "Lindsay", discriminator: "0007", avatar: "L", status: "online", sub: "Online" },
- { id: "u_tomy", name: "lucky tomy", discriminator: "2718", avatar: "t", status: "online", sub: "AI engineer", statusEmoji: "🍟", statusText: "Snack break" },
- { id: "u_azzo", name: "Azzo", discriminator: "4404", avatar: "A", status: "offline", sub: "Offline" },
- { id: "u_reece", name: "Reece", discriminator: "8080", avatar: "R", status: "offline", sub: "Offline" },
-]
-
-export const PENDING: PendingRequest[] = [
- { id: "fr_jg", userId: "u_jg", name: "jgtech", avatar: "j", kind: "incoming" },
- { id: "fr_dist", userId: "u_dist", name: "distagon", avatar: "d", kind: "outgoing" },
-]
-
-export const BLOCKED: BlockedUser[] = [
- { id: "u_spam", name: "spammer42", avatar: "s" },
-]
-
-export const DMS: DM[] = [
- {
- id: "dm_lindsay", userId: "u_lindsay", name: "Lindsay", discriminator: "0007", avatar: "L", status: "online",
- preview: "shipping that preset 🚀", unread: true,
- },
- {
- id: "dm_gus", userId: "u_gus", name: "Gus", discriminator: "1337", avatar: "Gu", status: "online",
- preview: "the email-per-agent thing is wild",
- },
- {
- id: "dm_tomy", userId: "u_tomy", name: "lucky tomy", discriminator: "2718", avatar: "t", status: "offline",
- preview: "wrangler deploy and you're set",
- },
-]
-
-export const DM_MESSAGES: Record<string, Msg[]> = {
- dm_lindsay: [
- { id: "d1", type: "chat", authorName: "Lindsay", createdAt: "2026-06-24T21:50:00Z", authorAvatar: "L", content: "hey! saw your research preset — looks great" },
- { id: "d2", type: "chat", authorName: "Gener", createdAt: "2026-06-24T21:51:00Z", authorAvatar: "G", content: "thanks! still tuning the **fact-checker** role" },
- { id: "d3", type: "chat", authorName: "Lindsay", createdAt: "2026-06-24T21:52:00Z", authorAvatar: "L", content: "want me to test it on the Q2 report?" },
- ],
- dm_gus: [
- { id: "g1", type: "chat", authorName: "Gus", createdAt: "2026-06-24T20:30:00Z", authorAvatar: "Gu", content: "can I forward an email straight to an agent?" },
- { id: "g2", type: "chat", authorName: "Gener", createdAt: "2026-06-24T20:31:00Z", authorAvatar: "G", content: "yep — each agent has its own address. just CC it." },
- ],
- dm_tomy: [
- { id: "y1", type: "chat", authorName: "lucky tomy", createdAt: "2026-06-23T14:00:00Z", authorAvatar: "t", content: "self-hosting was easier than I expected" },
- ],
-}
-
-export const PROFILES: Record<string, Profile> = {
- Gener: { name: "Gener", userId: "u_gener", discriminator: "0042", avatar: "G", role: "Owner", about: "Building Alook. Coffee, agents, and warm gray UIs.", mutual: 3 },
- Gus: { name: "Gus", userId: "u_gus", discriminator: "1337", avatar: "Gu", role: "Admin", about: "Tinkering with email-driven workflows.", mutual: 2 },
- Lindsay: { name: "Lindsay", userId: "u_lindsay", discriminator: "0007", avatar: "L", role: "Admin", about: "Research lead. Ask me about presets.", mutual: 2 },
-}
-
-export const INVITES: InviteRow[] = [
- { code: "alook-x9f2", uses: 3, maxUses: null, expiresAt: "2026-07-02T12:00:00Z", by: "Gener", creatorId: "u_gener" },
- { code: "alook-team", uses: 12, maxUses: 50, expiresAt: null, by: "Lindsay", creatorId: "u_lindsay" },
-]
-
-export const AUDIT_LOG: AuditEntry[] = [
- { actor: "Gener", action: "created channel", target: "#api-integrations", createdAt: "2026-06-25T09:20:00Z" },
- { actor: "Lindsay", action: "kicked member", target: "spammer42", createdAt: "2026-06-25T08:55:00Z" },
- { actor: "Gus", action: "updated role", target: "lucky tomy → Admin", createdAt: "2026-06-25T08:40:00Z" },
- { actor: "Gener", action: "deleted 12 messages", target: "#general", createdAt: "2026-06-24T16:00:00Z" },
-]
-
-export const MENTIONS: Mention[] = [
- {
- id: "mn_1", server: "Alook", channel: "general",
- m: { id: "mn_m1", type: "chat", authorName: "Gus", createdAt: "2026-06-25T09:48:00Z", authorAvatar: "Gu", content: "thanks @Gener — can you cross-post this in #general? cc @everyone" },
- },
- {
- id: "mn_2", server: "Cloudflare", channel: "flagship",
- m: { id: "mn_m2", type: "chat", authorName: "roerohan", createdAt: "2026-06-25T08:43:00Z", authorAvatar: "r", content: "@Gener the Workers binding you mentioned fixed it 🙏" },
- },
- {
- id: "mn_3", server: "Alook", channel: "help-forum",
- m: { id: "mn_m3", type: "chat", authorName: "jgtech", createdAt: "2026-06-25T07:14:00Z", authorAvatar: "j", content: "@Gener 587 fixed the SMTP timeout, thank you!" },
- },
-]
-
-// Unreads grouped by server — channel-level
-export const UNREAD_SERVERS: UnreadServer[] = [
- {
- serverId: "sv_alook",
- serverName: "Alook",
- channels: [
- {
- channelId: "ch_general",
- channelName: "general",
- lastMessageAt: "2026-06-25T10:00:00Z",
- mentionCount: 1,
- children: [
- { channelId: "th_budget", channelName: "budget-2026", lastMessageAt: "2026-06-25T09:45:00Z", mentionCount: 0 },
- ],
- },
- { channelId: "ch_releases", channelName: "releases", lastMessageAt: "2026-06-25T07:30:00Z", mentionCount: 0, children: [] },
- ],
- },
- {
- serverId: "sv_cf",
- serverName: "Cloudflare",
- channels: [
- { channelId: "ch_flagship", channelName: "flagship", lastMessageAt: "2026-06-25T08:43:00Z", mentionCount: 1, children: [] },
- ],
- },
-]
-
-export const MOCK_FOLDERS: CommunityFolder[] = [
- {
- id: "folder_1",
- name: "AI Projects",
- position: 0,
- servers: [
- { id: "fld_ai", initial: "AI", name: "Acontext" },
- { id: "fld_ml", initial: "ML", name: "memobase" },
- ],
- },
- {
- id: "folder_2",
- name: "Dev",
- position: 1,
- servers: [
- { id: "fld_js", initial: "JS", name: "Second Me" },
- { id: "fld_go", initial: "GO", name: "Midjourney" },
- ],
- },
-]
diff --git a/src/web/src/app/community/preview/page.tsx b/src/web/src/app/community/preview/page.tsx
deleted file mode 100644
index 0b98445f3..000000000
--- a/src/web/src/app/community/preview/page.tsx
+++ /dev/null
@@ -1,639 +0,0 @@
-"use client"
-
-/**
- * Community STYLE PREVIEW — mock data only, fixed URL /d-preview.
- * Not wired to any API. Built to validate the visual direction:
- * community layout + Alook design tokens.
- *
- * Everything resolves through Alook semantic tokens (globals.css) so it
- * adapts to light/dark. The one token Alook lacks — a surface deeper than
- * --sidebar for the server rail — is scoped locally below as --d-rail.
- *
- * Covers two things from the plan:
- * #1 Two responsive stages — desktop (≥640) / mobile (<640).
- * #2 A wider feature showcase — markdown, mentions, system messages, threads,
- * pinned / search / thread side panels, typing indicator.
- */
-
-import { useMemo, useState } from "react"
-import type React from "react"
-import { toast } from "sonner"
-import { isForum as isForumType, isServerOwner, deriveThreadName } from "@alook/shared"
-import { ResizablePanelGroup, ResizablePanel, ResizableHandle } from "@/components/ui/resizable"
-import { Dialog, DialogContent } from "@/components/ui/dialog"
-
-// ── Mock data + shared view-model types ──────────────────────────────────
-// Data lives in ./_mock (disposable); shared types in @/components/community/_types.
-import {
- SERVERS, CATEGORIES, MESSAGES, NEW_DIVIDER_BEFORE, PINNED, SEARCH_RESULTS,
- THREADS, THREAD_MESSAGES, FORUM_POSTS, FORUM_TAGS, MEMBERS, FRIENDS, PENDING, BLOCKED, DMS, DM_MESSAGES,
- PROFILES, INVITES, AUDIT_LOG, MENTIONS, UNREAD_SERVERS, MOCK_FOLDERS,
-} from "./_mock"
-import type { RightPanel, MobileZone, View, SettingsSection, Msg, PendingRequest, BlockedUser, ForumPost, Profile, Thread, Role, DM, Member } from "@/components/community/_types"
-import { useBreakpoint } from "@/hooks/use-mobile"
-import { useChannelTree } from "@/components/community/use-channel-tree"
-import { avatarInitial } from "@/lib/community/avatar"
-import { displayName } from "@/lib/community/display-name"
-import { ProfileCard } from "@/components/community/profile-card"
-import { ImageLightbox } from "@/components/community/image-lightbox"
-import { UserSettings } from "@/components/community/edit-profile-dialog"
-import { ServerRail } from "@/components/community/server-rail"
-import { ChannelSidebar } from "@/components/community/channel-sidebar"
-import { DmSidebar } from "@/components/community/dm-sidebar"
-import { UserBar } from "@/components/community/user-bar"
-import { ChannelHeader, type ChannelNotifLevel } from "@/components/community/channel-header"
-import { DmHeader } from "@/components/community/dm-header"
-import { MessageList } from "@/components/community/message-list"
-import { Composer } from "@/components/community/composer"
-import { CommunityPanelSheet } from "@/components/community/community-panel-sheet"
-import { ForumView } from "@/components/community/forum-view"
-import { Avatar } from "@/components/community/avatar"
-import { FriendsPage } from "@/components/community/friends-page"
-import { ServerSettings } from "@/components/community/server-settings"
-import { InboxPopover } from "@/components/community/community-inbox-popover"
-import { Shell } from "@/components/community/shell"
-
-// ── Page ────────────────────────────────────────────────────────────────
-export default function CommunityPreview() {
- const bp = useBreakpoint()
- // channel tree state lives here (single source of truth) so the page can tell whether the
- // active channel is a forum — including channels created at runtime via the sidebar.
- const channelTree = useChannelTree(CATEGORIES)
- const [view, setView] = useState<View>("server")
- const [activeChannel, setActiveChannel] = useState("welcome")
- const [activeDm, setActiveDm] = useState<string | null>(null)
- const [settingsSection, setSettingsSection] = useState<SettingsSection>("overview")
- const [rightPanel, setRightPanel] = useState<RightPanel>("members")
- // An open thread takes over the message area like a channel.
- const [openThreadId, setOpenThreadId] = useState<string | null>(null)
- const [mobileZone, setMobileZone] = useState<MobileZone>("messages")
- const [profile, setProfile] = useState<{
- data: Profile
- x: number
- y: number
- initialStatusEmoji: string | null
- initialStatusText: string | null
- } | null>(null)
- // demo state — preview-local; the live app replaces these handlers with API mutations + WS
- const [messages, setMessages] = useState<Msg[]>(MESSAGES)
- const [pinned, setPinned] = useState<Msg[]>(PINNED)
- const [friendList, setFriendList] = useState(FRIENDS)
- const [pending, setPending] = useState<PendingRequest[]>(PENDING)
- const [blocked, setBlocked] = useState<BlockedUser[]>(BLOCKED)
- const [invites, setInvites] = useState(INVITES)
- const [forumPosts, setForumPosts] = useState(FORUM_POSTS)
- const [threads, setThreads] = useState(THREADS)
- const [dmList, setDmList] = useState<DM[]>(DMS)
- // Per-surface message streams. Mirrors the live app, where opening a DM or
- // child channel loads its messages into `ctx.messages`; here we keep them
- // keyed by surface id so each takeover view reads from the same shape.
- const [threadMessages, setThreadMessages] = useState<Record<string, Msg[]>>(THREAD_MESSAGES)
- const [dmMessages, setDmMessages] = useState<Record<string, Msg[]>>(DM_MESSAGES)
- const [memberList, setMemberList] = useState(MEMBERS)
- const [serverName, setServerName] = useState("Alook")
- const [notifLevel, setNotifLevel] = useState("Only @mentions")
- const [channelNotif, setChannelNotif] = useState<Record<string, string>>(() => {
- const init: Record<string, string> = {}
- for (const cat of CATEGORIES) for (const ch of cat.channels) if (ch.muted) init[ch.id] = "Nothing"
- return init
- })
- const [myAboutMe, setMyAboutMe] = useState("Building Alook. Coffee, agents, and warm gray UIs.")
- // In-memory-only status save for the preview scaffold — mirrors myAboutMe's
- // pattern above; no real persistence/WS fan-out here (see plans/profile-card.md).
- const [myStatus, setMyStatus] = useState<{ emoji: string | null; text: string | null }>({ emoji: "🎧", text: "Vibing" })
- const [editingProfile, setEditingProfile] = useState(false)
- // reply target (message being replied to) — drives the composer quote bar
- const [replyTo, setReplyTo] = useState<{ id: string; authorName: string; text: string } | null>(null)
- // search query submitted from the channel header (opens the search panel pre-filled)
- const [searchQuery] = useState("")
- // image attachment being previewed in the lightbox
- const [preview, setPreview] = useState<string | null>(null)
- const [unreadFeed] = useState(UNREAD_SERVERS)
-
- // open an inbox event → jump to its server + channel
- const openServerChannel = (_sid: string, cid: string) => {
- setView("server")
- setActiveChannel(cid)
- setOpenThreadId(null)
- if (bp === "mobile") setMobileZone("messages")
- }
-
- // shell chrome — app name + inbox popover slot
- const shellProps = {
- appName: "Alook",
- inbox: (
- <InboxPopover
- unreads={unreadFeed}
- unreadDms={[]}
- mentions={MENTIONS}
- onOpenChannel={openServerChannel}
- onMarkAllRead={() => { }}
- />
- ),
- hasUnread: unreadFeed.length > 0 || MENTIONS.length > 0,
- }
-
- // open a profile card near the click point (desktop popover / mobile sheet).
- // Every member is clickable — fall back to a profile built from the member/friend
- // record when there's no curated PROFILES entry (the live app always has one).
- const openProfile = (name: string, e: React.MouseEvent) => {
- const member = memberList.find((m) => m.name === name)
- ?? friendList.find((f) => f.name === name)
- let data: Profile = PROFILES[name] ?? {
- name,
- userId: member?.userId ?? member?.id,
- avatar: member?.avatar ?? avatarInitial(name),
- role: "member",
- about: member && "sub" in member && member.sub ? member.sub : "No bio yet.",
- mutual: 1,
- }
- data = { ...data, presence: member?.status }
- if (name === "Gener") data = { ...data, about: myAboutMe }
- // Seed the status pill from the member row (or the local self-status for
- // Gener). In the live app the card subscribes to `useCommunityWsStore`;
- // in this preview scaffold no WS store is running, so the seed is what
- // the card actually renders.
- const initialStatusEmoji = name === "Gener" ? myStatus.emoji : (member?.statusEmoji ?? null)
- const initialStatusText = name === "Gener" ? myStatus.text : (member?.statusText ?? null)
- setProfile({ data, x: e.clientX, y: e.clientY, initialStatusEmoji, initialStatusText })
- }
- const profileProps = { onOpenProfile: openProfile }
- let msgSeq = messages.length
-
- // message from profile card — find or create a DM, append the message, and navigate
- const profileMessage = (userId: string, text: string) => {
- const source = memberList.find((m) => m.userId === userId) ?? friendList.find((f) => f.userId === userId)
- const name = displayName(source)
- let target = dmList.find((d) => d.userId === userId)
- if (!target) {
- target = { id: `dm_${userId}`, userId, name, avatar: avatarInitial(name), status: "online" as const, preview: text.slice(0, 40) }
- setDmList((prev) => [target!, ...prev])
- }
- const dmId = target.id
- setDmList((prev) => prev.map((d) => d.id !== dmId ? d : { ...d, preview: text.slice(0, 40) }))
- setDmMessages((prev) => ({
- ...prev,
- [dmId]: [...(prev[dmId] ?? []), { id: `m_local_${++msgSeq}`, type: "chat" as const, authorName: "Gener", authorAvatar: "G", createdAt: new Date().toISOString(), content: text }],
- }))
- setView("dm")
- setActiveDm(dmId)
- setProfile(null)
- if (bp === "mobile") setMobileZone("messages")
- }
-
- const togglePanel = (k: Exclude<RightPanel, null>) =>
- setRightPanel((p) => (p === k ? null : k))
-
- // Preview @-mention candidate pool. In the live app the composer's roster
- // is the enriched server `members` array (`Member[]`). This mock reshapes
- // `friendList` (a `Friend[]`) into `Member[]` by tacking on the two fields
- // that `Member` adds — a `role` and the (unused-by-popup) `userId` echoing
- // `id`. Keeps the preview visually identical without polluting `_mock.ts`.
- const composerMembers = useMemo<Member[]>(
- () => friendList.map((f) => ({ ...f, userId: f.userId ?? f.id, role: "member" as const })),
- [friendList],
- )
-
- // the active channel object (for forum detection) and the open thread/post.
- const activeChannelObj = Object.values(channelTree.order).flat().find((ch) => ch.id === activeChannel)
- const isForum = isForumType(activeChannelObj?.type)
- const allThreads = [...threads, ...Object.values(forumPosts).flat()]
- const openThread = allThreads.find((t) => t.id === openThreadId) ?? null
- const dm = dmList.find((d) => d.id === activeDm) ?? null
-
- // header button → channel thread list (side panel); picking one → full message area.
- // also used to open a forum post (forum posts share the Thread shape).
- const enterThread = (id: string) => {
- setOpenThreadId(id)
- setRightPanel(null)
- if (bp === "mobile") setMobileZone("messages")
- }
-
- // rail: @me → DM/Friends view; a server → server view
- const goHome = () => { setView("dm"); setActiveDm(null); setOpenThreadId(null); if (bp === "mobile") setMobileZone("nav") }
- const goServer = () => { setView("server"); setOpenThreadId(null); if (bp === "mobile") setMobileZone("nav") }
-
- const enterDm = (id: string) => {
- setActiveDm(id)
- setDmList((prev) => prev.map((d) => d.id === id ? { ...d, unread: false } : d))
- if (bp === "mobile") setMobileZone("messages")
- }
-
- // create a thread (local) and open it — anchored to the message it was
- // created from (its first message).
- let threadSeq = 0
- const createThread = (name: string, anchor?: Msg) => {
- const id = `thr_local_${++threadSeq}`
- const seed: Msg[] = anchor ? [anchor] : []
- const t: Thread = {
- id, name, messageCount: seed.length, lastMessageAt: new Date().toISOString(),
- parent: {
- authorName: anchor?.authorName ?? "Gener",
- text: anchor?.content ?? name,
- },
- }
- setThreads((prev) => [t, ...prev])
- setThreadMessages((prev) => ({ ...prev, [id]: seed }))
- enterThread(id)
- }
- // from a message — the message anchors the thread (its first message); name defaults
- // to the message's first words.
- const createThreadFromMessage = (id: string) => {
- const m = messages.find((x) => x.id === id)
- const name = deriveThreadName(m?.content, activeChannel)
- createThread(name, m)
- }
-
- // send a channel message — append to the local list (live app: POST + WS echo)
- const sendMessage = (markdown: string) => {
- if (!markdown) return
- setMessages((prev) => [
- ...prev,
- {
- id: `m_local_${++msgSeq}`, type: "chat" as const, authorName: "Gener", authorAvatar: "G", createdAt: new Date().toISOString(),
- content: markdown, ...(replyTo ? { replyTo } : {}),
- },
- ])
- setReplyTo(null)
- }
-
- // send into the open thread — appends to the thread's message stream (live: POST to thread)
- const sendThreadMessage = (markdown: string) => {
- if (!markdown || !openThreadId) return
- const tid = openThreadId
- const now = new Date().toISOString()
- setThreadMessages((prev) => ({
- ...prev,
- [tid]: [...(prev[tid] ?? []), { id: `m_local_${++msgSeq}`, type: "chat" as const, authorName: "Gener", authorAvatar: "G", createdAt: now, content: markdown }],
- }))
- setThreads((prev) => prev.map((t) => t.id !== tid ? t : { ...t, messageCount: t.messageCount + 1, lastMessageAt: now }))
- setForumPosts((prev) => {
- const next = { ...prev }
- for (const [ch, posts] of Object.entries(next))
- next[ch] = posts.map((p) => p.id !== tid ? p : { ...p, messageCount: p.messageCount + 1, lastMessageAt: now })
- return next
- })
- }
-
- // send into a DM conversation
- const sendDmMessage = (markdown: string) => {
- if (!markdown || !activeDm) return
- const dmId = activeDm
- setDmList((prev) => prev.map((d) => d.id !== dmId ? d : { ...d, preview: markdown.slice(0, 40) }))
- setDmMessages((prev) => ({
- ...prev,
- [dmId]: [...(prev[dmId] ?? []), { id: `m_local_${++msgSeq}`, type: "chat" as const, authorName: "Gener", authorAvatar: "G", createdAt: new Date().toISOString(), content: markdown }],
- }))
- }
-
- // reaction toggle — flip `me` and inc/dec count; add the emoji if it's new
- const toggleReaction = (id: string, emoji: string) =>
- setMessages((prev) => prev.map((m) => {
- if (m.id !== id) return m
- const existing = m.reactions?.find((r) => r.emoji === emoji)
- if (!existing) return { ...m, reactions: [...(m.reactions ?? []), { emoji, count: 1, me: true, userIds: ["u_gener"] }] }
- const reactions = m.reactions!
- .map((r) => {
- if (r.emoji !== emoji) return r
- const userIds = r.me ? (r.userIds ?? []).filter((uid) => uid !== "u_gener") : [...(r.userIds ?? []), "u_gener"]
- return { ...r, me: !r.me, count: userIds.length, userIds }
- })
- .filter((r) => r.count > 0)
- return { ...m, reactions }
- }))
-
-
- // retry a failed send — clear the failed flag (live app: re-POST)
- const retryMessage = (id: string) =>
- setMessages((prev) => prev.map((m) => m.id === id ? { ...m, failed: false } : m))
- // copy message text to the clipboard
- const copyMessage = (id: string) => {
- const m = messages.find((x) => x.id === id)
- if (m?.content) { navigator.clipboard?.writeText(m.content); toast("Copied to clipboard") }
- }
- // reply — set the composer's reply target from the message
- const replyToMessage = (id: string) => {
- const m = messages.find((x) => x.id === id)
- if (m) setReplyTo({ id: m.id, authorName: m.authorName ?? "", text: m.content ?? "" })
- }
- // pinned message ids — drives the Pin/Unpin menu label on each message row
- const pinnedIds = useMemo(() => new Set(pinned.map((p) => p.id)), [pinned])
- // pin — toggle the message in the local pinned set (shown in the Pinned panel)
- const pinMessage = (id: string) => {
- const m = messages.find((x) => x.id === id)
- if (!m) return
- const wasPinned = pinned.some((p) => p.id === id)
- setPinned((prev) => wasPinned ? prev.filter((p) => p.id !== id) : [m, ...prev])
- toast(wasPinned ? "Message unpinned" : "Message pinned")
- }
-
- const messageActions = {
- onToggleReaction: toggleReaction,
- onReact: toggleReaction,
- onReply: replyToMessage,
- onPin: pinMessage,
- onCreateThread: createThreadFromMessage,
- onCopy: copyMessage,
- onRetry: retryMessage,
- onPreviewImage: (name: string) => setPreview(name),
- onDownloadFile: (name: string) => toast(`Downloading ${name}`),
- }
-
- // member actions — change role / kick (real local-state mutations). Owner is fixed:
- // the UI never offers it, and we guard here too.
- const setMemberRole = (name: string, role: Role) => {
- setMemberList((prev) => prev.map((m) => m.name === name && m.role !== "owner" ? { ...m, role } : m))
- toast(`${name} is now ${role}`)
- }
- const kickMember = (name: string) => {
- setMemberList((prev) => prev.filter((m) => m.name !== name || isServerOwner(m.role)))
- toast(`${name} kicked`)
- }
- const memberActions = { onSetRole: setMemberRole, onKickMember: kickMember }
-
- // friend request actions — move rows between pending/blocked locally
- const friendActions = {
- onAccept: (id: string) => { const req = pending.find((r) => r.id === id); setPending((p) => p.filter((r) => r.id !== id)); if (req) setFriendList((p) => [...p, { id: `fr_${req.id}`, userId: req.userId, name: req.name, avatar: req.avatar, status: "online", sub: "" }]); toast("Friend request accepted") },
- onReject: (id: string) => setPending((p) => p.filter((r) => r.id !== id)),
- onCancelRequest: (id: string) => setPending((p) => p.filter((r) => r.id !== id)),
- onUnblock: (id: string) => { setBlocked((b) => b.filter((u) => u.id !== id)); toast("User unblocked") },
- onSendRequest: (username: string) => { setPending((p) => [...p, { id: `pr_${username}`, userId: `u_${username}`, name: username, avatar: avatarInitial(username), kind: "outgoing" }]); toast(`Friend request sent to ${username}`) },
- onRemoveFriend: (id: string) => { setFriendList((p) => p.filter((f) => f.id !== id)); toast("Friend removed") },
- onBlock: (id: string) => { const f = friendList.find((x) => x.id === id); setFriendList((p) => p.filter((x) => x.id !== id)); if (f) setBlocked((b) => [...b, { id: f.id, name: f.name, avatar: f.avatar }]); toast("User blocked") },
- }
-
- // server-settings actions — list deletions mutate local state; copy hits the clipboard.
- // Member role/kick reuse the shared member actions (same state as the member list).
- const settingsActions = {
- onKickMember: kickMember,
- onSetRole: setMemberRole,
- onRevokeInvite: (code: string) => { setInvites((p) => p.filter((iv) => iv.code !== code)); toast("Invite revoked") },
- onCopyInvite: (code: string) => { navigator.clipboard?.writeText(`/community/invite/${code}`); toast("Invite copied") },
- onDeleteServer: () => { toast("Server deleted"); goHome() },
- onUploadIcon: () => toast("Upload a server icon"),
- onUpdateServer: (name: string) => { setServerName(name); toast("Server updated") },
- notifLevel,
- onSetNotifLevel: setNotifLevel,
- }
-
- // create a forum post — prepend to the active channel's feed (live app: POST → thread)
- let postSeq = 0
- const createForumPost = (post: { name: string; content: string; tags: string[] }) => {
- const id = `fp_local_${++postSeq}`
- const now = new Date().toISOString()
- const created: ForumPost = {
- id, name: post.name, authorId: "u_gener", authorAvatar: "G", messageCount: 1, lastMessageAt: now,
- tags: post.tags, preview: post.content || "(no description)",
- parent: { authorName: "Gener", text: post.content || post.name },
- }
- setForumPosts((prev) => ({ ...prev, [activeChannel]: [created, ...(prev[activeChannel] ?? [])] }))
- setThreadMessages((prev) => ({
- ...prev,
- [id]: [{ id: `${id}_1`, type: "chat" as const, authorName: "Gener", authorAvatar: "G", createdAt: now, content: post.content || post.name }],
- }))
- toast(`Posted “${post.name}”`)
- }
-
- const panelProps = {
- onOpenThread: enterThread, members: memberList, pinned, searchResults: SEARCH_RESULTS, threads,
- searchQuery,
- ...memberActions,
- }
-
- const railProps = {
- servers: SERVERS, folders: MOCK_FOLDERS, setMobileZone, view, onHome: goHome, onServer: goServer,
- onCreateServer: (name: string) => toast(name ? `Server "${name}" created` : "Server created"),
- onJoinServer: () => toast("Joined server"),
- onLeaveServer: () => { toast("Left server"); goHome() },
- }
- const channelProps = {
- tree: channelTree,
- serverName,
- activeChannel,
- setActiveChannel: (id: string) => {
- setActiveChannel(id)
- channelTree.markRead(id)
- setOpenThreadId(null)
- if (bp === "mobile") setMobileZone("messages")
- },
- onOpenSettings: (section?: SettingsSection) => { if (section) setSettingsSection(section); setView("settings") },
- onBlockedCreate: () => toast("Only admins can create channels in a private category"),
- mutedChannels: Object.fromEntries(Object.entries(channelNotif).map(([k, v]) => [k, v === "Nothing"])),
- }
-
- // The left sidebar — channels (server view) or DM list (@me view).
- const sidebar = (opts: { bordered?: boolean; noHeader?: boolean } = {}) =>
- view === "dm" ? (
- <DmSidebar dms={dmList} activeDm={activeDm} onPickDm={enterDm} onShowFriends={() => setActiveDm(null)} {...opts} />
- ) : (
- <ChannelSidebar {...channelProps} {...opts} />
- )
-
- // The whole content column (header + body). Branches: open thread → thread takeover;
- // @me view → DM conversation or Friends page; server view → channel + right panel.
- const contentColumn = ({ compact }: { compact?: boolean } = {}) => {
-
- if (openThread)
- return (
- <>
- <ChannelHeader
- channel={activeChannel}
- forum={isForum}
- rightPanel={rightPanel}
- onToggle={togglePanel}
- onBack={compact ? () => setMobileZone("nav") : undefined}
- breadcrumb={{
- label: openThread.name,
- onNavigateBack: () => setOpenThreadId(null),
- onRename: (name) => { setThreads((p) => p.map((t) => t.id === openThreadId ? { ...t, name } : t)); setForumPosts((p) => { const next = { ...p }; for (const [ch, posts] of Object.entries(next)) next[ch] = posts.map((fp) => fp.id === openThreadId ? { ...fp, name } : fp); return next }) },
- }}
- />
- <main className="flex min-h-0 flex-1 flex-col">
- <MessageList
- channel={openThread.name}
- messages={threadMessages[openThread.id] ?? []}
- onOpenThread={() => { }}
- {...profileProps}
- />
- <Composer channel={openThread.name} context="thread" members={composerMembers} onSend={sendThreadMessage} />
- </main>
- </>
- )
-
- if (view === "dm")
- return dm ? (
- <>
- <DmHeader dm={dm} onBack={compact ? () => setMobileZone("nav") : undefined} />
- <main className="flex min-h-0 flex-1 flex-col">
- <MessageList
- channel={dm.name}
- messages={dmMessages[dm.id] ?? []}
- onOpenThread={() => { }}
- variant="dm"
- {...profileProps}
- hero={
- <>
- <div className="relative mb-3 w-fit"><Avatar label={dm.avatar} seed={dm.userId} size={64} /></div>
- <h2 className="text-2xl font-semibold leading-tight">{dm.name}</h2>
- <p className="mt-1 text-sm text-muted-foreground">This is the beginning of your direct message history with <span className="font-medium text-foreground">{dm.name}</span>.</p>
- </>
- }
- />
- <Composer channel={dm.name} context="dm" members={[]} onSend={sendDmMessage} />
- </main>
- </>
- ) : (
- <FriendsPage friends={friendList} pending={pending} blocked={blocked} onBack={compact ? () => setMobileZone("nav") : undefined} {...friendActions} {...profileProps} />
- )
-
- // forum channel → post list (a forum is a feed of threads, not a chat).
- // Shares ChannelHeader with text channels; forum actions live in its `actions` slot.
- if (isForum)
- return (
- <>
- <ChannelHeader
- channel={activeChannel}
- forum
- rightPanel={rightPanel}
- onToggle={togglePanel}
- notifLevel={(channelNotif[activeChannel] as ChannelNotifLevel) ?? "Use Server Default"}
- onSetNotifLevel={(l) => setChannelNotif((p) => ({ ...p, [activeChannel]: l }))}
- onBack={compact ? () => setMobileZone("nav") : undefined}
- tools={{ threads: false, pinned: false }}
- />
- <main className="flex min-h-0 min-w-0 flex-1 flex-col">
- <ForumView
- posts={forumPosts[activeChannel] ?? []}
- tags={FORUM_TAGS}
- onOpenPost={enterThread}
- onCreatePost={createForumPost}
- canManageTags
- />
- </main>
- </>
- )
-
- return (
- <>
- <ChannelHeader
- channel={activeChannel}
- rightPanel={rightPanel}
- onToggle={togglePanel}
- notifLevel={(channelNotif[activeChannel] as ChannelNotifLevel) ?? "Use Server Default"}
- onSetNotifLevel={(l) => setChannelNotif((p) => ({ ...p, [activeChannel]: l }))}
- onBack={compact ? () => setMobileZone("nav") : undefined}
- />
- <main className="flex min-h-0 min-w-0 flex-1 flex-col">
- <MessageList channel={activeChannel} messages={messages} pinnedIds={pinnedIds} newDividerBefore={NEW_DIVIDER_BEFORE} typingUsers={["Lindsay"]} onOpenThread={enterThread} {...messageActions} {...profileProps} />
- <Composer channel={activeChannel} context="channel" members={composerMembers} onSend={sendMessage} replyingTo={replyTo?.authorName} onCancelReply={() => setReplyTo(null)} />
- </main>
- </>
- )
- }
-
- // portaled dialogs — rendered in every layout branch
- const dialogs = (
- <>
- <Dialog open={editingProfile} onOpenChange={(o) => { if (!o) setEditingProfile(false) }}>
- <DialogContent className="flex h-[calc(100vh-4rem)] max-h-180 w-[calc(100vw-4rem)] sm:max-w-4xl flex-col gap-0 overflow-hidden rounded-xl p-0" showCloseButton={false}>
- <UserSettings
- onClose={() => setEditingProfile(false)}
- userId={null}
- userName="Preview User"
- aboutMe={myAboutMe}
- avatar="Preview User"
- statusEmoji={myStatus.emoji}
- statusText={myStatus.text}
- onSave={(data) => {
- if (data.aboutMe !== undefined) setMyAboutMe(data.aboutMe)
- if (data.statusEmoji !== undefined || data.statusText !== undefined) {
- setMyStatus((s) => ({
- emoji: data.statusEmoji !== undefined ? data.statusEmoji : s.emoji,
- text: data.statusText !== undefined ? data.statusText : s.text,
- }))
- }
- }}
- onLogout={() => toast("Logged out")}
- />
- </DialogContent>
- </Dialog>
- <Dialog open={view === "settings"} onOpenChange={(o) => { if (!o) goServer() }}>
- <DialogContent className="flex h-[calc(100vh-4rem)] max-h-180 w-[calc(100vw-4rem)] sm:max-w-4xl flex-col gap-0 overflow-hidden rounded-xl p-0" showCloseButton={false}>
- <ServerSettings section={settingsSection} setSection={setSettingsSection} onClose={goServer} serverName={serverName} serverDescription="Your Personal Company — AI agents that collaborate, always on." members={memberList} invites={invites} auditLog={AUDIT_LOG} {...settingsActions} {...profileProps} />
- </DialogContent>
- </Dialog>
- </>
- )
-
-
- // ── Desktop: full 4-column resizable shell ──
- if (bp === "desktop") {
- return (
- <Shell {...shellProps}>
- <ResizablePanelGroup orientation="horizontal" className="min-h-0 flex-1">
- <ResizablePanel defaultSize="24%" minSize="20%" maxSize="36%" className="flex flex-col" style={{ background: "var(--d-rail)" }}>
- <div className="flex min-h-0 flex-1">
- <ServerRail {...railProps} />
- {sidebar({ bordered: true })}
- </div>
- <UserBar user={{ id: "u_gener", name: "Gener", avatar: "G" }} {...profileProps} onEditProfile={() => setEditingProfile(true)} />
- </ResizablePanel>
-
- <ResizableHandle className="bg-transparent" />
-
- <ResizablePanel defaultSize="76%" className="flex min-w-0 flex-col border-t border-r border-border bg-sidebar">
- {contentColumn()}
- </ResizablePanel>
- </ResizablePanelGroup>
- {rightPanel && view === "server" && !openThread && (
- <CommunityPanelSheet
- open
- onOpenChange={(v) => { if (!v) setRightPanel(null) }}
- kind={rightPanel}
- {...panelProps}
- {...profileProps}
- />
- )}
- {profile && <ProfileCard key={`${profile.data.userId ?? profile.data.name}:${profile.x}:${profile.y}`} data={profile.data} x={profile.x} y={profile.y} bp={bp} onClose={() => setProfile(null)} onMessage={profileMessage} isSelf={profile.data.userId === "u_gener"} onUpdateStatus={(emoji, text) => { setMyStatus({ emoji, text }); setProfile((p) => p ? { ...p, initialStatusEmoji: emoji, initialStatusText: text } : p) }} initialStatusEmoji={profile.initialStatusEmoji} initialStatusText={profile.initialStatusText} />}
- {preview && <ImageLightbox src={preview} onClose={() => setPreview(null)} />}
- {dialogs}
- </Shell>
- )
- }
-
- // ── Mobile: single-zone stack navigation ──
- return (
- <Shell {...shellProps}>
- {mobileZone === "nav" && (
- <>
- <ServerRail {...railProps} bottomInset={60} />
- <div className="flex min-h-0 flex-1 flex-col" style={{ background: "var(--d-rail)" }}>
- <div className="flex min-h-0 flex-1">
- {sidebar({ noHeader: false })}
- </div>
- <UserBar user={{ id: "u_gener", name: "Gener", avatar: "G" }} {...profileProps} onEditProfile={() => setEditingProfile(true)} />
- </div>
- </>
- )}
-
- {mobileZone === "messages" && (
- <div className="flex min-h-0 flex-1 flex-col bg-sidebar">
- {contentColumn({ compact: true })}
- </div>
- )}
-
- {rightPanel && view === "server" && !openThread && (
- <CommunityPanelSheet
- open
- onOpenChange={(v) => { if (!v) setRightPanel(null) }}
- kind={rightPanel}
- {...panelProps}
- {...profileProps}
- />
- )}
- {profile && <ProfileCard key={`${profile.data.userId ?? profile.data.name}:${profile.x}:${profile.y}`} data={profile.data} x={profile.x} y={profile.y} bp={bp} onClose={() => setProfile(null)} onMessage={profileMessage} isSelf={profile.data.userId === "u_gener"} onUpdateStatus={(emoji, text) => { setMyStatus({ emoji, text }); setProfile((p) => p ? { ...p, initialStatusEmoji: emoji, initialStatusText: text } : p) }} initialStatusEmoji={profile.initialStatusEmoji} initialStatusText={profile.initialStatusText} />}
- {preview && <ImageLightbox src={preview} onClose={() => setPreview(null)} />}
- {dialogs}
- </Shell>
- )
-}
diff --git a/src/web/src/components/community/bots/bot-activity-modal.tsx b/src/web/src/components/community/bots/bot-activity-modal.tsx
index 8ab14cdcc..3c850e30e 100644
--- a/src/web/src/components/community/bots/bot-activity-modal.tsx
+++ b/src/web/src/components/community/bots/bot-activity-modal.tsx
@@ -18,7 +18,7 @@ import { BotActivityRow } from "./bot-activity-row"
/**
* Modal audit log for one bot. Owner-only surface (the API enforces 404 for
- * non-owners); opens over the current /community/me/bots view rather than
+ * non-owners); opens over the current /c/me/bots view rather than
* pushing a route.
*
* Reads like a developer log tail:
diff --git a/src/web/src/components/community/bots/bot-list.tsx b/src/web/src/components/community/bots/bot-list.tsx
index 40d216a56..d444156b1 100644
--- a/src/web/src/components/community/bots/bot-list.tsx
+++ b/src/web/src/components/community/bots/bot-list.tsx
@@ -36,7 +36,7 @@ import { EditBotSheet } from "./edit-bot-sheet"
import { BotActivityModal } from "./bot-activity-modal"
/**
- * BotList — the /community/me/bots surface.
+ * BotList — the /c/me/bots surface.
*
* Visual language matches the sibling MachineList: a back-bar header, a
* 6-unit-padded scroll region, header/CTA row, Card rows with a 40px avatar,
@@ -71,7 +71,7 @@ export function BotList({ onBack }: { onBack?: () => void } = {}) {
const chatWithBot = async (bot: BotSummary) => {
try {
const data = await createOrGetDm.mutateAsync({ userId: bot.id })
- router.push(`/community/me/${data.conversation.id}`)
+ router.push(`/c/me/${data.conversation.id}`)
} catch (e) {
toastApiError(e, "Failed to open chat")
}
@@ -255,7 +255,7 @@ export function BotList({ onBack }: { onBack?: () => void } = {}) {
className="h-6 shrink-0 px-2 text-xs"
onClick={(e) => {
e.stopPropagation()
- router.push(`/community/me/machines?reconnect=${machine.id}`)
+ router.push(`/c/me/machines?reconnect=${machine.id}`)
}}
>
Bring online
diff --git a/src/web/src/components/community/channel-ref-pill.tsx b/src/web/src/components/community/channel-ref-pill.tsx
index 03d1d0b0e..555ae6b49 100644
--- a/src/web/src/components/community/channel-ref-pill.tsx
+++ b/src/web/src/components/community/channel-ref-pill.tsx
@@ -139,7 +139,7 @@ export function ChannelRefPill({ children }: { children?: React.ReactNode }) {
<>
<ChannelPill
serverPrefix={view.serverPrefix}
- onClick={() => router.push(`/community/channels/${view.href.serverId}/${view.href.channelId}`)}
+ onClick={() => router.push(`/c/channels/${view.href.serverId}/${view.href.channelId}`)}
>
{view.label}
</ChannelPill>
diff --git a/src/web/src/components/community/community-invite-card.tsx b/src/web/src/components/community/community-invite-card.tsx
index 5b38279a3..e612091c7 100644
--- a/src/web/src/components/community/community-invite-card.tsx
+++ b/src/web/src/components/community/community-invite-card.tsx
@@ -44,7 +44,7 @@ export function CommunityInviteCard({ token }: { token: string }) {
try {
const result = await joinServer.mutateAsync({ inviteCode: token })
toast("Joined server")
- router.push(`/community/channels/${result.serverId}`)
+ router.push(`/c/channels/${result.serverId}`)
} catch (err) {
const msg =
err instanceof Error ? err.message : "Couldn't join the server — try again"
@@ -105,7 +105,7 @@ export function CommunityInviteCard({ token }: { token: string }) {
{alreadyMemberServerId ? (
<Button
size="sm"
- onClick={() => router.push(`/community/channels/${alreadyMemberServerId}`)}
+ onClick={() => router.push(`/c/channels/${alreadyMemberServerId}`)}
>
Go to Server
</Button>
diff --git a/src/web/src/components/community/eject-server.test.ts b/src/web/src/components/community/eject-server.test.ts
index 3f3c0bb6d..260cded94 100644
--- a/src/web/src/components/community/eject-server.test.ts
+++ b/src/web/src/components/community/eject-server.test.ts
@@ -37,7 +37,7 @@ describe("pickPostEjectDestination", () => {
it("returns the first other server when one remains", () => {
const servers = [makeServer("srv_ejected"), makeServer("srv_next"), makeServer("srv_third")]
expect(pickPostEjectDestination(servers, "srv_ejected")).toBe(
- "/community/channels/srv_next",
+ "/c/channels/srv_next",
)
})
@@ -46,16 +46,16 @@ describe("pickPostEjectDestination", () => {
// must still land on the first non-ejected id from left to right.
const servers = [makeServer("srv_first"), makeServer("srv_ejected"), makeServer("srv_third")]
expect(pickPostEjectDestination(servers, "srv_ejected")).toBe(
- "/community/channels/srv_first",
+ "/c/channels/srv_first",
)
})
- it("returns /community/me when the ejected server was the only one", () => {
+ it("returns /c/me when the ejected server was the only one", () => {
const servers = [makeServer("srv_only")]
- expect(pickPostEjectDestination(servers, "srv_only")).toBe("/community/me")
+ expect(pickPostEjectDestination(servers, "srv_only")).toBe("/c/me")
})
- it("returns /community/me when the list is empty", () => {
- expect(pickPostEjectDestination([], "srv_anything")).toBe("/community/me")
+ it("returns /c/me when the list is empty", () => {
+ expect(pickPostEjectDestination([], "srv_anything")).toBe("/c/me")
})
})
diff --git a/src/web/src/components/community/eject-server.ts b/src/web/src/components/community/eject-server.ts
index daf91e9cc..633d04ac1 100644
--- a/src/web/src/components/community/eject-server.ts
+++ b/src/web/src/components/community/eject-server.ts
@@ -28,6 +28,6 @@ export function pickPostEjectDestination(
ejectedServerId: string,
): string {
const remaining = servers.filter((s) => s.id !== ejectedServerId)
- if (remaining.length === 0) return "/community/me"
- return `/community/channels/${remaining[0].id}`
+ if (remaining.length === 0) return "/c/me"
+ return `/c/channels/${remaining[0].id}`
}
diff --git a/src/web/src/components/community/invite-dialog.tsx b/src/web/src/components/community/invite-dialog.tsx
index e788cc7f1..24665a444 100644
--- a/src/web/src/components/community/invite-dialog.tsx
+++ b/src/web/src/components/community/invite-dialog.tsx
@@ -22,7 +22,7 @@ const INVITE_ORIGIN =
typeof window !== "undefined" ? window.location.origin : ""
function inviteUrl(token: string) {
- return `${INVITE_ORIGIN}/community/invite/${token}`
+ return `${INVITE_ORIGIN}/c/invite/${token}`
}
/**
diff --git a/src/web/src/components/community/machines/machine-list.tsx b/src/web/src/components/community/machines/machine-list.tsx
index f48045602..ebfe1da18 100644
--- a/src/web/src/components/community/machines/machine-list.tsx
+++ b/src/web/src/components/community/machines/machine-list.tsx
@@ -85,7 +85,7 @@ export function MachineList({ onBack }: { onBack?: () => void } = {}) {
handledReconnectRef.current = reconnectId
const machine = machines.find((m) => m.id === reconnectId)
if (machine) openReconnect(machine)
- router.replace("/community/me/machines")
+ router.replace("/c/me/machines")
}, [searchParams, machines, machinesLoading, openReconnect, router])
const closePair = useCallback((open: boolean) => {
@@ -260,8 +260,8 @@ export function MachineList({ onBack }: { onBack?: () => void } = {}) {
setConfirmDelete(null)
router.push(
machineId
- ? `/community/me/bots?machineId=${machineId}`
- : "/community/me/bots"
+ ? `/c/me/bots?machineId=${machineId}`
+ : "/c/me/bots"
)
}}
>
diff --git a/src/web/src/components/community/message-body.tsx b/src/web/src/components/community/message-body.tsx
index 52df7d33a..17e21de3d 100644
--- a/src/web/src/components/community/message-body.tsx
+++ b/src/web/src/components/community/message-body.tsx
@@ -78,7 +78,7 @@ const REHYPE_PLUGINS: PluggableList = [
// parses directly into mdast nodes and maps to pill components — no custom
// markdown parser, no HTML-string splicing.
//
-// Community invite URLs (`/community/invite/<token>`) render inline: the
+// Community invite URLs (`/c/invite/<token>`) render inline: the
// URL stays as a plain auto-linked <a> in the message body, and a rich join
// card renders BELOW it. Both surfaces coexist so users can still copy/share
// the raw link even when the card is present.
diff --git a/src/web/src/components/community/message-markdown.test.ts b/src/web/src/components/community/message-markdown.test.ts
index ee7c8eaaa..4720d3d89 100644
--- a/src/web/src/components/community/message-markdown.test.ts
+++ b/src/web/src/components/community/message-markdown.test.ts
@@ -71,29 +71,29 @@ describe("buildMdComponents — mention pill onClick wiring", () => {
describe("extractInviteTokens", () => {
it("extracts a bare-path token", () => {
- expect(extractInviteTokens("join /community/invite/abc123XYZ")).toEqual(["abc123XYZ"])
+ expect(extractInviteTokens("join /c/invite/abc123XYZ")).toEqual(["abc123XYZ"])
})
it("extracts a full-origin URL token", () => {
- expect(extractInviteTokens("https://alook.ai/community/invite/xY9k2vW7aQ")).toEqual([
+ expect(extractInviteTokens("https://alook.ai/c/invite/xY9k2vW7aQ")).toEqual([
"xY9k2vW7aQ",
])
})
it("extracts tokens with underscore/dash (nanoid alphabet)", () => {
- expect(extractInviteTokens("/community/invite/ab_cd-EF12")).toEqual(["ab_cd-EF12"])
+ expect(extractInviteTokens("/c/invite/ab_cd-EF12")).toEqual(["ab_cd-EF12"])
})
it("dedupes repeated tokens in the same message", () => {
expect(
extractInviteTokens(
- "/community/invite/abc123XYZ /community/invite/abc123XYZ /community/invite/other456",
+ "/c/invite/abc123XYZ /c/invite/abc123XYZ /c/invite/other456",
),
).toEqual(["abc123XYZ", "other456"])
})
it("ignores tokens below the 6-char floor", () => {
- expect(extractInviteTokens("/community/invite/abc")).toEqual([])
+ expect(extractInviteTokens("/c/invite/abc")).toEqual([])
})
it("returns [] when the message has no invite URL", () => {
diff --git a/src/web/src/components/community/message-markdown.tsx b/src/web/src/components/community/message-markdown.tsx
index f7b212534..52578ca80 100644
--- a/src/web/src/components/community/message-markdown.tsx
+++ b/src/web/src/components/community/message-markdown.tsx
@@ -3,7 +3,7 @@ import { Spoiler, MentionPill } from "./inline-marks"
import { ChannelRefPill } from "./channel-ref-pill"
import { ServerRefPill } from "./server-ref-pill"
-// Match `/community/invite/<token>` — with or without an origin.
+// Match `/c/invite/<token>` — with or without an origin.
// - token allows [A-Za-z0-9_-] (nanoid alphabet) and length 6..64 (short + old
// 32-char tokens both fit)
// - unrelated to chat-only syntax (mention/spoiler/channelRef, now parsed as
@@ -11,7 +11,7 @@ import { ServerRefPill } from "./server-ref-pill"
// this regex only extracts invite tokens for the join-card row rendered
// below the message body; the URL text itself stays untouched and is
// auto-linked by Streamdown/GFM.
-const INVITE_URL_RE = /(https?:\/\/[^\s/]+)?\/community\/invite\/([A-Za-z0-9_-]{6,64})/g
+const INVITE_URL_RE = /(https?:\/\/[^\s/]+)?\/c\/invite\/([A-Za-z0-9_-]{6,64})/g
/**
* Extract every invite token in a message body (URL text stays as-is, cards
diff --git a/src/web/src/components/community/server-ref-pill.tsx b/src/web/src/components/community/server-ref-pill.tsx
index 1e97ba257..1d7a873c9 100644
--- a/src/web/src/components/community/server-ref-pill.tsx
+++ b/src/web/src/components/community/server-ref-pill.tsx
@@ -45,7 +45,7 @@ export function ServerRefPill({ children }: { children?: React.ReactNode }) {
if (view.kind === "plain") return <>{view.text}</>
return (
- <ServerPill onClick={() => router.push(`/community/channels/${view.serverId}`)}>
+ <ServerPill onClick={() => router.push(`/c/channels/${view.serverId}`)}>
{view.label}
</ServerPill>
)
diff --git a/src/web/src/components/community/shell-frame.tsx b/src/web/src/components/community/shell-frame.tsx
index d12a287ec..b7358cda1 100644
--- a/src/web/src/components/community/shell-frame.tsx
+++ b/src/web/src/components/community/shell-frame.tsx
@@ -159,7 +159,7 @@ export function ShellFrame({
)
const onRailServerNavigate = useCallback(
- (id: string) => { router.push(`/community/channels/${id}`) },
+ (id: string) => { router.push(`/c/channels/${id}`) },
[router],
)
const onRailCreateServer = useCallback(
@@ -174,7 +174,7 @@ export function ShellFrame({
{ onError: (e) => toastApiError(e, "Server created, but the icon failed to upload") },
)
}
- router.push(`/community/channels/${newId}`)
+ router.push(`/c/channels/${newId}`)
} catch (e) {
toastApiError(e, "Failed to create server")
}
@@ -186,7 +186,7 @@ export function ShellFrame({
try {
const data = await joinServer.mutateAsync({ inviteCode: invite })
toast("Joined server")
- router.push(`/community/channels/${data.serverId}`)
+ router.push(`/c/channels/${data.serverId}`)
} catch (e) {
toastApiError(e, "Failed to join server")
}
@@ -217,13 +217,13 @@ export function ShellFrame({
)
const onRailOpenSettings = useCallback(
(id?: string) => {
- if (id) router.push(`/community/channels/${id}?settings=1`)
+ if (id) router.push(`/c/channels/${id}?settings=1`)
},
[router],
)
const onRailOpenInvitePopover = useCallback(
(id?: string) => {
- if (id) router.push(`/community/channels/${id}?invite=1`)
+ if (id) router.push(`/c/channels/${id}?invite=1`)
},
[router],
)
@@ -461,7 +461,7 @@ export function ShellFrame({
toastApiError(e, "Failed to send message")
}
}
- router.push(`/community/me/${dmId}`)
+ router.push(`/c/me/${dmId}`)
}
const openServerChannel = useCallback(
@@ -469,7 +469,7 @@ export function ShellFrame({
// No PUT here — the channel/thread page's `useEagerChannelRead` fires the
// mark-read on mount, AFTER its read-state snapshot latches, so the NEW
// divider still anchors to the pre-open pointer. Navigating is enough.
- router.push(`/community/channels/${sid}/${cid}`)
+ router.push(`/c/channels/${sid}/${cid}`)
},
[router],
)
@@ -488,7 +488,7 @@ export function ShellFrame({
? { ...prev, conversations: prev.conversations.map((d) => (d.id === dmId ? { ...d, unread: false } : d)) }
: prev,
)
- router.push(`/community/me/${dmId}`)
+ router.push(`/c/me/${dmId}`)
},
[router, queryClient],
)
diff --git a/src/web/src/components/community/thread-opener.tsx b/src/web/src/components/community/thread-opener.tsx
index 78074fbdc..f5264e7b6 100644
--- a/src/web/src/components/community/thread-opener.tsx
+++ b/src/web/src/components/community/thread-opener.tsx
@@ -14,7 +14,7 @@ import type { OpenProfile } from "./_types"
// Thread opener — the parent message the thread was created from, pinned at
// the top of the thread's message list. Deliberately styled like a REGULAR
// message row (same 40px avatar, same name/timestamp/body scale as
-// `Message`) rather than a boxed-off card — `/community` never wraps
+// `Message`) rather than a boxed-off card — `/c` never wraps
// messages in cards, so a tinted, bordered box here would read as a
// foreign component instead of "the message this thread grew out of." A
// plain caption above it is enough to mark it as context, not part of the
diff --git a/src/web/src/hooks/community/use-friends.ts b/src/web/src/hooks/community/use-friends.ts
index ef9e96c4d..45c17299e 100644
--- a/src/web/src/hooks/community/use-friends.ts
+++ b/src/web/src/hooks/community/use-friends.ts
@@ -61,7 +61,7 @@ export function useFriends(): UseQueryResult<FriendsResponse> & {
* Friends can be online without ever sharing a server, so the co-member-
* scoped WS presence snapshot alone never learns about them. This seeds
* `useCommunityWsStore`'s `onlineUserIds` on mount (see
- * `app/community/me/layout.tsx`); WS `community:presence.update` events
+ * `app/c/me/layout.tsx`); WS `community:presence.update` events
* keep it fresh afterward.
*/
export type FriendsPresenceResponse = { online: string[] }
diff --git a/src/web/src/middleware.ts b/src/web/src/middleware.ts
index bb2c40d5f..21b35f10f 100644
--- a/src/web/src/middleware.ts
+++ b/src/web/src/middleware.ts
@@ -9,7 +9,7 @@ function isSafeRedirect(path: string): boolean {
return path.startsWith("/") && path[1] !== "/" && path[1] !== "\\"
}
-const AUTH_REQUIRED_PREFIXES = ["/invite/", "/w/", "/workspaces", "/dashboard", "/community"]
+const AUTH_REQUIRED_PREFIXES = ["/invite/", "/w/", "/workspaces", "/dashboard", "/c/"]
export async function middleware(request: NextRequest) {
if (
@@ -23,7 +23,7 @@ export async function middleware(request: NextRequest) {
}
const { pathname } = request.nextUrl
- const needsAuth = AUTH_REQUIRED_PREFIXES.some((p) => pathname.startsWith(p))
+ const needsAuth = pathname === "/c" || AUTH_REQUIRED_PREFIXES.some((p) => pathname.startsWith(p))
if (needsAuth) {
const { env } = await getCloudflareContext({ async: true })
diff --git a/src/web/src/test/e2e-ui/01-auth.spec.ts b/src/web/src/test/e2e-ui/01-auth.spec.ts
index 3cefc4ee1..cc5985100 100644
--- a/src/web/src/test/e2e-ui/01-auth.spec.ts
+++ b/src/web/src/test/e2e-ui/01-auth.spec.ts
@@ -4,10 +4,10 @@ import { test, expect } from "./_fixtures/community-fixture"
// global-setup, so this journey re-verifies the redirect/auth contract with a
// FRESH context (no saved session) plus an authenticated landing.
test.describe.serial("auth & first screen", () => {
- test("unauthenticated /community deep-link redirects to /sign-in with redirect param", async ({ browser }) => {
+ test("unauthenticated /c deep-link redirects to /sign-in with redirect param", async ({ browser }) => {
const context = await browser.newContext() // no storageState — anonymous
const page = await context.newPage()
- await page.goto("/community/channels/does-not-matter/whatever")
+ await page.goto("/c/channels/does-not-matter/whatever")
await page.waitForURL(/\/sign-in/, { timeout: 20_000 })
expect(page.url()).toContain("redirect=")
await context.close()
@@ -15,9 +15,9 @@ test.describe.serial("auth & first screen", () => {
test("authenticated user reaches the community shell", async ({ asUser }) => {
const { page } = await asUser("alice")
- await page.goto("/community")
+ await page.goto("/c")
// Not bounced to sign-in.
await expect(page).not.toHaveURL(/\/sign-in/)
- await page.waitForURL(/\/community/, { timeout: 20_000 })
+ await page.waitForURL(/\/c/, { timeout: 20_000 })
})
})
diff --git a/src/web/src/test/e2e-ui/02-server-channel-message.spec.ts b/src/web/src/test/e2e-ui/02-server-channel-message.spec.ts
index 393b8ef47..c28c6e46b 100644
--- a/src/web/src/test/e2e-ui/02-server-channel-message.spec.ts
+++ b/src/web/src/test/e2e-ui/02-server-channel-message.spec.ts
@@ -10,16 +10,16 @@ test.describe.serial("server → channel → message", () => {
test("create a server from the rail", async ({ asUser }) => {
const { page } = await asUser("alice")
- await page.goto("/community")
- await page.waitForURL(/\/community/, { timeout: 20_000 })
+ await page.goto("/c")
+ await page.waitForURL(/\/c/, { timeout: 20_000 })
serverId = await createServer(page, `E2E Server ${Date.now()}`)
expect(serverId).toBeTruthy()
})
test("send a message; it appears and the composer clears", async ({ asUser }) => {
const { page } = await asUser("alice")
- await page.goto(`/community/channels/${serverId}`)
- await page.waitForURL(/\/community\/channels\/[^/]+\/[^/]+/, { timeout: 20_000 })
+ await page.goto(`/c/channels/${serverId}`)
+ await page.waitForURL(/\/c\/channels\/[^/]+\/[^/]+/, { timeout: 20_000 })
const body = `hello world ${Date.now()}`
await sendMessage(page, body)
@@ -31,8 +31,8 @@ test.describe.serial("server → channel → message", () => {
test("empty message does not send; Shift+Enter inserts a newline", async ({ asUser }) => {
const { page } = await asUser("alice")
- await page.goto(`/community/channels/${serverId}`)
- await page.waitForURL(/\/community\/channels\/[^/]+\/[^/]+/, { timeout: 20_000 })
+ await page.goto(`/c/channels/${serverId}`)
+ await page.waitForURL(/\/c\/channels\/[^/]+\/[^/]+/, { timeout: 20_000 })
const input = page.getByTestId(tid.composerInput)
await input.click()
diff --git a/src/web/src/test/e2e-ui/03-realtime-multiuser.spec.ts b/src/web/src/test/e2e-ui/03-realtime-multiuser.spec.ts
index a0343ebb8..18a08e898 100644
--- a/src/web/src/test/e2e-ui/03-realtime-multiuser.spec.ts
+++ b/src/web/src/test/e2e-ui/03-realtime-multiuser.spec.ts
@@ -21,8 +21,8 @@ test.describe.serial("multi-user realtime", () => {
test("Alice's message reaches Bob live", async ({ asUser }) => {
const alice = await asUser("alice")
const bob = await asUser("bob")
- await alice.page.goto(`/community/channels/${serverId}/${channelId}`)
- await bob.page.goto(`/community/channels/${serverId}/${channelId}`)
+ await alice.page.goto(`/c/channels/${serverId}/${channelId}`)
+ await bob.page.goto(`/c/channels/${serverId}/${channelId}`)
await alice.page.waitForURL(new RegExp(channelId), { timeout: 20_000 })
await bob.page.waitForURL(new RegExp(channelId), { timeout: 20_000 })
@@ -35,8 +35,8 @@ test.describe.serial("multi-user realtime", () => {
test("Bob sees Alice's typing indicator, which clears after her message", async ({ asUser }) => {
const alice = await asUser("alice")
const bob = await asUser("bob")
- await alice.page.goto(`/community/channels/${serverId}/${channelId}`)
- await bob.page.goto(`/community/channels/${serverId}/${channelId}`)
+ await alice.page.goto(`/c/channels/${serverId}/${channelId}`)
+ await bob.page.goto(`/c/channels/${serverId}/${channelId}`)
await bob.page.waitForURL(new RegExp(channelId), { timeout: 20_000 })
await alice.page.getByTestId(tid.composerInput).click()
diff --git a/src/web/src/test/e2e-ui/04-dm.spec.ts b/src/web/src/test/e2e-ui/04-dm.spec.ts
index 711ffe911..ba79294ec 100644
--- a/src/web/src/test/e2e-ui/04-dm.spec.ts
+++ b/src/web/src/test/e2e-ui/04-dm.spec.ts
@@ -12,8 +12,8 @@ test.describe.serial("direct messages", () => {
const alice = await asUser("alice")
const bob = await asUser("bob")
- await alice.page.goto(`/community/me/${dmId}`)
- await bob.page.goto("/community/me")
+ await alice.page.goto(`/c/me/${dmId}`)
+ await bob.page.goto("/c/me")
await alice.page.waitForURL(new RegExp(dmId), { timeout: 20_000 })
const body = `dm hello ${Date.now()}`
@@ -34,7 +34,7 @@ test.describe.serial("direct messages", () => {
await seedBlock("carol", userId("bob"))
const carol = await asUser("carol")
- await carol.page.goto(`/community/me/${dmId}`)
+ await carol.page.goto(`/c/me/${dmId}`)
await carol.page.waitForURL(new RegExp(dmId), { timeout: 20_000 })
await expect(carol.page.getByTestId(tid.dmBlockedNotice)).toBeVisible()
diff --git a/src/web/src/test/e2e-ui/05-mention-bot.spec.ts b/src/web/src/test/e2e-ui/05-mention-bot.spec.ts
index 49e1164ce..e130c0178 100644
--- a/src/web/src/test/e2e-ui/05-mention-bot.spec.ts
+++ b/src/web/src/test/e2e-ui/05-mention-bot.spec.ts
@@ -19,7 +19,7 @@ test.describe.serial("mentions", () => {
test("the @-mention popup lists server members", async ({ asUser }) => {
const { page } = await asUser("alice")
- await page.goto(`/community/channels/${serverId}/${channelId}`)
+ await page.goto(`/c/channels/${serverId}/${channelId}`)
await page.waitForURL(new RegExp(channelId), { timeout: 20_000 })
const editable = composerEditable(page)
@@ -34,7 +34,7 @@ test.describe.serial("mentions", () => {
test("@everyone is offered in a channel", async ({ asUser }) => {
const { page } = await asUser("alice")
- await page.goto(`/community/channels/${serverId}/${channelId}`)
+ await page.goto(`/c/channels/${serverId}/${channelId}`)
await page.waitForURL(new RegExp(channelId), { timeout: 20_000 })
const editable = composerEditable(page)
diff --git a/src/web/src/test/e2e-ui/06-channel-member-admin.spec.ts b/src/web/src/test/e2e-ui/06-channel-member-admin.spec.ts
index 8f2bbde35..b227a868f 100644
--- a/src/web/src/test/e2e-ui/06-channel-member-admin.spec.ts
+++ b/src/web/src/test/e2e-ui/06-channel-member-admin.spec.ts
@@ -17,14 +17,14 @@ test.describe.serial("channel & member admin", () => {
test("a non-member is ejected when hitting the server URL directly", async ({ asUser }) => {
// Carol is not a member of Alice's server.
const { page } = await asUser("carol")
- await page.goto(`/community/channels/${serverId}/${channelId}`)
+ await page.goto(`/c/channels/${serverId}/${channelId}`)
// She's redirected away from the server she can't access.
await expect(page).not.toHaveURL(new RegExp(`/channels/${serverId}/${channelId}$`), { timeout: 20_000 })
})
test("the member list shows server members", async ({ asUser }) => {
const { page } = await asUser("alice")
- await page.goto(`/community/channels/${serverId}/${channelId}`)
+ await page.goto(`/c/channels/${serverId}/${channelId}`)
await page.waitForURL(new RegExp(channelId), { timeout: 20_000 })
// Open the members panel via the channel header.
await page.getByRole("button", { name: /member/i }).first().click()
diff --git a/src/web/src/test/e2e-ui/07-invite.spec.ts b/src/web/src/test/e2e-ui/07-invite.spec.ts
index 84f349051..d197c2f10 100644
--- a/src/web/src/test/e2e-ui/07-invite.spec.ts
+++ b/src/web/src/test/e2e-ui/07-invite.spec.ts
@@ -15,10 +15,10 @@ test.describe.serial("invite accept", () => {
test("Bob accepts the invite and lands in the server", async ({ asUser }) => {
const { page } = await asUser("bob")
- await page.goto(`/community/invite/${inviteToken}`)
+ await page.goto(`/c/invite/${inviteToken}`)
// Accept via the join CTA.
await page.getByRole("button", { name: /join server/i }).first().click()
- await page.waitForURL(new RegExp(`/community/channels/${serverId}`), { timeout: 20_000 })
- await expect(page).toHaveURL(new RegExp(`/community/channels/${serverId}`))
+ await page.waitForURL(new RegExp(`/c/channels/${serverId}`), { timeout: 20_000 })
+ await expect(page).toHaveURL(new RegExp(`/c/channels/${serverId}`))
})
})
diff --git a/src/web/src/test/e2e-ui/08-mobile.spec.ts b/src/web/src/test/e2e-ui/08-mobile.spec.ts
index 81c5206b7..444862783 100644
--- a/src/web/src/test/e2e-ui/08-mobile.spec.ts
+++ b/src/web/src/test/e2e-ui/08-mobile.spec.ts
@@ -18,7 +18,7 @@ test.describe.serial("mobile layout", () => {
test("opening a channel shows the messages zone with a back button", async ({ asUser }) => {
const { page } = await asUser("alice")
- await page.goto(`/community/channels/${serverId}/${channelId}`)
+ await page.goto(`/c/channels/${serverId}/${channelId}`)
await page.waitForURL(new RegExp(channelId), { timeout: 20_000 })
// Composer (messages zone) is present.
diff --git a/src/web/src/test/e2e-ui/09-forum-thread.spec.ts b/src/web/src/test/e2e-ui/09-forum-thread.spec.ts
index 510170d91..03dde6fd7 100644
--- a/src/web/src/test/e2e-ui/09-forum-thread.spec.ts
+++ b/src/web/src/test/e2e-ui/09-forum-thread.spec.ts
@@ -22,7 +22,7 @@ test.describe.serial("threads", () => {
test("creating a thread from a message shows a thread indicator on the parent", async ({ asUser }) => {
const { page } = await asUser("alice")
- await page.goto(`/community/channels/${serverId}/${channelId}`)
+ await page.goto(`/c/channels/${serverId}/${channelId}`)
await page.waitForURL(new RegExp(channelId), { timeout: 20_000 })
// The seeded parent message renders (real id, not a racy optimistic row).
@@ -46,7 +46,7 @@ test.describe.serial("threads", () => {
await expect(page.getByText(reply, { exact: false }).first()).toBeVisible({ timeout: 15_000 })
// Back on the parent channel, the message now carries a thread indicator.
- await page.goto(`/community/channels/${serverId}/${channelId}`)
+ await page.goto(`/c/channels/${serverId}/${channelId}`)
await expect(row).toBeVisible({ timeout: 20_000 })
await expect(page.locator(`[data-testid^="community-thread-indicator-"]`).first()).toBeVisible({ timeout: 15_000 })
})
diff --git a/src/web/src/test/e2e-ui/10-eject-nav-auth.spec.ts b/src/web/src/test/e2e-ui/10-eject-nav-auth.spec.ts
index b2aaf3b86..ef9050906 100644
--- a/src/web/src/test/e2e-ui/10-eject-nav-auth.spec.ts
+++ b/src/web/src/test/e2e-ui/10-eject-nav-auth.spec.ts
@@ -14,23 +14,23 @@ test.describe.serial("eject, navigation & logout", () => {
test("direct URL to a server you're not in redirects away", async ({ asUser }) => {
// Carol is not a member.
const { page } = await asUser("carol")
- await page.goto(`/community/channels/${serverId}/${channelId}`)
+ await page.goto(`/c/channels/${serverId}/${channelId}`)
await expect(page).not.toHaveURL(new RegExp(`/channels/${serverId}/${channelId}$`), { timeout: 20_000 })
})
test("clicking a rail server lands on a channel, not the bare server root", async ({ asUser }) => {
// Alice owns the server; navigating via the rail resolves to a channel.
const { page } = await asUser("alice")
- await page.goto(`/community/channels/${serverId}`)
+ await page.goto(`/c/channels/${serverId}`)
// The bare-server route redirects to the first channel.
- await page.waitForURL(/\/community\/channels\/[^/]+\/[^/]+/, { timeout: 20_000 })
+ await page.waitForURL(/\/c\/channels\/[^/]+\/[^/]+/, { timeout: 20_000 })
expect(page.url()).toMatch(new RegExp(`/channels/${serverId}/[^/]+`))
})
test("logout clears the session", async ({ asUser }) => {
const { page } = await asUser("bob")
- await page.goto("/community")
- await page.waitForURL(/\/community/, { timeout: 20_000 })
+ await page.goto("/c")
+ await page.waitForURL(/\/c/, { timeout: 20_000 })
// Drive the real logout: User settings → Log Out → redirect to sign-in.
await page.getByRole("button", { name: "User settings" }).click()
@@ -38,7 +38,7 @@ test.describe.serial("eject, navigation & logout", () => {
await page.waitForURL(/\/sign-in/, { timeout: 20_000 })
// Session is actually cleared: revisiting a protected route stays bounced.
- await page.goto("/community")
+ await page.goto("/c")
await page.waitForURL(/\/sign-in/, { timeout: 20_000 })
await expect(page).toHaveURL(/\/sign-in/)
})
diff --git a/src/web/src/test/e2e-ui/11-profile-ui-stability.spec.ts b/src/web/src/test/e2e-ui/11-profile-ui-stability.spec.ts
index 4d820e129..78ccce850 100644
--- a/src/web/src/test/e2e-ui/11-profile-ui-stability.spec.ts
+++ b/src/web/src/test/e2e-ui/11-profile-ui-stability.spec.ts
@@ -17,7 +17,7 @@ test.describe.serial("profile card stability", () => {
test("opening a member profile shows the card; closing detaches it", async ({ asUser }) => {
const { page } = await asUser("alice")
- await page.goto(`/community/channels/${serverId}/${channelId}`)
+ await page.goto(`/c/channels/${serverId}/${channelId}`)
await page.waitForURL(new RegExp(channelId), { timeout: 20_000 })
// Open the members panel and click Bob's row → profile card.
diff --git a/src/web/src/test/e2e-ui/12-friends.spec.ts b/src/web/src/test/e2e-ui/12-friends.spec.ts
index 4590f15d3..5af4f237a 100644
--- a/src/web/src/test/e2e-ui/12-friends.spec.ts
+++ b/src/web/src/test/e2e-ui/12-friends.spec.ts
@@ -11,8 +11,8 @@ test.describe.serial("friends", () => {
test("a friend shows in the friends list and opens a DM", async ({ asUser }) => {
const { page } = await asUser("alice")
- await page.goto("/community/me")
- await page.waitForURL(/\/community\/me/, { timeout: 20_000 })
+ await page.goto("/c/me")
+ await page.waitForURL(/\/c\/me/, { timeout: 20_000 })
// Bob appears in the friends list (his dev display name = email local-part).
const bobRow = page.getByText(userName("bob"), { exact: false }).first()
@@ -20,7 +20,7 @@ test.describe.serial("friends", () => {
// Left-click opens the DM with Bob.
await bobRow.click()
- await page.waitForURL(/\/community\/me\/[^/]+/, { timeout: 20_000 })
- expect(page.url()).toMatch(/\/community\/me\/[^/]+/)
+ await page.waitForURL(/\/c\/me\/[^/]+/, { timeout: 20_000 })
+ expect(page.url()).toMatch(/\/c\/me\/[^/]+/)
})
})
diff --git a/src/web/src/test/e2e-ui/_fixtures/actions.ts b/src/web/src/test/e2e-ui/_fixtures/actions.ts
index bbdc49f81..f342520f8 100644
--- a/src/web/src/test/e2e-ui/_fixtures/actions.ts
+++ b/src/web/src/test/e2e-ui/_fixtures/actions.ts
@@ -18,8 +18,8 @@ export async function createServer(page: Page, name: string, opts?: { autoDialog
await page.getByTestId(tid.createServerSubmit).click()
// Land on the new server's default channel.
- await page.waitForURL(/\/community\/channels\/[^/]+\/[^/]+/, { timeout: 20_000 })
- const m = page.url().match(/\/community\/channels\/([^/]+)\//)
+ await page.waitForURL(/\/c\/channels\/[^/]+\/[^/]+/, { timeout: 20_000 })
+ const m = page.url().match(/\/c\/channels\/([^/]+)\//)
if (!m) throw new Error(`createServer: no serverId in URL ${page.url()}`)
return m[1]
}
@@ -37,7 +37,7 @@ export async function createChannel(page: Page, categoryName: string, channelNam
export async function openServer(page: Page, serverId: string): Promise<void> {
await page.getByTestId(tid.serverIcon(serverId)).click()
- await page.waitForURL(new RegExp(`/community/channels/${serverId}/`), { timeout: 20_000 })
+ await page.waitForURL(new RegExp(`/c/channels/${serverId}/`), { timeout: 20_000 })
}
export async function openChannel(page: Page, channelId: string): Promise<void> {
diff --git a/src/web/src/test/e2e-ui/_setup/auth.ts b/src/web/src/test/e2e-ui/_setup/auth.ts
index 1100b3360..5a2251cc0 100644
--- a/src/web/src/test/e2e-ui/_setup/auth.ts
+++ b/src/web/src/test/e2e-ui/_setup/auth.ts
@@ -2,8 +2,8 @@ import { chromium } from "@playwright/test"
import { WEB_URL } from "./paths"
import { emailFor, type SeededUser, type UserKey } from "./users"
-// Drives the real dev sign-in UI: navigating to /community first makes
-// middleware redirect to /sign-in?redirect=/community, so post-login lands
+// Drives the real dev sign-in UI: navigating to /c first makes
+// middleware redirect to /sign-in?redirect=/c, so post-login lands
// back in community (default is /workspaces?auto otherwise). In dev the form
// is email-only — `handleDevSignIn` signs in with DEV_PASSWORD and
// auto-registers on first use. Captures storageState + the seeded userId.
@@ -20,7 +20,7 @@ export async function loginAndSaveState(
const context = await browser.newContext()
const page = await context.newPage()
try {
- await page.goto(`${WEB_URL}/community`)
+ await page.goto(`${WEB_URL}/c`)
await page.waitForURL(/\/sign-in/, { timeout: 30_000 })
await page.getByRole("textbox", { name: "Email" }).fill(email)