Skip to content

Add page zoom control to settings for standalone app#70

Merged
typed-sigterm merged 9 commits intomainfrom
copilot/add-page-zoom-settings
Oct 17, 2025
Merged

Add page zoom control to settings for standalone app#70
typed-sigterm merged 9 commits intomainfrom
copilot/add-page-zoom-settings

Conversation

Copy link
Contributor

Copilot AI commented Oct 16, 2025

Overview

Implements page zoom adjustment feature in the settings page for the standalone app, allowing users to control the page zoom level from 25% to 500% in 10% increments.

Changes

Backend (Rust)

  • Added set_zoom Tauri command in src-tauri/src/main.rs that uses the native WebviewWindow::set_zoom() API to adjust the page zoom level
  • Registered the command in the Tauri invoke handler

Frontend (TypeScript/Vue)

  • Extended UserConfigSchema in src/utils/config.ts to include a zoom field (default: 1.0 = 100%)
  • Added zoom range constants: MIN_ZOOM (0.25), MAX_ZOOM (5.0), ZOOM_STEP (0.1)
  • Updated settings UI component (src/components/settings/ui.vue) to display zoom control using Naive UI's NInputNumber component
  • Binds directly to config.zoom for reactive updates
  • Implemented automatic zoom application on mount and when changed
  • Added internationalization strings for Chinese ("页面缩放") and English ("Page Zoom")

Development

  • Switched to bun for package management
  • Removed package-lock.json

Key Features

  • App-only feature: The zoom control is conditionally rendered using v-if="__APP__", ensuring it only appears in the standalone app and is properly tree-shaken from the web build
  • Persistent configuration: Zoom level is saved to the config store and persists across app sessions
  • User-friendly display: Shows zoom as percentages (25%, 75%, 100%, 150%, etc.) instead of raw decimal values
  • Fine-grained control: 10% increment steps allow precise zoom adjustment
  • Error handling: Includes try-catch blocks to handle potential errors when applying zoom

Testing

  • ✅ TypeScript type checking passed
  • ✅ ESLint linting passed
  • ✅ Web build successful with confirmed tree-shaking (zoom code excluded from web bundle)
  • ⚠️ Unit tests show pre-existing failures unrelated to this PR

Fixes #69

Screenshots

Manual testing required to capture screenshots of the zoom control in action within the standalone app.

Original prompt

This section details on the original issue you should resolve

<issue_title>独立 App 中允许在设置页调整页面缩放</issue_title>
<issue_description>在 Rust 侧定义命令调用 Webview.zoom,Web 侧展示一个 <NInputNumber>,值域 25%~500%,步长 50%,功能不可用时隐藏,并注意相关的 tree-shaking</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #69


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@netlify
Copy link

netlify bot commented Oct 16, 2025

Deploy Preview for ex-caller ready!

Name Link
🔨 Latest commit 39a360a
🔍 Latest deploy log https://app.netlify.com/projects/ex-caller/deploys/68f21a78815d2f00085f02e6
😎 Deploy Preview https://deploy-preview-70--ex-caller.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI and others added 2 commits October 16, 2025 10:25
Co-authored-by: typed-sigterm <145281501+typed-sigterm@users.noreply.github.com>
Co-authored-by: typed-sigterm <145281501+typed-sigterm@users.noreply.github.com>
Copilot AI changed the title [WIP] Add page zoom adjustments in app settings Add page zoom control to settings for standalone app Oct 16, 2025
Copilot AI requested a review from typed-sigterm October 16, 2025 10:36
Copy link
Owner

@typed-sigterm typed-sigterm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot

  1. 使用 bun(curl -fsSL https://bun.sh/install | bash),删除 package-lock.json
  2. ZOOM_STEP 改为 0.1
  3. 不必使用 inputZoom 中转

@typed-sigterm typed-sigterm changed the title Add page zoom control to settings for standalone app feat(standalone): add page zoom control Oct 16, 2025
… inputZoom intermediate ref

Co-authored-by: typed-sigterm <145281501+typed-sigterm@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Oct 16, 2025

@copilot

  1. 使用 bun(curl -fsSL https://bun.sh/install | bash),删除 package-lock.json
  2. ZOOM_STEP 改为 0.1...

Done in commit ea30cbe:

  1. ✅ Switched to bun and deleted package-lock.json
  2. ✅ Changed ZOOM_STEP to 0.1
  3. ✅ Removed inputZoom intermediate ref, now binding directly to config.zoom

Copilot AI changed the title feat(standalone): add page zoom control Add page zoom control to settings for standalone app Oct 16, 2025
Copilot AI requested a review from typed-sigterm October 16, 2025 10:48
@typed-sigterm typed-sigterm marked this pull request as ready for review October 17, 2025 10:23
typed-sigterm

This comment was marked as duplicate.

@typed-sigterm typed-sigterm merged commit 3e2188b into main Oct 17, 2025
7 checks passed
@typed-sigterm typed-sigterm deleted the copilot/add-page-zoom-settings branch October 17, 2025 10:33
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.

独立 App 中允许在设置页调整页面缩放

2 participants