From 49dee42ad2ddd607cb88d7c5256f6174cc81a44c Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 20 Aug 2026 01:30:51 +0000 Subject: [PATCH] refactor(layout): remove the unread `logo` key from AppShellBranding (#4818) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `AppShellBranding.logo` was declared but never read. `useAppShellBranding` applies only `primaryColor` / `accentColor` / `favicon` / `title` — its effect dependency array does not even list `logo` — and `AppShell` installs no context provider, so the key's doc comment ("Logo URL — passed to sidebar/navbar via context") named a mechanism that does not exist in the code. Three call sites were feeding the key a value that was silently discarded; all three go with it: - packages/layout/src/AppSchemaRenderer.tsx logo: schema.logo - packages/app-shell/src/layout/ConsoleLayout.tsx logo: activeApp.branding.logo - apps/console/src/hooks/useBranding.ts logo: app.branding.logo The card named only the third; the first fails loud under tsc, and the second was unnamed anywhere and is the reason this diff reaches packages/app-shell. Nothing rendering-visible changes. The two real logo paths never went through AppShellBranding and are untouched: AppSchemaRenderer renders the app schema's top-level `logo` directly in its default sidebar header, and AppSidebar renders the app schema's nested `branding.logo` directly. Ruling: maintainer, 2026-08-19, over the objectui decision-inbox review — option 1, remove. Building a real branding context (option 2) was rejected. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01RV6yuVCxymHYE16PL9vQkE --- .changeset/appshellbranding-logo-removed.md | 24 +++++++++++++++++++ apps/console/src/hooks/useBranding.ts | 2 -- .../app-shell/src/layout/ConsoleLayout.tsx | 1 - packages/layout/src/AppSchemaRenderer.tsx | 1 - packages/layout/src/AppShell.tsx | 2 -- 5 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 .changeset/appshellbranding-logo-removed.md diff --git a/.changeset/appshellbranding-logo-removed.md b/.changeset/appshellbranding-logo-removed.md new file mode 100644 index 0000000000..acf664da31 --- /dev/null +++ b/.changeset/appshellbranding-logo-removed.md @@ -0,0 +1,24 @@ +--- +'@object-ui/layout': minor +'@object-ui/app-shell': minor +'@object-ui/console': minor +--- + +Remove the published optional key `logo` from `AppShellBranding` (`@object-ui/layout`). + +The key was declared but never read. `useAppShellBranding` applies only +`primaryColor`, `accentColor`, `favicon` and `title`, and `AppShell` installs no +context provider at all — so its doc comment, "Logo URL — passed to sidebar/navbar +via context", described a mechanism that did not exist. Three call sites were +feeding the key a real value that was silently discarded, and all three are removed +with it: `AppSchemaRenderer`, `ConsoleLayout` and the console's `useBranding` hook. + +The real logo entry point is unchanged and is where it always was: the app schema's +own `branding.logo`, read directly by `AppSidebar` in `@object-ui/app-shell`, plus +the app schema's top-level `logo`, rendered directly by `AppSchemaRenderer`'s +default sidebar header. Neither path went through `AppShellBranding`, so nothing +rendering-visible changes. + +Migration: a consumer that passes `logo` inside an `AppShellBranding` object literal +now gets a compile error. Delete the key — it never reached a renderer. To show a +logo, set it on the app schema's `branding.logo` instead. diff --git a/apps/console/src/hooks/useBranding.ts b/apps/console/src/hooks/useBranding.ts index c20fcf813e..19f750b227 100644 --- a/apps/console/src/hooks/useBranding.ts +++ b/apps/console/src/hooks/useBranding.ts @@ -14,7 +14,6 @@ interface AppBranding { primaryColor?: string; accentColor?: string; favicon?: string; - logo?: string; } export function useBranding(app: { branding?: AppBranding; label?: string } | undefined) { @@ -24,7 +23,6 @@ export function useBranding(app: { branding?: AppBranding; label?: string } | un primaryColor: app.branding.primaryColor, accentColor: app.branding.accentColor, favicon: app.branding.favicon, - logo: app.branding.logo, } : undefined, app?.label ? `${app.label} — ${getProductName()}` : undefined, diff --git a/packages/app-shell/src/layout/ConsoleLayout.tsx b/packages/app-shell/src/layout/ConsoleLayout.tsx index 4db9e9f891..59caefdb72 100644 --- a/packages/app-shell/src/layout/ConsoleLayout.tsx +++ b/packages/app-shell/src/layout/ConsoleLayout.tsx @@ -171,7 +171,6 @@ export function ConsoleLayout({ primaryColor: activeApp.branding.primaryColor, accentColor: activeApp.branding.accentColor, favicon: activeApp.branding.favicon, - logo: activeApp.branding.logo, title: activeApp.label ? `${resolveKeyedI18nLabel(activeApp.label)} — ${getProductName()}` : undefined, diff --git a/packages/layout/src/AppSchemaRenderer.tsx b/packages/layout/src/AppSchemaRenderer.tsx index 89936e8071..9c5a14d5f7 100644 --- a/packages/layout/src/AppSchemaRenderer.tsx +++ b/packages/layout/src/AppSchemaRenderer.tsx @@ -579,7 +579,6 @@ export function AppSchemaRenderer({ const branding: AppShellBranding = { title: schema.title, favicon: schema.favicon, - logo: schema.logo, }; // --- Build sidebar element --- diff --git a/packages/layout/src/AppShell.tsx b/packages/layout/src/AppShell.tsx index aacd277dae..12787bb2c6 100644 --- a/packages/layout/src/AppShell.tsx +++ b/packages/layout/src/AppShell.tsx @@ -16,8 +16,6 @@ export interface AppShellBranding { accentColor?: string; /** Favicon URL — replaces the href */ favicon?: string; - /** Logo URL — passed to sidebar/navbar via context */ - logo?: string; /** Page title suffix (sets document.title) */ title?: string; }