Full-page header: square Smooth icon default + customizable logoUrl#19
Merged
Conversation
… logoUrl The full-page header avatar rendered the full "smooth" wordmark (550×135) crammed into a square tile, so it overflowed/looked broken and stamped Smoo branding onto customers' pages. Default it to the square Smooth icon (assets/smooth-icon.svg, 150×150) which sits cleanly contained in the tile, and add an optional `logoUrl` config key + `logo-url` attribute so host pages can brand the header with their own logo. logoUrl is validated to absolute http(s) only (safeHttpUrl) — javascript:/data:/ relative are dropped — and escaped into the img src, so a hostile config can't inject script. Falls back to the Smooth icon when unset/invalid. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014pdFZByoK3RHMLDxprkdpx
🦋 Changeset detectedLatest commit: 52b22f4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In fullpage mode the header avatar hardcoded the full "smooth" wordmark (
SMOOTH_LOGO_SVG, viewBox0 0 550 135) — a wide wordmark crammed into a square tile, so it overflowed and looked broken, and it stamped Smoo branding onto customers' pages.ChatWidgetConfighad no logo key, so consumers couldn't override it.Changes
1. New default: the square Smooth icon. The fullpage header now renders the canonical square Smooth icon (the stylized
thglyph —assets/smooth-icon.svg, viewBox0 0 150 150), inlined asSMOOTH_ICON_SVGinsrc/logo.ts(mirrors howSMOOTH_LOGO_SVGis generated). It sits cleanly contained/centered in the square avatar tile — no overflow.SMOOTH_LOGO_SVGstays exported but is no longer referenced by the header (tree-shaken out of the bundle).2. Customizable via
logoUrl. New optionallogoUrlconfig key + declarativelogo-urlattribute. When set, the fullpage header renders<img class="logo-img">sized tocontainwithin the tile; otherwise it falls back to the Smooth icon.Security.
logoUrlis validated to absolutehttp(s)only via the existingsafeHttpUrlguard (javascript:/data:/relative dropped) and escaped into thesrcattribute — a hostile config can't inject script or break out of the attribute.Verification
pnpm checkgreen (typecheck + 105 unit tests + build).0 0 150 150, not the wordmark) with nologo-img; a safelogoUrlrenders an<img>with that src;javascript:/data:URLs are rejected and fall back to the icon;resolveConfigsanitizeslogoUrl.window.SmoothAgentChat.{mountFullPageChat,mountChatWidget,defineChatWidget}; verified the bundle contains the icon +logo-url+logo-imgand no longer the550×135wordmark.logoUrlswaps in an<img>in its place.Release
Minor bump (new config key) via changeset. Publish is automated on merge (changesets release workflow).
🤖 Generated with Claude Code
https://claude.ai/code/session_014pdFZByoK3RHMLDxprkdpx