diff --git a/ui/src/components/Layout.production.tsx b/ui/src/components/Layout.production.tsx index 2903267e57..12621fca3b 100644 --- a/ui/src/components/Layout.production.tsx +++ b/ui/src/components/Layout.production.tsx @@ -604,8 +604,6 @@ export function Layout() { ) : ( @@ -624,8 +622,6 @@ export function Layout() { )} diff --git a/ui/src/components/Layout.tsx b/ui/src/components/Layout.tsx index b308eb394f..99b7fba771 100644 --- a/ui/src/components/Layout.tsx +++ b/ui/src/components/Layout.tsx @@ -659,8 +659,6 @@ export function Layout() { @@ -684,8 +682,6 @@ export function Layout() { diff --git a/ui/src/components/SidebarAccountMenu.production.tsx b/ui/src/components/SidebarAccountMenu.production.tsx index b592387638..c136d4ea2f 100644 --- a/ui/src/components/SidebarAccountMenu.production.tsx +++ b/ui/src/components/SidebarAccountMenu.production.tsx @@ -8,7 +8,7 @@ import { UserRound, UserRoundPen, } from "lucide-react"; -import type { DeploymentMode, ServerGitInfo } from "@paperclipai/shared"; +import type { DeploymentMode } from "@paperclipai/shared"; import { Link } from "@/lib/router"; import { authApi } from "@/api/auth"; import { queryKeys } from "@/lib/queryKeys"; @@ -20,20 +20,15 @@ import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; import { cn, SIDEBAR_RAIL_HIDDEN_LABEL } from "../lib/utils"; import { ThemeToggle } from "./ThemeToggle"; import { SidebarServerInfo } from "./SidebarServerInfo"; -import { Badge } from "@/components/ui/badge"; const PROFILE_SETTINGS_PATH = "/company/settings/instance/profile"; const DOCS_URL = "https://docs.paperclip.ing/"; const FEEDBACK_URL = "https://paperclip.ing/feedback"; -const SOURCE_REPOSITORY_URL = "https://github.com/paperclipai/paperclip"; -const SOURCE_VERSION_RE = /\+\d+\.git\.([0-9a-f]{7,40})(?:\.dirty)?$/i; interface SidebarAccountMenuProps { deploymentMode?: DeploymentMode; open?: boolean; onOpenChange?: (open: boolean) => void; - serverGit?: ServerGitInfo; - version?: string | null; } interface MenuActionProps { @@ -67,11 +62,6 @@ function deriveUserSlug(name: string | null | undefined, email: string | null | return "me"; } -function sourceVersionSha(version: string): string | null { - const sourceVersion = version.match(SOURCE_VERSION_RE); - return sourceVersion?.[1] ?? null; -} - function MenuAction({ label, description, icon: Icon, onClick, href, external = false }: MenuActionProps) { const className = "flex w-full items-start gap-3 rounded-xl px-3 py-3 text-left transition-colors hover:bg-accent/60"; @@ -115,8 +105,6 @@ export function SidebarAccountMenu({ deploymentMode, open: controlledOpen, onOpenChange, - serverGit, - version, }: SidebarAccountMenuProps) { const [internalOpen, setInternalOpen] = useState(false); const { isMobile, setSidebarOpen, collapsed, peeking } = useSidebar(); @@ -134,15 +122,8 @@ export function SidebarAccountMenu({ const displayName = session?.user.name?.trim() || "Board"; const secondaryLabel = session?.user.email?.trim() || (deploymentMode === "authenticated" ? "Signed in" : "Local workspace board"); - const accountBadge = deploymentMode === "authenticated" ? "Account" : "Local"; const initials = deriveInitials(displayName); const profileHref = `/u/${deriveUserSlug(session?.user.name, session?.user.email, session?.user.id)}`; - const sourceSha = version ? sourceVersionSha(version) : null; - const sourceFullSha = - sourceSha && serverGit?.available && serverGit.fullSha.toLowerCase().startsWith(sourceSha.toLowerCase()) - ? serverGit.fullSha - : sourceSha; - const sourceBranch = sourceSha && serverGit?.available ? serverGit.branchName : null; function closeNavigationChrome() { setOpen(false); @@ -189,40 +170,8 @@ export function SidebarAccountMenu({
-
-

{displayName}

- - {accountBadge} - -
+

{displayName}

{secondaryLabel}

- {sourceSha && sourceFullSha ? ( -
- {sourceBranch ? ( - - {sourceBranch} - - ) : null} -

- Paperclip{" "} - - {sourceSha.slice(0, 7)} - -

-
- ) : version ? ( -

Paperclip v{version}

- ) : null}
diff --git a/ui/src/components/SidebarAccountMenu.test.tsx b/ui/src/components/SidebarAccountMenu.test.tsx index b883af6637..5c4ffe0c02 100644 --- a/ui/src/components/SidebarAccountMenu.test.tsx +++ b/ui/src/components/SidebarAccountMenu.test.tsx @@ -196,10 +196,7 @@ describe("SidebarAccountMenu", () => { root.render( - + , ); @@ -233,7 +230,9 @@ describe("SidebarAccountMenu", () => { const themePos = menuText.indexOf("Switch to"); expect(docsPos).toBeLessThan(themePos); - expect(document.body.textContent).toContain("Paperclip v1.2.3"); + // The popover header stays down to name + email: no "Account" badge, no version line. + expect(popover?.textContent).not.toContain("Account"); + expect(popover?.textContent).not.toContain("Paperclip v"); expect(document.body.textContent).toContain("jane@example.com"); expect(document.body.querySelector('[data-slot="popover-content"]')?.className) .toContain("w-(--sz-277px)"); @@ -331,53 +330,4 @@ describe("SidebarAccountMenu", () => { }); }); - it("shows the short commit sha instead of a version for source builds", async () => { - const root = createRoot(container); - const queryClient = new QueryClient({ - defaultOptions: { queries: { retry: false } }, - }); - - await act(async () => { - root.render( - - - - - , - ); - }); - await flushReact(); - - expect(document.body.textContent).toContain("feature/source-build-labelPaperclip 518fc71"); - expect(document.body.textContent).not.toContain("2026.626.0+58.git.518fc71ce"); - expect(document.body.querySelector('a[href="https://github.com/paperclipai/paperclip/tree/feature%2Fsource-build-label"]')?.textContent).toBe( - "feature/source-build-label", - ); - expect(document.body.querySelector('a[href="https://github.com/paperclipai/paperclip/commit/518fc71ce1234567890abcdef1234567890abcde"]')?.textContent).toBe( - "518fc71", - ); - - await act(async () => { - root.unmount(); - }); - }); }); diff --git a/ui/src/components/SidebarAccountMenu.tsx b/ui/src/components/SidebarAccountMenu.tsx index caec0bbd30..87c2897d51 100644 --- a/ui/src/components/SidebarAccountMenu.tsx +++ b/ui/src/components/SidebarAccountMenu.tsx @@ -9,7 +9,7 @@ import { UserRound, UserRoundPen, } from "lucide-react"; -import type { DeploymentMode, ServerGitInfo } from "@paperclipai/shared"; +import type { DeploymentMode } from "@paperclipai/shared"; import { Link } from "@/lib/router"; import { authApi } from "@/api/auth"; import { queryKeys } from "@/lib/queryKeys"; @@ -21,20 +21,15 @@ import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; import { cn, SIDEBAR_RAIL_HIDDEN_LABEL } from "../lib/utils"; import { ThemeToggle } from "./ThemeToggle"; import { SidebarServerInfo } from "./SidebarServerInfo"; -import { Badge } from "@/components/ui/badge"; const PROFILE_SETTINGS_PATH = "/company/settings/instance/profile"; const DOCS_URL = "https://docs.paperclip.ing/"; const FEEDBACK_URL = "https://paperclip.ing/feedback"; -const SOURCE_REPOSITORY_URL = "https://github.com/paperclipai/paperclip"; -const SOURCE_VERSION_RE = /\+\d+\.git\.([0-9a-f]{7,40})(?:\.dirty)?$/i; interface SidebarAccountMenuProps { deploymentMode?: DeploymentMode; open?: boolean; onOpenChange?: (open: boolean) => void; - serverGit?: ServerGitInfo; - version?: string | null; /** Contextual navigation occupies a full sidebar even if the saved global nav mode is collapsed. */ forceExpanded?: boolean; } @@ -70,11 +65,6 @@ function deriveUserSlug(name: string | null | undefined, email: string | null | return "me"; } -function sourceVersionSha(version: string): string | null { - const sourceVersion = version.match(SOURCE_VERSION_RE); - return sourceVersion?.[1] ?? null; -} - function MenuAction({ label, description, icon: Icon, onClick, href, external = false }: MenuActionProps) { const className = "flex w-full items-start gap-3 rounded-xl px-3 py-3 text-left transition-colors hover:bg-accent/60"; @@ -118,8 +108,6 @@ export function SidebarAccountMenu({ deploymentMode, open: controlledOpen, onOpenChange, - serverGit, - version, forceExpanded = false, }: SidebarAccountMenuProps) { const [internalOpen, setInternalOpen] = useState(false); @@ -138,15 +126,8 @@ export function SidebarAccountMenu({ const displayName = session?.user.name?.trim() || "Board"; const secondaryLabel = session?.user.email?.trim() || (deploymentMode === "authenticated" ? "Signed in" : "Local workspace board"); - const accountBadge = deploymentMode === "authenticated" ? "Account" : "Local"; const initials = deriveInitials(displayName); const profileHref = `/u/${deriveUserSlug(session?.user.name, session?.user.email, session?.user.id)}`; - const sourceSha = version ? sourceVersionSha(version) : null; - const sourceFullSha = - sourceSha && serverGit?.available && serverGit.fullSha.toLowerCase().startsWith(sourceSha.toLowerCase()) - ? serverGit.fullSha - : sourceSha; - const sourceBranch = sourceSha && serverGit?.available ? serverGit.branchName : null; function closeNavigationChrome() { setOpen(false); @@ -193,40 +174,8 @@ export function SidebarAccountMenu({
-
-

{displayName}

- - {accountBadge} - -
+

{displayName}

{secondaryLabel}

- {sourceSha && sourceFullSha ? ( -
- {sourceBranch ? ( - - {sourceBranch} - - ) : null} -

- Paperclip{" "} - - {sourceSha.slice(0, 7)} - -

-
- ) : version ? ( -

Paperclip v{version}

- ) : null}
diff --git a/ui/storybook/stories/navigation-layout.stories.tsx b/ui/storybook/stories/navigation-layout.stories.tsx index c78bdfb879..4eca73816f 100644 --- a/ui/storybook/stories/navigation-layout.stories.tsx +++ b/ui/storybook/stories/navigation-layout.stories.tsx @@ -256,7 +256,6 @@ function NavigationLayoutStories() { deploymentMode="authenticated" open onOpenChange={() => undefined} - version="0.3.1" />