feat(examples-chat): app-wide Light/Dark color scheme toggle#288
Merged
Conversation
The smoke-test demo previously hardcoded dark mode in index.html and styles.css, while the palette's A2UI Theme dropdown only restyled the <a2ui-surface> inside the chat composition. Toggling that dropdown to default-light left the page bg and chat composition unreadably dark. This adds a runtime app-wide color-scheme toggle (Light/Dark) above the existing Theme dropdown. The selection drives: - the demo page bg/text via `data-color-scheme` on <html> - the chat lib's internals via `data-ngaf-chat-theme` on <html> - the base A2UI theme via `data-theme` — but only when the dropdown is on a default-* preset. Material picks are left alone since the user explicitly opted in. A pre-bootstrap inline script in index.html applies the persisted scheme before stylesheets load to avoid FOUC; the DemoShell effect takes over once Angular bootstraps.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
blove
added a commit
that referenced
this pull request
May 13, 2026
@cacheplane/partial-markdown@0.3 does not flush trailing text on finish() unless the buffer ends with a newline. Plain LLM responses typically omit the trailing newline, so the parser produced a document with zero children — the assistant bubble shell rendered but the message text was missing entirely. Reproduce on main: send 'Say hello in one sentence.' to gpt-5-mini. Backend logs show success (1.8s); agent.messages() carries 'Hello — nice to meet you!'; the DOM shows the bubble structure (checkpoint marker, action buttons) but no text. Fix: push a sentinel newline before calling finish() in both branches of the root() computed (content-changed-then-flush and streaming-flipped- without-new-content). The newline only ever exists inside the parser buffer; the original content() signal is unchanged. Two new regression tests cover plain text without trailing newline in both branches. Found while walking the smoke checklist post-#288.
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.
Summary
The smoke-test demo previously hardcoded dark mode (
<html data-ngaf-chat-theme="dark">plus literal#0f1116/#e6e9efinstyles.css). The palette's existing A2UI Theme dropdown only restyled the<a2ui-surface>inside the chat composition, so switching it todefault-lightleft the page background and chat composition unreadably dark.This PR adds a runtime app-wide Light/Dark color-scheme toggle above the Theme dropdown. A single selection drives:
data-color-schemeon<html>(CSS custom props instyles.css)data-ngaf-chat-themeon<html>data-theme— only when the dropdown is on adefault-*preset. Material picks are preserved since the user explicitly opted in.To avoid FOUC on reload, a tiny pre-bootstrap inline script in
index.htmlreads the persisted scheme from localStorage and sets the two attrs synchronously before any stylesheet loads. TheDemoShelleffect takes over once Angular bootstraps.Files
examples/chat/angular/src/styles.css— body bg/text now usevar(--demo-page-bg)/var(--demo-page-text);html[data-color-scheme="light"]override blockexamples/chat/angular/src/index.html— drops hardcodeddata-ngaf-chat-theme="dark"; adds pre-bootstrap scriptexamples/chat/angular/src/app/shell/palette-persistence.service.ts— extendsPaletteStatewithcolorSchemeexamples/chat/angular/src/app/shell/demo-shell.component.ts—colorSchemesignal,colorSchemeOptions,onColorSchemeChange, effect that syncsdata-color-scheme+data-ngaf-chat-themeand (conditionally) the A2UI themeexamples/chat/angular/src/app/shell/demo-shell.component.html— new<chat-debug-segmented>above the Theme<chat-debug-select>Test plan
nx test chatpassesnx build chatpassesnx lint chatcleannx build examples-chat-angularpasses/embed— palette shows Light/Dark segmented above Theme; default is Darkdefault-dark→default-lightmaterial-lightthen toggle scheme — Material stays selected (no auto-sync)