Skip to content

fix(web): add visual preview swatches to theme mode selector#5767

Merged
singlerider merged 5 commits intomasterfrom
worktree-fix-theme-mode-display-5723
Apr 17, 2026
Merged

fix(web): add visual preview swatches to theme mode selector#5767
singlerider merged 5 commits intomasterfrom
worktree-fix-theme-mode-display-5723

Conversation

@theonlyhennygod
Copy link
Copy Markdown
Collaborator

@theonlyhennygod theonlyhennygod commented Apr 15, 2026

Summary

  • Base branch target (master for all contributions): master
  • Problem: (1) Both Dark and Light theme mode buttons in Appearance Settings render identically because they inherit styling from the current theme's CSS variables. (2) The README includes a "Buy Me a Coffee" donation badge and link that should be removed.
  • Why it matters: (1) Users cannot visually distinguish between Dark and Light mode options, making theme selection confusing. (2) The donation link is no longer desired in the project README.
  • What changed: (1) Added small color preview swatches inside each theme mode button that show the actual background color of that mode (dark bg for Dark, light bg for Light, split for System, black for OLED). (2) Removed the Buy Me a Coffee badge from the header badge bar and the donation paragraph from the Support section across the main README and all 30 localized README files.
  • What did not change (scope boundary): No changes to theme application logic, color theme previews, or any other settings UI. The Support ZeroClaw section and its Special Thanks subsection are retained.

Label Snapshot (required)

  • Risk label: risk: low
  • Size label: size: XS
  • Scope labels: docs, web
  • Module labels: web: settings
  • Contributor tier label: N/A
  • If any auto-label is incorrect, note requested correction: N/A

Change Metadata

  • Change type: bug, chore
  • Primary scope: multi

Linked Issue

