Skip to content

feat: add configurable GPU acceleration toggle#2037

Merged
ysfscream merged 7 commits into
mainfrom
feature/disable-gpu-acceleration
May 22, 2026
Merged

feat: add configurable GPU acceleration toggle#2037
ysfscream merged 7 commits into
mainfrom
feature/disable-gpu-acceleration

Conversation

@ysfscream
Copy link
Copy Markdown
Member

@ysfscream ysfscream commented Mar 17, 2026

This PR adds a configurable GPU acceleration toggle to the MQTTX desktop app. GPU acceleration stays enabled by default, and users can disable it to work around rendering issues on certain hardware.

GPU Acceleration Toggle

  • Added a settings.enableHardwareAcceleration setting backed by electron-store
  • Shared the setting key and strict boolean read logic between the main process and renderer store
  • Calls app.disableHardwareAcceleration() before app.ready when GPU acceleration is disabled
  • Added a Settings UI toggle with tooltip and restart prompt
  • Added i18n translations for all supported languages (zh/en/tr/ja/hu)

Copilot AI review requested due to automatic review settings March 17, 2026 15:03
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a configurable GPU acceleration toggle to the MQTTX desktop app, allowing users to disable hardware acceleration to work around rendering issues on certain hardware. It also upgrades the CLI toolchain from Node.js 18 to Node.js 22.

Changes:

  • Added a disableHardwareAcceleration setting backed by electron-store, with Vuex bindings, a UI toggle in the Settings page, and a restart prompt dialog
  • Added i18n translations (zh/en fully translated; tr/ja/hu use English placeholders) for the new setting and restart dialog
  • Upgraded CLI Node.js target from 18 to 22, updated tsconfig.json to ES2022, bumped @types/node, and fixed process.exit mock type signatures in tests

Reviewed changes

Copilot reviewed 12 out of 14 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/background.ts Reads GPU acceleration setting from electron-store before app.ready and calls app.disableHardwareAcceleration() when enabled; passes setting to sharedData
src/store/modules/app.ts Adds Vuex state, mutation, and action for disableHardwareAcceleration, persisting to both settingData and electron-store
src/store/getter.ts Adds disableHardwareAcceleration getter
src/types/global.d.ts Adds disableHardwareAcceleration to the App type
src/views/settings/index.vue Adds UI toggle with tooltip, restart prompt using remoteApp.relaunch()/exit(), and fixes queryAIAPIHost callback return type
src/lang/settings.ts Adds i18n keys for the new setting, description, and restart dialog
cli/package.json Upgrades Node.js engine from 18 to 22, updates @types/node and pkg targets
cli/tsconfig.json Updates target to ES2022, adds skipLibCheck, updates lib and types
cli/.nvmrc Updates nvm version from 18 to 22
cli/src/__tests__/utils/*.test.ts Fixes process.exit mock signatures to match updated @types/node

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread src/lang/settings.ts Outdated
Comment thread cli/.nvmrc Outdated
Comment thread src/lang/settings.ts Outdated
@ysfscream ysfscream force-pushed the feature/disable-gpu-acceleration branch 2 times, most recently from b2a5511 to a9e1a88 Compare March 17, 2026 15:09
- Add disableHardwareAcceleration setting to electron-store
- Add GPU toggle UI in settings page with tooltip
- Show restart prompt when toggle changes
- Add i18n support for 5 languages (zh/en/tr/ja/hu)
- Update TypeScript types and Vuex store
@ysfscream ysfscream force-pushed the feature/disable-gpu-acceleration branch from a9e1a88 to 266e735 Compare March 17, 2026 15:09
@ysfscream ysfscream marked this pull request as draft March 17, 2026 15:16
Add missing translations in settings.ts:
- topicWhitespaceDetection
- topicWhitespaceDetectionDesc
- disableHardwareAcceleration
- disableHardwareAccelerationDesc
- restartRequired
- restartRequiredDesc
- restartNow
- restartLater
- jsonHighlight

Fix incomplete translations:
- help.ts: helpMQTT (tr)
- common.ts: viewData, saveToLocal, msgType (hu)
Change 'Disable this option if...' to 'Enable this option if...' for
clearer semantics. When users experience issues, they should ENABLE
the 'Disable GPU Acceleration' toggle.

Updated translations:
- zh: 关闭此选项 -> 启用此选项
- en: Disable this option -> Enable this option
- tr: devre dışı bırakın -> etkinleştirin
- ja: 無効にしてください -> 有効にしてください
- hu: tiltsa le -> engedélyezze
…celeration

- Invert setting logic: ON/true = GPU enabled, OFF/false = GPU disabled
- Add GPU support detection for Windows using getGPUFeatureStatus()
- Change default to true (GPU enabled by default if supported)
- Add migration from legacy disableHardwareAcceleration setting
- Update all translations (zh/en/tr/ja/hu)

Fixes inverted UX where switch ON was disabling GPU instead of enabling it.
Includes automatic GPU capability detection to disable on unsupported Windows devices.
Remove LEGACY_DISABLE_HARDWARE_ACCELERATION_KEY and migration function.
This is treated as a fresh setting - no backwards compatibility needed.
Users with old disableHardwareAcceleration setting will get default behavior
(GPU enabled if supported, disabled if not detected on Windows).
@ysfscream ysfscream marked this pull request as ready for review May 21, 2026 07:38
@ysfscream ysfscream self-assigned this May 22, 2026
@ysfscream ysfscream moved this to In Progress in MQTTX May 22, 2026
@ysfscream ysfscream added enhancement New feature or request desktop MQTTX Desktop labels May 22, 2026
@ysfscream ysfscream added this to the v1.13.1 milestone May 22, 2026
@ysfscream ysfscream requested a review from Copilot May 22, 2026 08:46
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated 5 comments.

Comment thread src/background.ts Outdated
Comment thread src/store/modules/app.ts Outdated
Comment thread src/store/modules/app.ts
Comment thread src/views/settings/index.vue Outdated
Comment thread src/store/modules/app.ts
@ysfscream ysfscream merged commit a8a9087 into main May 22, 2026
4 checks passed
@ysfscream ysfscream deleted the feature/disable-gpu-acceleration branch May 22, 2026 09:36
@github-project-automation github-project-automation Bot moved this from In Progress to Done in MQTTX May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

desktop MQTTX Desktop enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants