Skip to content

Grayscale mode: per-channel color exceptions - #228

Merged
lawrencehook merged 4 commits into
mainfrom
feature/grayscale-channel-exceptions
Sep 6, 2026
Merged

Grayscale mode: per-channel color exceptions#228
lawrencehook merged 4 commits into
mainfrom
feature/grayscale-channel-exceptions

Conversation

@lawrencehook

@lawrencehook lawrencehook commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Grayscale mode can now exempt specific channels: grayscale stays on globally, but channels on a user-managed allowlist render in color automatically — no manual toggling. Useful when grayscale is a distraction guard for entertainment content, but certain channels should stay watchable in color.

Scope: page-level. Watching an exempt channel's video or browsing their channel page shows color; in-feed thumbnails stay gray. (CSS ancestor filters can't be reversed on descendants, so per-thumbnail color would require a fragile per-element grayscale rework — deliberately out of scope.)

UI: introduces the extension's first sub-option pattern — a pill input indented beneath the grayscale toggle, visible only while grayscale is on. Type a handle (with or without @), Enter/comma commits a pill, × or backspace removes. Stored as a plain comma-separated string (grayscale_exempt_channels, shortId 98), so import/export works with existing machinery.

Mechanics: the content script's existing dynamic loop derives html[grayscale_exempt] (URL match on channel pages, owner-link match on watch pages — self-correcting across SPA navigations), and the root grayscale rule gains :not([grayscale_exempt='true']).

Tests: 6 new unit tests for the parse/match helpers; suite at 176 passing. Not covered by automation: the pill UI itself and the live YouTube behavior — worth a manual pass (./dev.sh chrome, enable grayscale, add a channel, visit their page/video).

🤖 Generated with Claude Code

lawrencehook and others added 4 commits September 5, 2026 19:23
Feature request: keep grayscale on globally, but let designated channels
render in color automatically. Page-level scope: watch pages (matched by
the owner link) and channel pages (matched by URL); in-feed thumbnails
stay gray (a parent CSS filter cannot be undone on descendants).

- New string setting grayscale_exempt_channels (shortId 98), stored as a
  comma-separated @handle list; config of grayscale_mode, not a separate
  premium toggle.
- Content script derives html[grayscale_exempt] in the dynamic loop; the
  root grayscale rule gains :not([grayscale_exempt='true']).
- Options page: first sub-option UI — a pill input revealed beneath the
  grayscale toggle while it is on (Enter/comma adds, backspace/x removes,
  synced across windows via the existing storage listener).
- Unit tests for the parse/match helpers (176 passing).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@lawrencehook
lawrencehook merged commit c02ee73 into main Sep 6, 2026
4 checks passed
@lawrencehook
lawrencehook deleted the feature/grayscale-channel-exceptions branch September 6, 2026 00:45
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