Skip to content

feat(native): add contrast, glass and theme library - #127

Merged
rynfar merged 4 commits into
nativefrom
nw/1-appearance-themes
Nov 3, 2026
Merged

rynfar merged 4 commits into
nativefrom
nw/1-appearance-themes

Conversation

@rynfar

@rynfar rynfar commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

Native Appearance only offered built-in themes and could not apply the web's contrast or glass settings. This slice ports the remaining color controls and the theme library while keeping the theme editor separate.

  • Contrast (50–200%, default 100) and Glass opacity (40–100%, default 80) persist with the web keys, apply live, reset, and appear in settings search/command-palette results.
  • Custom/imported and environment themes share generated CSS role recipes, T3 Chat fallbacks, contrast interpolation, context-chip readability, seeded palette derivation and both diff schemes in core. Generated tokens remain generator-owned. Runtime palettes are owned and caches use a theme revision.
  • The library selects light/dark halves independently, applies collection defaults together, offers variant choices per appearance, duplicates built-in/custom/environment themes, exports custom JSON, and confirms removal of individual/selected variants while preserving unrelated selections. Re-import offers Update existing (preserves selections and collection metadata) and Keep both.
  • Add theme opens the native file picker only on a click. It reads up to 256 KiB off-thread and accepts T3 Code JSON and VS Code JSONC workbench palettes. Snapshot import uses a fixture path; it never reads the clipboard.
  • Published themes are requested by the config subscription, decoded/derived on the network worker, and delivered prepared to the UI. They survive reconnect snapshots, disappear when withdrawn, and yield to a saved custom theme with the same id. Literal CSS color imports include display-p3 and the other CSS color() spaces. Composer fills, outlines and dark highlights are generated from the web composer recipes, including T3 Chat overrides.

Refs #1. ST-APPEARANCE and AP-THEME stay partial: theme editing and clipboard import are outside this slice. Duplicate saves a copy directly because the editor is absent. Marketplace search/download is not part of this file-import slice. Multi-file import, import-name collision resolution across files, and automatic light/dark VS Code file pairing remain an explicit gap; Add theme currently accepts one file at a time. Earlier typography gaps (real embedded previews, non-monospace rejection UI, font inventory refresh) remain.

Validation: 1,138 native workspace tests pass. Workspace Clippy with warnings denied; snapshot build; theme generation, parity sync and client-runtime conformance checks; vp run check:changed. Core tests compare all default/built-in palette tokens to generated web output, seed colors to fixtures produced by the web's pure derivation, and exercise import validation, VS Code JSONC/alpha/readability, library preservation, half fallback, removal and streamed themes.

Offscreen evidence against a copied smoke home (local PNGs, not uploaded):

  • Before: /private/tmp/native-1-evidence/before-appearance.png
  • Default: /private/tmp/native-1-evidence/default-appearance.png, /private/tmp/native-1-evidence/default-thread.png
  • High contrast (195%): /private/tmp/native-1-evidence/high-contrast-appearance.png, /private/tmp/native-1-evidence/high-contrast-thread.png
  • Glass (40%): /private/tmp/native-1-evidence/glass-40-appearance.png, /private/tmp/native-1-evidence/glass-40-thread.png
  • Imported: /private/tmp/native-1-evidence/imported-appearance.png, /private/tmp/native-1-evidence/imported-thread.png
  • Published: /private/tmp/native-1-evidence/environment-selected.png
  • Actions: /private/tmp/native-1-evidence/duplicate-appearance.png, /private/tmp/native-1-evidence/remove-confirmation.png
  • VS Code: /private/tmp/native-1-evidence/vscode-import.png

The final workspace run passed after an isolated pass of the existing SSH launch-PID test, which had failed once during the preceding concurrent run. Logs: /private/tmp/native-1-review-final2-clippy.log, /private/tmp/native-1-review-final3-workspace.log, /private/tmp/native-1-review-final2-check-changed.log, /private/tmp/native-1-review-ssh-diagnostic.log.

Unverified: real native file dialogs and real-window blur (offscreen-only factory), remote/relay/tunnel visual checks, marketplace flows. No server or provider behavior changed; no turns, server writes, new servers, clipboard access, live install access, or edits to #124's file boundaries.

Additional review evidence: /private/tmp/native-1-evidence/before-light-composer.png, /private/tmp/native-1-evidence/review-light-composer.png, /private/tmp/native-1-evidence/review-reimport.png, /private/tmp/native-1-evidence/review-update.png, /private/tmp/native-1-evidence/review-copy.png, /private/tmp/native-1-evidence/review-collection.png, /private/tmp/native-1-evidence/review-collection-variants.png, /private/tmp/native-1-evidence/review-environment.png, /private/tmp/native-1-evidence/review-p3.png. Failing-first logs: /private/tmp/native-1-review-red-core.log, /private/tmp/native-1-review-red-client.log, /private/tmp/native-1-review-red-worker.log.

Built with GPT-6.1 Sol in Codex

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.

1 participant