feat(branding): render custom logo in the enclave switcher (LC-141) #161
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/lc-141-sidebar-logo"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Renders the custom branding logo (LC-96) inside the authenticated chrome. Follow-up to LC-96, which only showed the logo on the login page and admin preview.
Each enclave-switcher icon now shows the branding logo when one is set, falling back to the single-letter initial otherwise:
/branding/logo./enclave/{id}/branding/logo(which itself falls back to the global logo).How
SwitcherEntrygrowslogo_url: Option<String>, populated inload_switcherviadb::branding::resolve. Becauseresolvefalls back to the global row, a logo URL is set whenever the matching logo route would actually serve an image. This keeps the change toSwitcherEntry+load_switcher+ the switcher partial, with no logo field threaded through every layout-extending page struct (the blocker noted on the issue).object-containpadding, so a dark or edge-to-edge logo stays visible against the dark switcher rail (respects the safe-area note in the issue).Tests
Two new cases in
routes_branding.rs: the Home icon renders the global logo once set (and not before), and an active enclave's icon renders its own logo.just check,just test,just test-saasall green.🤖 Generated with Claude Code
LC-96 shipped per-scope branding but only rendered the logo on the login page and the admin preview. Render it in the authenticated chrome too: each enclave-switcher icon now shows the branding logo when one is set, falling back to the single-letter initial otherwise. SwitcherEntry grows a logo_url: Option<String>, populated in load_switcher. The Home entry resolves the global branding (/branding/logo); each enclave entry resolves /enclave/{id}/branding/logo. Both use db::branding::resolve, which falls back to the global row, so a logo URL is set whenever the matching logo route would actually serve an image (the enclave route itself falls back to the global logo). This satisfies both the global brand area (the Home icon at the top of the rail) and the per-enclave logo (the active enclave's icon) without threading a logo field through every layout-extending page struct. The switcher template renders the logo inside a white rounded chip with object-contain padding, so a dark or edge-to-edge logo stays visible against the dark switcher rail rather than disappearing into it. Tests: two new cases in routes_branding.rs assert the Home icon renders the global logo once set (and not before), and that an active enclave's icon renders its own logo. just check, just test, and just test-saas all green. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>The logo route sets Cache-Control: max-age=86400, so without a version query the switcher icon would serve a stale logo for up to a day after an operator changes it. Append ?v={asset_version} to match the cache-bust the login page and admin preview already use; the logo refreshes on deploy. Tests updated to assert the versioned URL. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>