Skip to content

fix(accessibility): preserve forced-colors state cues - #151

Draft
seonghobae wants to merge 10 commits into
mainfrom
fix/forced-colors-accessibility
Draft

fix(accessibility): preserve forced-colors state cues#151
seonghobae wants to merge 10 commits into
mainfrom
fix/forced-colors-accessibility

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Purpose

Implement issue #150 as a bounded forced-colors/high-contrast accessibility slice without changing Inkspan's normal light/dark theme behavior or host authority boundaries.

Exact test-first lineage

  • Protected base at branch creation and current live protected tip: main@50ac98cfa0ad9e8dd75f93ca437a5679fed4d804.
  • Initial RED head: d89bd41dabca47a00d486e847eed0d3df8b5456b. Exact CI run 31412302233, build-and-test job 93533014788, checked out that head and proved the missing forced-colors system-state mappings.
  • Initial implementation head 23a24f5f20475543e51c97a83a5dc7fc08db9ddb made the requested system-color/browser contract green, but a later audit found the authored @media (forced-colors: active) overrides were split before later equal-specificity base rules, leaving a real CSS-cascade regression risk.
  • Cascade RED head bcd993a1d521d3f44fe07eaeaa5acda10dce3d6b changed only src/forcedColorsStyles.test.ts. Exact CI run 31416835830, build-and-test job 93547761779, checked out that head and failed the intended boundary because two screen forced-colors blocks existed.
  • Source correction head bd109253141bcda7b0514de95d25f43ee2710602 consolidated the screen forced-colors overrides after the normal screen state rules. Its browser/Office/security/SAST jobs passed, while CI run 31417191422 exposed a test-scoping defect: the order assertion counted later @media print selectors that cannot override screen forced-colors behavior.
  • Test-scope head 940c2e1341ad46c66f1cdc4cfab3603fd7dfc1aa correctly excluded print media but still counted selectors inside the forced-colors block itself. Exact CI run 31417569588, build-and-test job 93550088295, failed only that over-broad assertion while the other 825 tests passed.
  • Current exact GREEN head: 862db1d4ec2f910fcc65dbd3aabdfcd49877d98d. The final contract identifies the balanced forced-colors media block, requires relevant base screen selectors before it, and rejects matching normal screen rules after it without confusing forced-colors or print declarations.

Implemented boundary

Inside one final screen @media (forced-colors: active) layer, Inkspan uses CSS system colors to preserve editor/container boundaries, toolbar and collaboration status chrome, toolbar grouping, keyboard focus, active and disabled control states, authored document links, blockquote/placeholder cues, code/pre/table borders, and collaboration cursors. Disabled buttons no longer rely on opacity as their forced-colors state cue. Normal light/dark theme declarations remain unchanged outside that media query, and Inkspan does not opt out of user-agent forced-color adjustment.

The deterministic stylesheet contract now also guards cascade placement. tests/browser/specs/forced-colors.browser.spec.ts supplies network-blocked real-engine evidence via Playwright forced-colors emulation for media activation, keyboard focus, disabled-state opacity, structural borders, underlined links, collaboration cursor/label visibility, and the editable document surface's own focus-visible outline.

The slice adds no persistence, transport, credentials, model use, authorization, tenant, network, provider, room, or durable-audit authority.

Exact-head evidence

For unchanged exact head 862db1d4ec2f910fcc65dbd3aabdfcd49877d98d:

  • CI run 31417814093: success;
  • Security Scan run 31417815005: success;
  • SAST Semgrep run 31417814222: success;
  • CI build-and-test passed typecheck, all 826 tests with exact 100% owned-production coverage, library build, packed-package consumer verification, and demo build;
  • the cross-engine Playwright 1.62.0 job passed, including the network-blocked forced-colors browser contract;
  • Office Python 3.11, 3.12, 3.13 and 3.14 test/100% branch-coverage/docstring/wheel/package jobs all passed;
  • CodeRabbit status is successful on this exact head; and
  • fresh review inspection shows no submitted formal reviews and no unresolved inline review threads. Automated status is not represented as independent formal approval.

Release dependency

Issue #118 still owns the exact 0.6.0 stable-candidate operational boundary. Keep this PR Draft and unmerged until that release boundary closes; moving protected main first would invalidate the current stable-candidate identity required by the protected release workflow. After #118 closes, refetch the then-current protected tip, reacquire live-base ancestry and exact-head gates, reconcile canonical next-release documentation/traceability, and only then evaluate Ready/merge status.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 01e56826-f52a-4fb3-bac6-a9fbd48a0676

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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