feat(enclave): surface configurable enclave icon on the settings page (LC-542) #548
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/lc542-enclave-icon-settings"
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?
Context
LC-542 asks to let an enclave owner configure their icon as general admin config (not hard-coded, not Bunyip-specific). Grounding against the real code first:
Bunyipreference in the codebase is the SSO login provider (LC-22), not a logo or mascot.SwitcherEntry.logo_url= the per-enclave branding logo (LC-96/LC-141), uploaded at/enclave/{id}/branding(owner/admin gated), stored inbranding.logo_upload_idscope=enclave, served at/enclave/{id}/branding/logo. It falls back to the enclave's initial letter.So the capability already exists as general admin configuration. The real gap was discoverability: the control lived only behind a "branding" sub-page link on the settings page.
What this PR does
Adds an inline Enclave icon card to the enclave settings page that writes the same per-enclave branding logo, so an owner can set the icon without discovering the branding sub-page. It shows the current icon, or a neutral placeholder glyph when unset (help text notes the rail falls back to the enclave's initial), plus a single upload control matching the app's settings-upload vocabulary.
Backend
POST /enclave/{id}/icon(require_manage, 2 MiB body cap like branding).parse_branding_multipartfor size/type validation (PNG/JPG/WebP/GIF, 1 MiB) and preserves every other branding field via resolve-then-upsert, so editing the icon never disturbs colors or login copy (same approach aspost_brandingfor a logo-only edit).enclave-flash-icon-updated).SwitcherEntry.logo_url.Acceptance criteria
Verification
routes_branding.rs: owner upload round-trip (sets the enclave logo, renders the icon on the settings page) + non-manager 403 gate.just checkgreen (standalone + saas + desktop + clippy + fmt);i18n_catalogen/es symmetry;routes_branding21,routes_enclave19,routes_enclave_nav7.Closes LC-542.
🤖 Generated with Claude Code
https://claude.ai/code/session_01GJbJChgMXj7m1Q8GdnTPyT
Yousif proposed letting an enclave owner change the icon; David agreed but stressed Let's Chat must stay general (it sits under the Automation Tools platform), not Bunyip-specific. Grounding against the real code: there is no hard-coded Bunyip icon to remove - every "Bunyip" reference is the SSO login provider - and the per-enclave icon shown on the switcher rail is already owner-configurable through the existing branding-logo system (LC-96/LC-141), stored in branding.logo_upload_id scope=enclave and served at /enclave/{id}/branding/logo. So the feature already exists as general admin config; the real gap is discoverability: that control lived only behind a "branding" sub-page link. This adds an inline "Enclave icon" card to the enclave settings page that writes the same per-enclave branding logo, so an owner can set the icon without discovering the branding sub-page. It shows the current icon (or a neutral placeholder glyph when unset, with help text noting the rail falls back to the enclave's initial) and a single upload control matching the app's settings-upload vocabulary. Backend: new owner-gated POST /enclave/{id}/icon (require_manage, 2 MiB body cap like branding) reuses the branding multipart parser for size/type validation and preserves every other branding field, so editing the icon from settings never disturbs colors or login copy - exactly how post_branding handles a logo-only edit. A validation error re-renders the full branding editor with the specific message inline rather than losing it through a redirect code; success redirects back to settings with a localized toast. No parallel storage or Bunyip-specific code is introduced; the icon is the same general branding logo already rendered by SwitcherEntry.logo_url. Tests: routes_branding.rs gains an owner upload round-trip (sets the enclave logo and renders the icon on the settings page) and a non-manager 403 gate. Full suite green: just check (standalone + saas + desktop + clippy + fmt), i18n_catalog en/es symmetry, routes_branding 21, routes_enclave 19, routes_enclave_nav 7. UI verified with headless-chrome screenshots of the set and unset card states. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GJbJChgMXj7m1Q8GdnTPyT