Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(desktop): show personal space without a hash (#82994)

Shy Alter2745f2b26ce5
diff --git a/products/desktop/packages/core/src/canvas/canvasApplicationService.ts b/products/desktop/packages/core/src/canvas/canvasApplicationService.ts
index 3fc0889fd2f3..64fe5c614aae 100644
--- a/products/desktop/packages/core/src/canvas/canvasApplicationService.ts
+++ b/products/desktop/packages/core/src/canvas/canvasApplicationService.ts
@@ -1,3 +1,4 @@
+import { channelDisplayReference } from "@posthog/core/canvas/channelName";
import {
REPORT_MODEL_RESOLVER,
type ReportModelResolver,
@@ -154,7 +155,7 @@ export class CanvasApplicationService {
}),
taskDescription: input.name
? `Generate canvas "${input.name}"`
- : `Generate a canvas in #${input.channelName}`,
+ : `Generate a canvas in ${channelDisplayReference(input.channelName)}`,
// Unattended generation: run in auto mode so it doesn't stall on
// edit-approval prompts.
executionMode: "auto" as const,
diff --git a/products/desktop/packages/core/src/canvas/channelName.test.ts b/products/desktop/packages/core/src/canvas/channelName.test.ts
index 984da91ff9ae..1ba129a97e1f 100644
--- a/products/desktop/packages/core/src/canvas/channelName.test.ts
+++ b/products/desktop/packages/core/src/canvas/channelName.test.ts
@@ -1,5 +1,7 @@
import { describe, expect, it } from "vitest";
import {
+ channelDisplayLabel,
+ channelDisplayReference,
normalizeChannelName,
normalizeChannelNameInput,
validateChannelName,
@@ -26,6 +28,27 @@ describe("normalizeChannelName", () => {
});
});
+describe("channelDisplayLabel", () => {
+ it.each([
+ ["me", undefined, "personal space"],
+ ["personal", undefined, "personal space"],
+ ["personal space", undefined, "personal space"],
+ ["personal", "personal" as const, "personal space"],
+ ["personal", "public" as const, "#personal"],
+ ["engineering", "public" as const, "#engineering"],
+ ])("formats %j (%s) as %j", (name, channelType, expected) => {
+ expect(channelDisplayLabel(name, channelType)).toBe(expected);
+ });
+
+ it.each([
+ ["me", undefined, "your personal space"],
+ ["personal", undefined, "your personal space"],
+ ["engineering", "public" as const, "#engineering"],
+ ])("references %j (%s) as %j", (name, channelType, expected) => {
+ expect(channelDisplayReference(name, channelType)).toBe(expected);
+ });
+});
+
describe("validateChannelName", () => {
it.each([
"mobile",
diff --git a/products/desktop/packages/core/src/canvas/channelName.ts b/products/desktop/packages/core/src/canvas/channelName.ts
index b7bd01b096be..3c5b77007990 100644
--- a/products/desktop/packages/core/src/canvas/channelName.ts
+++ b/products/desktop/packages/core/src/canvas/channelName.ts
@@ -12,7 +12,8 @@ export const PERSONAL_CHANNEL_NAME = "me";
* Lives in core because names reach a reader by more routes than the channel
* list — an activity row and a mention both carry one of their own.
*/
-export const PERSONAL_CHANNEL_LABEL = "personal";
+export const PERSONAL_CHANNEL_LABEL = "personal space";
+const LEGACY_PERSONAL_CHANNEL_LABEL = "personal";
/** A channel's name as a reader should see it. */
export function channelDisplayName(name: string): string;
@@ -21,6 +22,35 @@ export function channelDisplayName(name: string | null): string | null {
return name === PERSONAL_CHANNEL_NAME ? PERSONAL_CHANNEL_LABEL : name;
}
+function isPersonalChannelLabel(
+ name: string,
+ channelType?: "public" | "personal",
+): boolean {
+ return channelType !== undefined
+ ? channelType === "personal"
+ : name === PERSONAL_CHANNEL_NAME ||
+ name === PERSONAL_CHANNEL_LABEL ||
+ name === LEGACY_PERSONAL_CHANNEL_LABEL;
+}
+
+export function channelDisplayLabel(
+ name: string,
+ channelType?: "public" | "personal",
+): string {
+ return isPersonalChannelLabel(name, channelType)
+ ? PERSONAL_CHANNEL_LABEL
+ : `#${channelDisplayName(name)}`;
+}
+
+export function channelDisplayReference(
+ name: string,
+ channelType?: "public" | "personal",
+): string {
+ return isPersonalChannelLabel(name, channelType)
+ ? `your ${PERSONAL_CHANNEL_LABEL}`
+ : `#${channelDisplayName(name)}`;
+}
+
// A channel's name is used verbatim as its server-side filesystem path segment,
// so it must be directory-safe: lowercase letters, numbers, and hyphens only.
export const CHANNEL_NAME_PATTERN = /^[a-z0-9-]+$/;
@@ -49,7 +79,7 @@ export function normalizeChannelName(name: string): string {
*/
const RESERVED_CHANNEL_NAMES = new Set([
PERSONAL_CHANNEL_NAME,
- PERSONAL_CHANNEL_LABEL,
+ LEGACY_PERSONAL_CHANNEL_LABEL,
]);
export function validateChannelName(name: string): string | null {
diff --git a/products/desktop/packages/core/src/context-menu/context-menu.test.ts b/products/desktop/packages/core/src/context-menu/context-menu.test.ts
index d84bce9707a2..49b69eec23da 100644
--- a/products/desktop/packages/core/src/context-menu/context-menu.test.ts
+++ b/products/desktop/packages/core/src/context-menu/context-menu.test.ts
@@ -168,6 +168,12 @@ describe("ContextMenuService.showTaskContextMenu", () => {
const result = makeService(menu).showTaskContextMenu({
...baseTask,
channels: [
+ {
+ id: "0",
+ name: "personal",
+ channelType: "personal",
+ starred: true,
+ },
{ id: "1", name: "alpha" },
{ id: "2", name: "beta", starred: true },
{ id: "3", name: "gamma" },
@@ -176,7 +182,13 @@ describe("ContextMenuService.showTaskContextMenu", () => {
});
await menu.shown;
const submenu = findItem(menu.lastItems, "File to…").submenu ?? [];
- expect(labels(submenu)).toEqual(["#beta", "#delta", "#alpha", "#gamma"]);
+ expect(labels(submenu)).toEqual([
+ "personal space",
+ "#beta",
+ "#delta",
+ "#alpha",
+ "#gamma",
+ ]);
findSubmenuItem(menu.lastItems, "File to…", "#delta").click();
expect(await result).toEqual({
action: { type: "file-to-channel", channelId: "4" },
@@ -271,11 +283,17 @@ describe("ContextMenuService.showBulkTaskContextMenu", () => {
channels: [
{ id: "c1", name: "support" },
{ id: "c2", name: "design", starred: true },
+ {
+ id: "c3",
+ name: "personal",
+ channelType: "personal",
+ starred: true,
+ },
],
});
await menu.shown;
const submenu = findItem(menu.lastItems, "File to…").submenu ?? [];
- expect(labels(submenu)).toEqual(["#design", "#support"]);
+ expect(labels(submenu)).toEqual(["#design", "personal space", "#support"]);
});
it("gates archive on confirmation", async () => {
diff --git a/products/desktop/packages/core/src/context-menu/context-menu.ts b/products/desktop/packages/core/src/context-menu/context-menu.ts
index 68564a361c32..5bb16aaf36af 100644
--- a/products/desktop/packages/core/src/context-menu/context-menu.ts
+++ b/products/desktop/packages/core/src/context-menu/context-menu.ts
@@ -1,3 +1,4 @@
+import { channelDisplayLabel } from "@posthog/core/canvas/channelName";
import {
formatBulkArchiveWarning,
sessionsLabel,
@@ -134,9 +135,7 @@ export class ContextMenuService {
type: "submenu",
label: "File to…",
items: this.starredFirst(channels).map((c) => ({
- // Channel names are stored bare; every surface that shows one
- // adds the hash.
- label: `#${c.name}`,
+ label: channelDisplayLabel(c.name, c.channelType),
action: {
type: "file-to-channel" as const,
channelId: c.id,
@@ -227,9 +226,7 @@ export class ContextMenuService {
type: "submenu" as const,
label: "File to…",
items: this.starredFirst(channels).map((c) => ({
- // Channel names are stored bare; every surface that shows one
- // adds the hash.
- label: `#${c.name}`,
+ label: channelDisplayLabel(c.name, c.channelType),
action: {
type: "file-to-channel" as const,
channelId: c.id,
diff --git a/products/desktop/packages/core/src/context-menu/schemas.ts b/products/desktop/packages/core/src/context-menu/schemas.ts
index a622968dad12..2667f78404c7 100644
--- a/products/desktop/packages/core/src/context-menu/schemas.ts
+++ b/products/desktop/packages/core/src/context-menu/schemas.ts
@@ -4,6 +4,7 @@ import { z } from "zod";
const fileToChannel = z.object({
id: z.string(),
name: z.string(),
+ channelType: z.enum(["public", "personal"]).optional(),
starred: z.boolean().optional(),
});
diff --git a/products/desktop/packages/ui/src/features/canvas/AGENTS.md b/products/desktop/packages/ui/src/features/canvas/AGENTS.md
index f2b1770e89b6..2efebf601995 100644
--- a/products/desktop/packages/ui/src/features/canvas/AGENTS.md
+++ b/products/desktop/packages/ui/src/features/canvas/AGENTS.md
@@ -51,13 +51,14 @@ The root `AGENTS.md` architecture rules still apply.
horizontal swipe moves between them (`useChannelPaneSwipe`, wheel `deltaX`
accumulated per gesture and locked until the wheel goes quiet).
- In the list, "Starred"/"Spaces" are headings above lightly indented rows. The
- private "personal" row leads the Starred section and takes the same inset as the
+ private "personal space" row leads the Starred section and takes the same inset as the
spaces beside it. It is the one row that carries a glyph: the lock is the only
thing saying nobody else can see this space, which is worth its name starting a
glyph's width right of the others. The alpha's more deeply indented Channels
tree and hash glyphs are unchanged.
-- **The private space reads as "personal", and only on screen.** The row is `me`
+- **The private space reads as "personal space" without a hash, and only on screen.** The row is `me`
on the backend; `channelDisplayName` (core) swaps it on the way to a reader.
+ `channelDisplayLabel` adds a hash to shared spaces but leaves personal bare.
Four routes carry a channel's name — the channel list, an activity row, a
mention row, and remote search — and each calls it, because only the first
goes through `useTaskChannels`.
diff --git a/products/desktop/packages/ui/src/features/canvas/components/ActivityTimeline.tsx b/products/desktop/packages/ui/src/features/canvas/components/ActivityTimeline.tsx
index bba6cc7435ec..237f47c2eac3 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/ActivityTimeline.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/ActivityTimeline.tsx
@@ -8,6 +8,7 @@ import {
buildActivityTimeline,
type UserMessageLike,
} from "@posthog/core/canvas/activityTimeline";
+import { channelDisplayLabel } from "@posthog/core/canvas/channelName";
import type { ThreadTimelineRow } from "@posthog/core/canvas/threadTimeline";
import { DEFAULT_TAB_IDS } from "@posthog/core/panels/panelConstants";
import { findTabInTree } from "@posthog/core/panels/panelTree";
@@ -122,7 +123,7 @@ function UserMessageRow({
<FileTextIcon size={12} />
<span className="truncate text-xs">
{channelContext.mention.name
- ? `#${channelContext.mention.name} `
+ ? `${channelDisplayLabel(channelContext.mention.name)} `
: ""}
CONTEXT.md
</span>
diff --git a/products/desktop/packages/ui/src/features/canvas/components/ActivityView.test.tsx b/products/desktop/packages/ui/src/features/canvas/components/ActivityView.test.tsx
index 8e138eadf826..7ac883b19f92 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/ActivityView.test.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/ActivityView.test.tsx
@@ -101,16 +101,19 @@ describe("activityHeadline", () => {
expect(getByText(expected)).toBeInTheDocument();
});
- it("prefixes channel names with a hash", () => {
+ it.each([
+ ["shared channel", "engineering", "#engineering"],
+ ["personal channel", "personal", "your personal space"],
+ ])("formats the %s label", (_name, channelName, expected) => {
const { getByText } = render(
<div>
{activityHeadline(
- item({ activityKind: "completed", channelName: "me" }),
+ item({ activityKind: "completed", channelName }),
)}
</div>,
);
- expect(getByText("#me")).toBeInTheDocument();
+ expect(getByText(expected)).toBeInTheDocument();
});
it("opens an activity mention at its exact comment thread", () => {
diff --git a/products/desktop/packages/ui/src/features/canvas/components/ActivityView.tsx b/products/desktop/packages/ui/src/features/canvas/components/ActivityView.tsx
index 01f421f8d7dc..756e7183ee84 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/ActivityView.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/ActivityView.tsx
@@ -5,6 +5,7 @@ import {
LinkIcon,
RobotIcon,
} from "@phosphor-icons/react";
+import { channelDisplayReference } from "@posthog/core/canvas/channelName";
import type { TaskActivityItem } from "@posthog/core/canvas/taskActivity";
import {
Avatar,
@@ -66,9 +67,9 @@ function ChannelSuffix({ channelName }: { channelName: string | null }) {
return (
<>
{" in "}
- <Text as="span" size="1" weight="medium">
- #{channelName}
- </Text>
+ <span className="font-medium text-xs">
+ {channelDisplayReference(channelName)}
+ </span>
</>
);
}
diff --git a/products/desktop/packages/ui/src/features/canvas/components/ChannelsList.test.tsx b/products/desktop/packages/ui/src/features/canvas/components/ChannelsList.test.tsx
index a91e0c9d894e..d9c12b483ea6 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/ChannelsList.test.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/ChannelsList.test.tsx
@@ -208,14 +208,14 @@ describe("ChannelsList", () => {
it("pins the personal space above the channels, with its ⌘1 shortcut", () => {
renderList();
- const me = screen.getByText("personal");
+ const me = screen.getByText("personal space");
const eng = screen.getByText("engineering");
expect(
me.compareDocumentPosition(eng) & Node.DOCUMENT_POSITION_FOLLOWING,
).toBeTruthy();
// ChannelHotkeys binds ⌘1-9 to the same slots; the list is where they're
// advertised now that the switcher popover is gone.
- expect(me.parentElement?.textContent).toMatch(/personal(⌘|Ctrl)/);
+ expect(me.parentElement?.textContent).toMatch(/personal space(⌘|Ctrl)/);
});
describe("group headings", () => {
@@ -244,7 +244,7 @@ describe("ChannelsList", () => {
expect(screen.getByText("engineering")).toBeTruthy();
expect(screen.queryByText("design")).toBeNull();
- expect(screen.queryByText("personal")).toBeNull();
+ expect(screen.queryByText("personal space")).toBeNull();
});
// Grouping is for browsing; once you've named what you want, "Starred" and
@@ -267,9 +267,9 @@ describe("ChannelsList", () => {
mocks.channelsLayout = false;
renderList();
expect(screen.queryByLabelText("Search spaces")).toBeNull();
- expect(screen.getByText("personal").parentElement?.textContent).toBe(
- "personal",
- );
+ expect(
+ screen.getByText("personal space").parentElement?.textContent,
+ ).toBe("personal space");
});
it("says so when nothing matches", async () => {
diff --git a/products/desktop/packages/ui/src/features/canvas/components/ChannelsList.tsx b/products/desktop/packages/ui/src/features/canvas/components/ChannelsList.tsx
index 465a5659eb5c..e0ee8799602c 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/ChannelsList.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/ChannelsList.tsx
@@ -1296,11 +1296,11 @@ const ChannelSection = memo(
),
);
-// The user's private "#me" channel, pinned above the shared channel list.
+// The user's private channel, named personal, is pinned above the shared list.
// Provisioned lazily server-side when the channel list is fetched, so the row
// only has to find it — there is no client-side create.
/**
- * Opening the "me" row, shared by the row itself and the search results.
+ * Opening the personal row, shared by the row itself and the search results.
*
* The personal channel appears with the first channel-list fetch; until then
* the row's actions have nothing truthful to act on, so they explain rather
@@ -1318,8 +1318,9 @@ function useOpenPersonalChannel(): {
const ensureChannelId = (): string | undefined => {
const meChannel = channels.find((c) => c.channelType === "personal");
if (!meChannel) {
- toast.error("Couldn't open me", {
- description: "Your personal channel is still loading.",
+ toast.error("Couldn't open personal space", {
+ description:
+ "Your personal space is still loading. Try again in a moment.",
});
return undefined;
}
@@ -1442,7 +1443,7 @@ const PersonalChannelRow = memo(function PersonalChannelRow({
optionValue={meChannel?.id ?? PERSONAL_ROW_VALUE}
data-selected={(isActive && !expanded) || undefined}
onClick={openPersonalChannel}
- // "me" is a starred space among the others now, so it takes the same
+ // Personal is a starred space among the others, so it takes the same
// inset rather than sitting out at the heading's margin.
className={spacesLayout ? "pl-2" : undefined}
>
@@ -1639,8 +1640,8 @@ function ChannelGroup({
);
}
-// The channel list — the list pane of the sidebar slider. The private "#me"
-// channel is pinned at the top; starred channels surface in their own section
+// The channel list is the list pane of the sidebar slider. The personal channel
+// is pinned at the top; starred channels surface in their own section
// so the ones you use most stay in reach; the rest sit under a "Channels"
// label. Creating anything goes through the floating ChannelsFab, mounted by
// the sidebar outside this scroll region.
@@ -1664,7 +1665,7 @@ export function ChannelsList() {
const matches = (name: string) =>
!normalizedQuery || name.toLowerCase().includes(normalizedQuery);
- // The personal channel renders as the pinned "#me" row, not a shared channel.
+ // The personal channel renders as a pinned row, not a shared channel.
const me = allChannels.find((c) => c.channelType === "personal");
const channels = allChannels.filter((c) => c.channelType !== "personal");
const starred = channels.filter((c) => c.starred);
@@ -1765,7 +1766,7 @@ export function ChannelsList() {
// section is open — a folded section is still somewhere ↓ can land and
// → can open.
{ kind: "section", value: starredValue, sectionId: STARRED_SECTION_ID },
- // "me" leads the starred section rather than floating above it: it is
+ // Personal leads the starred section rather than floating above it. It is
// the space you always keep, so it belongs with the ones you chose to
// keep. Folding the section away takes it with them.
...(collapsedSections.has(STARRED_SECTION_ID)
@@ -1915,7 +1916,7 @@ export function ChannelsList() {
</>
) : (
<>
- {/* Always rendered: "me" lives here, so the section is never empty. */}
+ {/* Always rendered: personal lives here, so the section is never empty. */}
<ChannelGroup
sectionId={STARRED_SECTION_ID}
label="Starred"
diff --git a/products/desktop/packages/ui/src/features/canvas/components/WebsiteChannelLoops.tsx b/products/desktop/packages/ui/src/features/canvas/components/WebsiteChannelLoops.tsx
index 9d0609861e04..0e40c5c376b3 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/WebsiteChannelLoops.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/WebsiteChannelLoops.tsx
@@ -1,4 +1,5 @@
import { CloudIcon, PlusIcon } from "@phosphor-icons/react";
+import { channelDisplayReference } from "@posthog/core/canvas/channelName";
import { ChannelHeader } from "@posthog/ui/features/canvas/components/ChannelHeader";
import { useChannelsLayout } from "@posthog/ui/features/canvas/hooks/useChannelsLayout";
import { useSetHeaderContent } from "@posthog/ui/hooks/useSetHeaderContent";
@@ -32,18 +33,19 @@ import { useChannels } from "../hooks/useChannels";
import { useOrgMembers } from "../hooks/useOrgMembers";
function contextQuickStarts(name: string): { label: string; prompt: string }[] {
+ const contextReference = channelDisplayReference(name);
return [
{
label: "Digest to feed",
- prompt: `On a schedule, post a short digest to #${name}'s feed summarizing `,
+ prompt: `On a schedule, post a short digest to ${contextReference}'s feed summarizing `,
},
{
label: "Keep context.md current",
- prompt: `On a schedule, update #${name}'s context.md with the latest `,
+ prompt: `On a schedule, update ${contextReference}'s context.md with the latest `,
},
{
label: "Refresh a canvas",
- prompt: `On a schedule, refresh a canvas in #${name} with `,
+ prompt: `On a schedule, refresh a canvas in ${contextReference} with `,
},
{
label: "Watch and report",
@@ -155,7 +157,8 @@ function SpaceAttachedLoops({
navigateToNewLoop();
};
- const title = `Automate #${contextName}`;
+ const contextReference = channelDisplayReference(contextName);
+ const title = `Automate ${contextReference}`;
const description =
"Put your work on autopilot. Loops run on a schedule, on an API call, or when something happens on GitHub. You can finally close the laptop!";
const createButton = (
@@ -271,7 +274,7 @@ function SpaceAttachedLoops({
>
<LoopBuilderComposer
context={{ folderId: channelId, name: contextName }}
- placeholder={`What should #${contextName} keep an eye on?`}
+ placeholder={`What should ${contextReference} keep an eye on?`}
quickStarts={contextQuickStarts(contextName)}
disabledReason={limitReason}
/>
diff --git a/products/desktop/packages/ui/src/features/canvas/components/channelGlyph.test.tsx b/products/desktop/packages/ui/src/features/canvas/components/channelGlyph.test.tsx
index 1c5b3488ddd0..3992b50bc5cd 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/channelGlyph.test.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/channelGlyph.test.tsx
@@ -5,9 +5,9 @@ import { channelGlyph, isPrivateChannel } from "./channelGlyph";
describe("isPrivateChannel", () => {
it.each([
- ["personal", true],
- [" Personal ", true],
- ["PERSONAL", true],
+ ["personal space", true],
+ [" Personal Space ", true],
+ ["PERSONAL SPACE", true],
// The backend's own name for it, which no longer reaches here: every name
// a reader sees has been through `channelDisplayName` first.
["me", false],
@@ -28,7 +28,8 @@ describe("channelGlyph", () => {
["channel", false, HashIcon],
["private space", true, LockSimpleIcon],
])("renders the %s glyph", (_, space, expectedIcon) => {
- const name = expectedIcon === LockSimpleIcon ? "personal" : "engineering";
+ const name =
+ expectedIcon === LockSimpleIcon ? "personal space" : "engineering";
const glyph = channelGlyph(name, { space }) as ReactElement;
expect(glyph.type).toBe(expectedIcon);
@@ -40,8 +41,8 @@ describe("channelGlyph", () => {
expect(channelGlyph("engineering", { space: true })).toBeNull();
});
- // The flag beats the name in both directions. Without it, a public space
- // called "personal" wore the lock and the real private space showed none.
+ // The channel type beats the fallback name in both directions so public
+ // name collisions stay unmarked and the private space always has a lock.
it("locks the private space whatever it is called", () => {
const glyph = channelGlyph("anything", {
personal: true,
diff --git a/products/desktop/packages/ui/src/features/canvas/components/channelGlyph.tsx b/products/desktop/packages/ui/src/features/canvas/components/channelGlyph.tsx
index d584e4b7a5a3..06a8ebd1bcf5 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/channelGlyph.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/channelGlyph.tsx
@@ -9,10 +9,9 @@ import type { ReactNode } from "react";
/**
* Whether only its own members can see a channel, judged by its name.
*
- * A guess, and the fallback for surfaces that hold a name and nothing else. Any
- * caller with the channel in hand should pass `personal` to `channelGlyph`
- * instead — a public space named "personal" reaches this function looking
- * exactly like the private one.
+ * This is a fallback for surfaces that hold a name and nothing else. A caller
+ * with the channel in hand must pass `personal` to avoid deciding privacy from
+ * a display label.
*/
export function isPrivateChannel(channelName: string | undefined): boolean {
if (!channelName) return false;
diff --git a/products/desktop/packages/ui/src/features/canvas/hooks/useTaskChannels.test.tsx b/products/desktop/packages/ui/src/features/canvas/hooks/useTaskChannels.test.tsx
index bef5d3d5debc..906725639c10 100644
--- a/products/desktop/packages/ui/src/features/canvas/hooks/useTaskChannels.test.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/hooks/useTaskChannels.test.tsx
@@ -58,11 +58,11 @@ describe("useTaskChannels", () => {
await waitFor(() => expect(result.current.isLoading).toBe(false));
expect(result.current.channels.map((c) => c.id)).toEqual(["1", "p1"]);
- // Relabelled on the way in: the row is `me` on the backend and "personal"
- // everywhere a person reads it.
+ // Relabelled on the way in: the row is `me` on the backend and
+ // "personal space" everywhere a person reads it.
expect(result.current.personalChannel).toEqual({
...personal,
- name: "personal",
+ name: "personal space",
});
});
diff --git a/products/desktop/packages/ui/src/features/command/keyboard-shortcuts.ts b/products/desktop/packages/ui/src/features/command/keyboard-shortcuts.ts
index 38108842c45a..4d27a6971b2b 100644
--- a/products/desktop/packages/ui/src/features/command/keyboard-shortcuts.ts
+++ b/products/desktop/packages/ui/src/features/command/keyboard-shortcuts.ts
@@ -22,8 +22,8 @@ export const SHORTCUTS = {
SWITCH_TAB: "ctrl+1,ctrl+2,ctrl+3,ctrl+4,ctrl+5,ctrl+6,ctrl+7,ctrl+8,ctrl+9",
SWITCH_TASK: "mod+1,mod+2,mod+3,mod+4,mod+5,mod+6,mod+7,mod+8,mod+9",
// No mod+0: the Electron View menu owns CmdOrCtrl+0 for "Actual Size", and a
- // renderer preventDefault can't reliably beat a main-process accelerator. #me
- // takes slot 1 instead.
+ // renderer preventDefault can't reliably beat a main-process accelerator. The
+ // personal space takes slot 1 instead.
SWITCH_STARRED_CHANNEL:
"mod+1,mod+2,mod+3,mod+4,mod+5,mod+6,mod+7,mod+8,mod+9",
FOCUS_SPACE_SEARCH: "mod+shift+s",
@@ -141,7 +141,7 @@ export const KEYBOARD_SHORTCUTS: KeyboardShortcut[] = [
{
id: "switch-starred-channel",
keys: "mod+1-9",
- description: "Switch to space (⌘1 = #me, ⌘2-9 = starred)",
+ description: "Switch to space (⌘1 = personal space, ⌘2-9 = starred)",
category: "navigation",
context: "Spaces",
availability: "channels-layout",
diff --git a/products/desktop/packages/ui/src/features/loops/components/LoopContextFields.tsx b/products/desktop/packages/ui/src/features/loops/components/LoopContextFields.tsx
index 062f6b58f760..c5905c91140e 100644
--- a/products/desktop/packages/ui/src/features/loops/components/LoopContextFields.tsx
+++ b/products/desktop/packages/ui/src/features/loops/components/LoopContextFields.tsx
@@ -1,4 +1,5 @@
import type { LoopSchemas } from "@posthog/api-client/loops";
+import { channelDisplayLabel } from "@posthog/core/canvas/channelName";
import { Switch } from "@posthog/quill";
import { SettingsOptionSelect } from "@posthog/ui/features/settings/SettingsOptionSelect";
import { Flex, Text } from "@radix-ui/themes";
@@ -53,7 +54,7 @@ export function LoopContextFields({
{ value: NOT_ATTACHED_VALUE, label: "Not attached to a channel" },
...channels.map((channel) => ({
value: channel.id,
- label: `#${channel.name}`,
+ label: channelDisplayLabel(channel.name, channel.channelType),
})),
];
diff --git a/products/desktop/packages/ui/src/features/loops/components/LoopForm.tsx b/products/desktop/packages/ui/src/features/loops/components/LoopForm.tsx
index 95aeb1ba61d0..18c4c71eed16 100644
--- a/products/desktop/packages/ui/src/features/loops/components/LoopForm.tsx
+++ b/products/desktop/packages/ui/src/features/loops/components/LoopForm.tsx
@@ -5,6 +5,7 @@ import {
Check,
} from "@phosphor-icons/react";
import { type LoopSchemas, LoopsApiError } from "@posthog/api-client/loops";
+import { channelDisplayLabel } from "@posthog/core/canvas/channelName";
import { ANALYTICS_EVENTS } from "@posthog/shared";
import { useChannelsLayout } from "@posthog/ui/features/canvas/hooks/useChannelsLayout";
import { useBluebirdFlag } from "@posthog/ui/features/feature-flags/useBluebirdFlag";
@@ -980,7 +981,8 @@ function describeContext(target: LoopContextTargetDraft | null): string {
if (target.outputs.post_to_feed) outputs.push("feed");
if (target.outputs.update_context) outputs.push("context.md");
if (target.outputs.canvas_id) outputs.push("canvas");
+ const targetLabel = channelDisplayLabel(target.name);
return outputs.length > 0
- ? `#${target.name} (${outputs.join(", ")})`
- : `#${target.name}`;
+ ? `${targetLabel} (${outputs.join(", ")})`
+ : targetLabel;
}
diff --git a/products/desktop/packages/ui/src/features/loops/components/LoopsEmptyState.tsx b/products/desktop/packages/ui/src/features/loops/components/LoopsEmptyState.tsx
index c691b0acc70e..d3acada58f11 100644
--- a/products/desktop/packages/ui/src/features/loops/components/LoopsEmptyState.tsx
+++ b/products/desktop/packages/ui/src/features/loops/components/LoopsEmptyState.tsx
@@ -1,3 +1,4 @@
+import { channelDisplayReference } from "@posthog/core/canvas/channelName";
import { loopHog } from "@posthog/ui/assets/hedgehogs";
import { Flex, Text } from "@radix-ui/themes";
@@ -23,11 +24,11 @@ export function LoopsEmptyState({ contextName }: { contextName?: string }) {
className="min-w-0 flex-1"
>
<Flex direction="column" gap="1">
- <Text className="font-semibold text-[16px] text-gray-12">
+ <p className="font-semibold text-[16px] text-gray-12">
{contextName
- ? `Create a loop for #${contextName}`
+ ? `Create a loop for ${channelDisplayReference(contextName)}`
: "Create your first loop"}
- </Text>
+ </p>
<Text className="text-[13px] text-gray-11 leading-relaxed">
Set it up once and it keeps running on its own, even with your
laptop closed.
diff --git a/products/desktop/packages/ui/src/features/panels/panelLayoutStore.ts b/products/desktop/packages/ui/src/features/panels/panelLayoutStore.ts
index 9f163ec58add..13832c2c7f46 100644
--- a/products/desktop/packages/ui/src/features/panels/panelLayoutStore.ts
+++ b/products/desktop/packages/ui/src/features/panels/panelLayoutStore.ts
@@ -1,3 +1,4 @@
+import { channelDisplayLabel } from "@posthog/core/canvas/channelName";
import {
addRecentFile,
addActionTab as coreAddActionTab,
@@ -249,7 +250,7 @@ export const usePanelLayoutStore = createWithEqualityFn<PanelLayoutStore>()(
openChannelContextInSplit: (taskId, context) => {
const tabId = `context-${context.channelName ?? "channel"}`;
- const label = `${context.channelName ? `#${context.channelName} ` : ""}CONTEXT.md`;
+ const label = `${context.channelName ? `${channelDisplayLabel(context.channelName)} ` : ""}CONTEXT.md`;
set((state) =>
updateTaskLayout(
state,
diff --git a/products/desktop/packages/ui/src/features/sessions/components/CommentComposer.test.tsx b/products/desktop/packages/ui/src/features/sessions/components/CommentComposer.test.tsx
index d03f25150c67..0b53ad7bf896 100644
--- a/products/desktop/packages/ui/src/features/sessions/components/CommentComposer.test.tsx
+++ b/products/desktop/packages/ui/src/features/sessions/components/CommentComposer.test.tsx
@@ -32,7 +32,7 @@ describe("CommentComposer", () => {
const onValueChange = vi.fn();
render(
<Theme>
- <MentionAvailabilityProvider disabledReason="Mentions aren’t available in #me.">
+ <MentionAvailabilityProvider disabledReason="Mentions aren’t available in your personal space.">
<CommentComposer
value="@"
onValueChange={onValueChange}
@@ -45,7 +45,7 @@ describe("CommentComposer", () => {
);
expect(screen.getByRole("status")).toHaveTextContent(
- "Mentions aren’t available in #me.",
+ "Mentions aren’t available in your personal space.",
);
fireEvent.change(screen.getByRole("textbox", { name: "Comment" }), {
target: { value: "private note" },
diff --git a/products/desktop/packages/ui/src/features/sessions/components/chat-thread/ChatThread.tsx b/products/desktop/packages/ui/src/features/sessions/components/chat-thread/ChatThread.tsx
index 8fc24219d1b3..b1720274fb1a 100644
--- a/products/desktop/packages/ui/src/features/sessions/components/chat-thread/ChatThread.tsx
+++ b/products/desktop/packages/ui/src/features/sessions/components/chat-thread/ChatThread.tsx
@@ -8,6 +8,7 @@ import {
ThumbsUp,
} from "@phosphor-icons/react";
import { WorkerPoolContextProvider } from "@pierre/diffs/react";
+import { channelDisplayLabel } from "@posthog/core/canvas/channelName";
import { useService } from "@posthog/di/react";
import {
Button,
@@ -561,7 +562,7 @@ function UserBubble({
icon={<FileText size={12} />}
label={`${
channelContext.mention.name
- ? `#${channelContext.mention.name} `
+ ? `${channelDisplayLabel(channelContext.mention.name)} `
: ""
}CONTEXT.md`}
onClick={
diff --git a/products/desktop/packages/ui/src/features/sessions/components/session-update/UserMessage.tsx b/products/desktop/packages/ui/src/features/sessions/components/session-update/UserMessage.tsx
index 74d7a5dc05cf..868aef805aa1 100644
--- a/products/desktop/packages/ui/src/features/sessions/components/session-update/UserMessage.tsx
+++ b/products/desktop/packages/ui/src/features/sessions/components/session-update/UserMessage.tsx
@@ -5,6 +5,7 @@ import {
Scroll,
SlackLogo,
} from "@phosphor-icons/react";
+import { channelDisplayLabel } from "@posthog/core/canvas/channelName";
import { PROJECT_BLUEBIRD_FLAG } from "@posthog/shared";
import { Box, Flex, IconButton } from "@radix-ui/themes";
import { motion } from "framer-motion";
@@ -149,7 +150,7 @@ export const UserMessage = memo(function UserMessage({
icon={<FileText size={12} />}
label={`${
channelContext.mention.name
- ? `#${channelContext.mention.name} `
+ ? `${channelDisplayLabel(channelContext.mention.name)} `
: ""
}CONTEXT.md`}
onClick={
diff --git a/products/desktop/packages/ui/src/features/sessions/mentionAvailability.tsx b/products/desktop/packages/ui/src/features/sessions/mentionAvailability.tsx
index 43126abd46ea..33968c8b88ea 100644
--- a/products/desktop/packages/ui/src/features/sessions/mentionAvailability.tsx
+++ b/products/desktop/packages/ui/src/features/sessions/mentionAvailability.tsx
@@ -1,7 +1,7 @@
import { createContext, type ReactNode, useContext } from "react";
export const PRIVATE_SPACE_MENTIONS_DISABLED =
- "Mentions aren’t available in #me.";
+ "Mentions aren’t available in your personal space.";
const MentionAvailabilityContext = createContext<string | null>(null);
diff --git a/products/desktop/packages/ui/src/features/sidebar/components/SidebarBulkActionBar.tsx b/products/desktop/packages/ui/src/features/sidebar/components/SidebarBulkActionBar.tsx
index 3fae30847a91..dc449f8bf32f 100644
--- a/products/desktop/packages/ui/src/features/sidebar/components/SidebarBulkActionBar.tsx
+++ b/products/desktop/packages/ui/src/features/sidebar/components/SidebarBulkActionBar.tsx
@@ -6,6 +6,7 @@ import {
SquaresFourIcon,
XIcon,
} from "@phosphor-icons/react";
+import { channelDisplayLabel } from "@posthog/core/canvas/channelName";
import {
Button,
DropdownMenu,
@@ -152,7 +153,7 @@ export function SidebarBulkActionBar({
key={channel.id}
onClick={() => void actions.fileSelectedTo(channel.id)}
>
- {`#${channel.name}`}
+ {channelDisplayLabel(channel.name, channel.channelType)}
</DropdownMenuItem>
))}
</DropdownMenuContent>
diff --git a/products/desktop/packages/ui/src/features/sidebar/components/SidebarMenu.tsx b/products/desktop/packages/ui/src/features/sidebar/components/SidebarMenu.tsx
index fa30e03932e2..40d783e2b9f2 100644
--- a/products/desktop/packages/ui/src/features/sidebar/components/SidebarMenu.tsx
+++ b/products/desktop/packages/ui/src/features/sidebar/components/SidebarMenu.tsx
@@ -223,11 +223,14 @@ function SidebarMenuComponent() {
allPinned,
runningCount: bulkActions.runningCount,
stopsCloudSandbox: bulkActions.stopsCloudSandbox,
- channels: bulkActions.channels.map(({ id, name, starred }) => ({
- id,
- name,
- starred,
- })),
+ channels: bulkActions.channels.map(
+ ({ id, name, channelType, starred }) => ({
+ id,
+ name,
+ channelType,
+ starred,
+ }),
+ ),
});
if (!result.action) return;
diff --git a/products/desktop/packages/ui/src/features/task-detail/components/ChannelContextChip.tsx b/products/desktop/packages/ui/src/features/task-detail/components/ChannelContextChip.tsx
index 9a80b3801586..a3f0bfa72ef2 100644
--- a/products/desktop/packages/ui/src/features/task-detail/components/ChannelContextChip.tsx
+++ b/products/desktop/packages/ui/src/features/task-detail/components/ChannelContextChip.tsx
@@ -1,3 +1,4 @@
+import { channelDisplayLabel } from "@posthog/core/canvas/channelName";
import {
Chip,
ChipClose,
@@ -42,7 +43,7 @@ export function ChannelContextChip({
right padding, so a width that changes under the cursor would reflow
the text being typed. */}
<ChipClose
- aria-label={`Remove ${channelName ? `#${channelName} ` : ""}CONTEXT.md`}
+ aria-label={`Remove ${channelName ? `${channelDisplayLabel(channelName)} ` : ""}CONTEXT.md`}
className="mr-[-2.5px]"
onClick={(event) => {
// The chip itself opens the file; removing it must not also do that.
diff --git a/products/desktop/packages/ui/src/features/task-detail/components/ChannelContextTab.tsx b/products/desktop/packages/ui/src/features/task-detail/components/ChannelContextTab.tsx
index 482c0a00c00a..8a18635a9652 100644
--- a/products/desktop/packages/ui/src/features/task-detail/components/ChannelContextTab.tsx
+++ b/products/desktop/packages/ui/src/features/task-detail/components/ChannelContextTab.tsx
@@ -1,4 +1,5 @@
-import { Box, ScrollArea, Text } from "@radix-ui/themes";
+import { channelDisplayReference } from "@posthog/core/canvas/channelName";
+import { Box, ScrollArea } from "@radix-ui/themes";
import { MarkdownRenderer } from "../../editor/components/MarkdownRenderer";
interface ChannelContextTabProps {
@@ -16,10 +17,10 @@ export function ChannelContextTab({
return (
<ScrollArea type="auto" scrollbars="vertical" className="h-full">
<Box p="4">
- <Text className="mb-3 block text-[12px] text-gray-9">
+ <p className="mb-3 text-[12px] text-gray-9">
Sent with this task's prompt as background context
- {channelName ? ` from #${channelName}` : ""}.
- </Text>
+ {channelName ? ` from ${channelDisplayReference(channelName)}` : ""}.
+ </p>
<Box className="text-[13px]">
<MarkdownRenderer content={body} />
</Box>
diff --git a/products/desktop/packages/ui/src/features/tasks/useTaskContextMenu.ts b/products/desktop/packages/ui/src/features/tasks/useTaskContextMenu.ts
index ff6ec86c26dc..ee4b8c858946 100644
--- a/products/desktop/packages/ui/src/features/tasks/useTaskContextMenu.ts
+++ b/products/desktop/packages/ui/src/features/tasks/useTaskContextMenu.ts
@@ -88,9 +88,10 @@ export function useTaskContextMenu() {
isInCommandCenter,
hasEmptyCommandCenterCell,
showArchivePrior,
- channels: channels.map(({ id, name, starred }) => ({
+ channels: channels.map(({ id, name, channelType, starred }) => ({
id,
name,
+ channelType,
starred,
})),
});