Supersede Attribution (required when Supersedes # is used)

N/A

Validation Evidence (required)

The theme swatch change is a frontend-only change (web/src/components/SettingsModal.tsx). No Rust code was modified. The README change is documentation-only (31 README files, 155 lines removed).

  • Evidence provided: Visual verification via Playwright for theme swatches β€” screenshot confirms Dark button shows dark swatch, Light button shows light swatch, System shows split, OLED shows black. README changes verified by grep confirming zero remaining "Buy Me a Coffee" references across the repository.
  • If any command is intentionally skipped, explain why: cargo fmt/clippy/test skipped β€” no Rust changes

Security Impact (required)

  • New permissions/capabilities? No
  • New external network calls? No
  • Secrets/tokens handling changed? No
  • File system access scope changed? No

Privacy and Data Hygiene (required)

  • Data-hygiene status: pass
  • Redaction/anonymization notes: N/A
  • Neutral wording confirmation: Confirmed

Compatibility / Migration

  • Backward compatible? Yes
  • Config/env changes? No
  • Migration needed? No

i18n Follow-Through (required when docs or user-facing wording changes)

  • i18n follow-through triggered? Yes
  • If Yes, locale navigation parity updated in README*, docs/README*, and docs/SUMMARY.md for supported locales (en, zh-CN, ja, ru, fr, vi)? Yes β€” all 30 localized READMEs updated consistently
  • If Yes, localized runtime-contract docs updated where equivalents exist (minimum for fr/vi: commands-reference, config-reference, troubleshooting)? N/A β€” no runtime-contract docs affected
  • If Yes, Vietnamese canonical docs under docs/i18n/vi/** synced and compatibility shims under docs/*.vi.md validated? Yes β€” docs/i18n/vi/README.md updated
  • If any No/N.A., link follow-up issue/PR and explain scope decision: N/A

Human Verification (required)

  • Verified scenarios: Dark mode active β€” all four theme buttons render with distinct preview swatches. README Buy Me a Coffee links fully removed.
  • Edge cases checked: System mode shows split dark/light swatch; OLED shows pure black. All 30 localized READMEs verified clean.
  • What was not verified: Light mode active (visual appearance from light mode perspective)

Side Effects / Blast Radius (required)

  • Affected subsystems/workflows: Settings modal Appearance tab, README files (main + 30 localized)
  • Potential unintended effects: None β€” preview swatches are purely additive visual elements; README removal is purely subtractive
  • Guardrails/monitoring for early detection: Visual regression would be immediately obvious; README diff is trivially reviewable

Agent Collaboration Notes (recommended)

  • Agent tools used: Claude Code with Playwright for visual verification (theme swatches), grep for README verification
  • Verification focus: Theme mode buttons visual distinctiveness; complete removal of Buy Me a Coffee references
  • Confirmation: naming + architecture boundaries followed

Rollback Plan (required)

  • Fast rollback command/path: Revert the relevant commit(s)
  • Feature flags or config toggles: None needed
  • Observable failure symptoms: Theme mode buttons would again appear visually identical; Buy Me a Coffee links would reappear

Risks and Mitigations

  • None

Each theme mode button (System/Dark/Light/OLED) now includes a small
color swatch that previews the mode's background, making them visually
distinguishable regardless of the currently active theme.

Closes #5723
@theonlyhennygod
Copy link
Copy Markdown
Collaborator Author

Agent Review β€” PR #5767

Comprehension Summary

This PR adds visual preview swatches to the four theme mode selector buttons (System, Dark, Light, OLED) in the Settings modal's Appearance tab. Previously, all four buttons rendered identically because they inherited styling from the active theme's CSS variables β€” users could not visually distinguish which mode they were selecting. The fix adds small color preview rectangles inside each button showing the actual background color of that mode (dark for Dark, light for Light, split gradient for System, pure black for OLED), with the theme icon rendered inside the swatch. Blast radius is limited to web/src/components/SettingsModal.tsx only; no theme logic, color themes, or other settings UI is affected.

Review Summary

Gate checks β€” all pass:

  • Template fully completed with clear scope boundary and validation evidence.
  • Size XS (18+/7-, 1 file) β€” appropriate.
  • Privacy/data hygiene β€” clean, no PII or sensitive data.
  • No duplicates β€” PR fix(web): theme mode switch not applying light/dark correctlyΒ #5724 is related (theme mode logic fix in ThemeContext.tsx) but distinct from this visual display fix.
  • Architectural alignment β€” no Rust changes, no trait boundary concerns, no dependency additions.

Code review β€” no issues found:

  • Hardcoded hex colors in previewBg/previewFg are intentionally static (not CSS variables) β€” using CSS variables would recreate the original bug where all buttons look identical.
  • The linear-gradient(135deg, ...) for System mode is a clean approach for the split preview.
  • Border color logic (light gets dark border, others get light border) provides appropriate contrast.
  • Gap increase from gap-1 to gap-1.5 is a minor spacing improvement that accommodates the slightly taller swatch.
  • Icon is still rendered (inside the swatch at size 10) β€” no functionality removed.
  • No regressions to existing behavior β€” purely additive visual elements.

Security assessment: No security impact. No permissions, network calls, secrets, or file system changes.

Performance assessment: No performance impact. No new dependencies, no new runtime computation, no allocation changes.

CI Note

The CI Required Gate from the CI workflow passes. The failures shown are from the Quality Gate workflow's Security Audit, which flags rustls-webpki vulnerabilities (RUSTSEC-2026-0098 and RUSTSEC-2026-0099, published 2026-04-14). This same failure also affects master β€” it is a repo-wide dependency issue unrelated to this PR's changes.

Verdict

This PR is ready for maintainer merge.

Thank you for the clean, well-scoped fix β€” this directly improves theme selection UX with minimal blast radius.

@theonlyhennygod theonlyhennygod added the agent-approved PR approved by automated review agent label Apr 15, 2026
@singlerider
Copy link
Copy Markdown
Collaborator

Hey! CI is failing on Security Audit due to RUSTSEC-2026-0098 and RUSTSEC-2026-0099, two rustls-webpki advisories published 2026-04-14. This is a repo-wide issue β€” not specific to your PR.

The fix landed in #5786 (merged today). Please merge upstream/master into your branch to pick up the updated .cargo/audit.toml and re-run CI:

git fetch upstream
git merge upstream/master
git push

Sorry for the noise!

…READMEs

Remove the Buy Me a Coffee badge from the header badge bar and the
donation paragraph from the Support ZeroClaw section across the main
README and all 30 localized README files. The Support section is
retained with its Special Thanks subsection intact.
@github-actions github-actions bot added the docs Auto scope: docs/markdown/template files changed. label Apr 16, 2026
@singlerider singlerider added risk: low Auto risk: docs/chore-only paths. size: S Auto size: 81-250 non-doc changed lines. labels Apr 17, 2026
Copy link
Copy Markdown
Collaborator

@singlerider singlerider left a comment

Choose a reason for hiding this comment

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

Comprehension summary: Two bundled fixes: (1) adds distinct color swatches to the four theme mode buttons in SettingsModal (System, Dark, Light, OLED) using hardcoded hex values instead of CSS variables -- correct approach since CSS variables would recreate the visual identity bug; (2) removes the Buy Me a Coffee donation badge and paragraph from the main README and all 30 localized READMEs (155 lines, 31 files). Addresses #5723.

Note: the prior agent review understated blast radius as 'SettingsModal.tsx only' -- the README changes are also part of this PR and are correctly documented in the PR body.

Security assessment: No security impact. No permissions, network calls, secrets, or file system changes.

Performance assessment: No performance impact. No new dependencies, no new runtime computation.

@github-project-automation github-project-automation bot moved this from Backlog to Ready to Merge in ZeroClaw Project Board Apr 17, 2026
@singlerider singlerider merged commit 0407479 into master Apr 17, 2026
20 checks passed
@github-project-automation github-project-automation bot moved this from Ready to Merge to Shipped in ZeroClaw Project Board Apr 17, 2026
WareWolf-MoonWall added a commit to WareWolf-MoonWall/zeroclaw that referenced this pull request Apr 18, 2026
… changelog

- Bump workspace version 0.7.0 β†’ 0.7.1 in root Cargo.toml
- Revert release workflow to gh release create --target for workflow_dispatch
  (the git-push approach from zeroclaw-labs#5860 is blocked by the org Restrict creations
  rule; --target uses the Releases API which bypasses it, and v0.7.1 has no
  immutable release lock so the previous blocker does not apply)
- Update CHANGELOG-next.md: retitle to v0.6.9 β†’ v0.7.1, restore full
  comprehensive notes from the upstream draft, and add entries that were
  missing from the original v0.7.0 draft:
    - feat(observability): otel_headers for authenticated OTLP exporters (zeroclaw-labs#5700)
    - feat: GitHub Copilot provider onboarding (zeroclaw-labs#5321)
    - fix(channels/telegram): inline_keyboard for tool approval requests (zeroclaw-labs#5790)
    - fix(provider): strip tool_stream for non-Z.AI providers (zeroclaw-labs#5806)
    - fix(agent): normalize empty successful tool output (zeroclaw-labs#5565)
    - fix(web): theme mode switch not applying correctly (zeroclaw-labs#5724)
    - fix(web): add visual preview swatches to theme selector (zeroclaw-labs#5767)
    - fix: cron_run tool output not delivered to configured channels
WareWolf-MoonWall added a commit to WareWolf-MoonWall/zeroclaw that referenced this pull request Apr 18, 2026
… changelog

- Bump workspace version 0.7.0 β†’ 0.7.1 in root Cargo.toml
- Revert release workflow to gh release create --target for workflow_dispatch
  (the git-push approach from zeroclaw-labs#5860 is blocked by the org Restrict creations
  rule; --target uses the Releases API which bypasses it, and v0.7.1 has no
  immutable release lock so the previous blocker does not apply)
- Update CHANGELOG-next.md: retitle to v0.6.9 β†’ v0.7.1, restore full
  comprehensive notes from the upstream draft, and add entries that were
  missing from the original v0.7.0 draft:
    - feat(observability): otel_headers for authenticated OTLP exporters (zeroclaw-labs#5700)
    - feat: GitHub Copilot provider onboarding (zeroclaw-labs#5321)
    - fix(channels/telegram): inline_keyboard for tool approval requests (zeroclaw-labs#5790)
    - fix(provider): strip tool_stream for non-Z.AI providers (zeroclaw-labs#5806)
    - fix(agent): normalize empty successful tool output (zeroclaw-labs#5565)
    - fix(web): theme mode switch not applying correctly (zeroclaw-labs#5724)
    - fix(web): add visual preview swatches to theme selector (zeroclaw-labs#5767)
    - fix: cron_run tool output not delivered to configured channels
WareWolf-MoonWall added a commit to WareWolf-MoonWall/zeroclaw that referenced this pull request Apr 18, 2026
Version
- Bump workspace version 0.7.0 β†’ 0.7.1 in root Cargo.toml + Cargo.lock

CI rationalisation (FND-004 Phase 1 β€” Rationalise)
- Delete checks-on-pr.yml and ci-run.yml β€” two workflows doing identical
  work on every PR, producing duplicate signal and double compute cost
- Add ci.yml (name: Quality Gate) β€” single staged pipeline replacing both:
    Stage 1: fmt + clippy --workspace (fast gate)
    Stage 2: build matrix, check all-features / no-default-features / 32-bit,
             benchmarks compile (parallel, gated on Stage 1)
    Stage 3: nextest (gated on Stage 1)
    Stage 4: cargo deny check β€” licenses, sources, advisories (deny.toml
             already present and triaged)
    Stage 5: CI Required Gate composite job (branch protection target)
- Remove rust_strict_delta_gate.sh β€” workspace-aware clippy --workspace
  makes delta comparison implicit (clean baseline = any warning fails)
- pre-release-validate.yml: remove pull_request trigger (secrets unavailable
  on fork PRs caused guaranteed failure on every Cargo.toml bump); remove
  stale CARGO_REGISTRY_TOKEN check (crates.io publishing removed in zeroclaw-labs#5858)

Release workflow
- Revert release-stable-manual.yml to gh release create --target for
  workflow_dispatch (git push approach from zeroclaw-labs#5860 blocked by org Restrict
  creations rule; Releases API bypasses it; v0.7.1 has no immutable lock)

Changelog
- Retitle CHANGELOG-next.md to v0.6.9 β†’ v0.7.1, restore full release notes,
  add entries missing from original draft: otel_headers (zeroclaw-labs#5700), GitHub
  Copilot onboarding (zeroclaw-labs#5321), Telegram inline_keyboard (zeroclaw-labs#5790), tool_stream
  fix (zeroclaw-labs#5806), empty tool output (zeroclaw-labs#5565), web theme fixes (zeroclaw-labs#5724, zeroclaw-labs#5767),
  cron_run delivery fix
WareWolf-MoonWall added a commit to WareWolf-MoonWall/zeroclaw that referenced this pull request Apr 18, 2026
Version
- Bump workspace version 0.7.0 β†’ 0.7.1 in root Cargo.toml + Cargo.lock

CI rationalisation (FND-004 Phase 1 β€” Rationalise)
- Delete checks-on-pr.yml and ci-run.yml β€” two workflows doing identical
  work on every PR, producing duplicate signal and double compute cost
- Add ci.yml (name: Quality Gate) β€” single staged pipeline replacing both:
    Stage 1: fmt + clippy --workspace (fast gate)
    Stage 2: build matrix, check all-features / no-default-features / 32-bit,
             benchmarks compile (parallel, gated on Stage 1)
    Stage 3: nextest (gated on Stage 1)
    Stage 4: cargo deny check β€” licenses, sources, advisories (deny.toml
             already present and triaged)
    Stage 5: CI Required Gate composite job (branch protection target)
- Remove rust_strict_delta_gate.sh β€” workspace-aware clippy --workspace
  makes delta comparison implicit (clean baseline = any warning fails)
- pre-release-validate.yml: remove pull_request trigger (secrets unavailable
  on fork PRs caused guaranteed failure on every Cargo.toml bump); remove
  stale CARGO_REGISTRY_TOKEN check (crates.io publishing removed in zeroclaw-labs#5858)

Release workflow
- Revert release-stable-manual.yml to gh release create --target for
  workflow_dispatch (git push approach from zeroclaw-labs#5860 blocked by org Restrict
  creations rule; Releases API bypasses it; v0.7.1 has no immutable lock)

Changelog
- Retitle CHANGELOG-next.md to v0.6.9 β†’ v0.7.1, restore full release notes,
  add entries missing from original draft: otel_headers (zeroclaw-labs#5700), GitHub
  Copilot onboarding (zeroclaw-labs#5321), Telegram inline_keyboard (zeroclaw-labs#5790), tool_stream
  fix (zeroclaw-labs#5806), empty tool output (zeroclaw-labs#5565), web theme fixes (zeroclaw-labs#5724, zeroclaw-labs#5767),
  cron_run delivery fix
theonlyhennygod pushed a commit that referenced this pull request Apr 18, 2026
… 1) (#5867)

Version
- Bump workspace version 0.7.0 β†’ 0.7.1 in root Cargo.toml + Cargo.lock

CI rationalisation (FND-004 Phase 1 β€” Rationalise)
- Delete checks-on-pr.yml and ci-run.yml β€” two workflows doing identical
  work on every PR, producing duplicate signal and double compute cost
- Add ci.yml (name: Quality Gate) β€” single staged pipeline replacing both:
    Stage 1: fmt + clippy --workspace (fast gate)
    Stage 2: build matrix, check all-features / no-default-features / 32-bit,
             benchmarks compile (parallel, gated on Stage 1)
    Stage 3: nextest (gated on Stage 1)
    Stage 4: cargo deny check β€” licenses, sources, advisories (deny.toml
             already present and triaged)
    Stage 5: CI Required Gate composite job (branch protection target)
- Remove rust_strict_delta_gate.sh β€” workspace-aware clippy --workspace
  makes delta comparison implicit (clean baseline = any warning fails)
- pre-release-validate.yml: remove pull_request trigger (secrets unavailable
  on fork PRs caused guaranteed failure on every Cargo.toml bump); remove
  stale CARGO_REGISTRY_TOKEN check (crates.io publishing removed in #5858)

Release workflow
- Revert release-stable-manual.yml to gh release create --target for
  workflow_dispatch (git push approach from #5860 blocked by org Restrict
  creations rule; Releases API bypasses it; v0.7.1 has no immutable lock)

Changelog
- Retitle CHANGELOG-next.md to v0.6.9 β†’ v0.7.1, restore full release notes,
  add entries missing from original draft: otel_headers (#5700), GitHub
  Copilot onboarding (#5321), Telegram inline_keyboard (#5790), tool_stream
  fix (#5806), empty tool output (#5565), web theme fixes (#5724, #5767),
  cron_run delivery fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-approved PR approved by automated review agent docs Auto scope: docs/markdown/template files changed. risk: low Auto risk: docs/chore-only paths. size: S Auto size: 81-250 non-doc changed lines.

Projects

Status: Shipped

Development

Successfully merging this pull request may close these issues.

[Bug]: Theme mode display bug: both dark and light options appear as dark

2 participants