feat(hub-ui): support embedded viewer backgrounds - #320
Merged
Conversation
|
@dvcolomban is attempting to deploy a commit to the NuxtLabs Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds configurable background styling for the hub UI standalone viewer when it’s framed (embedded) by another tool, while preserving existing standalone behavior and CSS validation.
Changes:
- Introduces
branding.embeddedBackgroundalongsidebranding.background(supports string or{ light, dark }). - Updates standalone viewer runtime to select embedded vs standalone background based on frame context.
- Adds unit tests for embedded/standalone resolution and for CSS background validation application.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/snapshots/tsnapi/@devframes/hub-ui/index.snapshot.d.ts | Updates public API snapshot to include embeddedBackground. |
| packages/hub-ui/src/types.ts | Adds DevframeBranding.embeddedBackground to published types. |
| packages/hub-ui/src/index.test.ts | Ensures createUi() publishes embeddedBackground through static config. |
| packages/hub-ui/src/client/state/branding.ts | Extends resolved branding and updates useBrandingBackground() to support embedded selection/fallback. |
| packages/hub-ui/src/client/state/branding.test.ts | Adds coverage for embedded/standalone resolution and fallback behavior. |
| packages/hub-ui/src/client/standalone/viewer-background.ts | Extracts background application + CSS.supports validation into a helper. |
| packages/hub-ui/src/client/standalone/viewer-background.test.ts | Adds tests for supported/invalid/absent background application. |
| packages/hub-ui/src/client/standalone/main.ts | Uses embedded-aware branding background and the extracted helper. |
| docs/content/1.guide/18.hub-initiate.md | Documents embeddedBackground behavior in hub UI configuration guide. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
dvcolomban
force-pushed
the
codex/embedded-viewer-background
branch
from
August 31, 2026 12:48
82658b2 to
dca6735
Compare
dvcolomban
marked this pull request as draft
August 31, 2026 21:28
dvcolomban
force-pushed
the
codex/embedded-viewer-background
branch
from
August 31, 2026 22:21
dca6735 to
c246b56
Compare
dvcolomban
marked this pull request as ready for review
August 31, 2026 23:31
dvcolomban
force-pushed
the
codex/embedded-viewer-background
branch
from
August 31, 2026 23:39
c246b56 to
79da0fe
Compare
antfu
approved these changes
Sep 1, 2026
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.
Background (Why)
The standalone viewer can also be embedded as an iframe by downstream developer tools. Those consumers need a transparent framed surface while retaining an authored background for direct visits, without rewriting generated HTML or treating the Hub client type as iframe state.
Changes (What)
branding.backgroundstring and{ light, dark }forms unchanged; they still apply everywhere.{ standalone, iframe? }, where each value accepts the same flat color-scheme shape.window.self !== window.top; a missing iframe value falls back tostandalone.DockClientTypeunchanged.color-schemewithout the unused custom-background class.Verification (Testing)
#282828backgrounds and transparent cross-origin iframe backgrounds in both light and dark modes, including dark foreground andcolor-scheme.