Skip to content

Add keyboard commands: zoom, find-again, reload#3

Merged
sethbang merged 6 commits into
mainfrom
keyboard-shortcuts
May 18, 2026
Merged

Add keyboard commands: zoom, find-again, reload#3
sethbang merged 6 commits into
mainfrom
keyboard-shortcuts

Conversation

@sethbang
Copy link
Copy Markdown
Owner

Summary

Adds three groups of keyboard commands, prompted by the missing zoom shortcut:

  • Zoom⌘+ / ⌘= / ⌘- / ⌘0 (zoom in / zoom in / zoom out / actual size). Discrete browser-style steps, driven through a new window.markee.setZoom() JS call applying CSS zoom (reflows text, scales code/images/KaTeX/Mermaid). The level is one global value in UserDefaults — shared across windows and remembered across launches.
  • Find again⌘G / ⌘⇧G (find next / previous), with discoverable Edit-menu items. Reuses the existing find machinery; an empty query opens the find bar.
  • Reload⌘R manually re-reads and re-renders the file (a fallback for the rare save the watcher misses).

Native WKWebView.pageZoom was avoided deliberately — it is macOS 14+ and the deployment target is macOS 13.

Design + plan: docs/superpowers/specs/2026-05-18-keyboard-shortcuts-design.md, docs/superpowers/plans/2026-05-18-keyboard-shortcuts.md (gitignored, local only).

Test Plan

  • swift test — 30 tests pass (6 new ZoomTests covering nextZoom stepping + clamping)
  • node --test — 24 JS tests pass
  • make app builds clean
  • ⌘+ / ⌘= / ⌘- / ⌘0 resize the preview; text reflows
  • Open a second window — it inherits the current zoom; quit and relaunch — zoom persists
  • ⌘G / ⌘⇧G cycle matches with the find bar both open and closed
  • ⌘R re-renders the document
  • View menu shows Zoom In ×2 / Zoom Out / Actual Size / Reload; Edit menu shows Find Next / Find Previous

🤖 Generated with Claude Code

sethbang and others added 6 commits May 18, 2026 17:29
Add `nextZoom(from:direction:)` with discrete `zoomSteps` ladder and
`ZoomDirection` enum. Pure function; off-ladder inputs snap to nearest
rung, result clamped at bounds. Covered by 6 ZoomTests (TDD).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds ⌘G (Find Next) and ⌘⇧G (Find Previous) menu items that reuse the
existing findNext()/findPrevious() methods; falls back to opening the find
bar when no query has been entered yet.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds ⌘R menu item under View that re-reads and re-renders the current
file on demand — a manual fallback for saves the file watcher misses.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
markee fb675a8 Commit Preview URL

Branch Preview URL
May 18 2026, 11:50 PM

@sethbang sethbang merged commit 67e41ea into main May 18, 2026
4 checks passed
@sethbang sethbang deleted the keyboard-shortcuts branch May 18, 2026 23:56
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