Adding a shortcut for zooming (#2562)
<!-- devin-review-badge-begin -->
---
<a href="https://app.devin.ai/review/dyad-sh/dyad/pull/2562"
target="_blank">
<picture>
<source media="(prefers-color-scheme: dark)"
srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1">
<img
src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1"
alt="Open with Devin">
</picture>
</a>
<!-- devin-review-badge-end -->
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Adds keyboard shortcuts for zooming (Ctrl/Cmd + =, -, 0) and ties zoom
to user settings for consistent behavior across the app. Moves zoom
handling from the Electron menu to a client-side React hook.
- **New Features**
- Added useZoomShortcuts to handle zoom in/out/reset and update
settings.zoomLevel.
- Supports levels 90, 100, 110, 125, 150 (default 100) on Mac (Cmd) and
Windows/Linux (Ctrl).
- **Refactors**
- Centralized ZOOM_LEVELS and DEFAULT_ZOOM_LEVEL in schemas, derived
from ZoomLevelSchema.options.
- Removed Electron zoom roles and initialized the shortcut hook in
RootLayout.
- Prevent shortcuts from firing in inputs, textareas, and
contenteditable elements.
<sup>Written for commit cb368231e86d859a8e7397d237bb86e460ca7023.
Summary will update on new commits.</sup>
<!-- End of auto-generated description by cubic. -->
---------
Co-authored-by:
Claude Opus 4.5 <noreply@anthropic.com>
正在显示
src/hooks/useZoomShortcuts.ts
0 → 100644
请
注册
或者
登录
后发表评论