Skip to content

feat: add monochrome visual themes #121

Closed

Description

@kbuffardi

Problem

browser.cpp currently offers five visual themes, but none provides a strictly monochrome reading mode. Users who want black-on-white or white-on-black code and interface surfaces still see chromatic syntax, ANSI output, controls, and semantic states.

Proposed solution

Add two persistent visual themes:

  • monochrome-light: black primary content on white surfaces, with #666666 for tertiary elements.
  • monochrome-dark: white primary content on black surfaces, with #999999 for tertiary elements.

The monochrome themes must apply consistently to the shell, Monaco, xterm, ANSI palettes, controls, previews, borders, and semantic states. Source code must have no syntax highlighting: all code tokens use uniform foreground styling. Success, warning, and error states remain distinguishable through grayscale levels, borders, labels, and existing icons.

Existing themes, the browser-cpp-dark default, settings persistence, and Memory Debug Mode remain unchanged.

Acceptance criteria

  • Both themes appear exactly once in the registry and settings cards.
  • Both themes persist across reloads and unknown values still fall back safely.
  • New-theme CSS, Monaco, xterm, ANSI, preview, control, and semantic-state colors are grayscale.
  • Monochrome source code has no token-based syntax color, font-weight, or font-style differences.
  • Monaco and xterm selection colors remain readable and consistent.
  • Success, warning, and error remain distinguishable without hue.
  • Existing five themes retain their current behavior.
  • npm run lint, npm run build, npm run test:e2e, and available browser smoke tests pass.

Activity

  1. kbuffardi commented on Oct 30, 2026

    @kbuffardi
    OwnerAuthor

    Plan update

    The requested refinement is implemented in PR #122:

    • Monochrome Light now separates the explorer, editor, and terminal with #f2f2f2, #ffffff, and #e6e6e6.
    • Monochrome Dark now separates them with #1a1a1a, #000000, and #262626.
    • Buttons, including panel controls and close controls, use contrasting grey outlines in both themes.
    • Focused theme tests and browser-smoke assertions now cover panel backgrounds and button outlines.

    The existing five themes remain unchanged.

  2. kbuffardi commented on Oct 30, 2026

    @kbuffardi
    OwnerAuthor

    When highlighting text in the file editor (in either monochrome theme) the contrast is too small between the highlight background and the text.

    Fix this.

  3. kbuffardi commented on Oct 30, 2026

    @kbuffardi
    OwnerAuthor

    Plan: WCAG-compliant monochrome selections

    Agreed scope for the reopened selection-contrast issue:

    • Update monochrome-light and monochrome-dark selection colors only.
    • Make active and inactive selection foreground/background pairs meet WCAG AA contrast of at least 4.5:1.
    • Keep Monaco and xterm selection colors consistent within each theme and state; light and dark themes may use different grayscale colors.
    • Add unit-level regression coverage for the configured pairs and browser-smoke coverage for rendered Monaco and terminal selections in both focus states.
    • Preserve the existing five themes and existing monochrome syntax/grayscale behavior.

    Verification will include npm run lint, npm run build, npm run test:e2e, and available browser smoke tests.

  4. kbuffardi commented on Oct 30, 2026

    @kbuffardi
    OwnerAuthor

    Implementation correction

    @kbuffardi reported:

    the current implementation is incorrect so the new tests must be wrong as well. In both monochrome themes, the background selection is the same color as the text so there is NO contrast.

    Root cause: Monaco applied the configured selection background but retained the token foreground inside selected text. The previous smoke hook created a synthetic span, so it did not prove the actual Monaco selection rendering.

    The PR now:

    • explicitly overrides Monaco .selected-text foregrounds for the two monochrome themes;
    • probes a real Monaco model selection in the smoke hook; and
    • retains WCAG AA checks for active/inactive Monaco and xterm selections.

    Verification passed: lint, production build, and 234 E2E tests.

  5. kbuffardi commented on Oct 30, 2026

    @kbuffardi
    OwnerAuthor

    Monaco overlay correction

    @kbuffardi reported:

    active selected text has the same text color as background color; when another pane is focused on, then there is at least some contrast but I'm still not sure if it is proper contrast.

    The active-state screenshots showed that Monaco draws selection backgrounds in an overlay separate from source-code text spans. The previous selected-text CSS targeted the overlay and could not change the glyph color.

    The PR now removes that ineffective override and uses WCAG AA grayscale overlay backgrounds that contrast with Monaco's actual code foreground:

    • Monochrome Light: black on #999999 (active) and #bbbbbb (inactive).
    • Monochrome Dark: white on #555555 (active) and #707070 (inactive).

    The smoke hook now reads the real selection overlay background and the rendered source span color independently. Lint, production build, and 234 E2E tests passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions