Skip to content

Commit 6e1b273

Browse files
committed
channel rename + large new button
1 parent 9beff6e commit 6e1b273

18 files changed

Lines changed: 246 additions & 84 deletions

packages/ui/src/features/browser-tabs/BrowserTabStrip.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ export function BrowserTabStrip() {
525525
const meta = channelSectionFor(section);
526526
return {
527527
id: t.id,
528-
label: meta?.label ?? channel ?? "Context",
528+
label: meta?.label ?? channel ?? "Channel",
529529
icon: <SquircleDashed size={14} />,
530530
channelName: channel,
531531
// No section meta → the channel's index page.

packages/ui/src/features/canvas/components/ActivityView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ export function ActivityView() {
176176
Activity
177177
</Text>
178178
<Text size="2" className="block text-muted-foreground">
179-
Mentions of you across contexts.
179+
Mentions of you across channels.
180180
</Text>
181181
<div className="mt-4">
182182
{isLoading && items.length === 0 ? (

packages/ui/src/features/canvas/components/ChannelContextPanel.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ describe("ChannelContextPanel", () => {
6363
const user = userEvent.setup();
6464
const onClose = renderPanel();
6565
await user.click(
66-
screen.getByRole("button", { name: "Close context panel" }),
66+
screen.getByRole("button", { name: "Close CONTEXT.md panel" }),
6767
);
6868
expect(onClose).toHaveBeenCalledTimes(1);
6969
});

packages/ui/src/features/canvas/components/ChannelContextPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export function ChannelContextPanel({
3535
<button
3636
type="button"
3737
onClick={onClose}
38-
aria-label="Close context panel"
38+
aria-label="Close CONTEXT.md panel"
3939
className="flex size-6 shrink-0 items-center justify-center rounded text-gray-10 hover:bg-gray-4 hover:text-gray-12"
4040
>
4141
<X size={14} />

packages/ui/src/features/canvas/components/ChannelHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export function ChannelHeader({ channelId }: { channelId: string }) {
3434
className="shrink-0 text-muted-foreground/80"
3535
/>
3636
<Text className="min-w-0 truncate font-medium" title={channelName}>
37-
{channelName ?? "Context"}
37+
{channelName ?? "Channel"}
3838
</Text>
3939
</Button>
4040
<ChannelTabs channelId={channelId} />

packages/ui/src/features/canvas/components/ChannelIntro.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ export function ChannelIntro({
5555
<span className={mentionChipClass}>
5656
@{userDisplayName(creator ?? null)}
5757
</span>{" "}
58-
created this context {creationDatePhrase(channel.created_at)}. This
58+
created this channel {creationDatePhrase(channel.created_at)}. This
5959
is the very beginning of the{" "}
60-
<Text weight="bold">{channelName}</Text> context.
60+
<Text weight="bold">{channelName}</Text> channel.
6161
</Text>
6262
)}
6363
</div>
@@ -70,7 +70,7 @@ export function ChannelIntro({
7070
<ItemContent className="self-start">
7171
<ItemTitle>Created context.md</ItemTitle>
7272
<ItemDescription className="text-xs">
73-
Used in all sessions within this context
73+
Used in all sessions within this channel
7474
</ItemDescription>
7575
</ItemContent>
7676
</Item>
@@ -125,9 +125,10 @@ export function ChannelIntro({
125125
<Info size={18} />
126126
</ItemMedia>
127127
<ItemContent className="self-start">
128-
<ItemTitle>Learn more about contexts</ItemTitle>
128+
<ItemTitle>Learn more about channels</ItemTitle>
129129
<ItemDescription className="text-xs">
130-
Context is a group of tasks that are related to a specific topic.
130+
A channel is a group of tasks that are related to a specific
131+
topic.
131132
</ItemDescription>
132133
</ItemContent>
133134
</Item>
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
import { FileTextIcon, PlusIcon } from "@phosphor-icons/react";
2+
import {
3+
Button,
4+
DropdownMenu,
5+
DropdownMenuContent,
6+
DropdownMenuItem,
7+
DropdownMenuTrigger,
8+
Tooltip,
9+
TooltipContent,
10+
TooltipTrigger,
11+
} from "@posthog/quill";
12+
import { CreateChannelModal } from "@posthog/ui/features/canvas/components/CreateChannelModal";
13+
import { openTaskInput } from "@posthog/ui/router/useOpenTask";
14+
import { useRouterState } from "@tanstack/react-router";
15+
import { SquircleDashed } from "lucide-react";
16+
import { useState } from "react";
17+
18+
// The create affordance for the Channels space, floated over the bottom-right
19+
// of the channel list. It owns the create-channel modal (the list itself has no
20+
// other entry point) and opens its menu upward, since it sits at the bottom.
21+
export function ChannelsFab() {
22+
const [modalOpen, setModalOpen] = useState(false);
23+
// New task has no /website mirror yet, so it jumps back to Code unless we're
24+
// already in the Channels space — same rule as the nav's New task row.
25+
const inChannels = useRouterState({
26+
select: (s) => s.location.pathname.startsWith("/website"),
27+
});
28+
29+
return (
30+
<>
31+
<DropdownMenu>
32+
<Tooltip>
33+
<TooltipTrigger
34+
render={
35+
<DropdownMenuTrigger
36+
render={
37+
<Button
38+
variant="primary"
39+
size="icon-lg"
40+
aria-label="Create"
41+
className="absolute right-3 bottom-3 z-10 rounded-full shadow-lg"
42+
>
43+
<PlusIcon size={20} weight="bold" />
44+
</Button>
45+
}
46+
/>
47+
}
48+
/>
49+
<TooltipContent side="top" align="center">
50+
Create something new
51+
</TooltipContent>
52+
</Tooltip>
53+
<DropdownMenuContent align="center" side="top" sideOffset={6}>
54+
<DropdownMenuItem onClick={() => setModalOpen(true)}>
55+
<SquircleDashed size={14} className="text-gray-9" />
56+
New channel
57+
</DropdownMenuItem>
58+
<DropdownMenuItem
59+
onClick={() =>
60+
openTaskInput(inChannels ? { space: "website" } : undefined)
61+
}
62+
>
63+
<FileTextIcon size={14} className="text-gray-9" />
64+
New task
65+
</DropdownMenuItem>
66+
</DropdownMenuContent>
67+
</DropdownMenu>
68+
69+
<CreateChannelModal open={modalOpen} onOpenChange={setModalOpen} />
70+
</>
71+
);
72+
}

0 commit comments

Comments
 (0)