Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.
feat(web): themed sidebar header art for nightly and dev builds (#4130)
maria53e3c98a5523
diff --git a/apps/web/src/components/AppSidebarLayout.tsx b/apps/web/src/components/AppSidebarLayout.tsxindex 07ec0dc90..587ec65cb 100644--- a/apps/web/src/components/AppSidebarLayout.tsx+++ b/apps/web/src/components/AppSidebarLayout.tsx@@ -4,10 +4,18 @@ import { useLocation, useNavigate } from "@tanstack/react-router";import { isElectron } from "../env";import { resolveShortcutCommand, shortcutLabelForCommand } from "../keybindings";-import { isMacPlatform } from "../lib/utils";+import { cn, isMacPlatform } from "../lib/utils";import { primaryServerKeybindingsAtom } from "../state/server";import ThreadSidebar from "./Sidebar";-import { Sidebar, SidebarProvider, SidebarRail, SidebarTrigger, useSidebar } from "./ui/sidebar";+import { useSidebarStageBackdropVariant } from "./SidebarStageBackdrop";+import {+ Sidebar,+ SidebarProvider,+ SidebarRail,+ SidebarTrigger,+ useSidebar,+ useSidebarVisibility,+} from "./ui/sidebar";import { Tooltip, TooltipPopup, TooltipTrigger } from "./ui/tooltip";const THREAD_SIDEBAR_WIDTH_STORAGE_KEY = "chat_thread_sidebar_width";@@ -18,6 +26,8 @@ const MACOS_TRAFFIC_LIGHTS_LEFT_INSET = "90px";function SidebarControl() {const keybindings = useAtomValue(primaryServerKeybindingsAtom);const { toggleSidebar } = useSidebar();+ const isSidebarVisible = useSidebarVisibility();+ const stageBackdropVariant = useSidebarStageBackdropVariant();const shortcutLabel = shortcutLabelForCommand(keybindings, "sidebar.toggle");useEffect(() => {@@ -42,7 +52,15 @@ function SidebarControl() {<Tooltip><TooltipTriggerrender={- <SidebarTrigger className="pointer-events-auto" aria-label="Toggle main sidebar" />+ <SidebarTrigger+ className={cn(+ "pointer-events-auto",+ isSidebarVisible &&+ stageBackdropVariant &&+ "hover:bg-white/15 [&_svg]:text-white/85! [&_svg]:hover:text-white!",+ )}+ aria-label="Toggle main sidebar"+ />}/><TooltipPopup side="bottom">diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsxindex 6a76494da..38e9f7a82 100644--- a/apps/web/src/components/Sidebar.tsx+++ b/apps/web/src/components/Sidebar.tsx@@ -77,7 +77,7 @@ import { isElectron } from "../env";import { APP_STAGE_LABEL } from "../branding";import { useOpenPrLink } from "../lib/openPullRequestLink";import { isTerminalFocused } from "../lib/terminalFocus";-import { isMacPlatform } from "../lib/utils";+import { cn, isMacPlatform } from "../lib/utils";import {readThreadShell,useProject,@@ -126,6 +126,7 @@ import {import { stackedThreadToast, toastManager } from "./ui/toast";import { formatRelativeTimeLabel } from "../timestampFormat";import { SettingsSidebarNav } from "./settings/SettingsSidebarNav";+import { SidebarStageBackdrop, resolveSidebarStageBackdropVariant } from "./SidebarStageBackdrop";import { Kbd } from "./ui/kbd";import {getArm64IntelBuildWarningDescription,@@ -2744,33 +2745,55 @@ const SidebarChromeHeader = memo(function SidebarChromeHeader({}: {isElectron: boolean;}) {- return isElectron ? (- <SidebarHeader className="@container/sidebar-header drag-region h-[var(--workspace-topbar-height)] shrink-0 flex-row items-center px-3 py-0 md:px-0">- <SidebarTrigger className="md:hidden" />- <SidebarBrand />- </SidebarHeader>- ) : (- <SidebarHeader className="@container/sidebar-header h-[var(--workspace-topbar-height)] shrink-0 flex-row items-center px-3 py-0 md:px-0">- <SidebarTrigger className="md:hidden" />- <SidebarBrand />+ const stageLabel = useSidebarStageLabel();+ const backdropVariant = resolveSidebarStageBackdropVariant(stageLabel);++ return (+ <SidebarHeader+ className={cn(+ "@container/sidebar-header relative h-[var(--workspace-topbar-height)] shrink-0 flex-row items-center px-3 py-0 md:px-0",+ isElectron && "drag-region",+ )}+ >+ {backdropVariant ? <SidebarStageBackdrop variant={backdropVariant} /> : null}+ <SidebarTrigger+ className={cn(+ "relative z-10 md:hidden",+ backdropVariant && "hover:bg-white/15 [&_svg]:text-white/85! [&_svg]:hover:text-white!",+ )}+ />+ <SidebarBrand onBackdrop={backdropVariant !== null} stageLabel={stageLabel} /></SidebarHeader>);});-function SidebarBrand() {- const stageLabel = useSidebarStageLabel();-+function SidebarBrand({ stageLabel, onBackdrop }: { stageLabel: string; onBackdrop: boolean }) {return (<Linkaria-label="Go to threads"- className="sidebar-brand ml-[var(--workspace-titlebar-content-left)] h-7 w-fit min-w-0 shrink-0 items-center gap-1 overflow-hidden rounded-md text-foreground outline-hidden ring-ring focus-visible:ring-2"+ className={cn(+ "sidebar-brand relative z-10 ml-[var(--workspace-titlebar-content-left)] h-7 w-fit min-w-0 shrink-0 items-center gap-1 overflow-hidden rounded-md outline-hidden ring-ring focus-visible:ring-2",+ onBackdrop ? "text-white" : "text-foreground",+ )}to="/"><T3Wordmark />- <span className="truncate text-sm font-medium tracking-tight text-muted-foreground">+ <span+ className={cn(+ "truncate text-sm font-medium tracking-tight",+ onBackdrop ? "text-white/70" : "text-muted-foreground",+ )}+ >Code</span>- <span className="sidebar-brand-stage shrink-0 items-center whitespace-nowrap rounded-full bg-muted/50 px-1.5 py-0.5 text-[8px] font-medium uppercase tracking-[0.18em] text-muted-foreground/60">+ <span+ className={cn(+ "sidebar-brand-stage shrink-0 items-center whitespace-nowrap rounded-full px-1.5 py-0.5 text-[8px] font-medium uppercase tracking-[0.18em]",+ onBackdrop+ ? "bg-white/15 text-white/80 backdrop-blur-sm"+ : "bg-muted/50 text-muted-foreground/60",+ )}+ >{stageLabel}</span></Link>@@ -2791,7 +2814,7 @@ function T3Wordmark() {return (<svgaria-label="T3"- className="h-2.5 w-auto shrink-0 text-foreground"+ className="h-2.5 w-auto shrink-0"viewBox="15.5309 37 94.3941 56.96"xmlns="http://www.w3.org/2000/svg">diff --git a/apps/web/src/components/SidebarStageBackdrop.tsx b/apps/web/src/components/SidebarStageBackdrop.tsxnew file mode 100644index 000000000..963a8c2a9--- /dev/null+++ b/apps/web/src/components/SidebarStageBackdrop.tsx@@ -0,0 +1,316 @@+import { useAtomValue } from "@effect/atom-react";++import { APP_STAGE_LABEL } from "../branding";+import { resolveServerBackedAppStageLabel } from "../branding.logic";+import { primaryServerConfigAtom } from "../state/server";++export type SidebarStageBackdropVariant = "nightly" | "dev";++// A wide viewBox keeps the 96-unit art height at a fixed scale while sidebar resizing reveals+// more horizontal canvas instead of zooming the scene.+const STAGE_BACKDROP_VIEW_BOX = "0 0 8192 96";++export function resolveSidebarStageBackdropVariant(+ stageLabel: string,+): SidebarStageBackdropVariant | null {+ const normalized = stageLabel.trim().toLowerCase();+ if (normalized === "nightly") return "nightly";+ if (normalized === "dev") return "dev";+ return null;+}++export function useSidebarStageBackdropVariant(): SidebarStageBackdropVariant | null {+ const primaryServerVersion =+ useAtomValue(primaryServerConfigAtom)?.environment.serverVersion ?? null;++ return resolveSidebarStageBackdropVariant(+ resolveServerBackedAppStageLabel({+ primaryServerVersion,+ fallbackStageLabel: APP_STAGE_LABEL,+ }),+ );+}++/** Stage-channel header art; palettes mirror the per-channel app icons in `assets/`. */+export function SidebarStageBackdrop({ variant }: { variant: SidebarStageBackdropVariant }) {+ return (+ <div+ aria-hidden+ className="sidebar-stage-backdrop pointer-events-none absolute inset-x-0 top-0 z-0 h-20 select-none overflow-hidden"+ >+ {variant === "nightly" ? <NightlySkyArt /> : <DevBlueprintArt />}+ </div>+ );+}++const NIGHTLY_STARS: ReadonlyArray<{+ cx: number;+ cy: number;+ r: number;+ opacity: number;+}> = [+ { cx: 14, cy: 10, r: 0.6, opacity: 0.85 },+ { cx: 38, cy: 22, r: 0.4, opacity: 0.55 },+ { cx: 58, cy: 8, r: 0.5, opacity: 0.7 },+ { cx: 84, cy: 16, r: 0.4, opacity: 0.5 },+ { cx: 104, cy: 7, r: 0.6, opacity: 0.8 },+ { cx: 126, cy: 20, r: 0.4, opacity: 0.55 },+ { cx: 148, cy: 11, r: 0.5, opacity: 0.7 },+ { cx: 170, cy: 24, r: 0.4, opacity: 0.5 },+ { cx: 192, cy: 9, r: 0.6, opacity: 0.8 },+ { cx: 214, cy: 18, r: 0.4, opacity: 0.55 },+ { cx: 236, cy: 8, r: 0.5, opacity: 0.7 },+ { cx: 258, cy: 20, r: 0.45, opacity: 0.6 },+ { cx: 278, cy: 11, r: 0.55, opacity: 0.75 },+ { cx: 26, cy: 34, r: 0.4, opacity: 0.45 },+ { cx: 118, cy: 34, r: 0.4, opacity: 0.45 },+ { cx: 202, cy: 32, r: 0.4, opacity: 0.5 },+ { cx: 268, cy: 34, r: 0.4, opacity: 0.45 },+];++const NIGHTLY_SPARKLES: ReadonlyArray<{ x: number; y: number }> = [+ { x: 70, y: 28 },+ { x: 160, y: 36 },+ { x: 246, y: 26 },+];++function NightlySkyArt() {+ return (+ <svg+ className="h-full w-full"+ fill="none"+ preserveAspectRatio="xMinYMin slice"+ viewBox={STAGE_BACKDROP_VIEW_BOX}+ xmlns="http://www.w3.org/2000/svg"+ >+ <defs>+ <linearGradient+ id="stage-night-sky"+ x1="24"+ y1="0"+ x2="264"+ y2="96"+ gradientUnits="userSpaceOnUse"+ spreadMethod="reflect"+ >+ <stop stopColor="#07152F" />+ <stop offset="0.5" stopColor="#151443" />+ <stop offset="1" stopColor="#32155B" />+ </linearGradient>+ <radialGradient+ id="stage-night-glow"+ cx="0"+ cy="0"+ r="1"+ gradientTransform="translate(216 18) rotate(137) scale(120 84)"+ gradientUnits="userSpaceOnUse"+ >+ <stop stopColor="#5165D8" stopOpacity="0.4" />+ <stop offset="0.5" stopColor="#283075" stopOpacity="0.16" />+ <stop offset="1" stopColor="#111635" stopOpacity="0" />+ </radialGradient>+ <linearGradient+ id="stage-night-cloud"+ x1="0"+ y1="60"+ x2="288"+ y2="96"+ gradientUnits="userSpaceOnUse"+ >+ <stop stopColor="#4EA4FF" stopOpacity="0.5" />+ <stop offset="0.52" stopColor="#696FEA" stopOpacity="0.62" />+ <stop offset="1" stopColor="#A85BEA" stopOpacity="0.5" />+ </linearGradient>+ <filter+ id="stage-night-soft"+ x="-24"+ y="-24"+ width="336"+ height="144"+ filterUnits="userSpaceOnUse"+ >+ <feGaussianBlur stdDeviation="4" />+ </filter>+ <pattern id="stage-night-stars" width="288" height="96" patternUnits="userSpaceOnUse">+ <g fill="#E4EAFF">+ {NIGHTLY_STARS.map((star) => (+ <circle+ key={`${star.cx}-${star.cy}`}+ cx={star.cx}+ cy={star.cy}+ r={star.r}+ fillOpacity={star.opacity}+ />+ ))}+ </g>+ <g stroke="#C8D7FF" strokeLinecap="round" strokeOpacity="0.7" strokeWidth="0.6">+ {NIGHTLY_SPARKLES.map((sparkle) => (+ <g key={`${sparkle.x}-${sparkle.y}`}>+ <path d={`M${sparkle.x - 1.5} ${sparkle.y}H${sparkle.x + 1.5}`} />+ <path d={`M${sparkle.x} ${sparkle.y - 1.5}V${sparkle.y + 1.5}`} />+ </g>+ ))}+ </g>+ </pattern>+ <pattern id="stage-night-glows" width="640" height="96" patternUnits="userSpaceOnUse">+ <rect width="640" height="96" fill="url(#stage-night-glow)" />+ </pattern>+ </defs>++ <rect width="100%" height="96" fill="url(#stage-night-sky)" />+ <rect width="100%" height="96" fill="url(#stage-night-glows)" />+ <rect width="100%" height="96" fill="url(#stage-night-stars)" />++ <g filter="url(#stage-night-soft)">+ <path+ d="M-12 88C-12 74 0 63 14 63C18 50 30 41 44 41C58 41 70 49 74 62C79 57 86 54 94 54C110 54 123 66 124 82C132 83 138 88 141 96H-12V88Z"+ fill="url(#stage-night-cloud)"+ />+ </g>+ <g filter="url(#stage-night-soft)">+ <path+ d="M150 96C151 84 161 75 173 75C176 64 186 57 198 57C210 57 220 64 223 75C231 75 238 80 241 87C250 87 257 91 260 96H150Z"+ fill="url(#stage-night-cloud)"+ fillOpacity="0.8"+ />+ </g>+ </svg>+ );+}++function DevBlueprintArt() {+ return (+ <svg+ className="stage-blueprint h-full w-full"+ fill="none"+ preserveAspectRatio="xMinYMin slice"+ viewBox={STAGE_BACKDROP_VIEW_BOX}+ xmlns="http://www.w3.org/2000/svg"+ >+ <defs>+ <linearGradient+ id="stage-bp-paper"+ x1="60"+ y1="0"+ x2="220"+ y2="96"+ gradientUnits="userSpaceOnUse"+ spreadMethod="reflect"+ >+ <stop style={{ stopColor: "var(--stage-bp-top)" }} />+ <stop offset="0.5" style={{ stopColor: "var(--stage-bp-mid)" }} />+ <stop offset="1" style={{ stopColor: "var(--stage-bp-bottom)" }} />+ </linearGradient>+ <radialGradient+ id="stage-bp-glow"+ cx="0"+ cy="0"+ r="1"+ gradientTransform="translate(216 14) rotate(137) scale(120 84)"+ gradientUnits="userSpaceOnUse"+ >+ <stop stopColor="#D4F6FF" stopOpacity="0.4" />+ <stop offset="0.52" stopColor="#65C8FF" stopOpacity="0.16" />+ <stop offset="1" stopColor="#276AF1" stopOpacity="0" />+ </radialGradient>+ <radialGradient+ id="stage-bp-glow-celeste"+ cx="0"+ cy="0"+ r="1"+ gradientTransform="translate(474 44) rotate(166) scale(156 92)"+ gradientUnits="userSpaceOnUse"+ >+ <stop stopColor="#D2FFFF" stopOpacity="0.34" />+ <stop offset="0.5" stopColor="#48DCF5" stopOpacity="0.18" />+ <stop offset="1" stopColor="#277EF1" stopOpacity="0" />+ </radialGradient>+ <radialGradient+ id="stage-bp-glow-violet"+ cx="0"+ cy="0"+ r="1"+ gradientTransform="translate(704 18) rotate(145) scale(132 88)"+ gradientUnits="userSpaceOnUse"+ >+ <stop stopColor="#D9D8FF" stopOpacity="0.3" />+ <stop offset="0.52" stopColor="#7C8BFF" stopOpacity="0.14" />+ <stop offset="1" stopColor="#3155DF" stopOpacity="0" />+ </radialGradient>+ <pattern id="stage-bp-grid-minor" width="8" height="8" patternUnits="userSpaceOnUse">+ <path d="M8 0H0V8" stroke="#EAF6FF" strokeOpacity="0.14" strokeWidth="0.5" />+ </pattern>+ <pattern id="stage-bp-grid-major" width="32" height="32" patternUnits="userSpaceOnUse">+ <path d="M32 0H0V32" stroke="#EAF6FF" strokeOpacity="0.26" strokeWidth="0.6" />+ </pattern>+ <pattern id="stage-bp-ruler" width="32" height="6" patternUnits="userSpaceOnUse">+ <path+ d="M4 0V2.5M12 0V2.5M20 0V4M28 0V2.5"+ stroke="#DDF7FF"+ strokeOpacity="0.5"+ strokeWidth="0.5"+ />+ </pattern>+ <pattern id="stage-bp-glows" width="768" height="96" patternUnits="userSpaceOnUse">+ <rect width="768" height="96" fill="url(#stage-bp-glow)" />+ <rect width="768" height="96" fill="url(#stage-bp-glow-celeste)" />+ <rect width="768" height="96" fill="url(#stage-bp-glow-violet)" />+ </pattern>+ <pattern id="stage-bp-annotations" width="768" height="96" patternUnits="userSpaceOnUse">+ <g stroke="#DDF7FF" strokeLinecap="round" strokeOpacity="0.6" strokeWidth="0.7">+ <path d="M180 64H264" strokeDasharray="5 4" />+ <path d="M180 61V67M264 61V67" />+ <path d="M276 10V44" strokeDasharray="4 4" strokeOpacity="0.5" />+ <path d="M273 10H279M273 44H279" strokeOpacity="0.5" />+ <path d="M348 30H428" strokeDasharray="3.5 5" strokeOpacity="0.5" />+ <path d="M348 27V33M428 27V33" strokeOpacity="0.5" />+ <path d="M512 48V80" strokeDasharray="5 3" strokeOpacity="0.45" />+ <path d="M509 48H515M509 80H515" strokeOpacity="0.45" />+ <path d="M590 70H724" strokeDasharray="7 4" strokeOpacity="0.55" />+ <path d="M590 67V73M724 67V73" strokeOpacity="0.55" />+ </g>++ <g stroke="#DDF7FF" strokeLinecap="round" strokeOpacity="0.55" strokeWidth="0.6">+ <g>+ <path d="M34 60L38 64M38 60L34 64" />+ </g>+ <g>+ <path d="M228 26H234M231 23V29" />+ </g>+ <g>+ <path d="M143 51H149M146 48V54" />+ </g>+ <g>+ <path d="M316 16L322 22M322 16L316 22" />+ </g>+ <g>+ <path d="M468 70H476M472 66V74" />+ </g>+ <g>+ <path d="M558 28L564 34M564 28L558 34" />+ </g>+ <g>+ <path d="M742 44H750M746 40V48" />+ </g>+ </g>++ <g stroke="#DDF7FF" strokeOpacity="0.35" strokeWidth="0.6">+ <circle cx="196" cy="38" r="13" strokeDasharray="3.5 4" />+ <path d="M196 33V43M191 38H201" strokeOpacity="0.6" strokeWidth="0.4" />+ <circle cx="414" cy="64" r="10" strokeDasharray="2.5 3.5" />+ <path d="M414 60V68M410 64H418" strokeOpacity="0.6" strokeWidth="0.4" />+ <circle cx="648" cy="32" r="15" strokeDasharray="4 5" />+ <path d="M648 26V38M642 32H654" strokeOpacity="0.6" strokeWidth="0.4" />+ </g>+ </pattern>+ </defs>++ <rect width="100%" height="96" fill="url(#stage-bp-paper)" />+ <rect width="100%" height="96" fill="url(#stage-bp-glows)" />+ <rect width="100%" height="96" fill="url(#stage-bp-grid-minor)" />+ <rect width="100%" height="96" fill="url(#stage-bp-grid-major)" />+ <rect width="100%" height="6" fill="url(#stage-bp-ruler)" />+ <rect width="100%" height="96" fill="url(#stage-bp-annotations)" />+ </svg>+ );+}diff --git a/apps/web/src/index.css b/apps/web/src/index.cssindex c500eb68d..77a5f027c 100644--- a/apps/web/src/index.css+++ b/apps/web/src/index.css@@ -231,6 +231,42 @@ html[data-mobile-composer-route-transition="true"]::view-transition-old(t3-mobil}}+ /* Stage-channel sidebar art; ::after ramps to the sidebar bg color and the+ mask lets the surface grain show through at the boundary. */+ .sidebar-stage-backdrop {+ mask-image: linear-gradient(to bottom, black 0%, black 55%, transparent 92%);+ -webkit-mask-image: linear-gradient(to bottom, black 0%, black 55%, transparent 92%);+ }++ .sidebar-stage-backdrop::after {+ content: "";+ position: absolute;+ inset: 0;+ background: linear-gradient(+ to bottom,+ transparent 0%,+ transparent 28%,+ color-mix(in srgb, var(--app-chrome-background) 10%, transparent) 40%,+ color-mix(in srgb, var(--app-chrome-background) 30%, transparent) 52%,+ color-mix(in srgb, var(--app-chrome-background) 58%, transparent) 64%,+ color-mix(in srgb, var(--app-chrome-background) 82%, transparent) 75%,+ color-mix(in srgb, var(--app-chrome-background) 96%, transparent) 85%,+ var(--app-chrome-background) 93%+ );+ }++ .stage-blueprint {+ --stage-bp-top: #67c2ff;+ --stage-bp-mid: #347ff8;+ --stage-bp-bottom: #1538d0;+ }++ .dark .stage-blueprint {+ --stage-bp-top: #3a7ad1;+ --stage-bp-mid: #2050ae;+ --stage-bp-bottom: #101f6e;+ }+.workspace-topbar {display: flex;height: var(--workspace-topbar-height);