Skip to content

Theme cleanup phase 1#859

Merged
emeeks merged 4 commits intomainfrom
theming-improvements
Apr 20, 2026
Merged

Theme cleanup phase 1#859
emeeks merged 4 commits intomainfrom
theming-improvements

Conversation

@emeeks
Copy link
Copy Markdown
Member

@emeeks emeeks commented Apr 20, 2026

Theme layer extended:

  • SemioticTheme.colors now carries semantic status roles: success, danger, warning, error, info, plus secondary and surface.
  • All 17 presets (LIGHT, DARK, HIGH_CONTRAST + 7 branded × 2 modes) populated with brand-appropriate values.
  • themeToCSS, themeToTokens, and ThemeProvider inline emit --semiotic-{role} CSS custom properties. CSS cascade override works
    per-subtree — confirmed visually in the playwright scoped snapshot.

Dead prop fixed:

  • barStyle now routes StreamXYFrame → pipelineConfig → XYSceneConfig → barScene.ts.
  • RealtimeHistogram's declared stroke / strokeWidth / fill / gap props are live for the first time.
  • Fill precedence for bars: barColors[cat] > barStyle.fill > themeSemantic.primary > hardcoded hex.

Tests:

  • 9 new barScene.test.ts cases covering theme-semantic, barStyle fields, and precedence.
  • Regression test in StreamXYFrame.test.tsx that spies on PipelineStore.updateConfig and asserts every declared *Style prop reaches the
    config — catches the next drop.
  • Playwright spec histogram-theme-stroke.spec.ts — 3 snapshots (light / dark / scoped-cascade-override) + a pixel check confirming
    strokes actually paint (>100 gray pixels per frame). All 4 pass on chromium.

Docs:

  • New /theming/semantic-colors page, threaded into nav (after Theme Provider, before Theme Explorer). Covers the four theme dimensions,
    role vocabulary with live swatches, using roles on charts, CSS cascade override with side-by-side live example, nested ThemeProvider for
    scale overrides, status-semantics worked examples, full CSS-var reference table, "how it works under the hood" pipeline explanation.
    Prev/next chain updated on adjacent pages.

AI surface synced:

  • CLAUDE.md theming section expanded with semantic roles + scoped override pattern; mirrored to .clinerules, .cursorrules,
    .windsurfrules, .github/copilot-instructions.md, docs/public/llms-full.txt.
  • ai/system-prompt.md picks up the same guidance.

Comment thread docs/src/pages/theming/SemanticColorsPage.js Fixed
Comment thread docs/src/pages/theming/SemanticColorsPage.js Fixed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands Semiotic’s theming layer to include semantic “status role” colors (success/danger/warning/error/info plus secondary/surface) and wires them through both CSS custom properties and the streaming pipeline, while also fixing a previously-dead barStyle plumbing path so RealtimeHistogram stroke/strokeWidth/fill/gap actually affect rendering. It adds unit + Playwright coverage and introduces new theming documentation (Semantic Colors) along with doc route/link updates.

Changes:

  • Add semantic role colors to SemioticTheme, presets, CSS var emission (--semiotic-{role}), and token/CSS serializers.
  • Fix barStyle plumbing from RealtimeHistogram → StreamXYFrame → PipelineStore → bar scene builder, including theme-aware fill/stroke precedence.
  • Add tests (Vitest + Playwright) and documentation/navigation updates for semantic colors + RealtimeHistogram route rename.

Reviewed changes

