A review of db25c4ee found that colorblind mode reached past the quota
curve and that its legend shapes matched nothing on the plot:
- The fallback rules `.qc-line:not([data-series="0"])...` and the
matching `.qc-key` rule also matched elements with no data-series, so
the balance curve's solid line became dashed like its fitted line, and
its legend dot became a ring in var(--c4) while the line was var(--c1).
- A filled circle, hollow square or diamond in the legend appeared
nowhere on the plot, so it didn't tell a reader which line was which.
Series 3 and up shared one dash and one shape.
- The 7-day line's 6 2.5 dash sat beside its own 3 3 dashed even pace in
the same colour, while the tooltip still said "Solid: what was left.
Dashed: an even pace".
- The Context tab's "good" grade took var(--c2), which the palette turns
amber, next to "fair" in --amber (dark #fbbf24 vs #f2b544).
- omarchy.css made the first legend dot round with colorblind mode off.
- The legend set its colour twice (--sw and background) and undid it
with !important.
Now, with colorblind mode on:
- drawQuotaPlot tags each window's path.qc-line and line.qc-even with
data-series (its index mod 7, the same slot as its colour), and the
quota legend tags its key. Seven dash patterns, one per slot, apply to
`:is(.qc-line, .qc-dash)[data-series=N]`, so a line and its key can't
drift apart. Nothing else sets data-series, so the balance curve is as
on main.
- Each quota legend key shows a 22px sample of its window's line
(svg.qc-sample > line.qc-dash) in place of the dot; with the mode off
the sample is hidden and the dot is as on main.
- The even paces are dotted (0 4, round caps), unlike every window's
dash; the curve's tooltip, set in box.draw, says "Each window's line
has the dash shown beside its name. Dotted: an even pace, ..." in en,
zh, zh-TW, ja and de.
- `.ctx-ring.good` / `.ctx-grade-word.good` take --c1, the palette's
blue.
- omarchy.css is back to main's; the legend's `--sw` and !important are
gone.
- The Settings note now says what the mode does ("Colorblind-safe chart
colors, and each allowance window's line in a dash of its own"), and
gui-shell.md says the note is the Off/On control's tooltip, as the
code has it.
Run on db25c4ee + this change (upstream/main f074996d9 unchanged),
Playwright 1.58.2, Chromium and WebKit:
- New tests fail without the change: with db25c4ee's assets the 10
"colorblind mode separates quota windows by colour and dash, in the
legend too" (both engines, 5 languages), the 2 "seven windows have
seven dashes" and the 2 balance-curve "colorblind mode leaves the
balance curve's solid line, dashed fit and dot" fail, 14/14 (e.g.
"key 0 shows its line, not a dot"). Broken by hand on this change,
each is caught: the good-grade rule removed ("good and fair too close:
light: {good: 41.5, fair: 26.0}"), the dotted pace removed (pace dash
equals its default), the colorblind tooltip removed ("the tooltip names
the dashes and dots: Solid: ..."), the :not() fallback put back ("the
balance stays solid: line 2.5px, 2px"), series 3-6 given one dash
("every window its own dash: 4 !== 7"), the sample's dash rule dropped
(key 1's dash).
- quota-curve.test.cjs 27/27, balance-curve.test.cjs 6/6; the colorblind
tests 14/14 three runs in a row at --test-concurrency=4.
- balance-currencies, context-window, quota-read-at, settings-general,
usage-ledger-chart, api-key-theme, gui-de, gui-ja, gui-zh-tw,
i18n-keys, keep-awake, lightweight, omarchy, seg-contrast, segs-glide,
settings-search, settings-sections and usage-ledger*: with the two
above, 305/315. The 10 failures are settings-general's WebKit cases
('English\n' for 'English' from #langPick's innerText, a span and an
svg), which fail the same 10 on upstream/main f074996d9 in this
Playwright's WebKit; not fixed here.
- node --check app.js, i18n.js and both tests: clean.
- Sandbox HOME, GOPATH/GOMODCACHE/GOCACHE pinned, set -o pipefail:
gofmt -l on the changed .go files prints nothing; go vet ./...,
GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet ./...,
go build, GOOS=linux go build -tags nogui, GOOS=windows go build and
go test -tags nogui ./... all exit 0 (the only output is the existing
cgo -Wenum-conversion warning in trayimage_darwin.go);
TestSettingsColorblindMode passes.
- Not run: the whole GUI suite (707 files; only the files above), the real Linux app under
WebKitGTK, and a check by a colour-blind reader.
Subsystem design references
These pages describe current responsibilities, runtime paths, state, and contracts. Start with the subsystem relevant to your task, then follow its source links to verify the implementation you change.
| Subsystem | Reference |
|---|---|
| Built-in subscriptions moving to plugins | Provider and plugin ownership |
| Built-in plugins: registry, lifecycle, plugins.yml, presets, settings schemas, the window's kernel (slots, error boundary, kit) | Plugin runtime |
| Plugins that run on the gateway's requests and replies | Gateway middleware |
| Claude subscription turns across Claude Code runs | Claude subscription bridge |
| How the gateway picks a provider, key or account, and falls back | Gateway routing and fallback |
| Gateway Session Aggregation | Gateway Session Aggregation |
| Connecting an agent's config to the gateway, drift, disconnect, WSL twins | Agent wiring |
| Providers, keys, subscription accounts, refresh and allowance | Providers and accounts |
| Instructions, MCP servers, skills and RTK written into agents | Library |
Tray, panel, window, magpie web and the page's JSON API |
GUI app shell |
| Encrypted backups and setup synchronization over WebDAV, S3 or GitHub | Sync and backup |
A subsystem can span several packages or repositories. Its reference describes the behavior those parts provide together; it does not need to list every function.
Maintain a reference
Update the owning reference in the same PR when a change alters a documented responsibility, interface, state transition, runtime path, compatibility rule, or failure behavior. An internal refactor that preserves these contracts does not require a prose change.
Keep each fact in one reference and link to it from agent instructions or other pages. Link to source files and named symbols rather than copying implementation details that change frequently. Explain field meanings and constraints that signatures alone do not express.
For a new reference, include the responsibilities and boundaries, source of truth, main runtime paths, state transitions, important constraints, and existing verification commands. Include failure and compatibility behavior where relevant. Document current behavior separately from proposed changes; the proposal belongs in its issue or PR.
Describe a PR's semantic changes
For each affected subsystem, explain the observable change with its trigger and before/after behavior. Include changes to interfaces, state, compatibility, and failure behavior when relevant. Link the affected reference, implementation, and verification evidence. State when a refactor preserves the documented behavior.
For example, a change to plugin adoption should explain which migration state and account condition trigger it, which implementation handles requests before and after adoption, and which test exercises that transition.
This is an author-provided explanation that a reviewer verifies against the diff and surrounding code. It is not an automatically proven compatibility verdict.
Review a change
- Identify the affected subsystem and the actual runtime path, including plugin or built-in ownership.
- Compare the claimed before/after behavior with the base and head implementation. Trace relevant callers and state transitions beyond the changed lines.
- Check that changed contracts appear in the owning reference and that source links still resolve.
- Check that the cited tests or runtime evidence exercise the claimed behavior. Report checks that were not run.
A documentation update alone does not prove the implementation. Existing tests and runtime evidence remain necessary for behavior changes.