Skip to content

Open-source SEO, GEO, and marketing skills for AI agents.

fix(notfair-cmo): drop slug subtitle from project switcher trigger

Yuting Zhongb4c1dc5a918b
diff --git a/notfair-cmo/src/components/project-switcher.test.tsx b/notfair-cmo/src/components/project-switcher.test.tsx
index fbd42653..ca9abf31 100644
--- a/notfair-cmo/src/components/project-switcher.test.tsx
+++ b/notfair-cmo/src/components/project-switcher.test.tsx
@@ -65,16 +65,17 @@ afterEach(() => {
});
describe("ProjectSwitcher", () => {
- it("shows the active project display name and slug", () => {
+ it("shows the active project display name (and not the slug)", () => {
render(<ProjectSwitcher projects={projects} activeSlug="proj-a" />);
expect(screen.getByText("Alpha")).toBeInTheDocument();
- expect(screen.getByText("proj-a")).toBeInTheDocument();
+ // The slug subtitle was redundant — only the avatar + display name
+ // render in the trigger now.
+ expect(screen.queryByText("proj-a")).not.toBeInTheDocument();
});
it("falls back to placeholder text when no project is active", () => {
render(<ProjectSwitcher projects={[]} activeSlug={null} />);
- expect(screen.getByText("No project")).toBeInTheDocument();
- expect(screen.getByText("Create one to get started")).toBeInTheDocument();
+ expect(screen.getByText("No workspace")).toBeInTheDocument();
});
it("shows the project initials in the avatar", () => {
diff --git a/notfair-cmo/src/components/project-switcher.tsx b/notfair-cmo/src/components/project-switcher.tsx
index b29a86bf..497a7c97 100644
--- a/notfair-cmo/src/components/project-switcher.tsx
+++ b/notfair-cmo/src/components/project-switcher.tsx
@@ -48,14 +48,9 @@ export function ProjectSwitcher({ projects, activeSlug }: Props) {
<div className="flex aspect-square size-8 items-center justify-center rounded-md bg-sidebar-primary text-sidebar-primary-foreground text-xs font-semibold">
{(active?.display_name ?? "—").slice(0, 2).toUpperCase()}
</div>
- <div className="grid flex-1 text-left text-sm leading-tight">
- <span className="truncate font-medium">
- {active?.display_name ?? "No project"}
- </span>
- <span className="truncate text-xs text-muted-foreground">
- {active ? active.slug : "Create one to get started"}
- </span>
- </div>
+ <span className="flex-1 truncate text-left text-sm font-medium leading-tight">
+ {active?.display_name ?? "No workspace"}
+ </span>
<ChevronsUpDown className="ml-auto size-4" />
</SidebarMenuButton>
</DropdownMenuTrigger>