Copilot reviewed 36 out of 39 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/components/stream/xySceneBuilders/types.ts Adds barStyle + themeSemantic to XY scene config.
src/components/stream/xySceneBuilders/barScene.ts Resolves bar fill/stroke/gap from barStyle + themeSemantic.primary.
src/components/stream/xySceneBuilders/barScene.test.ts Adds unit tests for barStyle/themeSemantic precedence and gap/stroke behavior.
src/components/stream/StreamXYFrame.tsx Threads barStyle and themeSemantic into pipelineConfig.
src/components/stream/StreamXYFrame.test.tsx Adds regression test ensuring *Style props reach PipelineStore config.
src/components/stream/PipelineStore.ts Extends PipelineConfig with themeSemantic and barStyle typing/docs.
src/components/store/ThemeStore.ts Extends SemioticTheme.colors and populates built-in presets with semantic roles.
src/components/semiotic-themes.ts Populates branded presets with semantic roles; emits semantic CSS vars + tokens.
src/components/ThemeProvider.tsx Emits semantic role CSS variables inline on provider wrapper.
package.json Adds new histogram-stroke example page to serve-examples scripts.
integration-tests/histogram-theme-stroke.spec.ts-snapshots/histogram-stroke-scoped-chromium-darwin.png New Playwright baseline (scoped override case).
integration-tests/histogram-theme-stroke.spec.ts-snapshots/histogram-stroke-light-chromium-darwin.png New Playwright baseline (light theme).
integration-tests/histogram-theme-stroke.spec.ts-snapshots/histogram-stroke-dark-chromium-darwin.png New Playwright baseline (dark theme).
integration-tests/histogram-theme-stroke.spec.ts New Playwright regression test for histogram stroke + scoped CSS var override.
integration-tests/histogram-theme-stroke-examples/index.js Example harness page exercising histogram stroke + scoped override.
integration-tests/histogram-theme-stroke-examples/index.html HTML entry for the new integration-test example.
docs/src/pages/theming/ThemeExplorerPage.js Updates prev/next chain to include Semantic Colors page.
docs/src/pages/theming/SemanticColorsPage.js New docs page describing semantic roles, swatches, and override patterns.
docs/src/pages/features/ThemingPage.js Links next page from Theme Provider → Semantic Colors.
docs/src/pages/charts/RealtimeWaterfallChartPage.js Updates RealtimeHistogram related links to new slug.
docs/src/pages/charts/RealtimeSwarmChartPage.js Updates prevPage/related links to new RealtimeHistogram slug.
docs/src/pages/charts/RealtimeLineChartPage.js Updates nextPage/related links to new RealtimeHistogram slug.
docs/src/pages/charts/RealtimeHistogramPage.js Updates breadcrumb slug to /charts/realtime-histogram.
docs/src/pages/charts/RealtimeHeatmapPage.js Updates related link + inline docs link to new slug.
docs/src/pages/api/ChartsApiPage.js Updates RealtimeHistogram API slug to realtime-histogram.
docs/src/pages/GettingStartedPage.js Updates RealtimeHistogram link to new slug.
docs/src/components/navData.js Updates nav path for RealtimeHistogram and adds Semantic Colors entry.
docs/src/Landing.js Updates gallery item path for RealtimeHistogram.
docs/src/App.js Adds Semantic Colors route and renames RealtimeHistogram route path.
docs/public/llms.txt Updates RealtimeHistogram doc link to new slug.
docs/public/llms-full.txt Updates theming CSS-var list and adds semantic roles/cascade guidance.
ai/system-prompt.md Syncs AI prompt with semantic role + scoped override guidance.
OUTSTANDING_WORK.md Documents planned Primitive Theming phases and risks; references this plumbing.
CLAUDE.md Updates AI-facing theming section with semantic roles + scoped override guidance.
CHANGELOG.md Updates docs link path reference from /charts/realtime-bar-chart/charts/realtime-histogram.
.windsurfrules Syncs theming CSS var list + semantic role guidance.
.github/copilot-instructions.md Syncs theming CSS var list + semantic role guidance.
.cursorrules Syncs theming CSS var list + semantic role guidance.
.clinerules Syncs theming CSS var list + semantic role guidance.

