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.
fix(web): open Usage as a full page like Plugins (#344)
Leof6ae1623eb53
diff --git a/.changeset/usage-full-page.md b/.changeset/usage-full-page.mdnew file mode 100644index 000000000..2c4e0440f--- /dev/null+++ b/.changeset/usage-full-page.md@@ -0,0 +1,5 @@+---+"@akeru/web": patch+---++Usage now opens as a full page like Plugins, hiding the bot list and using the window width.diff --git a/apps/web/src/components/sidebar/ExperimentalSidebar.tsx b/apps/web/src/components/sidebar/ExperimentalSidebar.tsxindex ca639fcaf..63305e981 100644--- a/apps/web/src/components/sidebar/ExperimentalSidebar.tsx+++ b/apps/web/src/components/sidebar/ExperimentalSidebar.tsx@@ -59,11 +59,15 @@ export function useSidebarExperiment(): boolean {/** Rail plus panel use a fixed width; resizing is ignored while experimenting. */export const EXPERIMENTAL_SIDEBAR_WIDTH = RAIL_WIDTH + PANEL_WIDTH;-/** Full-page places such as Plugins show only the rail. */+/** Full-page places such as Plugins and Usage show only the rail. */export const EXPERIMENTAL_RAIL_ONLY_WIDTH = RAIL_WIDTH;export function isRailOnlyPath(pathname: string): boolean {- return pathname === "/plugins" || pathname.startsWith("/plugins/");+ return isPathUnder(pathname, "/plugins") || isPathUnder(pathname, "/usage");+}++function isPathUnder(pathname: string, base: string): boolean {+ return pathname === base || pathname.startsWith(`${base}/`);}type Place = "chats" | "routines";@@ -75,16 +79,18 @@ export function ExperimentalSidebar() {// Settings is a route, not a panel toggle: the URL decides whether it owns// the panel, and leaving it goes back to the chat workspace.const onSettings = pathname === "/settings" || pathname.startsWith("/settings/");- const onPlugins = isRailOnlyPath(pathname);+ const onPlugins = isPathUnder(pathname, "/plugins");+ const onUsage = isPathUnder(pathname, "/usage");+ const railOnly = onPlugins || onUsage;// Collapsing hides the panel and keeps the rail; picking a place brings it back.- const { state: sidebarState, setOpen: setSidebarOpen } = useSidebar();+ const { state: sidebarState, setOpen: setSidebarOpen, isMobile } = useSidebar();const revealPanel = () => {if (sidebarState === "collapsed") setSidebarOpen(true);};const choosePlace = (next: Place) => {setPlace(next);revealPanel();- if (onSettings || onPlugins) void navigate({ to: "/" });+ if (onSettings || railOnly) void navigate({ to: "/" });};const isMacosDesktop = isElectron && isMacPlatform(navigator.platform);const { resolvedTheme, setAppearanceMode } = useTheme();@@ -115,13 +121,13 @@ export function ExperimentalSidebar() {<RailButtonlabel={t("Chats")}icon={BubbleChatIcon}- active={!onSettings && !onPlugins && place === "chats"}+ active={!onSettings && !railOnly && place === "chats"}onClick={() => choosePlace("chats")}/><RailButtonlabel={t("Routines")}icon={Calendar03Icon}- active={!onSettings && !onPlugins && place === "routines"}+ active={!onSettings && !railOnly && place === "routines"}onClick={() => choosePlace("routines")}/><RailButton@@ -132,7 +138,14 @@ export function ExperimentalSidebar() {if (!onPlugins) openPlugins();}}/>- <RailButton label={t("Usage")} icon={Analytics01Icon} onClick={() => openUsage()} />+ <RailButton+ label={t("Usage")}+ icon={Analytics01Icon}+ active={onUsage}+ onClick={() => {+ if (!onUsage) openUsage();+ }}+ /></div><div className="mt-auto flex flex-col items-center gap-1.5"><RailButton@@ -159,7 +172,7 @@ export function ExperimentalSidebar() {{/* The panel is a raised card; its row tokens are re-based on the card surface. */}{/* Fixed width so collapsing clips the panel instead of squeezing its rows. */}<div- className={cn("flex shrink-0 py-2 pr-2", onPlugins && "hidden")}+ className={cn("flex shrink-0 py-2 pr-2", railOnly && !isMobile && "hidden")}style={{ width: PANEL_WIDTH }}><div className="flex min-w-0 flex-1 flex-col overflow-hidden rounded-2xl border border-sidebar-border/70 bg-sidebar shadow-[var(--shell-card-shadow)] [--sidebar-row-active:color-mix(in_srgb,var(--sidebar-foreground)_7%,transparent)] [--sidebar-row-hover:color-mix(in_srgb,var(--sidebar-foreground)_4%,transparent)] [--card:var(--shell-card)] [--sidebar:var(--shell-card)]">diff --git a/apps/web/src/components/usage/UsagePage.tsx b/apps/web/src/components/usage/UsagePage.tsxindex 2f91fae63..cddc384ce 100644--- a/apps/web/src/components/usage/UsagePage.tsx+++ b/apps/web/src/components/usage/UsagePage.tsx@@ -238,7 +238,7 @@ export function UsagePage() {<WorkspacePageHeader electron={isElectron}>{topbarContent}</WorkspacePageHeader><ScrollArea className="min-h-0 flex-1">- <WorkspacePageContainer width="readable">+ <WorkspacePageContainer width="expanded" className="px-4 sm:px-10">{showingLimits ? (<UsageLimitsOverviewplanLimits={planLimits}