Reading Comfort restores its toggle on launch but not its typography

Closed
#99 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
74/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
frontend, testing

Research direction

Read docs/specs/12-dyslexia-mode.md and trace startup in src/main.ts, alongside applyReadingComfort() in src/lib/reading-comfort.ts; check how src/components/settings-screen.ts reads the stored state. Add a regression test for the launch path that asserts the applied attribute and computed scale. Done means stored settings are applied before the first screen paints, the toggle and DOM agree even on first run, and terminals opened after restoration use the stored font settings.

Written by the indexing model from the issue text.

Description

accessibility bug p2

Goal

Make Reading Comfort actually take effect on launch when it is already enabled, as docs/specs/12-dyslexia-mode.md requires.

Priority

p2. A persisted preference silently stops working across restarts, and the status-bar toggle actively reports the wrong thing (aria-pressed="true" with no visual effect). The workaround is to toggle the mode off and on again, which a user only discovers by accident.

Current gap

With comnd-reading-comfort stored as {"enabled":true,"prevFontSize":14,"lastFontSize":16,"uiScale":1.15,"lineHeight":1.4,"letterSpacing":2}, after a reload:

  • the status-bar toggle reports aria-pressed="true";
  • data-reading-comfort is absent from <html>;
  • --text-scale is unset;
  • host names render at 13px instead of 14.95px.

Toggling the mode off and on applies everything correctly (data-reading-comfort="on", --text-scale: 1.15, 14.95px), so the state round-trips and only the startup application is missing. Spec 12's manual step 2 says "Restart app → mode + all values persist".

Likely cause

src/lib/reading-comfort.ts exports applyReadingComfort() and calls it from enable(), update() and resetToPreset(), but nothing calls it during startup. src/main.ts imports isReadingComfortEnabled and wires the comnd:reading-comfort event, and src/components/settings-screen.ts reads isReadingComfortEnabled() to render the toggle — so the UI reads the stored state while the DOM never receives it.

Recorded in PR #96 (docs/testing/manual-matrix.md §Findings, F-1) and deliberately not fixed there, because that change is documentation only.

Scope

Apply the stored mode once during startup, before the first screen paints, so the app does not flash unstyled text. Reuse the existing applyReadingComfort() path rather than duplicating it; if terminals need a size notification on startup, emit the same comnd:reading-comfort event the other entry points emit.

Acceptance criteria

  • With the mode stored as enabled, a fresh launch sets data-reading-comfort="on" and --text-scale to the stored uiScale without any user interaction.
  • Host names and other UI text render at the scaled size on the first paint, not after a toggle.
  • The status-bar toggle's aria-pressed and the applied DOM state agree on every launch path, including a first run where nothing is stored.
  • A regression test covers the launch path and fails if the startup call is removed. It must assert the applied attribute and computed scale, not merely that a function ran.
  • Terminals opened after a restored session use the stored Reading Comfort font settings.

Boundaries

Do not change the storage format or the preset values, and do not add a second persistence path. Terminal font handling stays where it is; this is the UI-text application at startup.

Dominant language
TypeScript
Stars
0
Forks
0
Avg merge
6h 28m
Merged PRs (30d)
77

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bonzo81/comnd

All issues in bonzo81/comnd

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.