Comment thread src/components/stream/xySceneBuilders/types.ts Outdated
Comment thread src/components/stream/StreamXYFrame.test.tsx Outdated
Comment thread src/components/stream/PipelineStore.ts
Comment thread integration-tests/histogram-theme-stroke-examples/index.js Outdated
Comment thread src/components/ThemeProvider.tsx Outdated
Comment thread src/components/semiotic-themes.ts Outdated
Comment thread integration-tests/histogram-theme-stroke.spec.ts Outdated
Comment thread integration-tests/histogram-theme-stroke.spec.ts Fixed
Comment thread integration-tests/histogram-theme-stroke.spec.ts Fixed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 36 out of 39 changed files in this pull request and generated 5 comments.

Comment thread src/components/stream/xySceneBuilders/barScene.ts
Comment thread src/components/stream/StreamXYFrame.tsx
Comment thread src/components/stream/xySceneBuilders/types.ts Outdated
Comment thread src/components/semiotic-themes.ts Outdated
Comment thread src/components/stream/StreamXYFrame.test.tsx Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 37 out of 40 changed files in this pull request and generated 3 comments.

Comment on lines +43 to +71
function Swatch({ role, label }) {
const cssVar = `var(--semiotic-${role})`
return (
<div
style={{
display: "flex",
alignItems: "center",
gap: 12,
padding: "8px 12px",
border: "1px solid var(--semiotic-border)",
borderRadius: 6,
minWidth: 180,
}}
>
<div
style={{
width: 32,
height: 32,
background: cssVar,
border: "1px solid var(--semiotic-border)",
borderRadius: 4,
flexShrink: 0,
}}
/>
<div style={{ fontSize: 13, display: "flex", flexDirection: "column" }}>
<strong>{label}</strong>
<code style={{ fontSize: 11, opacity: 0.7 }}>--semiotic-{role}</code>
</div>
</div>
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Swatch/RoleGrid (and the example charts below) rely on CSS vars like --semiotic-primary, --semiotic-danger, etc., but the docs site default CSS only defines --semiotic-bg/text/text-secondary/border/grid (see docs/src/index.css). Without wrapping this page (or at least the demo sections) in ThemeProvider, most swatches will render with missing/incorrect colors. Consider wrapping the page content in a ThemeProvider (tied to the docs light/dark toggle) or adding explicit fallbacks/definitions for the new --semiotic-* vars in the docs CSS so the live examples are deterministic.

Copilot uses AI. Check for mistakes.
]}
prevPage={{ title: "Multi-Axis Line Chart", path: "/charts/multi-axis-line-chart" }}
nextPage={{ title: "Realtime Bar Chart", path: "/charts/realtime-bar-chart" }}
nextPage={{ title: "Realtime Bar Chart", path: "/charts/realtime-histogram" }}
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The page navigation label still says "Realtime Bar Chart" but the linked route is now /charts/realtime-histogram. Updating the title to "Realtime Histogram" would keep the naming consistent with the component name and sidebar/nav entries.

Suggested change
nextPage={{ title: "Realtime Bar Chart", path: "/charts/realtime-histogram" }}
nextPage={{ title: "Realtime Histogram", path: "/charts/realtime-histogram" }}

Copilot uses AI. Check for mistakes.
{ label: "RealtimeSwarmChart", path: "/charts/realtime-swarm-chart" },
]}
prevPage={{ title: "Realtime Bar Chart", path: "/charts/realtime-bar-chart" }}
prevPage={{ title: "Realtime Bar Chart", path: "/charts/realtime-histogram" }}
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous-page navigation still labels the link as "Realtime Bar Chart" while the route is now /charts/realtime-histogram. Renaming the title to "Realtime Histogram" would avoid confusion and align with the updated slug elsewhere.

Suggested change
prevPage={{ title: "Realtime Bar Chart", path: "/charts/realtime-histogram" }}
prevPage={{ title: "Realtime Histogram", path: "/charts/realtime-histogram" }}

Copilot uses AI. Check for mistakes.
@emeeks emeeks merged commit 5f485f1 into main Apr 20, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants