mirror of
https://github.com/block/buzz.git
synced 2026-11-27 11:41:21 +00:00
## Why The Inbox surface was briefly renamed to **Activity** during #2045 and picked up a bell icon to match. The name was reverted to **Inbox** before merge, but the icon was not. A bell says "notification tray." Inbox is a destination — a focused, conversation-oriented place to catch up on work relevant to you, including drafts and reminders that have nothing to do with notifications. The glyph should say that. ## What changed - Swap the sidebar entry from Lucide `Bell` to Lucide `Inbox`. - Assert the icon in `inbox-refactor-screenshots.spec.ts`. Nothing pinned it before, which is exactly how it drifted through a rename. This also brings desktop back in line with mobile, which already uses `LucideIcons.inbox300` / `inbox500` for the same destination. ## Deliberately unchanged The bell on **reminder** rows in the list pane (`InboxListPane.tsx`, reminders → bell, drafts → file) stays. A bell is the right glyph for a reminder; that one was never about the surface's identity. ## Verification - The new assertion is a real guard, not a no-op: with `Bell` restored the test fails with `Expected: 1, Received: 0` on `svg.lucide-inbox`. Confirmed before committing. - `biome` and `tsc` clean. - Playwright smoke: `inbox-refactor-screenshots` 4 passed; `smoke`, `navigation`, `channels`, `sidebar-more-unread-overlap`, `home-collapsed-top-chrome`, `workspace-rail` — 107 passed, 1 skipped. - Screenshot below is the regenerated `02-current-controls` shot from the spec. Signed-off-by: Clay Delk <clay.delk@gmail.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
176 lines
5.3 KiB
TypeScript
176 lines
5.3 KiB
TypeScript
import { Activity, Bot, FolderGit2, Inbox, Zap } from "lucide-react";
|
|
|
|
import { TopbarSearch } from "@/features/search/ui/TopbarSearch";
|
|
import { FeatureGate } from "@/shared/features";
|
|
import type { Channel, SearchHit } from "@/shared/api/types";
|
|
import {
|
|
SidebarHeader,
|
|
SidebarMenu,
|
|
SidebarMenuBadge,
|
|
SidebarMenuButton,
|
|
SidebarMenuItem,
|
|
} from "@/shared/ui/sidebar";
|
|
import { SidebarMenuLabel } from "@/shared/ui/sidebar-menu-label";
|
|
|
|
type SidebarSelectedView =
|
|
| "home"
|
|
| "channel"
|
|
| "messages"
|
|
| "agents"
|
|
| "workflows"
|
|
| "pulse"
|
|
| "projects";
|
|
|
|
type AppSidebarPinnedHeaderProps = {
|
|
channelLabels: Record<string, string>;
|
|
currentPubkey?: string;
|
|
onBrowseChannels?: () => void;
|
|
onCreateAgent: () => void;
|
|
onCreateChannel: () => void;
|
|
onOpenDm: (input: { pubkeys: string[] }) => Promise<void>;
|
|
onOpenSearchResult: (hit: SearchHit) => void;
|
|
onSelectChannel: (channelId: string) => void;
|
|
searchChannels: Channel[];
|
|
searchFocusRequest: number;
|
|
suggestionChannels: Channel[];
|
|
};
|
|
|
|
type AppSidebarPrimaryMenuProps = {
|
|
homeBadgeCount: number;
|
|
onSelectAgents: () => void;
|
|
onSelectHome: () => void;
|
|
onSelectProjects: () => void;
|
|
onSelectPulse: () => void;
|
|
onSelectWorkflows: () => void;
|
|
selectedView: SidebarSelectedView;
|
|
};
|
|
|
|
export function AppSidebarPinnedHeader({
|
|
channelLabels,
|
|
currentPubkey,
|
|
onBrowseChannels,
|
|
onCreateAgent,
|
|
onCreateChannel,
|
|
onOpenDm,
|
|
onOpenSearchResult,
|
|
onSelectChannel,
|
|
searchChannels,
|
|
searchFocusRequest,
|
|
suggestionChannels,
|
|
}: AppSidebarPinnedHeaderProps) {
|
|
return (
|
|
<div
|
|
className="mx-[3px] shrink-0 px-2 pb-2 pt-3"
|
|
data-testid="sidebar-pinned-header"
|
|
>
|
|
<TopbarSearch
|
|
channelLabels={channelLabels}
|
|
channels={searchChannels}
|
|
currentPubkey={currentPubkey}
|
|
focusRequest={searchFocusRequest}
|
|
onOpenChannel={onSelectChannel}
|
|
onOpenResult={onOpenSearchResult}
|
|
onOpenUser={(user) => onOpenDm({ pubkeys: [user.pubkey] })}
|
|
onBrowseChannels={onBrowseChannels}
|
|
onCreateAgent={onCreateAgent}
|
|
onCreateChannel={onCreateChannel}
|
|
suggestionChannels={suggestionChannels}
|
|
/>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export function AppSidebarPrimaryMenu({
|
|
homeBadgeCount,
|
|
onSelectAgents,
|
|
onSelectHome,
|
|
onSelectProjects,
|
|
onSelectPulse,
|
|
onSelectWorkflows,
|
|
selectedView,
|
|
}: AppSidebarPrimaryMenuProps) {
|
|
return (
|
|
<SidebarHeader
|
|
className="relative z-40 cursor-default select-none px-2 pb-0 pt-0"
|
|
data-tauri-drag-region
|
|
data-testid="sidebar-primary-menu"
|
|
>
|
|
<SidebarMenu className="pb-2">
|
|
<SidebarMenuItem>
|
|
<SidebarMenuButton
|
|
isActive={selectedView === "home"}
|
|
onClick={onSelectHome}
|
|
tooltip="Inbox"
|
|
type="button"
|
|
>
|
|
<Inbox className="h-4 w-4" />
|
|
<SidebarMenuLabel>Inbox</SidebarMenuLabel>
|
|
</SidebarMenuButton>
|
|
{homeBadgeCount > 0 ? (
|
|
<SidebarMenuBadge
|
|
className="right-2 rounded-full bg-primary/15 px-1.5 text-2xs text-primary peer-data-[active=true]/menu-button:bg-sidebar-active-foreground/20 peer-data-[active=true]/menu-button:text-sidebar-active-foreground"
|
|
data-testid="sidebar-home-count"
|
|
>
|
|
{Math.min(homeBadgeCount, 99)}
|
|
</SidebarMenuBadge>
|
|
) : null}
|
|
</SidebarMenuItem>
|
|
<FeatureGate feature="pulse">
|
|
<SidebarMenuItem>
|
|
<SidebarMenuButton
|
|
data-testid="open-pulse-view"
|
|
isActive={selectedView === "pulse"}
|
|
onClick={onSelectPulse}
|
|
tooltip="Pulse"
|
|
type="button"
|
|
>
|
|
<Activity className="h-4 w-4" />
|
|
<SidebarMenuLabel>Pulse</SidebarMenuLabel>
|
|
</SidebarMenuButton>
|
|
</SidebarMenuItem>
|
|
</FeatureGate>
|
|
<FeatureGate feature="projects">
|
|
<SidebarMenuItem>
|
|
<SidebarMenuButton
|
|
data-testid="open-projects-view"
|
|
isActive={selectedView === "projects"}
|
|
onClick={onSelectProjects}
|
|
tooltip="Projects"
|
|
type="button"
|
|
>
|
|
<FolderGit2 className="h-4 w-4" />
|
|
<SidebarMenuLabel>Projects</SidebarMenuLabel>
|
|
</SidebarMenuButton>
|
|
</SidebarMenuItem>
|
|
</FeatureGate>
|
|
<SidebarMenuItem>
|
|
<SidebarMenuButton
|
|
data-testid="open-agents-view"
|
|
isActive={selectedView === "agents"}
|
|
onClick={onSelectAgents}
|
|
tooltip="Agents"
|
|
type="button"
|
|
>
|
|
<Bot className="h-4 w-4" />
|
|
<SidebarMenuLabel>Agents</SidebarMenuLabel>
|
|
</SidebarMenuButton>
|
|
</SidebarMenuItem>
|
|
<FeatureGate feature="workflows">
|
|
<SidebarMenuItem>
|
|
<SidebarMenuButton
|
|
data-testid="open-workflows-view"
|
|
isActive={selectedView === "workflows"}
|
|
onClick={onSelectWorkflows}
|
|
tooltip="Workflows"
|
|
type="button"
|
|
>
|
|
<Zap className="h-4 w-4" />
|
|
<SidebarMenuLabel>Workflows</SidebarMenuLabel>
|
|
</SidebarMenuButton>
|
|
</SidebarMenuItem>
|
|
</FeatureGate>
|
|
</SidebarMenu>
|
|
</SidebarHeader>
|
|
);
|
|
}
|