[P2] Forced-colors (high-contrast) mode hides the tissue bars, tank gauge fill, reserve marker and NDL meter #116
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Priority: P2
Type: bug
Source: full codebase review requested 2026-10-31 (independently reproduced against
2cac7cf)Location:
src/style.css:385-410,src/ui/TissueBars.tsx:46-54,src/ui/TankPressureGauge.tsx:38-75,src/style.css:640-650,src/style.css:1298-1322,src/style.css:1858-1870Problem and evidence
The stylesheet has no
@media (forced-colors: active)rules and never setsforced-color-adjust. A grep of src/ and docs/ for "forced" finds nothing. These graphics are drawn only with background colours:.bar, which gets its colour from the inlinebackgroundin TissueBars.tsx. Its parent.tissue-barbutton hasbackground:none; border:0..tank-gauge-fill.tank-reserve-marker.ndl-meter > divand its trackThe selected compartment is shown only by opacity plus
box-shadow. In forced-colors mode the browser replaces background-color with Canvas and removes box-shadow. So the 16 compartment bars and their button outlines disappear, and so does the selection cue. Every cylinder gauge looks like an empty outlined rectangle at any pressure, with no reserve marker. The NDL meter is invisible. The numbers still show, but the main tissue visualisation stops working for users who rely on Windows High Contrast or other forced-colours modes.I served the HEAD build (/tmp/divesim-review-dist-SqbiNx) on a private port and loaded it in Playwright Chromium twice, once with
forcedColors:'none'and once withforcedColors:'active'. In the forced run, matchMedia('(forced-colors: active)') returned true. Computed styles, normal vs forced:.tissue-bar .barbackground: rgb(67,207,189) normal, rgb(255,255,255) forced. Its box-shadowrgb(197,248,239) 0 0 0 1pxbecamenone. The bar is still 26.9px tall but painted the page colour. The parent.tissue-barhas transparent background andborder: none..tank-gauge-fillbackground: rgb(67,207,189) normal, rgb(255,255,255) forced. The track.tank-gaugeis also white; only its 1px black border survives..tank-reserve-markerbackground: rgb(255,223,0) normal, rgb(255,255,255) forced, with its box-shadow removed..ndl-meter > divand.ndl-meterare both rgb(255,255,255) in forced mode, so the meter is invisible.The forced-mode screenshot shows the Cylinder 1 gauge at 3000.0 psi (full) drawn as an empty outlined bar.
Suggested correction
Add a
@media (forced-colors: active)block:.tissue-bara1px solid ButtonBorderborder..bar,.tank-gauge-fill,.ndl-meter > divand.tank-reserve-markerforced-color-adjust: nonewith a system colour:background: Highlightfor the fills andCanvasTextfor the reserve marker. Alternatively, draw them with borders or outlines, which survive forced colours..tissue-bar.selected/[aria-pressed=true]with anoutline: 2px solid Highlightinstead of the box-shadow..tank-gaugeand.ndl-metertracks aCanvasTextorButtonBorderborder.MarkorLinkText, or with patterns.Acceptance criteria
Run Playwright Chromium with
forcedColors:'active'and check:.tissue-bar .bar,.tank-gauge-fill,.tank-reserve-markerand.ndl-meter > divdiffers from the Canvas colour of their container..tissue-barhas a visible border.Also add a regression test: either an e2e test asserting those computed styles under forced colours, or a CSS test asserting that the forced-colors media block exists and covers these selectors. Normal-mode rendering must not change. pnpm verify passes.
Scope: maintenance of the educational simulator. Preserve historical R1 acceptance and operational-validation limits.