From 2c6e8e1dcb40b5395f49926a441e61f62294cc37 Mon Sep 17 00:00:00 2001 From: Raman Yasel Date: Fri, 4 Dec 2026 19:04:20 +0300 Subject: [PATCH] Update the sidebar and shared layout The sidebar and the page are two slabs on the window, drawn to the updated Figma kit and the designer's window backgrounds: a new scheme color, `window` (#0B121A in light, #4A4E66 in dark) with its dots drawn in code; the strip as icons in 40px circles with the notch in the window's colors; 36px panel rows; Settings and Admin on the same slab; one 48px look for the eight banners and PageShell's bar. Co-Authored-By: Claude Opus 5.5 --- .claude/skills/openbot-copy/SKILL.md | 6 +- app/src/assets/patterns/window-matrix.svg | 16 ++ app/src/components/admin/admin-sidebar.tsx | 167 ++++++++++-------- .../components/app-sidebar/app-sidebar.tsx | 35 +++- app/src/components/app-sidebar/bots-panel.tsx | 30 ++-- .../app-sidebar/channel-item-content.tsx | 19 +- app/src/components/app-sidebar/channel.tsx | 6 +- .../app-sidebar/conversations-panel.tsx | 62 ++++--- .../components/app-sidebar/section-strip.tsx | 20 +-- .../components/layout/app-frame-skeleton.tsx | 46 +++-- app/src/components/layout/banner.ts | 19 ++ .../components/layout/connection-banner.tsx | 4 +- app/src/components/layout/menu-sidebar.tsx | 96 ++++++++++ app/src/components/layout/page-shell.tsx | 4 +- app/src/components/layout/plan-banner.tsx | 9 +- app/src/components/layout/section-panel.tsx | 15 +- app/src/components/layout/selection-notch.tsx | 35 ++++ .../components/layout/self-host-banner.tsx | 13 +- app/src/components/layout/sidebar-shell.tsx | 17 +- app/src/components/layout/sidebar-toggle.tsx | 8 +- app/src/components/layout/strip.tsx | 112 ++++++------ app/src/components/layout/update-banner.tsx | 10 +- .../components/moves/moved-apps-notice.tsx | 12 +- .../moves/moved-bot-keys-notice.tsx | 10 +- .../moves/moved-elsewhere-banner.tsx | 12 +- .../left-organization-banner.tsx | 4 +- .../components/settings/settings-sidebar.tsx | 123 +++++++------ app/src/lib/artifacts/bridge/wire.ts | 2 + app/src/lib/artifacts/tokens.css | 4 + app/src/lib/sidebar.ts | 8 +- app/src/routes/_authed/_app.tsx | 6 +- app/src/styles.css | 35 +++- app/src/theme.css | 15 ++ app/tests/app-navigation.test.tsx | 4 +- app/tests/bots-panel.test.tsx | 2 +- app/tests/browser-nav-item.test.tsx | 5 +- app/tests/channel-item-working.test.tsx | 9 +- app/tests/design-tokens.test.ts | 25 ++- app/tests/section-strip-routines.test.tsx | 6 +- app/tests/section-strip.test.tsx | 36 ++-- app/tests/sidebar-preference.test.ts | 8 +- app/tests/sidebar-window-buttons.test.tsx | 11 +- app/tests/sidebar-zoom-drag.test.tsx | 5 +- app/tests/skins-window-buttons.test.tsx | 9 +- app/tests/strip.test.tsx | 21 +-- docs/app-guidelines.md | 11 +- docs/design-system.md | 8 +- mobile/src/scheme.ts | 4 + tokens/src/scheme.ts | 30 +++- tokens/tests/contrast.test.ts | 2 + tokens/tests/slate.test.ts | 10 +- 51 files changed, 788 insertions(+), 398 deletions(-) create mode 100644 app/src/assets/patterns/window-matrix.svg create mode 100644 app/src/components/layout/banner.ts create mode 100644 app/src/components/layout/menu-sidebar.tsx create mode 100644 app/src/components/layout/selection-notch.tsx diff --git a/.claude/skills/openbot-copy/SKILL.md b/.claude/skills/openbot-copy/SKILL.md index fb8c609323..aeb68ea46b 100644 --- a/.claude/skills/openbot-copy/SKILL.md +++ b/.claude/skills/openbot-copy/SKILL.md @@ -63,9 +63,9 @@ than showing an empty row. `app/src/lib/primitives.ts` holds the names, the orde | **Setup** | A Bot's name and instructions. | | | **Vault** | Your saved logins and keys. No Bot sees what is in it. | Saved logins, Passwords, Keys, Credentials (as pages) | -**The sidebar strip's short names.** The strip writes each section's name under its icon, in a -column too narrow for the long ones, so there alone Conversations is **Chats**. The panel it opens -keeps its full name, and sentences still say "conversation". Nowhere else uses this short name. +**The sidebar strip's names.** The strip shows each section's name in a tooltip beside its icon, +and says it to a screen reader, so a section keeps its full name there too: **Conversations**, as +the panel it opens says. The strip has no short names of its own. The scopes are **this Bot** (the Bot's page), **every Bot** (Settings, and Apps in the sidebar) and, in the team edition, **everyone** (Admin). The words in the "Not" column may still appear in a diff --git a/app/src/assets/patterns/window-matrix.svg b/app/src/assets/patterns/window-matrix.svg new file mode 100644 index 0000000000..6c9e31394c --- /dev/null +++ b/app/src/assets/patterns/window-matrix.svg @@ -0,0 +1,16 @@ + + diff --git a/app/src/components/admin/admin-sidebar.tsx b/app/src/components/admin/admin-sidebar.tsx index d5df3f8ab1..445cba7d60 100644 --- a/app/src/components/admin/admin-sidebar.tsx +++ b/app/src/components/admin/admin-sidebar.tsx @@ -1,8 +1,17 @@ -import { IconArrowLeft } from "@/components/icons"; import { Link, type LinkOptions } from "@tanstack/react-router"; import type * as React from "react"; import { useAdminSections } from "@/components/admin/admin-sections"; import { usePendingRequestCounts } from "@/components/plugins/access-requests"; +import { + MenuSidebarBack, + MenuSidebarNotch, + MenuSidebarPanel, + menuSidebarActiveProps, + menuSidebarButtonClassName, + menuSidebarGroupClassName, + menuSidebarLabelClassName, +} from "@/components/layout/menu-sidebar"; +import { SIDEBAR_SLAB } from "@/components/layout/sidebar-shell"; import { Sidebar, SidebarContent, @@ -37,95 +46,105 @@ export function AdminSidebar({ */ const waiting = usePendingRequestCounts()?.total ?? 0; return ( - + // A slab on the window, as the app's sidebar is. + {/* - * Pinned to the same height as the app sidebar's header. Left to itself this one is 60px - * against the app's 45px — `p-2` around a `size="lg"` button rather than a fixed height — so - * the nav list started lower here and the sidebar appeared to shift on the way into Admin. - * - * The button takes its default height rather than `h-full`. `h-full` resolves against the - * parent, which in the app sidebar is a flex row holding a second control and here is not, so - * the same class produces two different heights. + * On the slab's top row, beside the window's buttons in OpenBot Desktop on macOS, at the same + * height as Settings'. The button takes its default height rather than `h-full`, which + * resolves against the parent and so drew two different heights in two shells. */} ( - - Back to app + )} /> - - - - - {/* - * `activeOptions.exact`, because /admin is a prefix of every other route here and - * would otherwise light up on all of them. - */} - ( - - Overview - - )} - /> - - - - {sections.map((group) => ( - - {group.title} - - {group.items.map((item) => { - const count = item.linkOptions.to === APPS_TO ? waiting : 0; - return ( - - ( - - - {/* Cut short on one line in a narrow sidebar, never wrapped out of the row. */} - {item.title} - {count > 0 ? ( - - , {count} {count === 1 ? "request" : "requests"}{" "} - waiting - - ) : null} - - )} - /> - {/* As Settings badges Setup: the count beside the name, read out once in the link. */} - {count > 0 ? ( - - ) : null} - - ); - })} + + + + + + + {/* + * `activeOptions.exact`, because /admin is a prefix of every other route here and + * would otherwise light up on all of them. + */} + ( + + Overview + + )} + /> + - ))} - + {sections.map((group) => ( + + + {group.title} + + + {group.items.map((item) => { + const count = item.linkOptions.to === APPS_TO ? waiting : 0; + return ( + + + ( + + + {/* Cut short on one line in a narrow sidebar, never wrapped out of the row. */} + + {item.title} + + {count > 0 ? ( + + , {count} {count === 1 ? "request" : "requests"}{" "} + waiting + + ) : null} + + )} + /> + {/* As Settings badges Setup: the count beside the name, read out once in the link. */} + {count > 0 ? ( + + ) : null} + + ); + })} + + + ))} + + ); diff --git a/app/src/components/app-sidebar/app-sidebar.tsx b/app/src/components/app-sidebar/app-sidebar.tsx index 552751b192..1003d32ad1 100644 --- a/app/src/components/app-sidebar/app-sidebar.tsx +++ b/app/src/components/app-sidebar/app-sidebar.tsx @@ -1,9 +1,17 @@ import type * as React from "react"; import { useState } from "react"; import { useBeforeCommandNavigate } from "@/components/navigation/command-menu"; +import { SIDEBAR_SLAB } from "@/components/layout/sidebar-shell"; +import { SIDEBAR_SHORTCUT_LABEL } from "@/components/layout/sidebar-toggle"; import { Sidebar, SidebarRail, useSidebar } from "@/components/ui/sidebar"; +import { + Tooltip, + TooltipContent, + TooltipTrigger, +} from "@/components/ui/tooltip"; import { useChannelEvents } from "@/lib/channels/use-channel-events"; import { useOpenSection } from "@/lib/sections"; +import { cn } from "@/lib/utils"; import { BotsPanel } from "./bots-panel"; import { ConversationsPanel } from "./conversations-panel"; import { SectionStrip } from "./section-strip"; @@ -27,7 +35,7 @@ export { * Bots' on the Bots section, Conversations' everywhere else. */ export function AppSidebar({ ...props }: React.ComponentProps) { - const { setOpenMobile } = useSidebar(); + const { setOpenMobile, state } = useSidebar(); const { section } = useOpenSection(); /* * Both panels stay mounted once shown, the one not open out of sight: going back to a panel finds @@ -45,18 +53,37 @@ export function AppSidebar({ ...props }: React.ComponentProps) { return ( - {/* In OpenBot Desktop on macOS, what shows of this row past the strip moves the window too. */} + {/* + * In OpenBot Desktop on macOS, what shows of this row past the strip moves the window too. In + * a narrow window the sheet is the slab, and the panel lies in it the same way. + */}
- + {/* Folded down to the strip, its edge says how to bring the panel back. */} + {state === "collapsed" ? ( + + {/* The rail's own slot, which the trigger's would otherwise replace. */} + } + /> + + Show sidebar + {SIDEBAR_SHORTCUT_LABEL} + + + ) : ( + + )}
); } diff --git a/app/src/components/app-sidebar/bots-panel.tsx b/app/src/components/app-sidebar/bots-panel.tsx index a3e089a9d7..0f6ae5aea8 100644 --- a/app/src/components/app-sidebar/bots-panel.tsx +++ b/app/src/components/app-sidebar/bots-panel.tsx @@ -68,7 +68,7 @@ const HeldReads = createContext<(botId: string, held: unknown) => void>( /** The row under a Bot that is not a conversation: Show more. */ const BOT_LIST_ACTION_ROW = - "w-full justify-start px-2.5 font-normal text-muted-foreground text-sm"; + "w-full justify-start pr-3 pl-1.5 font-normal text-muted-foreground text-sm"; /** * One Bot's latest conversations, under its row: {@link BOT_CONVERSATIONS_PAGE} at a time, read from @@ -198,7 +198,7 @@ function BotConversations({ /** The squares after a Bot's name: + for a new conversation, and the caret. */ const BOT_ROW_SQUARE = - "flex size-9 shrink-0 items-center justify-center rounded-lg bg-transparent text-muted-foreground outline-hidden ring-sidebar-ring transition-colors hover:bg-foreground/5 hover:text-sidebar-foreground focus-visible:ring-2"; + "flex size-9 shrink-0 items-center justify-center rounded-md bg-transparent text-muted-foreground outline-hidden ring-sidebar-ring transition-colors hover:bg-sidebar-accent/50 hover:text-sidebar-foreground focus-visible:ring-2"; /** * One Bot: its orb and name, a link to its page, with a dot when something waits on the person from @@ -230,7 +230,7 @@ function BotRow({ @@ -282,8 +282,9 @@ function BotRow({ {expanded ? ( - // The line stops short of the next Bot's orb, which sits right under it otherwise. -
+ // The line stops short of the next Bot's orb, which sits right under it otherwise. It keeps + // to the orb's left of centre as the row's 6px gutter moves the orb. +
) : null} @@ -337,7 +338,7 @@ export function BotsPanel({ hidden = false }: { hidden?: boolean }) { actions={
) : shown.length === 0 ? ( -

+

{term ? `No Bots match “${search.trim()}”.` : "No Bots yet. Make one with New Bot."} @@ -397,7 +399,7 @@ export function BotsPanel({ hidden = false }: { hidden?: boolean }) { ) : ( {held !== undefined ? ( -

+
) : null} -