From 5a4d06b4c16b620d2f49bc40f6ef80a1f117e7b7 Mon Sep 17 00:00:00 2001 From: agent Date: Tue, 17 Nov 2026 08:32:41 +0000 Subject: [PATCH 1/2] Keep the collapsed AppSidebar's header and footer inside the sidebar Co-Authored-By: Claude Opus 5.5 --- .changeset/sidebar-collapsed-header-footer.md | 5 ++++ docs/layout-and-navigation/app-sidebar.md | 2 +- .../components/layout/app-sidebar.test.tsx | 22 ++++++++++++++ .../onu/src/components/layout/app-sidebar.tsx | 29 +++++++++++++++++-- packages/onu/src/components/layout/logo.tsx | 6 +++- web/src/pages/_shared/shells.tsx | 2 +- .../app-sidebar.demo.tsx | 9 ++++-- 7 files changed, 68 insertions(+), 7 deletions(-) create mode 100644 .changeset/sidebar-collapsed-header-footer.md diff --git a/.changeset/sidebar-collapsed-header-footer.md b/.changeset/sidebar-collapsed-header-footer.md new file mode 100644 index 000000000..46f7f0ca8 --- /dev/null +++ b/.changeset/sidebar-collapsed-header-footer.md @@ -0,0 +1,5 @@ +--- +"@javaabu/onu": patch +--- + +`AppSidebar`: collapsed to icons, the header and footer no longer spill out of the sidebar. A `Logo` shows only its mark, a `UserProfile` only its avatar, and anything else is clipped to the sidebar's width. diff --git a/docs/layout-and-navigation/app-sidebar.md b/docs/layout-and-navigation/app-sidebar.md index 97ef00f1f..31096472f 100644 --- a/docs/layout-and-navigation/app-sidebar.md +++ b/docs/layout-and-navigation/app-sidebar.md @@ -43,7 +43,7 @@ Inside a panel `AppLayout` (the default) the sidebar uses `surface="shell"`: Pro - **`action`**: the main call to action under the header, as a full-width 44px button (Proton's "New message"). Collapsed to icons, only its icon shows; the label stays its accessible name. - **Count pills**: numeric badges are brand-coloured pills for unread-like counts, read as "12 new" by screen readers. Set `badgeTone: "neutral"` on an item for a plain muted total, read as the number alone. - **Folders and labels**: give an item a `color`. With a semantic icon (`icon: "folder"`) the icon is tinted; with no icon it shows a coloured dot. The colour is decorative; the label carries the meaning. -- **Header and footer**: put a `Logo` in `header`, with an [`ActionMenu`](../overlays/action-menu) of the suite's apps next to it if there is one, and a quota bar ([`ProgressBar`](../loading/progress-bar) with a link) or a `UserProfile` in `footer`. +- **Header and footer**: put a `Logo` in `header`, with an [`ActionMenu`](../overlays/action-menu) of the suite's apps next to it if there is one, and a quota bar ([`ProgressBar`](../loading/progress-bar) with a link) or a `UserProfile` in `footer`. Collapsed to icons, the header and footer are an icon wide: a `Logo` shows only its mark and a `UserProfile` only its avatar, and anything else that doesn't fit is clipped. Hide content that has no icon form, such as the quota bar or the app switcher, with `className="group-data-[collapsible=icon]:hidden"`. ```tsx { expect(within(menu).getByRole("menuitem", { name: "Locked" })).toHaveAttribute("aria-disabled", "true") }) + it("fits a Logo and a UserProfile into the header and footer when collapsed to icons", () => { + renderSidebar( + } + footer={} + />, + {}, + false, + ) + const header = document.querySelector("[data-slot=sidebar-header]")! + const footer = document.querySelector("[data-slot=sidebar-footer]")! + expect(header).toHaveClass("group-data-[collapsible=icon]:overflow-hidden") + expect(header).toHaveClass("group-data-[collapsible=icon]:[&_[data-slot=logo-text]]:sr-only") + expect(header.querySelector("[data-slot=logo-text]")).toHaveTextContent("Onu Admin") + expect(footer).toHaveClass("group-data-[collapsible=icon]:overflow-hidden") + expect(footer).toHaveClass("group-data-[collapsible=icon]:[&_[data-slot=user-profile-text]]:hidden") + expect(screen.getByRole("button", { name: /Aishath Shifa/ })).toHaveAttribute("data-part", "user-profile") + }) + it("toggles with the sidebar trigger and Ctrl+B", async () => { renderSidebar() const sidebar = document.querySelector("[data-slot=sidebar]")! diff --git a/packages/onu/src/components/layout/app-sidebar.tsx b/packages/onu/src/components/layout/app-sidebar.tsx index 153939969..2789467cb 100644 --- a/packages/onu/src/components/layout/app-sidebar.tsx +++ b/packages/onu/src/components/layout/app-sidebar.tsx @@ -98,6 +98,21 @@ export interface AppSidebarProps extends Omit {header || action ? ( {header} {action ? ( @@ -494,7 +513,13 @@ export function AppSidebar({ {children} - {footer ? {footer} : null} + {footer ? ( + + {footer} + + ) : null} {rail ? : null} ) diff --git a/packages/onu/src/components/layout/logo.tsx b/packages/onu/src/components/layout/logo.tsx index d249aedef..b7c8c8584 100644 --- a/packages/onu/src/components/layout/logo.tsx +++ b/packages/onu/src/components/layout/logo.tsx @@ -82,7 +82,11 @@ export function Logo({ const content = ( <> {mark} - {text ? {text} : null} + {text ? ( + + {text} + + ) : null} ) diff --git a/web/src/pages/_shared/shells.tsx b/web/src/pages/_shared/shells.tsx index 509333c50..7f4439fe3 100644 --- a/web/src/pages/_shared/shells.tsx +++ b/web/src/pages/_shared/shells.tsx @@ -239,7 +239,7 @@ export function AdminShell({ } footer={ -
+
+ } @@ -136,7 +141,7 @@ function ShellDemo() { }, ]} footer={ -
+
Date: Tue, 17 Nov 2026 08:35:04 +0000 Subject: [PATCH 2/2] Release v0.3.1 Co-Authored-By: Claude Opus 5.5 --- .changeset/sidebar-collapsed-header-footer.md | 5 ----- figma/plugin/code.js | 2 +- packages/onu-mcp/CHANGELOG.md | 4 ++++ packages/onu-mcp/package.json | 2 +- packages/onu/CHANGELOG.md | 6 ++++++ packages/onu/package.json | 2 +- plugins/onu/.claude-plugin/plugin.json | 2 +- 7 files changed, 14 insertions(+), 9 deletions(-) delete mode 100644 .changeset/sidebar-collapsed-header-footer.md diff --git a/.changeset/sidebar-collapsed-header-footer.md b/.changeset/sidebar-collapsed-header-footer.md deleted file mode 100644 index 46f7f0ca8..000000000 --- a/.changeset/sidebar-collapsed-header-footer.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@javaabu/onu": patch ---- - -`AppSidebar`: collapsed to icons, the header and footer no longer spill out of the sidebar. A `Logo` shows only its mark, a `UserProfile` only its avatar, and anything else is clipped to the sidebar's width. diff --git a/figma/plugin/code.js b/figma/plugin/code.js index 5daab2d41..43bfac187 100644 --- a/figma/plugin/code.js +++ b/figma/plugin/code.js @@ -2,7 +2,7 @@ (function() { //#region ../packages/onu/package.json - var version = "0.3.0"; + var version = "0.3.1"; //#endregion //#region ../tokens.json diff --git a/packages/onu-mcp/CHANGELOG.md b/packages/onu-mcp/CHANGELOG.md index bd83ddfc8..fad5a59fa 100644 --- a/packages/onu-mcp/CHANGELOG.md +++ b/packages/onu-mcp/CHANGELOG.md @@ -1,5 +1,9 @@ # @javaabu/onu-mcp +## 0.3.1 + +No changes in this release. + ## 0.3.0 ### Minor Changes diff --git a/packages/onu-mcp/package.json b/packages/onu-mcp/package.json index 6063bfb77..33e2ff4ad 100644 --- a/packages/onu-mcp/package.json +++ b/packages/onu-mcp/package.json @@ -1,6 +1,6 @@ { "name": "@javaabu/onu-mcp", - "version": "0.3.0", + "version": "0.3.1", "description": "MCP server for Onu (@javaabu/onu): gives AI assistants the component docs and the rules for writing Onu code.", "license": "MIT", "author": { diff --git a/packages/onu/CHANGELOG.md b/packages/onu/CHANGELOG.md index 67c1bf3e4..64a6858cf 100644 --- a/packages/onu/CHANGELOG.md +++ b/packages/onu/CHANGELOG.md @@ -1,5 +1,11 @@ # @javaabu/onu +## 0.3.1 + +### Patch Changes + +- 5a4d06b: `AppSidebar`: collapsed to icons, the header and footer no longer spill out of the sidebar. A `Logo` shows only its mark, a `UserProfile` only its avatar, and anything else is clipped to the sidebar's width. + ## 0.3.0 ### Minor Changes diff --git a/packages/onu/package.json b/packages/onu/package.json index ae142d803..5c06fddd2 100644 --- a/packages/onu/package.json +++ b/packages/onu/package.json @@ -1,6 +1,6 @@ { "name": "@javaabu/onu", - "version": "0.3.0", + "version": "0.3.1", "description": "Javaabu's React UI component library: shadcn/ui based, RTL and Dhivehi first, Thaana keyboard input, one-variable theming.", "license": "MIT", "author": { diff --git a/plugins/onu/.claude-plugin/plugin.json b/plugins/onu/.claude-plugin/plugin.json index ea970e685..44620acaa 100644 --- a/plugins/onu/.claude-plugin/plugin.json +++ b/plugins/onu/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "onu", "description": "Build UI with Onu (@javaabu/onu): the rules for writing Onu code, and the component docs through the Onu MCP server.", - "version": "0.3.0", + "version": "0.3.1", "author": { "name": "Javaabu Pvt. Ltd.", "url": "https://javaabu.com"