Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions packages/shared/src/analytics-events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,6 @@ export type ChannelsSurface =
| "channel_home"
| "channel_history"
| "channel_artifacts"
| "channel_inbox"
| "pinned"
| "dashboards_grid"
| "canvas"
Expand All @@ -835,7 +834,6 @@ export type ChannelActionType =
| "view_context"
| "view_history"
| "view_artifacts"
| "view_inbox"
| "open_artifact"
| "file_task"
| "unfile_task"
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/browser-tabs-schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const browserTabSchema = z.object({
taskId: z.string().nullable().default(null),
channelId: z.string().nullable().default(null),
/**
* Channel sub-section this tab fronts (`inbox` / `artifacts` / `history` /
* Channel sub-section this tab fronts (`artifacts` / `history` /
* `context`). Null = the channel home, or a non-channel tab (canvas / task /
* blank). Pairs with `channelId`: the two together identify a channel tab.
*/
Expand Down
26 changes: 13 additions & 13 deletions packages/shared/src/browser-tabs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,16 @@ describe("openOrFocusTab", () => {
});

it("treats a channel's sections as distinct tabs but dedups the same one", () => {
const inbox = openOrFocusTab(snapshot(), {
const history = openOrFocusTab(snapshot(), {
windowId: "w1",
dashboardId: null,
taskId: null,
channelId: "c1",
channelSection: "inbox",
channelSection: "history",
makeId,
now,
});
const artifacts = openOrFocusTab(inbox.snapshot, {
const artifacts = openOrFocusTab(history.snapshot, {
windowId: "w1",
dashboardId: null,
taskId: null,
Expand All @@ -94,17 +94,17 @@ describe("openOrFocusTab", () => {
});
expect(artifacts.opened).toBe(true);
expect(artifacts.snapshot.tabs).toHaveLength(2);
const inboxAgain = openOrFocusTab(artifacts.snapshot, {
const historyAgain = openOrFocusTab(artifacts.snapshot, {
windowId: "w1",
dashboardId: null,
taskId: null,
channelId: "c1",
channelSection: "inbox",
channelSection: "history",
makeId,
now,
});
expect(inboxAgain.opened).toBe(false);
expect(inboxAgain.tabId).toBe(inbox.tabId);
expect(historyAgain.opened).toBe(false);
expect(historyAgain.tabId).toBe(history.tabId);
});

it("appends new tabs after existing ones", () => {
Expand Down Expand Up @@ -314,7 +314,7 @@ describe("decideTabNavigation", () => {
});

it("replaces the active tab when navigating between channel sections", () => {
// In-tab nav from a channel's inbox to its artifacts: same tab, new section.
// In-tab nav from a channel's history to its artifacts: same tab, new section.
expect(
decideTabNavigation({
...base,
Expand All @@ -324,7 +324,7 @@ describe("decideTabNavigation", () => {
dashboardId: null,
taskId: null,
channelId: "c1",
channelSection: "inbox",
channelSection: "history",
},
routeChannelId: "c1",
routeChannelSection: "artifacts",
Expand All @@ -345,14 +345,14 @@ describe("decideTabNavigation", () => {
decideTabNavigation({
...base,
routeChannelId: "c1",
routeChannelSection: "inbox",
routeChannelSection: "history",
}),
).toEqual({
type: "open",
dashboardId: null,
taskId: null,
channelId: "c1",
channelSection: "inbox",
channelSection: "history",
stampTabId: null,
});
});
Expand All @@ -367,10 +367,10 @@ describe("decideTabNavigation", () => {
dashboardId: null,
taskId: null,
channelId: "c1",
channelSection: "inbox",
channelSection: "history",
},
routeChannelId: "c1",
routeChannelSection: "inbox",
routeChannelSection: "history",
}),
).toEqual({ type: "stamp", stampTabId: "tab-a" });
});
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/browser-tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export type TabTarget = {
* Everything that identifies a tab's contents: a canvas, a task, or a channel
* sub-section (channel + section). Two tabs with the same identity are the same
* page, so dedup and in-tab-nav comparisons key on all four — a channel's
* `inbox` and `artifacts`, or two channels' inboxes, are distinct pages.
* `history` and `artifacts`, or two channels' artifacts, are distinct pages.
*/
export type TabIdentity = {
dashboardId: string | null;
Expand Down
30 changes: 13 additions & 17 deletions packages/ui/src/features/browser-tabs/BrowserTabStrip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export function BrowserTabStrip() {

const { channels } = useChannels();

// The active channel sub-section (inbox/artifacts/history/context) is the
// The active channel sub-section (artifacts/history/context) is the
// route segment after the channelId. Null when on the channel home or a
// non-section route (canvas/task), so a channel-home tab labels by name.
const routeChannelSection = useMemo(() => {
Expand Down Expand Up @@ -318,7 +318,7 @@ export function BrowserTabStrip() {
pinned,
};
}
// A channel tab: a sub-section (Inbox/Artifacts/…) or the channel home.
// A channel tab: a sub-section (Artifacts/Recents/…) or the channel home.
// The section drives the label; the channel name carries the `#` hover
// context. Home has no section, so it labels by the channel name.
if (channelId) {
Expand Down Expand Up @@ -371,21 +371,17 @@ export function BrowserTabStrip() {
});
} else if (tab.channelId) {
const params = { channelId: tab.channelId };
switch (tab.channelSection) {
case "inbox":
navigate({ to: "/website/$channelId/inbox", params, state });
break;
case "artifacts":
navigate({ to: "/website/$channelId/artifacts", params, state });
break;
case "history":
navigate({ to: "/website/$channelId/history", params, state });
break;
case "context":
navigate({ to: "/website/$channelId/context", params, state });
break;
default:
navigate({ to: "/website/$channelId", params, state });
// Section keys are the route segments; unknown/stale sections (e.g. from
// a since-removed tab type) fall back to the channel home.
const section = channelSectionFor(tab.channelSection);
if (section) {
navigate({
to: `/website/$channelId/${section.key}` as const,
params,
state,
});
} else {
navigate({ to: "/website/$channelId", params, state });
}
} else {
navigate({ to: "/website", state });
Expand Down
3 changes: 1 addition & 2 deletions packages/ui/src/features/canvas/channelSections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
* `channelSection`; `label` is the tab + nav text.
*/
export interface ChannelSection {
key: "inbox" | "artifacts" | "history" | "context";
key: "artifacts" | "history" | "context";
label: string;
}

export const CHANNEL_SECTIONS: readonly ChannelSection[] = [
{ key: "inbox", label: "Inbox" },
{ key: "artifacts", label: "Artifacts" },
{ key: "history", label: "Recents" },
{ key: "context", label: "CONTEXT.md" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { useNavigate, useRouterState } from "@tanstack/react-router";
// item — it routes to the channel home (`/website/$channelId`, like the sidebar
// channel row) and highlights `bg-fill-selected` while you're there, the same
// pathname-driven active state the rest of the channel tab strip uses. Followed
// by that strip (Inbox / Artifacts / Recents / CONTEXT.md), rendered into the
// by that strip (Artifacts / Recents / CONTEXT.md), rendered into the
// header bar by every channel view so the tabs stay in view.
export function ChannelHeader({ channelId }: { channelId: string }) {
const navigate = useNavigate();
Expand Down
11 changes: 5 additions & 6 deletions packages/ui/src/features/canvas/components/ChannelTabs.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { Button, cn } from "@posthog/quill";
import { CHANNEL_SECTIONS } from "@posthog/ui/features/canvas/channelSections";
import { ChannelPinnedMenu } from "@posthog/ui/features/canvas/components/ChannelPinnedMenu";
import { Link, useRouterState } from "@tanstack/react-router";

const TABS = [
{ label: "Inbox", to: "/website/$channelId/inbox" },
{ label: "Artifacts", to: "/website/$channelId/artifacts" },
{ label: "Recents", to: "/website/$channelId/history" },
{ label: "CONTEXT.md", to: "/website/$channelId/context" },
] as const;
const TABS = CHANNEL_SECTIONS.map((s) => ({
label: s.label,
to: `/website/$channelId/${s.key}` as const,
}));

// Home / History / Artifacts tab switcher shown in the channel header bar, with
// a Pinned quick-access menu alongside. Pathname-driven active state (the
Expand Down
38 changes: 0 additions & 38 deletions packages/ui/src/features/canvas/components/WebsiteChannelInbox.tsx

This file was deleted.

21 changes: 0 additions & 21 deletions packages/ui/src/router/routeTree.gen.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 0 additions & 11 deletions packages/ui/src/router/routes/website/$channelId/inbox.tsx

This file was deleted.

Loading