Repository navigation
feat(showcase): dark mode for every demo and shell - #8098
Conversation
|
Important Review skippedIgnore keyword(s) in the title. ⛔ Ignored keywords: 4
Please check the settings in the CodeRabbit UI or the
|
Production Digest-Pinning AuditAll 43 services digest-pinned. Run 2026-11-10 11:46:26 PST — 0 finding(s). |
contextablemark
left a comment
There was a problem hiding this comment.
Looking through this more closely, most of the size makes sense: the same demo UI exists across the integrations, and many cards, controls, and tooltips hardcode light colors. For example, the bar-chart tooltip needs its own color changes; setting .dark on the page wouldn’t fix that alone.
There are a few places where I think we could simplify things:
-
Could we share the bootstrap script? This is the main change I’d suggest.
The 22 integration
theme-script.tsfiles are byte-identical—for example, LangGraph Python and AG2. They all implement the same query-param fallback, system preference listener, and parent-message handling. Any future fix to that behavior would need to reach all 22 copies.We already have a pattern for sharing source while keeping integration builds self-contained:
stage_shared()materializes shared symlinks into each Docker build context. There’s also an existing Next route importing TypeScript through_shared, in probe-threads/route.ts. Could we use that pattern for the bootstrap and leave each layout with just the import and script injection?The bridges in
shell,shell-dojo, andshell-docsare also identical. Sharing those might be worthwhile too, although the dashboard needs an adapter because it readsdata-themerather than.dark. -
Could the repeated border changes become one default?
Across 171 UI component files, the styling change is just adding
dark:border-border. Examples are Card and DialogContent.A scoped dark border default in Tailwind’s base layer seems like it could cover these, with explicit border utilities still taking precedence. That would remove a fair number of mechanical edits and automatically cover future primitives. The component-specific background, text, and status colors would still need their individual changes.
-
Could the theme hook and bootstrap use the same setter?
In Beautiful Chat, the theme hook holds React state and writes the HTML class. The bootstrap’s system listener can independently rewrite that class.
For example: the demo starts light, the frontend tool selects dark, and then the OS switches dark and back to light. The bootstrap returns the page to light, but React still holds
"dark". The next toggle asks React to set"dark"again, which can become a no-op.One setter handling explicit choices, parent updates, and system changes would avoid that split. A few focused tests for those transitions and iframe synchronization would help; they shouldn’t require agent backends.
-
Could we include the scaffolding?
generateLayout()still generates a layout without the bootstrap, and the starter stylesheet still hardcodes a light background and text. Updating those would keep the next integration from immediately reintroducing the issue.
I may be overengineering things and getting nitpicky, so feel free to ignore any or all of these suggestions. The 22 identical bootstrap scripts are the clearest win to me, especially given the shared-source patterns we already have.
…k borders Addresses review on #8098. - One theme module in integrations/_shared/ts/theme.ts replaces the 22 identical theme-script.ts copies and the shell/dojo variants. Every integration links it through `_shared` (the five that had no link get one; Dockerfiles with explicit COPY lists copy the file). It exposes a single setter, `window.__copilotkitTheme`, so a page's own pick, the embedding page's theme, and the system preference no longer fight: the newest choice wins and an OS flip can't undo a pick. - Beautiful Chat's theme hook reads and writes that setter instead of keeping its own React state. - The shells' DemoThemeBridge components wrap one shared installThemeBridge; the dashboard passes an adapter for its data-theme attribute. - A dark-only base-layer border default replaces the 171 `dark:border-border` edits to ui primitives (and 17 more across demos). Light mode keeps Tailwind's currentColor; explicit border colors still win. - create-integration's layout and stylesheet, and the starter template, now include the bootstrap and dark styles. - Tests for theme transitions and parent/iframe sync run in test_unit-showcase-integrations, with the existing _shared/ts suite. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Size Change: 0 B Total Size: 2.47 MB ℹ️ View Unchanged
|
contextablemark
left a comment
There was a problem hiding this comment.
The earlier requests are addressed, and the surgical re-review passed: 137 focused tests, the shared-module typecheck, and Chromium checks for the minified bootstrap, cross-origin iframe synchronization, manual overrides, and border precedence.
One narrow P2 remains: changes to the new shared theme module are not inputs to either build matrix.
This theme-specific regression comes from the extraction in f748c69: previously the theme implementations lived inside each app's already-watched directory. Now all 22 React integrations and four shells import showcase/integrations/_shared/ts/theme.ts, but a change touching only that file matches zero filters in both showcase_build.yml and showcase_build_check.yml. Such a fix could pass unit tests while skipping its consumer image builds and deployment.
Could we include that exact file as a shared build dependency for its 26 consumers in both workflows?
GitHub's native Apply suggestion button cannot edit these two workflow files because neither is part of this PR's diff. Here is an apply-ready two-file patch instead. Save the diff as shared-theme-build-filters.patch and run git apply shared-theme-build-filters.patch from the repository root.
I validated that the patch applies cleanly, both workflows parse, and their actual jq selectors choose exactly the 22 integration images and four shells for a theme-only change. Empty changes, an individual integration change, and the production single-service dispatch still select the expected services. The shared-theme filter does not select unrelated services or match theme-test-only edits.
--- a/.github/workflows/showcase_build.yml
+++ b/.github/workflows/showcase_build.yml
@@ -143,6 +143,8 @@
# single-line strings, but mixing styles (list vs. string)
# in the same filters block is easy to misread during review.
filters: |
+ shared_theme:
+ - 'showcase/integrations/_shared/ts/theme.ts'
workflow_config:
- '.github/workflows/showcase_build_check.yml'
angular:
@@ -369,6 +371,10 @@
($dispatch == "" and (
($workflow_changed or ($changes | index("workflow_config") != null)) or
($changes | index($fk) != null) or
+ (($changes | index("shared_theme") != null) and (
+ (.context | startswith("showcase/integrations/")) or
+ (.dispatch_name | IN("shell", "shell-dojo", "shell-dashboard", "shell-docs"))
+ )) or
(($changes | index("angular") != null) and (
(.context | startswith("showcase/integrations/")) or
.dispatch_name == "shell"
--- a/.github/workflows/showcase_build_check.yml
+++ b/.github/workflows/showcase_build_check.yml
@@ -53,6 +53,8 @@
id: filter
with:
filters: |
+ shared_theme:
+ - 'showcase/integrations/_shared/ts/theme.ts'
workflow_config:
- '.github/workflows/showcase_build.yml'
- '.github/workflows/showcase_build_check.yml'
@@ -254,7 +256,11 @@
if .build_args_branch == "__GH_REF_NAME__" then .build_args_branch = $ref else . end |
(.filter_key as $fk | select(
($changes | index("workflow_config") != null) or
- ($changes | index($fk) != null)
+ ($changes | index($fk) != null) or
+ (($changes | index("shared_theme") != null) and (
+ (.context | startswith("showcase/integrations/")) or
+ (.dispatch_name | IN("shell", "shell-dojo", "shell-dashboard", "shell-docs"))
+ ))
))]
')No other changes requested from this re-review.
|
Thanks, Mark — all four are in f748c69.
Verified locally: production builds of langgraph-python, shell, dojo and dashboard, plus a browser run of the minified bootstrap (system, |
Showcase Eval Results
Partial JSON output{
"version": 1,
"timestamp": "2026-11-03T01:12:24.329Z",
"branch": "HEAD",
"base": "origin/main",
"level": "d5",
"scope": {
"mode": "all",
"reason": "manual override: langgraph-python, mastra, spring-ai",
"slugs": [
"langgraph-python",
"mastra",
"spring-ai"
]
},
"results": {
"langgraph-python": {
"_status": {
"status": "fail",
"duration_ms": 376
}
}
},
"summary": {
"total": 1,
"pass": 0,
"fail": 1,
"skip": 0,
"duration_ms": 376
}
} |
|
I pushed 7142205 with the remaining build-filter wiring. Changes to the shared theme module now select its 22 React integrations and four shells in both PR build checks and the production pipeline. All 44 matrix tests pass, and I checked the actual filters/selectors too. That covers my last requested change. |
@copilotkit/a2ui-renderer
@copilotkit/agentcore-runner
@copilotkit/angular
@copilotkit/channels
@copilotkit/channels-core
@copilotkit/channels-discord
@copilotkit/channels-intelligence
@copilotkit/channels-slack
@copilotkit/channels-teams
@copilotkit/channels-ui
@copilotkit/channels-whatsapp
@copilotkit/core
@copilotkit/intelligence-langgraph
@copilotkit/intelligence-mastra
@copilotkit/learning
@copilotkit/mcp-apps-renderer
@copilotkit/react-core
@copilotkit/react-native
@copilotkit/react-textarea
@copilotkit/react-ui
@copilotkit/runtime
@copilotkit/runtime-client-gql
@copilotkit/sdk-js
@copilotkit/shared
@copilotkit/sqlite-runner
@copilotkit/voice
@copilotkit/vue
@copilotkit/web-components
@copilotkit/web-inspector
commit: |
…k borders Addresses review on #8098. - One theme module in integrations/_shared/ts/theme.ts replaces the 22 identical theme-script.ts copies and the shell/dojo variants. Every integration links it through `_shared` (the five that had no link get one; Dockerfiles with explicit COPY lists copy the file). It exposes a single setter, `window.__copilotkitTheme`, so a page's own pick, the embedding page's theme, and the system preference no longer fight: the newest choice wins and an OS flip can't undo a pick. - Beautiful Chat's theme hook reads and writes that setter instead of keeping its own React state. - The shells' DemoThemeBridge components wrap one shared installThemeBridge; the dashboard passes an adapter for its data-theme attribute. - A dark-only base-layer border default replaces the 171 `dark:border-border` edits to ui primitives (and 17 more across demos). Light mode keeps Tailwind's currentColor; explicit border colors still win. - create-integration's layout and stylesheet, and the starter template, now include the bootstrap and dark styles. - Tests for theme transitions and parent/iframe sync run in test_unit-showcase-integrations, with the existing _shared/ts suite. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
652c3e7 to
6e2d6bc
Compare
…k borders Addresses review on #8098. - One theme module in integrations/_shared/ts/theme.ts replaces the 22 identical theme-script.ts copies and the shell/dojo variants. Every integration links it through `_shared` (the five that had no link get one; Dockerfiles with explicit COPY lists copy the file). It exposes a single setter, `window.__copilotkitTheme`, so a page's own pick, the embedding page's theme, and the system preference no longer fight: the newest choice wins and an OS flip can't undo a pick. - Beautiful Chat's theme hook reads and writes that setter instead of keeping its own React state. - The shells' DemoThemeBridge components wrap one shared installThemeBridge; the dashboard passes an adapter for its data-theme attribute. - A dark-only base-layer border default replaces the 171 `dark:border-border` edits to ui primitives (and 17 more across demos). Light mode keeps Tailwind's currentColor; explicit border colors still win. - create-integration's layout and stylesheet, and the starter template, now include the bootstrap and dark styles. - Tests for theme transitions and parent/iframe sync run in test_unit-showcase-integrations, with the existing _shared/ts suite. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
6e2d6bc to
758d44d
Compare
|
I pushed 029afa5 to bring OpenAI Agents Python onto the existing shared theme setup. The production build, all three real D6 flows (Shared State Read, Human in the Loop, and A2UI), 26 shared unit tests, and 10 snippet tests pass. Production browser checks cover live iframe theme updates and manual overrides; light screenshots are pixel-identical on all three checked pages. Standalone typechecking reports the same 18 pre-existing errors before and after, with none introduced by this patch. The follow-up is confined to this integration’s frontend. |
Embedded demos rendered white inside the dark docs. Every showcase demo (22 React integrations, Angular, Vue) and every shell now follows the reader's theme, and an embedded demo follows the page around it. - Demos run a pre-paint theme script (integrations' src/app/theme-script.ts, inlined in the Angular and Vue index.html). It asks the embedding page with a `copilotkit:theme-request` message, then falls back to `?theme=` and the system preference, and toggles `.dark` on <html>. CopilotKit follows that class with its own dark styles; nothing forces it. - Shells answer through DemoThemeBridge and re-send when their theme changes, so open demos switch live. shell and shell-dojo gain dark mode and a toggle, and follow their own parent when embedded. - Integration globals.css carry light and dark tokens, color-scheme, and a class-based `dark:` variant. Demo colors keep their light values and gain dark partners (`dark:` classes, `light-dark()`), so light mode is unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…k borders Addresses review on #8098. - One theme module in integrations/_shared/ts/theme.ts replaces the 22 identical theme-script.ts copies and the shell/dojo variants. Every integration links it through `_shared` (the five that had no link get one; Dockerfiles with explicit COPY lists copy the file). It exposes a single setter, `window.__copilotkitTheme`, so a page's own pick, the embedding page's theme, and the system preference no longer fight: the newest choice wins and an OS flip can't undo a pick. - Beautiful Chat's theme hook reads and writes that setter instead of keeping its own React state. - The shells' DemoThemeBridge components wrap one shared installThemeBridge; the dashboard passes an adapter for its data-theme attribute. - A dark-only base-layer border default replaces the 171 `dark:border-border` edits to ui primitives (and 17 more across demos). Light mode keeps Tailwind's currentColor; explicit border colors still win. - create-integration's layout and stylesheet, and the starter template, now include the bootstrap and dark styles. - Tests for theme transitions and parent/iframe sync run in test_unit-showcase-integrations, with the existing _shared/ts suite. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
029afa5 to
3a9c392
Compare
## What does this PR do? Fixes the `Static analysis (zizmor)` check, which fails on every PR that changes a workflow file. The cause is on `main`, not in those PRs. `security_zizmor.yml` runs zizmor `latest`. Since the action bump in #7827, CI runs zizmor 1.32.0, which reports two new kinds of findings in files the failing PRs don't touch: - **`dangerous-triggers` (high):** the `issue_comment` triggers of `showcase_eval.yml` (`/eval`) and `test_e2e-showcase-on-demand.yml` (`/test`). Both already run only for trusted commenters: `showcase_eval.yml` checks for write access with `getCollaboratorPermissionLevel`, and `test_e2e-showcase-on-demand.yml` requires `OWNER`, `MEMBER` or `COLLABORATOR`. Both check out PR-head code with a `contents: read` token and `persist-credentials: false`. Each file's SECURITY header records the remaining TOCTOU risk. - **`obfuscation` (low):** `fromJSON('"\n"')` in `aeo_synthetics.yml`, `showcase_build.yml`, `showcase_validate.yml`, `test_smoke-starter.yml` and `test_starter-clean-install.yml`. It is how those workflows put a newline inside a one-line `format()` expression. zizmor's `--fix=safe` replaces it with a literal newline, which makes the YAML invalid. This PR: - adds the two comment-trigger workflows to `dangerous-triggers.ignore`, with the reason, as the config asks for each new entry; - adds an `obfuscation.ignore` list for the five workflows; - pins the action to zizmor `1.32.0`, so a future zizmor release can't fail unrelated PRs again. Bump it on purpose and update `.github/zizmor.yml` in the same PR. **Needs a maintainer's review:** the config says every new `dangerous-triggers` suppression must be reviewed by a maintainer. ## Verification - `uvx [email protected] --config .github/zizmor.yml --min-severity low .` on `main`: 2 high and 8 low findings, the same as CI. - The same command on this branch: "No findings to report" (45 ignored, 316 suppressed). - The `ghcr.io/zizmorcore/zizmor:1.32.0` image exists, and zizmor-action v0.8.1 accepts an exact `X.Y.Z` version. ## Related PRs and Issues - Unblocks the zizmor check on #8098 and #8214. ## Checklist - [x] I have read the [Contribution Guide](https://github.com/copilotkit/copilotkit/blob/master/CONTRIBUTING.md) - [x] If the PR changes or adds functionality, I have updated the relevant documentation - [x] If the PR contains a breaking change, the title has `!` (for example `feat(react-core)!: ...`) and the description has a `BREAKING CHANGE:` line with migration steps. See [VERSIONING.md](https://github.com/CopilotKit/CopilotKit/blob/main/VERSIONING.md) - [x] "Allow edits by maintainers" is checked (lets us help iterate on your PR directly — faster turnaround for everyone) 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Chores** * Pinned the security workflow to a specific version. * Updated security-check settings for selected workflows, including documented safeguards and accepted risks. Also adjusted handling of findings related to workflow expression formatting. These changes affect automated repository checks and do not change the app’s user-facing functionality. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Summary
Embedded demos showed up white inside the dark docs. Now every showcase demo (all 22 React integrations, plus Angular and Vue) and every shell follows the reader's theme. When a page embeds a demo, the demo follows that page's theme, and it switches live without reloading.
How it works
One module,
showcase/integrations/_shared/ts/theme.ts, holds both halves of the theme protocol. Integrations reach it through their_sharedlink; the shells import it directly.themeScript()in<head>, which sets.darkon<html>before first paint.{ type: "copilotkit:theme-request" }to its parent. It applies a{ type: "copilotkit:theme", theme }reply only when the reply comes from that parent.?theme=light|dark, then a stored pick if the page has astorageKey(the shell and dojo toggles), then the system preference.window.__copilotkitTheme(get/set/subscribe). The newest choice wins between the page's own pick and the embedding page's theme. The system preference applies only when neither has chosen..darkwith their own dark styles; nothing forces them.installThemeBridgeanswers those requests, and sends the theme again whenever the page's theme changes. Iframesrcvalues are unchanged.DemoThemeBridgeis a thin wrapper around it. The dashboard passes an adapter for itsdata-themeattribute.shellandshell-dojoget dark mode and a toggle. When embedded themselves, they follow their parent.index.htmlis static and can't import TypeScript, so each keeps an inline copy of the script with the same protocol.Styles
globals.cssnow has:color-scheme;dark:variant;bordertakes--borderin dark. Light keeps Tailwind'scurrentColor, and explicit border colors still win.dark:classes, orlight-dark()for inline styles.@regionmarkers, so published snippets stay within the 200-line limit.<html>class can't drift apart.Scaffolding, docs and CI
create-integrationlinks_sharedand generates the theme script, tokens and dark styles. The starter template's layout and stylesheet include them too.STYLING-GUIDE.md's "Theme" section describes this setup._shared/ts/theme.tsrebuild its consumers (the 22 React integrations and four shells) in bothshowcase_build.ymlandshowcase_build_check.yml, through ashared_themepaths filter. Each integration reaches the file through its_sharedsymlink, which the per-service filters don't see.Light mode is unchanged
shellnav links shift about 20px left to make room, andshell-dojogains a 16px icon.Tests
New
showcase/integrations/_shared/ts/theme.test.ts(11 tests, no backends). It covers:It runs in
test_unit-showcase-integrationswith the existing_shared/tssuite (26 tests).shell 354/354, shell-docs 582/582 and shell-dashboard 1865 pass. The Angular (21 + 167) and Vue (22) suites match their baselines. The
showcase/scriptsgenerator, bundling and hosting tests pass.Production builds of langgraph-python, shell, shell-dojo and shell-dashboard succeed. A browser run of the minified bootstrap covers:
?theme=;CI's Docker build-check passes for all 22 integrations and all four shells.
Not yet run: the real-cell D6 probes required by
showcase/AGENTS.md. Results will follow in a comment.Known gaps (not in this PR)
CopilotSidebarandCopilotPopuphave hardcoded white headers (packages/angular/.../modal). That needs a package fix; this PR doesn't override CopilotKit.main.Deployed docs embed the production demos, so the fix shows up there after the integrations are redeployed.
🤖 Generated with Claude Code