Skip to content

Make focus dimming opt-in and end regions at H3 - #78

Merged
jnahian merged 2 commits into
mainfrom
claude/peaceful-bell-x0svpi
Sep 9, 2026
Merged

jnahian merged 2 commits into
mainfrom
claude/peaceful-bell-x0svpi

Conversation

@jnahian

@jnahian jnahian commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Summary

Two default changes in Settings → Focus Mode:

  • Dim other sections now defaults off. ⌥⌘F still hides the chrome, goes fullscreen and narrows the canvas — dimming is the one piece that rewrites the page itself rather than the chrome around it, so it becomes opt-in. The other three switches are unchanged and still on.
  • Region ends at now defaults to H3 or above instead of Any heading, so when dimming is on an h4 step inside the section being read no longer splits it. Any heading remains available in the picker.

Each key migrates on its own: a stored value survives, an absent one takes the new default. So an install that switched dimming on but never opened the picker keeps its toggle and does widen to H3 or above.

One behaviour change came with the new depth. applyFocusDim gives up when fewer than two headings match the chosen depth, so at H3 or above a document shaped # Title over #### steps would have dimmed nothing at all. The setting is now a floor: if a document has no headings that coarse, the next deeper level becomes the boundary.

Also updated: the focus-mode screenshot manifest (docs/features/reading.shots.json) had been relying on dimming being on by default to produce its dimmed shot, so dimming is now pinned on there explicitly and the caption says so; docs/assets/screenshots/settings/01-window.png is re-shot at the new defaults (dim toggle off, Region/Dimming rows greyed); the bundled changelog and shortcut table; and the docs/ pages for reading and settings.

Related issue

n/a

Testing

  • swift test — 316 tests, 0 failures
  • Built the app and exercised focus dimming on a # Title + #### document: dimming now lights the title's region and dims the steps, where before the change nothing dimmed
  • Re-shot the manual settings screenshot per .claude/skills/reader-docs/references/manual-shots.md (840px native, same fixtures and geometry)

Tests/ReaderMdTests/FocusModeTests.swift was updated to match: the defaults test asserts dimming off at .h3, a new test pins the other three switches on, the unknown-stored-depth fallback asserts .h3, and the suite's baseline is the shipped depth rather than .any.

Checklist

  • macOS 26-only APIs are guarded with a pre-26 fallback (deployment target is 13) — none touched
  • Imperative actions follow the token-bump pattern on AppState — none added
  • Change is focused; matches surrounding code style

🤖 Generated with Claude Code

https://claude.ai/code/session_01MDdYaeJzsdtLzvDmy7kZWT

Focus mode's dimming is the one piece of the mode that rewrites the page
rather than the chrome around it, so it now defaults off — ⌥⌘F still hides
the chrome, goes fullscreen and narrows the canvas. When it is switched on,
a region ends at H3 rather than at every heading, so an `h4` step inside a
section no longer splits it.

Also pins dimming on in the focus-mode screenshot manifest, which had been
relying on the old default to produce a dimmed shot.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012zJ8wDPAECfboKi7Km47EC
@jnahian
jnahian marked this pull request as ready for review September 9, 2026 11:38
@jnahian jnahian self-assigned this Sep 9, 2026
Review follow-ups on the opt-in dimming change:

- `applyFocusDim` bailed whenever fewer than two headings matched the chosen
  depth, so at the new `.h3` default a document shaped `# Title` over `####`
  steps dimmed nothing at all — the first thing a user would see after going
  and switching the feature on. The depth is now a floor: widen a level at a
  time until the document has two regions to tell apart.
- `bridge.js` still documented and initialised the depth as 4, "the default".
- Re-shot `settings/01-window.png` at the new defaults: the dim toggle off and
  the Region/Dimming rows greyed. It is a `manual: true` shot, so the
  `capture.sh` run the PR suggested would have skipped it.
- The focus-mode caption and its alt text still presented dimming as stock
  behaviour; they now say the shot has the opt-in setting switched on.
- `FocusModeTests` pinned `.any` as its baseline, so nothing exercised the
  shipped depth.
- Settings.swift lost the per-key migration note when the comment was
  rewritten; an install that enabled dimming but never opened the picker does
  pick up the new region default.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MDdYaeJzsdtLzvDmy7kZWT
@jnahian
jnahian merged commit 6ef98f4 into main Sep 9, 2026
1 check passed
@jnahian
jnahian deleted the claude/peaceful-bell-x0svpi branch September 9, 2026 12:26
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.

2 participants