Compare commits

..
Author SHA1 Message Date
YXC0915 74242c323a Keep ARM image downloads behind the installer boundary 2026-12-06 00:39:23 +08:00
YXC0915 7f07999a3b Merge GitHub upstream main into Gitea 2026-12-06 00:36:02 +08:00
yxc0915 2caf459647 Merge pull request '支持下载 ARM 恢复镜像并创建 ARM64 虚拟机' (#1) from release/arm64-preview.2 into main
Windows CI / verify (push) Failing after 5m1s
2026-12-05 16:32:25 +00:00
YXC0915 d8c9abc3df fix(cli): route ARM and Intel disk options separately 2026-12-06 00:12:34 +08:00
YXC0915 ea6390e8ca feat: download ARM restore images and isolate runtime selection 2026-12-06 00:09:59 +08:00
YXC0915 44905aaa17 fix(stambha): report the newest unusable runtime 2026-12-06 00:03:06 +08:00
YXC0915 92573ce550 feat: support the QEMU Stambha ARM64 preview runtime 2026-12-06 00:03:06 +08:00
千川白浪 aac3979373 refactor: 收敛根目录布局并统一资源与脚本归属 (#203)
* refactor: 收敛根目录布局并统一资源与脚本归属

* fix: 停止监视器时等待显示定位协程退出
2026-12-05 06:34:01 -07:00
YXC0915 1d15e41482 ci: shorten Windows checkout paths for Unix socket tests
Windows CI / verify (push) Successful in 6m45s
2026-12-05 21:23:41 +08:00
YXC0915 c08ddd7b48 ci: run Windows verification on Gitea
Windows CI / verify (push) Failing after 2m35s
2026-12-05 21:11:03 +08:00
千川白浪 9006e6d9a7 refactor: 抽离 HostAPIService 并将 internal/plugin 拆分为四层无环子包 (#202)
CI / verify (push) Canceled after 0s
CI / rolling-release (push) Canceled after 0s
2026-12-05 06:05:41 -07:00
千川白浪 107a8d73e0 refactor: 收拢核心管线、强化错误处理、优化热路径与更新体积 (#200)
* refactor: 收拢核心管线、强化错误处理、优化热路径与更新体积

* fix: preserve download recovery and bound PBZX decoding

Keep VM diagnostics available during plugin initialization failures and verify settings through the unified driver lifecycle.
2026-12-05 20:54:41 +08:00
千川白浪 96ea9928e0 fix: 按提交标题触发滚动开发版构建(#199) 2026-12-05 20:14:50 +08:00
千川白浪 08409a1fa3 fix: 移除虚拟机修饰键重映射和宿主机全局热键拦截(#198) 2026-12-05 19:48:11 +08:00
千川白浪 bff26d8fe1 fix: 恢复移动硬盘更换盘符后的虚拟机注册路径(#197) 2026-12-05 19:45:17 +08:00
cosimawei c7419e7196 fix: 插件市场直接安装推荐版本(#195) 2026-12-05 19:40:13 +08:00
千川白浪 1e1649ed03 Merge pull request #189 from reiasu2/feat/auto-resolution
feat(display): add automatic per-display HiDPI resolution mode
2026-12-05 18:20:17 +08:00
Nwflower 6388865cbb fix(display): honor runtime VM screen environment 2026-12-05 03:13:28 -07:00
千川白浪 6f22f20fae Merge pull request #194 from Nwflower/fix/auto-gpu-on-stale-vulkan-manifest
fix(vm): fall back to automatic GPU selection for stale Vulkan manifests
2026-12-05 18:10:53 +08:00
Nwflower e180b55a7b fix(vm): fall back to automatic GPU selection for stale Vulkan manifests 2026-12-05 02:34:20 -07:00
Nwflower 24da891365 release: prepare v0.2.15
Release Reims-Go / release (push) Canceled after 0s
Archive the bilingual changelog and synchronize the app and frontend release versions.
2026-12-05 02:23:14 -07:00
千川白浪 e24422176a Merge pull request #193 from Nwflower/ci/workflow-timeouts-and-path-filters
ci: bound job time and skip docs-only pushes
2026-12-05 17:20:48 +08:00
千川白浪 8ea7e3141e Merge pull request #192 from Nwflower/fix/held-input-retry-and-generation
fix(plugin): retry a failed held-input release and keep presses made during it
2026-12-05 17:20:29 +08:00
Nwflower 892d67644b fix(runtime): fall back to Reims-Go releases 2026-12-05 02:19:03 -07:00
Nwflower 875f4df333 ci: bound job time and skip docs-only pushes
A stuck Windows job could hold a runner for the default six hours, so each job now has a timeout: ten minutes for the alpha plan step and thirty for the build jobs.

Pushes and pull requests that only touch documentation, readmes or repository templates no longer start the full verification, which keeps the queue for changes that can break the build.
2026-12-05 02:12:36 -07:00
Nwflower 6501fe2000 fix(plugin): retry a failed held-input release and keep presses made during it
A fallback release that fails while the VM is still running left the record without any retry: its timer had already fired and a plugin that exited never makes the next call, so a modifier stayed pressed in the guest. The record now rearms with a retry timeout, and a VM that stopped while the release was in flight drops the record instead of retrying it.

A release that finishes after the plugin pressed something new lifted that press and then deleted it from the record, so a later fallback no longer knew to lift it. Each record now carries a generation, and a release only clears what it lifted when nothing changed since its snapshot.
2026-12-05 02:07:11 -07:00
Nwflower ddc7f61b06 release: prepare v0.2.14
Release Reims-Go / release (push) Canceled after 0s
Archive the bilingual changelog and synchronize the app and frontend release versions.
2026-12-05 01:57:34 -07:00
千川白浪 22c01cee5b Merge pull request #190 from Nwflower/feat/plugin-host-api-catalog
feat(plugin): catalog the Host API, open secret typing and extend the SDK
2026-12-05 16:48:49 +08:00
Nwflower d55241cba2 feat(plugin): catalog the Host API, open secret typing and extend the SDK
Give the Sidecar Host API one authoritative catalog in pkg/pluginproto: every
host/* method's status, required permissions, handshake feature and request and
result shapes. The host, pkg/pluginsdk and plugins share those types, so a field
can no longer exist on one side only, and permissions come from the catalog
instead of from each handler. Tests gate that every served method is
catalogued, every stable catalogued method is served, and every catalogued
permission is one the host recognizes.

Open the interface up instead of adding consent gates. Typing a secret setting
is no longer reserved for reims.agent: any plugin that holds qmp:write and that
the user authorized for the VM can have the host type the plugin's own setting,
which the plugin never reads back. Restoring a snapshot works on any authorized
VM, a plugin names its own clones, a held key may carry modifiers, and a
screenshot width outside the supported range is brought into range rather than
refused. Deleting a VM stays limited to the temporary VMs a plugin created.

Record the keys and pointer buttons each plugin holds per VM and lift them when
the plugin's process exits, its scope is disposed, the VM stops or it stops
calling, so a guest never stays stuck with a modifier down. Requests from
plugins that declare pluginApi 1.3 or newer are decoded strictly and answer an
undefined field with JSON-RPC -32602, while older plugins keep tolerant
decoding.

Add typed VM and console methods to pkg/pluginsdk so a plugin no longer needs
its own JSON-RPC client. A method the contract does not catalog, or one the
host did not advertise in the handshake, is refused before it is sent, and the
host's JSON-RPC error code reaches the caller.
2026-12-05 01:43:28 -07:00
棠渚听潮 e0a25bb243 fix(display): address PR #189 review feedback on guest_lang order and pending change merge 2026-12-05 16:19:43 +08:00
棠渚听潮 e25c7952ca feat(display): add automatic per-display HiDPI resolution mode 2026-12-05 16:02:42 +08:00
千川白浪 2f7f33b53f Merge pull request #188 from reiasu2/fix/plugin-install-rename-retry
fix(plugin): retry Windows directory rename on transient antivirus locks
2026-12-05 15:40:19 +08:00
千川白浪 714070f5ac Merge pull request #187 from Nwflower/feat/mcp-host-v2
feat(plugin): scope MCP connections and add held input, region capture and force stop
2026-12-05 15:40:15 +08:00
棠渚听潮 33253318c4 test(archtest): update renameOwners for plugin package rename helpers 2026-12-05 15:06:06 +08:00
NwflowerandClaude Opus 5.5 bd4e85af1a feat(plugin): scope MCP connections and add held input, region capture and force stop
- Each plugin connect connection gets a session id that is forwarded with
  channel/<id>/message; when the connection ends the host notifies the
  sidecar with channel/<id>/closed so it can cancel calls and release input.
- host/console.screenshot crops a region from the full-resolution frame,
  optionally measured in a reference image size, and full frames now honor
  max_width up to 2560.
- host/console.key can hold or release one key, and host/console.release
  lifts keys and pointer buttons in one call. Driver consoles stay press-only.
- host/vm.shutdown accepts force, and host/vm.snapshot.list needs only vm:read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-04 23:55:43 -07:00
棠渚听潮 668b93f493 fix(plugin): retry Windows directory rename on transient antivirus locks 2026-12-05 14:49:16 +08:00
Nwflower 95236d624c chore(dev): keep the first-run location file inside .debug
The wails-dev-firstrun launch configuration wrote to a machine-specific absolute path. It now creates .debug/runs/reims-firstrun and points the location file there.
2026-12-04 23:24:36 -07:00
Nwflower 652bf50e8d refactor(frontend): move the i18n entry module into its directory
frontend/src/i18n.ts and frontend/src/i18n/ shared a name, so ./i18n resolved to the file while ./i18n/icu resolved to the directory. The entry module is now frontend/src/i18n/index.ts and no importer changed.
2026-12-04 23:24:36 -07:00
Nwflower 7529171600 docs(repo): fold the AI doc index and issue automation into existing docs
AI-DOCS.md only pointed back at AGENTS.md and sat outside the durable-document link check, so its twenty links were never validated. Its two tables now live in the AGENTS.md navigation section and are checked by scripts/debug/check.mjs.

docs/issue-automation.md joins docs/pr-review-guidelines.md as section 5. The PR description structure has one source, the pull request template: the guideline no longer asks for a second set of field names, and AGENTS.md keeps only the policy sentence about the model and tool declaration.
2026-12-04 23:24:36 -07:00
Nwflower f4395a1f28 refactor(brand): generate the frontend logo copy and wordmark geometry
assets/logo.svg was duplicated byte for byte in frontend/public, and WordmarkLoader hand-copied the ten wordmark strokes from the Python generator, so the icon and the lettering could drift silently.

scripts/brand/wordmark.py now writes frontend/public/logo.svg and frontend/src/components/wordmark.gen.ts, and the loader imports that geometry. The unreferenced assets/wordmark-*.svg outputs are gone, and frontend/scripts/test-brand.mjs fails when either copy is edited by hand.
2026-12-04 23:24:36 -07:00
Nwflower 87e7ac8774 refactor(ci): move GitHub automation scripts under scripts/ci
The repository had three script roots with three test entry points. The automation scripts now live in scripts/ci and run through scripts/test.mjs, which gained a quick automation profile and includes them in the ci and release profiles.

The workflows keep checking the scripts out from the workflow commit, never from the PR branch. stateKey now returns its fallback explicitly, because the file is inside the empty-catch guard once it sits under scripts/. The review and diagnosis exclude lists also skip the generated frontend wordmark module.
2026-12-04 23:24:36 -07:00
千川白浪 bd7c9abaa3 Merge pull request #183 from reiasu2/fix/capture-compat-input-ui
fix(input): adapt to runtimes without --capture and clarify modifier key settings
2026-12-05 14:12:23 +08:00
Nwflower 3d5c6cb826 fix(input): preserve legacy capture when the probe fails 2026-12-04 23:01:43 -07:00
Xiaochi You 7e1afcfd9b Merge pull request #185 from yxc0915/feat/win32-raw-partition-aio
feat(storage): Windows raw disk/partition in-place mode and disk cache policy
2026-12-05 12:35:33 +08:00
YXC0915 a4fb1c6db6 fix(storage): close create flow capability gate, raw disk stats/CoW guards, and UI recovery path 2026-12-05 12:29:06 +08:00
YXC0915 04f0d8d096 fix(storage): address PR review findings on raw disk enumeration, CoW guard, and capability gating 2026-12-05 12:20:33 +08:00
YXC0915 3837e72644 feat(storage): add Windows raw disk/partition in-place mode and disk cache policy 2026-12-05 12:04:54 +08:00
千川白浪andClaude Opus 5.5 3e5b0d7e6c feat(plugin): open settings panels from the settings button, merge plugin logs into the app log (#182)
- The settings button now also appears for plugins that only contribute a
  settings.plugin panel; the panel opens in the settings dialog beside the
  declarative form instead of the bottom of the Plugins page.
- Plugin stderr and non-routine audit entries are mirrored to the app log as
  plugin:<id>, rate limited per plugin; the per-plugin log window is removed.
- The installed-plugin security scan button is removed; the scan verdict shows
  in the permissions tooltip. The pre-install archive scan is unchanged.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-05 12:01:51 +08:00
棠渚听潮 1433602f14 fix(ui): keep unsaved CPU affinity edits across host refreshes (#178)
* fix(ui): keep unsaved CPU affinity edits across host refreshes

* fix(ui): offer retry button when AffinityDialog initial load fails
2026-12-05 12:01:45 +08:00
棠渚听潮 ed1a0ba254 fix(reims): drop uncalled PostCreateSetOpts and PreviewCreateCommand wrappers 2026-12-05 12:01:30 +08:00
棠渚听潮 d40327e724 fix(input): adapt to runtimes without --capture and clarify modifier key settings 2026-12-05 11:50:51 +08:00
Xiaochi You a11d08cb9b Merge pull request #180 from yxc0915/codex/fix-macos-app-window-reporter
Fix macOS app window reporting, cropping, and drag rendering.
2026-12-05 03:49:23 +08:00
YXC0915 3020137a9e fix(appwindow): handle slow reports and guide Guest Tools upgrades 2026-12-05 03:42:41 +08:00
YXC0915 2658949f05 fix(appwindow): keep macOS app windows visible during dragging 2026-12-05 03:30:26 +08:00
千川白浪 b3b66c9306 fix(host): dedupe repeated Vulkan GPUs by DeviceUUID and integrated PCI ID (#177) 2026-12-04 23:25:36 +08:00
Xiaochi You fc3f35f6af Merge pull request #175 from yxc0915/codex/client-version-takeover
fix(update): 手动打开新版 Windows 客户端时接管旧版
2026-12-04 23:14:37 +08:00
千川白浪 0830bf5856 feat(market): show all channels with Alpha tag, version picker, sorting, and title links (#176)
* feat(market): show all channels with Alpha tag, version picker, sorting, and title links

* fix(market): merge multi-channel releases and default picker to card version
2026-12-04 23:12:24 +08:00
千川白浪 5aca93a862 Merge pull request #174 from Nwflower/feat/clipboard-plugin-settings
feat(plugin): move clipboard sync settings to plugin configuration
2026-12-04 23:09:18 +08:00
YXC0915 717b324cf2 fix(update): let legacy clients complete tray shutdown before replacing them 2026-12-04 23:07:08 +08:00
Nwflower fcff64669f fix(datamigrate): migrate legacy per-VM clipboard settings to plugin scope 2026-12-04 08:02:27 -07:00
YXC0915 d41b29e345 fix(update): let newer Windows clients take over the running instance 2026-12-04 22:56:37 +08:00
Nwflower 2031a27627 feat(plugin): move clipboard sync settings to plugin configuration 2026-12-04 07:56:21 -07:00
千川白浪 1eb06a404f Merge pull request #173 from Nwflower/feat/app-update-asset-digest
feat(update): verify app updates with GitHub assets[].digest
2026-12-04 22:56:00 +08:00
Nwflower 6fa1b5853b feat(update): verify app updates with GitHub assets[].digest 2026-12-04 07:49:31 -07:00
千川白浪 c5c5922acb Merge pull request #172 from Nwflower/feat/vm-create-progress
feat(ui): show VM creation progress in sidebar and main view (#120)
2026-12-04 22:34:44 +08:00
千川白浪 98763160f6 Merge pull request #171 from Nwflower/fix/runtime-latest-indicator
fix(ui): mark older active runtime as not latest (#151)
2026-12-04 22:34:26 +08:00
千川白浪 781f129fc1 feat(plugin): custom SVG icons, market stats, submit link, and native locale scaffold (#170)
* feat(plugin): custom SVG icons, market stats, submit link, and native locale scaffold

* chore(ci): allow spaces in PR model names and rename agent declaration to tool

* fix(plugin): validate icon.svg size and markup during static scan
2026-12-04 22:34:12 +08:00
Nwflower 14cb98255a feat(ui): show VM creation progress in sidebar and main view (#120) 2026-12-04 07:16:57 -07:00
Nwflower 9d06e8db05 fix(ui): mark older active runtime as not latest (#151) 2026-12-04 07:16:57 -07:00
千川白浪 4053ffb60c Merge pull request #169 from Nwflower/feat/ui-polish
feat(ui,app,host): polish update UX, relocate moved VM registry, dedupe GPUs, and fix clone MCP flow
2026-12-04 22:06:21 +08:00
Nwflower 69ec8e1cbf fix(app,host,macos): address PR #169 round-2 review findings 2026-12-04 07:01:33 -07:00
YXC0915 975889078f release: prepare v0.2.13
Release Reims-Go / release (push) Canceled after 0s
Archive the bilingual changelog and synchronize the app and frontend release versions.
2026-12-04 21:57:55 +08:00
Nwflower 8d7bcd8fbd fix(app,host,macos): resolve archtest boundary and PR #169 review issues 2026-12-04 06:53:02 -07:00
Nwflower c40b8aafdc fix(ui): serialize app update channel writes to prevent out-of-order saves 2026-12-04 06:39:06 -07:00
Xiaochi You 90a9e476d2 Merge pull request #168 from yxc0915/codex/fix-precision-log-severity
fix(logs): 修正 QEMU 精度提示误报为错误
2026-12-04 21:36:30 +08:00
Nwflower 43291667a6 feat(ui,host): default host memory specs, dedupe Vulkan GPUs
Sync the host's SMBIOS Type 17 memory spec by default and drop the toggle:
the frontend switch, the App.SetSyncHostMemorySMBIOS binding and the
sync_host_memory_smbios config field are gone, so macOS About This Mac always
reports the host's real RAM speed and generation. A manual -smbios type=17
argument still wins, and a host without a readable speed keeps the default.

Deduplicate repeated Vulkan physical devices on the Runtime page when several
ICD manifests enumerate the same GPU, preferring the healthiest/newest probe
while keeping genuinely distinct adapters. Move Appearance & language to the
top of Settings.

model: deepseek/deepseek-v4.1-flash
agent: lead (DeepSeek Harness)
2026-12-04 06:32:51 -07:00
YXC0915 d4c2099de9 docs(changelog): record the precision log fix 2026-12-04 21:29:54 +08:00
YXC0915 2e480d99b7 fix(logs): classify successful Metal precision notes as info
Ignore the Metal selector when a QEMU message reports a successful precision note. Reuse the same severity for log rows and the unread-error badge.
2026-12-04 21:23:18 +08:00
Nwflower 33e28520b7 fix(mcp): read clone secrets and SSH user from the source VM
A temporary clone made by session_create keeps no vm settings of its own, so
vm_unlock on a clone always failed with "secret setting is empty" even though
the source VM had a saved login password and AI access enabled. The SSH user
was empty for the same reason: the clone has no settings and no copied
.reims-go-ssh-user file, while access is granted through the owns-clone path.

Record the source VM key in the temporary VM ownership marker and fall back to
it when a clone has no value of its own. The fallback reads the single stored
secret instead of copying it, so the password never multiplies across clones,
nothing is left behind when a clone is disposed, and revoking AI access on the
source removes the fallback immediately. Surface a clear localized error when
no VM has a saved password.

model: deepseek/deepseek-v4.1-flash
agent: lead (DeepSeek Harness)
2026-12-04 06:02:10 -07:00
Nwflower d5841f0f70 feat(ui,app): polish update UX, speed units, and relocate moved VM registry 2026-12-04 05:54:38 -07:00
Nwflower d74868589d fix(macos): give CoW clones their own SSH port forward
CloneCoW built reims.CreateOpts without SSHPort even though the field and
the --ssh-port argument both exist, so every CoW clone came up with no host
SSH forward. MCP temporary sessions and any other clone then failed every
SSH-based guest tool (guest_exec, guest_wait_ready, test_run) with a port
that nothing listened on.

Pick the next free port after the source VM's forward and pass it to create;
a source without forwarding still yields a clone without one. Add
TestCloneSSHPort for the selection logic.

model: deepseek/deepseek-v4.1-flash
agent: lead (DeepSeek Harness)
2026-12-04 05:39:40 -07:00
Nwflower 8b467563c7 Merge branch 'ci/review-code-only' 2026-12-04 05:16:10 -07:00
千川白浪 0ba805754e Merge pull request #135 from icaruszezen/fix/vm-delete-cleanup-and-dir-check
fix(vm,ui): retry deleted VM directory cleanup and validate non-empty target dirs
2026-12-04 18:43:04 +08:00
千川白浪 254eacc937 Merge pull request #152 from ELDment/feat/auto-apply-qemu-aslr
feat(host,ui): add a switch to auto-apply ASLR to the selected QEMU runtime
2026-12-04 18:38:02 +08:00
NwflowerandClaude Opus 5.5 c7db42ac03 fix(vm): keep the directory of a running create when cloning
A running reims-ctl create looks the same as a killed one: it is unregistered and has no vm.toml until it ends. Cloning or creating through the driver no longer deletes such a directory. Also drop a wrapper only tests called.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-04 03:36:45 -07:00
NwflowerandClaude Opus 5.5 cc1daf32d8 Merge branch 'main' into fix/vm-delete-cleanup-and-dir-check
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-04 03:36:45 -07:00
ELDment e9dc282fb0 Merge upstream/main into feat/auto-apply-qemu-aslr 2026-12-04 18:27:09 +08:00
ELDment c665f32627 Merge upstream/main into feat/auto-apply-qemu-aslr 2026-12-04 18:07:22 +08:00
IcarusZezen 1752f03df8 fix(vm): harden delete cleanup, target dir validation, and monitor timeouts 2026-12-04 09:38:41 +08:00
IcarusZezen fce4de7b82 Merge branch 'main' into fix/vm-delete-cleanup-and-dir-check 2026-12-04 09:23:08 +08:00
ELDment 77cb246c66 Merge upstream/main into feat/auto-apply-qemu-aslr 2026-12-04 08:37:47 +08:00
ELDment a8b7894208 fix(runtime): keep QEMU ASLR in sync across runtime and data folder changes 2026-12-04 08:11:39 +08:00
ELDment 7049f3e388 fix(runtime): separate ASLR repair from VM start and retry activation 2026-12-03 23:37:43 +08:00
ELDment f1eeff2ee3 fix(runtime): keep ASLR updates responsive and follow runtime switches 2026-12-03 23:23:55 +08:00
ELDment b43cd9e16e feat(host,ui): add a switch to auto-apply ASLR to the selected QEMU runtime 2026-12-03 22:56:16 +08:00
千川白浪 a7f6d6a4b7 fix(vm): reconcile partial deletes and check all driver directories
model: magpie-responses/codex/gpt-6.2-sol
agent: Codex
2026-12-03 22:18:02 +08:00
千川白浪 e2cb665bee fix(vm): protect registered VM data during directory cleanup
model: magpie-responses/codex/gpt-6.2-sol
agent: Codex
2026-12-03 22:10:43 +08:00
Nwflower 164ea7f7ba ci: keep PR reviews focused on code findings 2026-12-03 04:50:41 -07:00
IcarusZezen d09990709e fix(vm,ui): retry deleted VM directory cleanup and validate non-empty target dirs 2026-12-03 14:18:26 +08:00
423 changed files with 20135 additions and 8322 deletions

No files matched your search

+1 -1
View File
@@ -10,7 +10,7 @@
{
"name": "wails-dev-firstrun",
"runtimeExecutable": "pwsh",
"runtimeArgs": ["-NoProfile", "-Command", "$env:REIMS_GO_FIRST_RUN='1'; $env:REIMS_GO_LOCATION_FILE='D:/Build/Temp/reims-firstrun/location.json'; wails dev -browser=false"],
"runtimeArgs": ["-NoProfile", "-Command", "New-Item -ItemType Directory -Force .debug/runs/reims-firstrun | Out-Null; $env:REIMS_GO_FIRST_RUN='1'; $env:REIMS_GO_LOCATION_FILE='.debug/runs/reims-firstrun/location.json'; wails dev -browser=false"],
"port": 34115
}
]
+115
View File
@@ -0,0 +1,115 @@
name: Windows CI
on:
push:
branches: [main]
workflow_dispatch:
concurrency:
group: reims-windows-ci-${{ github.ref }}
cancel-in-progress: true
env:
REIMS_CI_WORKSPACE: D:/RgCI/${{ github.run_id }}-${{ github.run_attempt }}
GOCACHE: D:/RgCI/${{ github.run_id }}-${{ github.run_attempt }}/.debug/cache/go-build
jobs:
verify:
runs-on: reims-windows-x64
timeout-minutes: 30
steps:
- name: Check out the triggering commit
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
$PSNativeCommandUseErrorActionPreference = $true
if (Test-Path -LiteralPath $env:REIMS_CI_WORKSPACE) { throw 'The CI checkout directory already exists' }
New-Item -ItemType Directory -Path $env:REIMS_CI_WORKSPACE -Force | Out-Null
Set-Location -LiteralPath $env:REIMS_CI_WORKSPACE
git init .
git remote add origin "$env:GITHUB_SERVER_URL/$env:GITHUB_REPOSITORY.git"
git fetch --depth=1 origin $env:GITHUB_SHA
git checkout --detach FETCH_HEAD
if ((git rev-parse HEAD) -ne $env:GITHUB_SHA) { throw 'Unexpected checkout commit' }
- name: Verify installed build tools
working-directory: ${{ env.REIMS_CI_WORKSPACE }}
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
$PSNativeCommandUseErrorActionPreference = $true
git --version
go version
node --version
pnpm --version
- name: Verify CHANGELOG.md matches current version
working-directory: ${{ env.REIMS_CI_WORKSPACE }}
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
node scripts/changelog.mjs check
if ($LASTEXITCODE -ne 0) { throw 'Changelog validation failed' }
$verFile = Get-Content -Raw -LiteralPath 'internal/version/version.go'
if ($verFile -notmatch 'var\s+Version\s*=\s*"(v[^"]+)"') {
throw 'Could not parse Version from internal/version/version.go'
}
$ver = $Matches[1]
New-Item -ItemType Directory -Force -Path .debug/runs/ci | Out-Null
$tmp = Join-Path $PWD ".debug/runs/ci/release-notes-$ver.md"
& ./scripts/build-release-notes.ps1 -Tag $ver -OutFile $tmp
"REIMS_APP_VERSION=$ver" >> $env:GITHUB_ENV
Write-Host "PASS CHANGELOG.md contains valid release notes for $ver ($((Get-Item -LiteralPath $tmp).Length) bytes)"
- name: Workspace hygiene
working-directory: ${{ env.REIMS_CI_WORKSPACE }}
shell: pwsh
run: node scripts/debug/check.mjs
- name: Install frontend dependencies
working-directory: ${{ env.REIMS_CI_WORKSPACE }}
shell: pwsh
run: pnpm --dir frontend install --frozen-lockfile
- name: CI tests
working-directory: ${{ env.REIMS_CI_WORKSPACE }}
shell: pwsh
run: node scripts/test.mjs ci
- name: Bundle frontend
working-directory: ${{ env.REIMS_CI_WORKSPACE }}
shell: pwsh
run: pnpm --dir frontend bundle
- name: Build reims-go.exe (window + command-line mode)
working-directory: ${{ env.REIMS_CI_WORKSPACE }}
shell: pwsh
run: |
$env:GOTMPDIR = (Resolve-Path .debug/runs/ci).Path
$exe = '.debug/runs/ci/reims-go.exe'
go vet -tags desktop,production .
if ($LASTEXITCODE -ne 0) { throw 'Go desktop vet failed' }
go build -trimpath -tags desktop,production -ldflags "-H windowsgui" -o $exe .
if ($LASTEXITCODE -ne 0) { throw 'Go desktop build failed' }
./scripts/check-release-artifact.ps1 -Executable $exe -Version $env:REIMS_APP_VERSION
- name: WebView2 first-launch smoke
working-directory: ${{ env.REIMS_CI_WORKSPACE }}
timeout-minutes: 3
run: node scripts/test.mjs webview2 .debug/runs/ci/reims-go.exe
- name: Remove the CI checkout
if: always()
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
if (!(Test-Path -LiteralPath $env:REIMS_CI_WORKSPACE)) { return }
$checkout = Get-Item -LiteralPath $env:REIMS_CI_WORKSPACE
$parent = Get-Item -LiteralPath 'D:/RgCI'
if ($checkout.Parent.FullName -ne $parent.FullName -or
$checkout.Name -notmatch '^[0-9]+-[0-9]+$' -or
($checkout.Attributes -band [IO.FileAttributes]::ReparsePoint) -or
($parent.Attributes -band [IO.FileAttributes]::ReparsePoint)) {
throw 'Refusing to remove an unexpected CI checkout path'
}
Remove-Item -LiteralPath $checkout.FullName -Recurse -Force
+7 -4
View File
@@ -1,12 +1,15 @@
## 变更说明
- 用户可观察的行为变化
- 实现归属仓库与关联的跨仓提交或运行时版本(纯本仓改动可填无)
- 变更位置与责任仓库,附上游证据(仓库、commit、文件及行号;纯本仓改动可填无)
- 跨仓依赖:关联 PR、合并顺序与运行时要求(无跨仓依赖可填无)
- 旧版或缺失运行时下的兼容与降级表现(不涉及运行时可填不适用)
## 模型与 Agent 申报
## 模型与编程工具申报
<!-- 请逐行填写参与代码编写的实际模型和 Agent。模型格式为 model: 提供方/模型名称,Agent 格式为 agent: 名称。 -->
<!-- 请逐行填写参与代码编写的实际模型与编程工具,不要放在代码块或 HTML 注释内。
模型格式:model: 提供方/模型名称(例如 model: deepseek/deepseek-R1 或 model: google/Gemini 4 Neon)
编程工具格式:tool: 名称(例如 tool: Cursor、tool: Claude Code、tool: WorkBuddy、tool: 豆包;兼容旧的 agent: 写法) -->
## 验证记录
@@ -18,4 +21,4 @@
- [ ] 改动归属清晰,跨仓实现已按职责拆分并附上游源码或提交依据
- [ ] 涉及默认值、配置迁移或插件行为时,已附上[已有用户升级兼容性](https://github.com/Nwflower/Reims-Go/blob/main/docs/pr-review-guidelines.md#已有用户升级兼容性)验证记录
- [ ] `node scripts/debug/check.mjs`、`node scripts/changelog.mjs check` 与 `node scripts/test.mjs ci` 通过
- [ ] 面向用户或集成方的变化已写入 `changes/<slug>.json`(纯内部重构无需添加)
- [ ] 面向用户或集成方的变化已写入 `.github/changes/<slug>.json`(纯内部重构无需添加)
@@ -0,0 +1,7 @@
{
"group": "new",
"order": 0,
"authors": ["reiasu2"],
"zh": "虚拟机可在冷启动时自动选用当前目标显示器的推荐分辨率。",
"en": "VMs can automatically use the target monitor's recommended resolution on cold start."
}
@@ -0,0 +1,7 @@
{
"group": "chores",
"order": 0,
"authors": ["Nwflower"],
"zh": "滚动开发版仅在合入主分支的提交标题包含 `#` 且不包含 `docs` 时自动构建。",
"en": "Automatically build rolling Dev releases only when the commit title on the main branch contains `#` and does not contain `docs`."
}
@@ -0,0 +1,7 @@
{
"group": "improvements",
"order": 0,
"authors": ["cosimawei"],
"zh": "在插件市场点击安装或更新时直接使用市场推荐的最新版本。",
"en": "Install or update directly to the latest version offered by the plugin market."
}
@@ -0,0 +1,7 @@
{
"group": "fixes",
"order": 0,
"authors": ["Nwflower"],
"zh": "移动硬盘换盘符后,即使旧版已保存新的数据目录,客户端启动或重新选择目录时仍会修复默认位置虚拟机的旧路径。([#181](https://github.com/Nwflower/Reims-Go/issues/181))",
"en": "Repair stale paths for VMs in the default location when the client opens or reselects a data folder after an external drive changes letters, even if an older version already saved the new folder. ([#181](https://github.com/Nwflower/Reims-Go/issues/181))"
}
@@ -0,0 +1,7 @@
{
"group": "fixes",
"order": 0,
"authors": ["Nwflower"],
"zh": "虚拟机的 Vulkan 清单丢失或无法枚举显卡时,客户端会保存唯一匹配的新清单,找不到时改为自动选卡,再继续启动。",
"en": "If a VM's Vulkan manifest is missing or cannot enumerate GPUs, the client saves the only matching replacement if one exists, otherwise selects Automatic, then continues startup."
}
@@ -0,0 +1,7 @@
{
"group": "improvements",
"order": 10,
"authors": ["Nwflower"],
"zh": "应用内更新改为优先下载已校验的 `.zip` 压缩包(更新流量减少约 62%),并优化物理桥接转发吞吐与离线安装镜像 PBZX 并发解压速度。",
"en": "Download verified `.zip` release archives for in-app updates (~62% smaller update downloads), reduce per-packet allocations in the packet bridge, and parallelize PBZX chunk decompression for offline installer packages."
}
@@ -0,0 +1,7 @@
{
"group": "removals",
"order": 0,
"authors": ["Nwflower"],
"zh": "移除按虚拟机设置的修饰键重映射和「拦截宿主机全局热键」。升级后,原有设置停止生效,虚拟机恢复默认按键处理。",
"en": "Remove per-VM modifier-key remapping and host global shortcut blocking. Existing settings stop taking effect after upgrading, and VMs return to default keyboard handling."
}
+1
View File
@@ -24,6 +24,7 @@ concurrency:
jobs:
plan:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: write
outputs:
+26 -5
View File
@@ -3,8 +3,24 @@ name: CI
on:
push:
branches: [main]
paths-ignore:
- 'docs/**'
- 'README.md'
- 'README.*.md'
- 'AGENTS.md'
- '.github/ISSUE_TEMPLATE/**'
- '.github/PULL_REQUEST_TEMPLATE.md'
- '.github/readme/**'
pull_request:
branches: [main]
paths-ignore:
- 'docs/**'
- 'README.md'
- 'README.*.md'
- 'AGENTS.md'
- '.github/ISSUE_TEMPLATE/**'
- '.github/PULL_REQUEST_TEMPLATE.md'
- '.github/readme/**'
concurrency:
group: ci-${{ github.event.pull_request.number || github.ref }}
@@ -16,6 +32,7 @@ env:
jobs:
verify:
runs-on: windows-latest
timeout-minutes: 30
outputs:
rolling: ${{ steps.rolling.outputs.publish }}
steps:
@@ -28,8 +45,15 @@ jobs:
PREVIOUS_SHA: ${{ github.event.before }}
shell: pwsh
run: |
$publish = $true
if ($env:PREVIOUS_SHA -notmatch '^0+$') {
# Read the commit object so shallow checkouts retain its parent headers.
$commitLines = @(git cat-file commit HEAD)
if ($LASTEXITCODE -ne 0) { throw 'Could not read the main commit' }
$headerEnd = [Array]::IndexOf($commitLines, '')
if ($headerEnd -lt 1) { throw 'Could not locate the main commit message' }
$parents = @($commitLines[0..($headerEnd - 1)] -like 'parent *')
$subject = $commitLines[$headerEnd + 1]
$publish = $parents.Count -le 1 -and $subject -like '*#*' -and $subject -notlike '*docs*'
if ($publish -and $env:PREVIOUS_SHA -notmatch '^0+$') {
git fetch --depth=1 origin $env:PREVIOUS_SHA
if ($LASTEXITCODE -ne 0) { throw 'Could not fetch the previous main commit' }
$changed = git diff --name-only $env:PREVIOUS_SHA HEAD -- . ':(exclude)docs/**' ':(exclude)README.md' ':(exclude,glob)README.*.md' ':(exclude)AGENTS.md' ':(exclude).github/ISSUE_TEMPLATE/**' ':(exclude).github/PULL_REQUEST_TEMPLATE.md' ':(exclude).github/readme/**'
@@ -52,9 +76,6 @@ jobs:
cache: pnpm
cache-dependency-path: frontend/pnpm-lock.yaml
- name: Test GitHub automation scripts
run: node --test ".github/scripts/*.test.mjs"
- name: Verify CHANGELOG.md matches current version
shell: pwsh
run: |
+1 -1
View File
@@ -66,4 +66,4 @@ jobs:
PR_REVIEW_LLM_MODEL: ${{ vars.PR_REVIEW_LLM_MODEL || 'glm-5.4' }}
PR_REVIEW_LLM_PROTOCOL: ${{ vars.PR_REVIEW_LLM_PROTOCOL || 'anthropic' }}
PR_REVIEW_LLM_EXTRA_BODY: ${{ vars.PR_REVIEW_LLM_EXTRA_BODY }}
run: node .github/scripts/code-diagnosis.mjs
run: node scripts/ci/code-diagnosis.mjs
+3
View File
@@ -17,6 +17,7 @@ env:
jobs:
dev-release:
runs-on: windows-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
@@ -136,6 +137,8 @@ jobs:
- name: Build Windows x64 binary
shell: pwsh
env:
CGO_ENABLED: "0"
run: |
$ErrorActionPreference = 'Stop'
$ver = $env:DEV_VERSION
+2 -2
View File
@@ -34,7 +34,7 @@ jobs:
ref: ${{ github.workflow_sha }}
persist-credentials: false
sparse-checkout-cone-mode: false
sparse-checkout: /.github/scripts/
sparse-checkout: /scripts/ci/
- name: Triage issue
env:
GITHUB_TOKEN: ${{ github.token }}
@@ -43,4 +43,4 @@ jobs:
PR_REVIEW_LLM_MODEL: ${{ vars.PR_REVIEW_LLM_MODEL || 'glm-5.3-flash' }}
PR_REVIEW_LLM_PROTOCOL: ${{ vars.PR_REVIEW_LLM_PROTOCOL || 'anthropic' }}
PR_REVIEW_LLM_EXTRA_BODY: ${{ vars.PR_REVIEW_LLM_EXTRA_BODY }}
run: node .github/scripts/issue-triage.mjs
run: node scripts/ci/issue-triage.mjs
+4 -4
View File
@@ -1,4 +1,4 @@
name: PR Model and Agent Declaration
name: PR Model and Coding Tool Declaration
on:
pull_request_target:
@@ -20,8 +20,8 @@ jobs:
ref: ${{ github.workflow_sha }}
persist-credentials: false
sparse-checkout-cone-mode: false
sparse-checkout: /.github/scripts/pr-model.mjs
- name: Check the model and agent declarations
sparse-checkout: /scripts/ci/pr-model.mjs
- name: Check the model and coding tool declarations
env:
GITHUB_TOKEN: ${{ github.token }}
run: node .github/scripts/pr-model.mjs
run: node scripts/ci/pr-model.mjs
+3 -3
View File
@@ -46,8 +46,8 @@ jobs:
persist-credentials: false
sparse-checkout-cone-mode: false
sparse-checkout: |
/.github/scripts/pr-review.mjs
/.github/scripts/pr-review-language.mjs
/scripts/ci/pr-review.mjs
/scripts/ci/pr-review-language.mjs
/.opencodereview/rule.json
/docs/pr-review-guidelines.md
/docs/design-guidelines.md
@@ -108,4 +108,4 @@ jobs:
PR_REVIEW_STATE_DIR: ${{ runner.temp }}/pr-review-state/sessions
PR_REVIEW_SESSION_HOME: ${{ runner.temp }}/pr-review-state/sessions
PR_REVIEW_REUSE_INCOMPLETE: "true"
run: node .github/scripts/pr-review.mjs
run: node scripts/ci/pr-review.mjs
+3
View File
@@ -25,6 +25,7 @@ env:
jobs:
release:
runs-on: windows-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
@@ -102,6 +103,8 @@ jobs:
- name: Build Windows x64 binary
shell: pwsh
env:
CGO_ENABLED: "0"
run: |
$ErrorActionPreference = 'Stop'
$tag = $env:RELEASE_TAG
+1
View File
@@ -2,6 +2,7 @@
"exclude": [
"frontend/wailsjs/**",
"frontend/src/i18n/domains/*.gen.ts",
"frontend/src/components/*.gen.ts",
"go.sum",
"**/package-lock.json",
"**/pnpm-lock.yaml"
+32 -5
View File
@@ -40,18 +40,45 @@ Reims-Go 发布的便携运行时基于团队独立维护的 `reims-go/reims-vgp
7. 捕获异常后必须执行上报错误、记录诊断告警或回退状态等明确处理,前端测试会自动拦截空异常捕获块。
8. `docs/` 只存放当前生效且删掉会影响编码的文档,采用主谓清晰的简单句说明现状,不写本机路径、排期历史、内部变量函数名或「粗体标题加冒号」的口号句式。
## PR 模型与 Agent 申报
## PR 模型与编程工具申报
提交新 PR 时,请在描述中逐行如实申报参与代码编写的模型和 Agent。模型使用 `model: 提供方/模型名称`,例如 `model: deepseek/deepseek-R1`。Agent 使用 `agent: 名称`,例如 `agent: WorkBuddy` 或 `agent: 豆包`。请填写实际使用的名称。
提交新 PR 时,在描述正文逐行如实申报参与代码编写的模型和编程工具。行格式与示例只写在 [PR 模板](.github/PULL_REQUEST_TEMPLATE.md),由 [`scripts/ci/pr-model.mjs`](scripts/ci/pr-model.mjs) 校验。
缺少模型或 Agent 申报的 PR 直接关闭。纯人工编写的提交不予合并。此规则仅适用于生效后新建的 PR,已创建的 PR 继续按原规则处理。
缺少模型或编程工具申报的 PR 直接关闭。纯人工编写的提交不予合并。此规则仅适用于生效后新建的 PR,已创建的 PR 继续按原规则处理。
## 版本变更与开源合规
面向用户或集成方的变化随改动写入 `changes/<slug>.json`,准备正式版时编入 [`CHANGELOG.md`](CHANGELOG.md),格式与命令见 [`docs/changelog.md`](docs/changelog.md)。
面向用户或集成方的变化随改动写入 `.github/changes/<slug>.json`,准备正式版时编入 [`CHANGELOG.md`](CHANGELOG.md),格式与命令见 [`docs/changelog.md`](docs/changelog.md)。
Reims-Go 自身代码采用 [Apache-2.0](LICENSE) 协议。便携运行时以独立子进程和独立压缩包形式集成,公开运行时发布必须同处附带对应源码包、本地补丁与完整许可证文本(见 [`NOTICE.md`](NOTICE.md))。应用不打包也不托管任何 Apple 系统文件。
## 文档导航
开始处理用户任务前,先通过 [AI 文档索引](AI-DOCS.md) 定位修改目标涉及的领域,并阅读对应的规范。跨领域任务须查阅各相关规范。
开始处理用户任务前,先按下表定位修改目标涉及的领域,并阅读对应的规范。跨领域任务须查阅各相关规范。任务范围变化时,先补读新领域的规范。
### 仓库规范
| 涉及领域 | 文档名称 | 位置 |
| :--- | :--- | :--- |
| 核心分层、跨仓归属、运行时契约和数据迁移 | 系统架构 | [docs/architecture.md](docs/architecture.md) |
| 运行时下载、安装、版本门槛和分发 | 运行时客户端版本兼容规范 | [docs/runtime-client-compatibility.md](docs/runtime-client-compatibility.md) |
| 界面、状态模型、生产文案和操作反馈 | 产品与界面设计规范 | [docs/design-guidelines.md](docs/design-guidelines.md) |
| 插件、驱动扩展接口、权限和分发 | 插件系统架构 | [docs/plugin-architecture.md](docs/plugin-architecture.md) |
| 测试选择、构建检查、冒烟和并发隔离 | 测试 | [docs/testing.md](docs/testing.md) |
| 网络模式、Npcap 桥接、出口热切和驱动安装 | 网络管理 | [docs/networking.md](docs/networking.md) |
| 提交、PR 描述、跨仓审查、合并检查、Issue 分诊和定期代码诊断 | PR 变更归属审查与 GitHub 自动化 | [docs/pr-review-guidelines.md](docs/pr-review-guidelines.md) |
| PR 验证记录和合并前核对 | PR 模板 | [.github/PULL_REQUEST_TEMPLATE.md](.github/PULL_REQUEST_TEMPLATE.md) |
| 用户可见变更、更新日志与发布说明 | 更新日志编写与发布 | [docs/changelog.md](docs/changelog.md) |
| 开源许可、依赖声明和运行时分发合规 | Apache License 2.0、Third-Party Notices | [LICENSE](LICENSE) · [NOTICE.md](NOTICE.md) |
### 专题与关联仓库
| 涉及领域 | 文档名称 | 位置 |
| :--- | :--- | :--- |
| 挂起恢复所用运行时的编号和兼容判定 | Alpha 运行时编号与挂起兼容性规范 | [reims-go/reims-vgpu 的 packaging/windows-runtime/versioning.md](https://github.com/reims-go/reims-vgpu/blob/master/packaging/windows-runtime/versioning.md) |
| 运行时源码、依赖补丁和补丁退役 | 运行时源码与依赖补丁 | [reims-go/reims-vgpu 的 packaging/windows-runtime/patches/README.md](https://github.com/reims-go/reims-vgpu/blob/master/packaging/windows-runtime/patches/README.md) |
| FileVault 开机输入与启动镜像 | FileVault 开机输入镜像构建 | [scripts/filevault-input/README.md](scripts/filevault-input/README.md) |
| 虚拟机系统盘性能测量 | 系统盘小文件 I/O 基准与采样工具 | [scripts/io-bench/README.md](scripts/io-bench/README.md) |
| 跨会话工单与 Agent 交接 | 调试工单模板 | [scripts/debug/work-template.md](scripts/debug/work-template.md) |
项目总览见 [English](README.md) 和 [简体中文](README.zh-CN.md)。已发布的客户端变更见 [CHANGELOG.md](CHANGELOG.md)。新增、移动或废止规范时同步更新本节。
-33
View File
@@ -1,33 +0,0 @@
# AI 任务文档索引
开始处理用户任务前,先阅读 [AGENTS.md](AGENTS.md)。根据任务的修改目标定位可能涉及的领域,阅读下表对应的规范和相关章节,再修改文件或执行验证。跨领域任务须阅读各相关规范。任务范围变化时,先补读新领域的规范。
## 仓库规范
| 涉及领域 | 文档名称 | 位置 |
| :--- | :--- | :--- |
| 任务范围、存储、调试目录、安全和合规 | 仓库协作规则 | [AGENTS.md](AGENTS.md) |
| 核心分层、跨仓归属、运行时契约和数据迁移 | 系统架构 | [docs/architecture.md](docs/architecture.md) |
| 运行时下载、安装、版本门槛和分发 | 运行时客户端版本兼容规范 | [docs/runtime-client-compatibility.md](docs/runtime-client-compatibility.md) |
| 界面、状态模型、生产文案和操作反馈 | 产品与界面设计规范 | [docs/design-guidelines.md](docs/design-guidelines.md) |
| 插件、驱动扩展接口、权限和分发 | 插件系统架构 | [docs/plugin-architecture.md](docs/plugin-architecture.md) |
| 测试选择、构建检查、冒烟和并发隔离 | 测试 | [docs/testing.md](docs/testing.md) |
| 网络模式、Npcap 桥接、出口热切和驱动安装 | 网络管理 | [docs/networking.md](docs/networking.md) |
| 提交、PR 描述、跨仓审查和合并检查 | PR 变更归属审查 | [docs/pr-review-guidelines.md](docs/pr-review-guidelines.md) |
| Issue 分诊、恶意内容拦截和定期代码诊断 | Issue 自动化 | [docs/issue-automation.md](docs/issue-automation.md) |
| PR 验证记录和合并前核对 | PR 模板 | [.github/PULL_REQUEST_TEMPLATE.md](.github/PULL_REQUEST_TEMPLATE.md) |
| 用户可见变更、更新日志与发布说明 | 更新日志编写与发布 | [docs/changelog.md](docs/changelog.md) |
| 开源许可、依赖声明和运行时分发合规 | Apache License 2.0、Third-Party Notices | [LICENSE](LICENSE) · [NOTICE.md](NOTICE.md) |
## 专题与关联仓库
| 涉及领域 | 文档名称 | 位置 |
| :--- | :--- | :--- |
| 挂起恢复所用运行时的编号和兼容判定 | Alpha 运行时编号与挂起兼容性规范 | [reims-go/reims-vgpu 的 packaging/windows-runtime/versioning.md](https://github.com/reims-go/reims-vgpu/blob/master/packaging/windows-runtime/versioning.md) |
| 运行时源码、依赖补丁和补丁退役 | 运行时源码与依赖补丁 | [reims-go/reims-vgpu 的 packaging/windows-runtime/patches/README.md](https://github.com/reims-go/reims-vgpu/blob/master/packaging/windows-runtime/patches/README.md) |
| ARM macOS 实验运行时和准备启动介质 | ARM macOS 实验版 | [docs/arm64-preview.md](docs/arm64-preview.md) |
| FileVault 开机输入与启动镜像 | FileVault 开机输入镜像构建 | [scripts/filevault-input/README.md](scripts/filevault-input/README.md) |
| 虚拟机系统盘性能测量 | 系统盘小文件 I/O 基准与采样工具 | [scripts/io-bench/README.md](scripts/io-bench/README.md) |
| 跨会话工单与 Agent 交接 | 调试工单模板 | [scripts/debug/work-template.md](scripts/debug/work-template.md) |
项目总览见 [English](README.md) 和 [简体中文](README.zh-CN.md)。已发布的客户端变更见 [CHANGELOG.md](CHANGELOG.md)。新增、移动或废止规范时同步更新本索引。
+180
View File
@@ -4,6 +4,186 @@
Client releases are listed newest first. Release notes for portable runtimes (`runtime-*`) are available on [GitHub Releases](https://github.com/Nwflower/Reims-Go/releases).
## v0.2.15 — 2026-12-05
[中文](#cn-v0.2.15) | [English](#en-v0.2.15)
<h3 id="cn-v0.2.15">问题修复</h3>
- 插件退出或长时间不再调用后,宿主替它抬起按住的输入时若释放失败会自动重试,不再让修饰键一直卡在客体里。释放期间插件新按下的键不会被误抬起,也不会从宿主记录中丢失。 — [@Nwflower](https://github.com/Nwflower)
- 主运行时发布仓库无法访问时,自动从 `Nwflower/Reims-Go` 检查可用运行时。 — [@Nwflower](https://github.com/Nwflower)
<h3 id="en-v0.2.15">Bug Fixes</h3>
- When the host lifts input a plugin left held and that release fails, it now retries instead of leaving a modifier stuck in the guest. A key the plugin pressed while a release was in flight is no longer lifted by mistake or dropped from the host's record. — [@Nwflower](https://github.com/Nwflower)
- Check `Nwflower/Reims-Go` for available runtimes when the primary runtime release repository is unavailable. — [@Nwflower](https://github.com/Nwflower)
## v0.2.14 — 2026-12-05
[中文](#cn-v0.2.14) | [English](#en-v0.2.14)
<h3 id="cn-v0.2.14">新增功能</h3>
- 为 Windows Q35 虚拟机新增原生块设备直通模式(支持物理磁盘或分区就地挂载、`--disk-cache` 主机缓存策略配置,以及配合便携运行时新版 QEMU 的 Win32 原生 IOCP/WHPX/NVMe 性能优化)。 — [@yxc0915](https://github.com/yxc0915)
- `pkg/pluginsdk` 新增虚拟机与控制台方法,插件无需自写 JSON-RPC 客户端即可列出和操作虚拟机、截图、按键、键入文本与敏感设置、抬起仍按住的输入。宿主未在握手中宣告的方法会在发送前被拒绝,宿主返回的 JSON-RPC 错误码也会保留给调用方。 — [@Nwflower](https://github.com/Nwflower)
### 体验优化
- 应用内更新改为直接读取 GitHub Releases 接口返回的 `assets[].digest` 校验安装包 SHA-256,不再额外下载 `SHA256SUMS.txt`(该文件计划在 v0.3 退役)。 — [@Nwflower](https://github.com/Nwflower)
- 将「剪贴板互通」的全部配置项从虚拟机设置迁移到插件页的插件配置中统一管理,并在升级时按显式关闭与更严格限制优先的规则自动迁移旧的单虚拟机配置。 — [@Nwflower](https://github.com/Nwflower)
- MCP 插件接口按连接区分会话,客户端断开后会通知插件释放仍按住的输入;截图支持按源分辨率裁剪局部区域,按键支持单独按住和松开,关机支持强制停止,读取恢复点列表只需读取权限。 — [@Nwflower](https://github.com/Nwflower)
- 插件支持在清单中声明颜色令牌与 SVG 前景图标并迁移全部内置插件,插件页新增「上架插件」入口,市场卡片展示 GitHub Star 数与下载量,语言包脚手架默认仅生成目标语言标题与精简描述。 — [@Nwflower](https://github.com/Nwflower)
- 插件日志并入应用日志并标明插件包名,不再使用单独的日志窗口。 — [@Nwflower](https://github.com/Nwflower)
- 插件市场不再隐藏 Alpha 通道插件(改为展示 `Alpha` 标签),安装与更新时弹出版本选择清单,支持按综合(发布日与下载量)、Star、下载量与最新发布排序,并将带主页的插件标题设为可跳转超链接。 — [@Nwflower](https://github.com/Nwflower)
- 已安装插件的安全扫描结论改为在权限提示中显示。 — [@Nwflower](https://github.com/Nwflower)
- 插件自带的设置面板改为从该插件的设置按钮打开,不再排在插件页底部。 — [@Nwflower](https://github.com/Nwflower)
- 下载速度低于 1 MB/s 时改以 KB/s 显示,精简关于页与更新通道文案,默认同步宿主机内存规格并将外观与语言设置分组置顶,更新检查按通道缓存 5 分钟且切换通道时不再禁用控件。 — [@Nwflower](https://github.com/Nwflower)
- 新建虚拟机时在左侧栏显示正在创建的条目,并在主界面直接展示创建进度、步骤说明与取消入口 (#120)。 — [@Nwflower](https://github.com/Nwflower)
- 插件宿主接口新增统一目录,每个 `host/*` 方法的权限与请求、结果字段只定义一次,宿主、SDK 与插件共用。键入敏感设置不再只对官方 MCP 插件开放,任何持有 `qmp:write` 且用户已按虚拟机授权访问的插件都可使用,宿主只键入该插件自己的设置且不返回明文。恢复点还原对已授权访问的虚拟机开放,克隆名称由插件自定。 — [@Nwflower](https://github.com/Nwflower)
- 插件在客体里按住键或鼠标键后退出、停用或两分钟不再调用时,宿主会替它抬起,虚拟机不再卡在修饰键按下的状态。按住按键时可同时带修饰键,截图宽度超出支持范围时会被收进范围内而不是被拒绝。 — [@Nwflower](https://github.com/Nwflower)
### 问题修复
- 修复在处理器核心弹窗中勾选核心、切换模式或调整 EcoQoS 开关后,未保存前因后台状态刷新自动跳回旧配置的问题。 — [@reiasu2](https://github.com/reiasu2)
- 适配新版运行时移除 `reims-ctl set --capture` 参数,按运行时能力隐藏「点击窗口时捕获键鼠」并避免新建、克隆与保存设置报错,同时将修饰键状态行独立显示并明确「拦截宿主机全局热键」用途与立即生效说明。 — [@reiasu2](https://github.com/reiasu2)
- 手动打开更高版本的 Windows 客户端时,自动退出正在运行的旧客户端并在原位置更新,原来的快捷方式仍可使用。 — [@yxc0915](https://github.com/yxc0915)
- 修复克隆虚拟机没有主机 SSH 端口转发的问题。源虚拟机开启端口转发时,克隆出的虚拟机现在会占用源端口之后的一个空闲端口,因此 MCP 临时会话与克隆上的 SSH 相关工具(`guest_exec`、`guest_wait_ready`、`test_run` 等)可以正常连接客体。源虚拟机未开启转发时克隆仍不开启。 — [@Nwflower](https://github.com/Nwflower)
- 修复 MCP 临时克隆无法自动输入登录密码、SSH 用户名常为空的问题。克隆不保存自己的虚拟机设置,现在它读取 `login_password` 和 `username` 时会回退到来源虚拟机,且仅在来源虚拟机仍开启「允许 AI 访问」时生效;撤销来源的授权后克隆立即失去回退。密码不会复制进克隆,克隆销毁后不留存副本。虚拟机未保存登录密码时,解锁会提示去 MCP 服务设置里填写,而不是返回内部错误。 — [@Nwflower](https://github.com/Nwflower)
- 修复宿主机存在多份 Vulkan ICD 驱动清单或重复枚举同一张显卡时,内核页与虚拟机设置页重复显示同一块显卡且缺失驱动版本号的问题。 — [@Nwflower](https://github.com/Nwflower)
- 清理 macOS 独立应用窗口边角残留的桌面画面。拖动标题栏中部即可移动 Windows 窗口,拖动期间保留上一帧,避免闪出来宾桌面。 — [@yxc0915](https://github.com/yxc0915)
- 修复 Guest Tools 窗口上报进程崩溃导致的「打开独立应用窗口」失败。已有虚拟机请重新安装 Guest Tools,更新至 `v22`。 — [@yxc0915](https://github.com/yxc0915)
- 在 Windows 上从插件市场安装、重装插件或导入本地 ZIP 插件包时,若杀毒软件实时防护短暂占用刚解压的插件可执行文件,自动短暂重试,避免报 `Access is denied` 失败。 — [@reiasu2](https://github.com/reiasu2)
- 修复手动移动数据目录并在设置或首启界面重新选择新目录后,因虚拟机注册表保留旧路径导致无法启动虚拟机的问题。 — [@Nwflower](https://github.com/Nwflower)
- 手动切换到旧版运行时后,在内核页将当前运行时标注为不是最新并提示切换,同时将最新标签标注在实际最新版本旁 (#151)。 — [@Nwflower](https://github.com/Nwflower)
<h3 id="en-v0.2.14">New Features</h3>
- Add Windows raw disk/partition in-place mounting and per-VM `--disk-cache` policy support, paired with the Win32 native IOCP AIO, WHPX doorbell/fast-MMIO, and NVMe runtime optimizations. — [@yxc0915](https://github.com/yxc0915)
- Add VM and console methods to `pkg/pluginsdk`, so a plugin can list and control VMs, take screenshots, press keys, type text and secrets and release held input without writing its own JSON-RPC client. A method the host did not advertise in the handshake is refused before it is sent, and the host's JSON-RPC error code reaches the caller. — [@Nwflower](https://github.com/Nwflower)
### Improvements
- Verify in-app update downloads directly against the `assets[].digest` SHA-256 returned by the GitHub Releases API instead of fetching `SHA256SUMS.txt` (planned for retirement in v0.3). — [@Nwflower](https://github.com/Nwflower)
- Move all Clipboard Sync settings from VM settings into the plugin configuration on the Plugins page, automatically migrating legacy per-VM settings on upgrade with explicit-off and stricter limits taking precedence. — [@Nwflower](https://github.com/Nwflower)
- The MCP plugin interface now scopes each client connection as its own session and notifies the plugin when a client disconnects so held input is released. Screenshots can crop a region at source resolution, keys can be held and released individually, shutdown can force-stop, and listing restore points needs only read permission. — [@Nwflower](https://github.com/Nwflower)
- Support custom icon tone tokens and monochrome SVG foregrounds in plugin manifests (migrating all built-in plugins), add a Submit plugin button to the Plugins page, display GitHub star and download counts on market cards, and scaffold language packs with concise native-locale metadata. — [@Nwflower](https://github.com/Nwflower)
- Show plugin logs in the app log, labeled with the plugin ID, instead of a separate log window. — [@Nwflower](https://github.com/Nwflower)
- Show Alpha plugins directly in the marketplace with an `Alpha` tag instead of hiding them, open a version picker when installing or updating, add sorting by Recommended (recency + downloads), Stars, Downloads, and Recently updated, and make plugin titles clickable links to their homepage. — [@Nwflower](https://github.com/Nwflower)
- Show the security scan result of installed plugins in their permissions tooltip. — [@Nwflower](https://github.com/Nwflower)
- Open a plugin's own settings panel from its settings button instead of the bottom of the Plugins page. — [@Nwflower](https://github.com/Nwflower)
- Display download speeds below 1 MB/s in KB/s, tighten About page and update channel copy, sync host memory SMBIOS specs by default and move Appearance & language to the top of Settings, cache update checks per channel for 5 minutes, and keep the update channel selector interactive while switching. — [@Nwflower](https://github.com/Nwflower)
- Show in-progress VM creation in the sidebar and display its progress, current step, and cancel action directly in the main view (#120). — [@Nwflower](https://github.com/Nwflower)
- Add one authoritative catalog for the plugin Host API, so each `host/*` method's permissions and request and result fields are defined once and shared by the host, the SDK and plugins. Typing a secret setting is no longer reserved for the official MCP plugin, so any plugin holding `qmp:write` that the user authorized for that VM can use it, and the host only types the plugin's own setting without returning it. Restoring a snapshot works on any authorized VM, and a plugin names its own clones. — [@Nwflower](https://github.com/Nwflower)
- When a plugin leaves a key or a pointer button held in a guest and then exits, is disabled or stops calling for two minutes, the host lifts it, so a VM no longer stays stuck with a modifier down. A held key may carry modifiers, and a screenshot width outside the supported range is brought into range instead of being refused. — [@Nwflower](https://github.com/Nwflower)
### Bug Fixes
- Preserve unsaved core selections, mode changes, and EcoQoS toggles in the CPU cores dialog when background host refreshes occur. — [@reiasu2](https://github.com/reiasu2)
- Detect whether the active runtime supports `reims-ctl set --capture` so newer runtimes omit `--capture` during create, clone, and settings updates and hide the retired capture toggle, while moving modifier-key status to its own row and clarifying global host hotkey blocking. — [@reiasu2](https://github.com/reiasu2)
- Opening a newer Windows client now closes the running older client and updates its executable in place so existing shortcuts still work. — [@yxc0915](https://github.com/yxc0915)
- Fix cloned VMs having no host SSH port forward. When the source VM forwards SSH, a clone now takes the next free port after the source port, so SSH-based guest tools such as `guest_exec`, `guest_wait_ready`, and `test_run` work on MCP temporary sessions and other clones. A source without forwarding still yields a clone without one. — [@Nwflower](https://github.com/Nwflower)
- Fix MCP temporary clones failing to type the login password and often reporting an empty SSH username. A clone keeps no VM settings of its own, so reads of `login_password` and `username` now fall back to the source VM, and only while the source still allows AI access; revoking access on the source removes the fallback immediately. The password is never copied into the clone, so disposing it leaves no copy behind. When a VM has no saved login password, unlock now asks you to set it in the MCP Service settings instead of returning an internal error. — [@Nwflower](https://github.com/Nwflower)
- Deduplicate repeated Vulkan physical device entries on the Runtime and VM settings pages when the same GPU is enumerated multiple times. — [@Nwflower](https://github.com/Nwflower)
- Remove stray desktop pixels from the corners of separate macOS app windows. Drag the middle of the title bar to move the Windows window. The last frame stays visible during the move to prevent the guest desktop from flashing through. — [@yxc0915](https://github.com/yxc0915)
- Fix a Guest Tools window reporter crash that prevented macOS apps from opening in separate windows. Reinstall Guest Tools in existing VMs to update to `v22`. — [@yxc0915](https://github.com/yxc0915)
- When installing or reinstalling a plugin from the market or importing a local ZIP package on Windows, briefly retry if real-time antivirus protection holds newly extracted plugin executables open so installation does not fail with `Access is denied`. — [@reiasu2](https://github.com/reiasu2)
- Fix VMs failing to start after moving the data folder and reselecting its new location by updating stale paths in the VM registry. — [@Nwflower](https://github.com/Nwflower)
- Mark the active runtime as not latest with a switch hint when an older runtime is selected on the Engine page, and place the Latest badge on the actual newest installed runtime (#151). — [@Nwflower](https://github.com/Nwflower)
## v0.2.13 — 2026-12-04
[中文](#cn-v0.2.13) | [English](#en-v0.2.13)
<h3 id="cn-v0.2.13">新增功能</h3>
- 支持在 Windows 与 macOS 虚拟机之间复制粘贴文件和文件夹。Windows 中剪切的文件可粘贴到 macOS,原文件和剪切状态会保留。可在插件页或虚拟机设置中调整文件同步和传输上限。已有虚拟机可更新至 Guest Tools `v21`,一并获得双向文件同步和最新拖放修复。 [#108](https://github.com/Nwflower/Reims-Go/pull/108) — [@YinLiaoCo](https://github.com/YinLiaoCo), [@staytomorrow](https://github.com/staytomorrow), [@yxc0915](https://github.com/yxc0915)
- 可在设置中开启快捷键,在虚拟机窗口内切换无边框全屏。默认关闭,默认组合键为 `Ctrl+Shift+F`,可自行录制。 — [@reiasu2](https://github.com/reiasu2), [@Nwflower](https://github.com/Nwflower)
- 支持由插件接入非 macOS 虚拟机,可在客户端查看其状态,并通过 SSH、WSL、远程桌面、Hyper-V 连接或 ADB 打开。插件契约升级为 `pluginApi 1.2` 和 `uiApi 2.1`,并公开 `pkg/drivertest` 契约测试套件([#74](https://github.com/Nwflower/Reims-Go/issues/74))。 — [@icaruszezen](https://github.com/icaruszezen), [@Nwflower](https://github.com/Nwflower)
- 启用内置的「macOS 应用窗口」插件后,可从运行中的虚拟机菜单把单屏 macOS 客体的前台应用打开为 Windows 无边框窗口,并在宿主与客体之间复制粘贴。 [#118](https://github.com/Nwflower/Reims-Go/pull/118) — [@yxc0915](https://github.com/yxc0915)
- 沙箱页面插件新增四种视图位置、宿主表单与导航、虚拟机和设置访问、授权文件读写、任务进度、受控网络请求及事件订阅,并支持确认、复制、外链和私有存储。 — [@Nwflower](https://github.com/Nwflower)
- 「内核」页新增 QEMU ASLR 开关,默认关闭。启用后,虚拟机冷启动时可能恢复 Dock 图标。规则随运行时版本切换,关闭时仅移除自动添加的规则。 — [@ELDment](https://github.com/ELDment)
- 「设置」页新增默认关闭的「Hyper-V 启动切换」选项,开启后可确认切换 Windows Hypervisor 下次启动状态以兼容独占模式的 VMware,并在「内核」页区分 Hypervisor 关闭与 BIOS 虚拟化未开启。 [#122](https://github.com/Nwflower/Reims-Go/issues/122) — [@Dnyo666](https://github.com/Dnyo666)
### 体验优化
- 运行时改从 `reims-go/reims-vgpu` 下载。`REIMS_GO_RELEASES_REPO` 现在只影响应用更新,运行时仓库改用 `REIMS_GO_RUNTIME_RELEASES_REPO` 指定。 — [@Nwflower](https://github.com/Nwflower)
### 问题修复
- 修复 macOS 剪贴板含有无法读取的格式时,无法粘贴从 Windows 复制的文件的问题。 — [@YinLiaoCo](https://github.com/YinLiaoCo)
- 修复虚拟机交互期间的启停、挂起和截图输入竞争,清理桌面重启后遗留的 MCP 临时虚拟机,并确保 MCP 控制通道在长请求、输入结束和请求失败时正确传递响应。登录密码通过键盘输入,不再经过客体剪贴板。 — [@bvzrays](https://github.com/bvzrays)
- 文件拖放通过 WebDAV 挂载导入文件,而 Guest Tools 后台以 `sh` 运行。修复全新 macOS 虚拟机首次拖放时未弹出 `sh`「网络宗卷」授权提示导致失败的问题;若权限被拒,拖放会立即提示「文件拖放受限」并在连接卡显示开启路径。开启权限后,拖入访达窗口或照片时会自动重挂仍无法获取文件引用的陈旧挂载;其他挂载故障及文件剪贴板仍保留下载兜底。已有虚拟机需将 Guest Tools 更新至 `v21`。 — [@YinLiaoCo](https://github.com/YinLiaoCo)
- Windows 文件复制到 macOS 时,挂载文件不可读会改用下载回退。诊断报告会记录客体确认写入文件剪贴板的次数。 — [@yxc0915](https://github.com/yxc0915)
- 修复 QEMU 的 Metal 精度提示误标为错误,避免这些提示增加未读错误计数。 — [@yxc0915](https://github.com/yxc0915)
- 修复放入默认共享文件夹的文件在虚拟机中不显示或同步过慢的问题,移动便携目录后共享文件夹也会使用新位置。升级后需在虚拟机内重新安装 Guest Tools。 — [@reiasu2](https://github.com/reiasu2), [@Nwflower](https://github.com/Nwflower)
- 清理无法恢复的挂起残留,并在 Windows 短暂占用文件时重试封存和清理。挂起和恢复支持存放在长路径下的虚拟机。已有可恢复状态时,启动会提示先恢复或放弃该状态。 [#109](https://github.com/Nwflower/Reims-Go/pull/109) — [@reiasu2](https://github.com/reiasu2), [@Nwflower](https://github.com/Nwflower)
- 修复物理网卡绑定 Hyper-V 外部虚拟交换机后无法启用 Npcap 桥接的问题,自动使用关联管理虚拟网卡的地址转发宿客流量。 — [@ssdsl0126](https://github.com/ssdsl0126)
- 修复文件同步或 WebDAV 挂载耗时较长时,虚拟机中的 Win → ⌘ 快捷键意外打开 Windows 开始菜单的问题。 — [@reiasu2](https://github.com/reiasu2)
- 修复 MCP 创建临时 macOS 虚拟机时的名称校验错误,并开放已授权虚拟机的挂起和恢复操作。 — [@Nwflower](https://github.com/Nwflower)
- 在插件列表和设置中提示当前运行时不支持的插件设置。 — [@cosimawei](https://github.com/cosimawei)
- 修复插件设置中的已保存密钥在清空后仍显示旧掩码,以及连续修改同一设置时保存顺序错乱的问题。 — [@bvzrays](https://github.com/bvzrays)
- 修复分段选项在保存期间短暂禁用后,当前选项的高亮可能消失的问题。 — [@Nwflower](https://github.com/Nwflower)
- 从命令行启动虚拟机失败时,一并显示 Guest Tools 和网络相关的日志。 — [@Nwflower](https://github.com/Nwflower)
- 修复删除虚拟机后可能因文件句柄占用残留旧目录并在重建同名虚拟机时报错的问题。删除前先等待日志监控退出并关闭桥接通道,注销后目录仍被短暂占用时自动重试清理;同时在新建向导、命令行与克隆前提前校验目标目录是否非空,避免保留文件或残留目录拖到建机阶段才失败。删除和清理残留目录前检查其中是否有其他已注册虚拟机的数据。 — [@icaruszezen](https://github.com/icaruszezen), [@Nwflower](https://github.com/Nwflower)
- 修复只用名称指定虚拟机时读不到 SSH 端口等设置的问题。智能体工具此前会因此误报未启用 SSH 端口转发。 — [@Nwflower](https://github.com/Nwflower)
### 移除
- 主题清单不再支持从未生效的 `sounds` 字段。带交互脚本的主题可以自行播放提示音。 — [@Nwflower](https://github.com/Nwflower)
### 其他变更
- 新建 Issue 后自动提示补充信息、疑似重复和提交位置,并定期诊断代码、创建改进 Issue。 — [@Nwflower](https://github.com/Nwflower)
- PR 自动审查改用 OpenCodeReview,支持隔离的只读仓库分析、跨提交增量审查和即时 CI 状态。 — [@Nwflower](https://github.com/Nwflower)
- 提高 PR 自动审查的 token 预算,部分任务出错时仍发布已完成的审查结果。 — [@Nwflower](https://github.com/Nwflower)
- 自动审查要求说明缺陷触发条件、实际后果和代码证据,并在摘要中显示覆盖状态。 — [@Nwflower](https://github.com/Nwflower)
- 自动审查意见优先说明触发条件和实际后果,默认省略代码建议。 — [@Nwflower](https://github.com/Nwflower)
<h3 id="en-v0.2.13">New Features</h3>
- Copy and paste files and folders between Windows and macOS VMs. Pasting files cut in Windows into macOS preserves the original files and the Windows cut state. Adjust file sync and transfer limits in the plugin or VM settings. Update Guest Tools to `v21` in existing VMs for bidirectional file sync and the latest drag-and-drop fixes. [#108](https://github.com/Nwflower/Reims-Go/pull/108) — [@YinLiaoCo](https://github.com/YinLiaoCo), [@staytomorrow](https://github.com/staytomorrow), [@yxc0915](https://github.com/yxc0915)
- Add an optional shortcut in Settings to toggle borderless full screen from the VM window. It is off by default, uses `Ctrl+Shift+F`, and can be customized. — [@reiasu2](https://github.com/reiasu2), [@Nwflower](https://github.com/Nwflower)
- Let plugins add non-macOS VMs, with their state shown in the app and access through SSH, WSL, Remote Desktop, VMConnect, or ADB. The plugin contracts move to `pluginApi 1.2` and `uiApi 2.1`, and the `pkg/drivertest` contract test suite is public ([#74](https://github.com/Nwflower/Reims-Go/issues/74)). — [@icaruszezen](https://github.com/icaruszezen), [@Nwflower](https://github.com/Nwflower)
- Enable the built-in macOS App Windows plugin to open the foreground app from a running, single-display macOS VM in a borderless Windows window, with copy and paste between host and guest. [#118](https://github.com/Nwflower/Reims-Go/pull/118) — [@yxc0915](https://github.com/yxc0915)
- Add four view locations, host forms and navigation, VM and settings access, authorized file I/O, task progress, controlled HTTP requests, and event subscriptions to sandboxed plugins, alongside confirmations, clipboard copy, external links, and private storage. — [@Nwflower](https://github.com/Nwflower)
- Add an opt-in QEMU ASLR switch on the Engine page. It may restore missing Dock icons after a cold start. Rules follow the selected runtime. Turning it off removes only Reims-Go's rules. — [@ELDment](https://github.com/ELDment)
- Add an opt-in Hyper-V boot switch in Settings to toggle Windows Hypervisor launch on next boot for exclusive-mode VMware coexistence, and distinguish hypervisor launch off from disabled BIOS virtualization on the Engine page. [#122](https://github.com/Nwflower/Reims-Go/issues/122) — [@Dnyo666](https://github.com/Dnyo666)
### Improvements
- Runtimes are now downloaded from `reims-go/reims-vgpu`. `REIMS_GO_RELEASES_REPO` now only affects app updates; set the runtime repository with `REIMS_GO_RUNTIME_RELEASES_REPO`. — [@Nwflower](https://github.com/Nwflower)
### Bug Fixes
- Fix pasting files copied from Windows when the macOS clipboard contains an unreadable format. — [@YinLiaoCo](https://github.com/YinLiaoCo)
- Fix races between VM lifecycle and console operations, clean up orphaned MCP temporary VMs after desktop restarts, and preserve MCP control-channel responses during long requests, input shutdown, and request failures. Login passwords are entered as keystrokes without passing through the guest clipboard. — [@bvzrays](https://github.com/bvzrays)
- File drops transfer files over a WebDAV mount read by the Guest Tools background agent (`sh`). macOS now prompts for `sh` Network Volumes access when needed during a drop. If access is denied, drops fail immediately with a File drop limited toast and a Connection card notice showing where to enable it. After access is granted, drops into Finder windows or Photos automatically remount stale WebDAV mounts whose file references are unavailable. Other mount failures and file clipboard sync keep download fallback. Update Guest Tools to `v21` in existing VMs. — [@YinLiaoCo](https://github.com/YinLiaoCo)
- When Windows clipboard files cannot be read from the mounted share on macOS, Guest Tools uses the download fallback. Diagnostics count file clipboard writes confirmed by the guest. — [@yxc0915](https://github.com/yxc0915)
- Show QEMU Metal precision notes as informational logs so they do not increase the unread error count. — [@yxc0915](https://github.com/yxc0915)
- Fix files added to the default shared folder not appearing or syncing slowly in the VM, and use the new location after moving a portable directory. Reinstall Guest Tools in the VM after upgrading. — [@reiasu2](https://github.com/reiasu2), [@Nwflower](https://github.com/Nwflower)
- Clean up orphaned suspend files and retry sealing or cleaning up state when Windows briefly holds the files open. Suspend and resume support VMs stored under long paths. Starting a VM with a recoverable state asks you to resume or discard it first. [#109](https://github.com/Nwflower/Reims-Go/pull/109) — [@reiasu2](https://github.com/reiasu2), [@Nwflower](https://github.com/Nwflower)
- Fix Npcap bridging when a physical adapter is bound to a Hyper-V external virtual switch by using its associated management adapter for host and guest traffic. — [@ssdsl0126](https://github.com/ssdsl0126)
- Fix Win → Command shortcuts opening the Windows Start menu during slow file sync or WebDAV mounting. — [@reiasu2](https://github.com/reiasu2)
- Fix name validation for temporary macOS VMs created by MCP and expose suspend and resume for authorized VMs. — [@Nwflower](https://github.com/Nwflower)
- Show which settings the active runtime does not support in the plugin list and settings dialog. — [@cosimawei](https://github.com/cosimawei)
- Fix saved plugin secrets remaining masked after being cleared and preserve save order when the same setting is edited repeatedly. — [@bvzrays](https://github.com/bvzrays)
- Keep the highlight on the current option of a segmented control after it was briefly disabled while saving. — [@Nwflower](https://github.com/Nwflower)
- Include Guest Tools and network log lines when a VM fails to start from the command line. — [@Nwflower](https://github.com/Nwflower)
- Fix deleted VMs leaving behind their directory on Windows due to transient file locks and breaking subsequent creation of a VM with the same name. Wait for the log monitor to exit and close bridge sockets before deletion, retry directory removal if the VM was already unregistered, and validate non-empty target directories upfront in the create wizard, CLI, and clone flows. Check whether another registered VM uses the directory before removing it. — [@icaruszezen](https://github.com/icaruszezen), [@Nwflower](https://github.com/Nwflower)
- Fixed missing settings such as the SSH port when a VM is identified by name only. Agent tools used to report that SSH port forwarding was off. — [@Nwflower](https://github.com/Nwflower)
### Removals
- Theme manifests no longer accept the `sounds` field, which never took effect. Themes with an interactive script can play their own sounds. — [@Nwflower](https://github.com/Nwflower)
### Chores
- Guide new issues with missing details, possible duplicates, and where to submit them, and regularly diagnose the code to open improvement issues. — [@Nwflower](https://github.com/Nwflower)
- Use OpenCodeReview for PR reviews with isolated read-only repository analysis, incremental commit ranges, and non-blocking CI status. — [@Nwflower](https://github.com/Nwflower)
- Raise the token budget for automated PR reviews and publish completed results when some review tasks fail. — [@Nwflower](https://github.com/Nwflower)
- Require automated review findings to include a trigger, impact, and code evidence, and report coverage in the summary. — [@Nwflower](https://github.com/Nwflower)
- Automated PR reviews lead with the trigger and impact and omit code suggestions by default. — [@Nwflower](https://github.com/Nwflower)
## v0.2.12 — 2026-12-03
[中文](#cn-v0.2.12) | [English](#en-v0.2.12)
-1
View File
@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 539 141" width="539" height="141" role="img" aria-label="Reims-Go"><g transform="translate(4 107)"><defs><linearGradient id="wm" gradientUnits="userSpaceOnUse" x1="376" y1="0" x2="531" y2="0"><stop offset="0" stop-color="#3b8cff"/><stop offset="0.5" stop-color="#6d5dfc"/><stop offset="1" stop-color="#ff7a9a"/></linearGradient><linearGradient id="wmb" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#ffd43b"/><stop offset="1" stop-color="#ff9f0a"/></linearGradient></defs><g fill="none" stroke-width="15" stroke-linecap="round" stroke-linejoin="round"><path d="M7.5 -7.5V-36A24 28.5 0 0 1 31.5 -64.5" stroke="#f4f5fa"/><path d="M50.5 -36H107.5A28.5 28.5 0 1 0 100.18 -16.93" stroke="#f4f5fa"/><path d="M133.5 -64.5V-7.5" stroke="#f4f5fa"/><circle cx="133.5" cy="-94" r="9" fill="#ff7a9a"/><path d="M159.5 -7.5V-36A22 28.5 0 0 1 203.5 -36V-7.5M203.5 -36A22 28.5 0 0 1 247.5 -36V-7.5" stroke="#f4f5fa"/><path d="M311.05 -59.02A21 14.25 0 0 0 273.5 -50.25A21 14.25 0 0 0 294.5 -36A21 14.25 0 0 1 315.5 -21.75A21 14.25 0 0 1 277.95 -12.98" stroke="#f4f5fa"/><path d="M340.5 -36H358.5" stroke="#5d6382"/><path d="M440.5 -36A28.5 28.5 0 1 1 440.5 -36.01" stroke="url(#wm)"/><path d="M440.5 -64.5V0A28.5 22.5 0 0 1 387.32 11.25" stroke="url(#wm)"/><path d="M523.5 -36A28.5 28.5 0 1 1 523.5 -36.01" stroke="url(#wm)"/></g></g></svg>

Before

Width:  |  Height:  |  Size: 1.4 KiB

-1
View File
@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 539 141" width="539" height="141" role="img" aria-label="Reims-Go"><g transform="translate(4 107)"><defs><linearGradient id="wm" gradientUnits="userSpaceOnUse" x1="376" y1="0" x2="531" y2="0"><stop offset="0" stop-color="#3b8cff"/><stop offset="0.5" stop-color="#6d5dfc"/><stop offset="1" stop-color="#ff7a9a"/></linearGradient><linearGradient id="wmb" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#ffd43b"/><stop offset="1" stop-color="#ff9f0a"/></linearGradient></defs><g fill="none" stroke-width="15" stroke-linecap="round" stroke-linejoin="round"><path d="M7.5 -7.5V-36A24 28.5 0 0 1 31.5 -64.5" stroke="#16182e"/><path d="M50.5 -36H107.5A28.5 28.5 0 1 0 100.18 -16.93" stroke="#16182e"/><path d="M133.5 -64.5V-7.5" stroke="#16182e"/><circle cx="133.5" cy="-94" r="9" fill="#ff7a9a"/><path d="M159.5 -7.5V-36A22 28.5 0 0 1 203.5 -36V-7.5M203.5 -36A22 28.5 0 0 1 247.5 -36V-7.5" stroke="#16182e"/><path d="M311.05 -59.02A21 14.25 0 0 0 273.5 -50.25A21 14.25 0 0 0 294.5 -36A21 14.25 0 0 1 315.5 -21.75A21 14.25 0 0 1 277.95 -12.98" stroke="#16182e"/><path d="M340.5 -36H358.5" stroke="#a3a8bf"/><path d="M440.5 -36A28.5 28.5 0 1 1 440.5 -36.01" stroke="url(#wm)"/><path d="M440.5 -64.5V0A28.5 22.5 0 0 1 387.32 11.25" stroke="url(#wm)"/><path d="M523.5 -36A28.5 28.5 0 1 1 523.5 -36.01" stroke="url(#wm)"/></g></g></svg>

Before

Width:  |  Height:  |  Size: 1.4 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

-7
View File
@@ -1,7 +0,0 @@
{
"group": "fixes",
"order": 0,
"authors": ["YinLiaoCo"],
"zh": "修复 macOS 剪贴板含有无法读取的格式时,无法粘贴从 Windows 复制的文件的问题。",
"en": "Fix pasting files copied from Windows when the macOS clipboard contains an unreadable format."
}
-7
View File
@@ -1,7 +0,0 @@
{
"group": "new",
"order": 0,
"authors": ["YinLiaoCo", "staytomorrow", "yxc0915"],
"zh": "支持在 Windows 与 macOS 虚拟机之间复制粘贴文件和文件夹。Windows 中剪切的文件可粘贴到 macOS,原文件和剪切状态会保留。可在插件页或虚拟机设置中调整文件同步和传输上限。已有虚拟机需将 Guest Tools 更新至 `v16` 以使用双向文件同步。",
"en": "Copy and paste files and folders between Windows and macOS VMs. Pasting files cut in Windows into macOS preserves the original files and the Windows cut state. Adjust file sync and transfer limits in the plugin or VM settings. Update Guest Tools to `v16` in existing VMs for bidirectional file sync."
}
@@ -1,7 +0,0 @@
{
"group": "fixes",
"order": 0,
"authors": ["bvzrays"],
"zh": "修复虚拟机交互期间的启停、挂起和截图输入竞争,清理桌面重启后遗留的 MCP 临时虚拟机,并确保 MCP 控制通道在长请求、输入结束和请求失败时正确传递响应。登录密码通过键盘输入,不再经过客体剪贴板。",
"en": "Fix races between VM lifecycle and console operations, clean up orphaned MCP temporary VMs after desktop restarts, and preserve MCP control-channel responses during long requests, input shutdown, and request failures. Login passwords are entered as keystrokes without passing through the guest clipboard."
}
@@ -1,7 +0,0 @@
{
"group": "fixes",
"order": 0,
"authors": ["YinLiaoCo"],
"zh": "文件拖放通过 WebDAV 挂载导入文件,而 Guest Tools 后台以 `sh` 运行。修复全新 macOS 虚拟机首次拖放时未弹出 `sh`「网络宗卷」授权提示导致失败的问题;若权限被拒,拖放会立即提示「文件拖放受限」并在连接卡显示开启路径。开启权限后,拖入访达窗口或照片时会自动重挂仍无法获取文件引用的陈旧挂载;其他挂载故障及文件剪贴板仍保留下载兜底。已有虚拟机需将 Guest Tools 更新至 `v21`。",
"en": "File drops transfer files over a WebDAV mount read by the Guest Tools background agent (`sh`). macOS now prompts for `sh` Network Volumes access when needed during a drop. If access is denied, drops fail immediately with a File drop limited toast and a Connection card notice showing where to enable it. After access is granted, drops into Finder windows or Photos automatically remount stale WebDAV mounts whose file references are unavailable. Other mount failures and file clipboard sync keep download fallback. Update Guest Tools to `v21` in existing VMs."
}
-7
View File
@@ -1,7 +0,0 @@
{
"group": "fixes",
"order": 0,
"authors": ["yxc0915"],
"zh": "Windows 文件复制到 macOS 时,挂载文件不可读会改用下载回退。诊断报告会记录客体确认写入文件剪贴板的次数。",
"en": "When Windows clipboard files cannot be read from the mounted share on macOS, Guest Tools uses the download fallback. Diagnostics count file clipboard writes confirmed by the guest."
}
-7
View File
@@ -1,7 +0,0 @@
{
"group": "fixes",
"order": 0,
"authors": ["reiasu2", "Nwflower"],
"zh": "修复放入默认共享文件夹的文件在虚拟机中不显示或同步过慢的问题,移动便携目录后共享文件夹也会使用新位置。升级后需在虚拟机内重新安装 Guest Tools。",
"en": "Fix files added to the default shared folder not appearing or syncing slowly in the VM, and use the new location after moving a portable directory. Reinstall Guest Tools in the VM after upgrading."
}
@@ -1,7 +0,0 @@
{
"group": "fixes",
"order": 0,
"authors": ["reiasu2", "Nwflower"],
"zh": "自动清理无法恢复的挂起残留,避免它们阻止再次挂起,并修复 Windows 上文件仍被短暂占用时挂起封存或清理失败的问题。挂起与恢复支持存放在长路径下的虚拟机。已保存可恢复快照的虚拟机在启动时会改为拒绝并提示先恢复或放弃挂起状态,旧版启动入口同样适用,不再直接冷启动覆盖快照。",
"en": "Clear orphaned suspend files that block later suspend attempts and avoid snapshot publication or cleanup failures when Windows files are briefly still in use. Suspend and resume also support VMs stored under long paths. A VM that holds a recoverable snapshot now refuses to start and asks you to resume or discard that state first, including through the older start path, instead of cold-starting over the snapshot."
}
-7
View File
@@ -1,7 +0,0 @@
{
"group": "new",
"order": 0,
"authors": ["reiasu2", "Nwflower"],
"zh": "可在设置中开启快捷键,在虚拟机窗口内切换无边框全屏。默认关闭,默认组合键为 `Ctrl+Shift+F`,可自行录制。",
"en": "Add an optional shortcut in Settings to toggle borderless full screen from the VM window. It is off by default, uses `Ctrl+Shift+F`, and can be customized."
}
-7
View File
@@ -1,7 +0,0 @@
{
"group": "new",
"order": 0,
"authors": ["icaruszezen", "Nwflower"],
"zh": "支持由插件接入非 macOS 虚拟机,可在客户端查看其状态,并通过 SSH、WSL、远程桌面、Hyper-V 连接或 ADB 打开。插件契约升级为 `pluginApi 1.2` 和 `uiApi 2.1`,并公开 `pkg/drivertest` 契约测试套件([#74](https://github.com/Nwflower/Reims-Go/issues/74))。",
"en": "Let plugins add non-macOS VMs, with their state shown in the app and access through SSH, WSL, Remote Desktop, VMConnect, or ADB. The plugin contracts move to `pluginApi 1.2` and `uiApi 2.1`, and the `pkg/drivertest` contract test suite is public ([#74](https://github.com/Nwflower/Reims-Go/issues/74))."
}
-7
View File
@@ -1,7 +0,0 @@
{
"group": "fixes",
"order": 0,
"authors": ["ssdsl0126"],
"zh": "修复物理网卡绑定 Hyper-V 外部虚拟交换机后无法启用 Npcap 桥接的问题,自动使用关联管理虚拟网卡的地址转发宿客流量。",
"en": "Fix Npcap bridging when a physical adapter is bound to a Hyper-V external virtual switch by using its associated management adapter for host and guest traffic."
}
-7
View File
@@ -1,7 +0,0 @@
{
"group": "chores",
"order": 0,
"authors": ["Nwflower"],
"zh": "新建 Issue 后自动提示补充信息、疑似重复和提交位置,并定期诊断代码、创建改进 Issue。",
"en": "Guide new issues with missing details, possible duplicates, and where to submit them, and regularly diagnose the code to open improvement issues."
}
-7
View File
@@ -1,7 +0,0 @@
{
"group": "fixes",
"order": 0,
"authors": ["reiasu2"],
"zh": "修复文件同步或 WebDAV 挂载耗时较长时,虚拟机中的 Win → ⌘ 快捷键意外打开 Windows 开始菜单的问题。",
"en": "Fix Win → Command shortcuts opening the Windows Start menu during slow file sync or WebDAV mounting."
}
-7
View File
@@ -1,7 +0,0 @@
{
"group": "new",
"order": 0,
"authors": ["yxc0915"],
"zh": "启用「macOS 应用窗口」内置插件后,可在 Windows 无边框窗口中操作虚拟机的前台应用,并在宿主与客体之间复制粘贴。",
"en": "Enable the built-in macOS App Windows plugin to use a VM’s foreground app in a borderless Windows window with bidirectional copy and paste."
}
-7
View File
@@ -1,7 +0,0 @@
{
"group": "fixes",
"order": 0,
"authors": ["Nwflower"],
"zh": "修复 MCP 创建临时 macOS 虚拟机时的名称校验错误,并开放已授权虚拟机的挂起和恢复操作。",
"en": "Fix name validation for temporary macOS VMs created by MCP and expose suspend and resume for authorized VMs."
}
-7
View File
@@ -1,7 +0,0 @@
{
"group": "chores",
"order": 0,
"authors": ["Nwflower"],
"zh": "PR 自动审查改用 OpenCodeReview,支持隔离的只读仓库分析、跨提交增量审查和即时 CI 状态。",
"en": "Use OpenCodeReview for PR reviews with isolated read-only repository analysis, incremental commit ranges, and non-blocking CI status."
}
@@ -1,7 +0,0 @@
{
"group": "fixes",
"order": 0,
"authors": ["cosimawei"],
"zh": "在插件列表和设置中提示当前运行时不支持的插件设置。",
"en": "Show which settings the active runtime does not support in the plugin list and settings dialog."
}
-7
View File
@@ -1,7 +0,0 @@
{
"group": "fixes",
"order": 0,
"authors": ["bvzrays"],
"zh": "修复插件设置中的已保存密钥在清空后仍显示旧掩码,以及连续修改同一设置时保存顺序错乱的问题。",
"en": "Fix saved plugin secrets remaining masked after being cleared and preserve save order when the same setting is edited repeatedly."
}
-7
View File
@@ -1,7 +0,0 @@
{
"group": "new",
"order": 0,
"authors": ["Nwflower"],
"zh": "沙箱页面插件新增四种视图位置、宿主表单与导航、虚拟机和设置访问、授权文件读写、任务进度、受控网络请求及事件订阅,并支持确认、复制、外链和私有存储。",
"en": "Add four view locations, host forms and navigation, VM and settings access, authorized file I/O, task progress, controlled HTTP requests, and event subscriptions to sandboxed plugins, alongside confirmations, clipboard copy, external links, and private storage."
}
-7
View File
@@ -1,7 +0,0 @@
{
"group": "chores",
"order": 0,
"authors": ["Nwflower"],
"zh": "提高 PR 自动审查的 token 预算,部分任务出错时仍发布已完成的审查结果。",
"en": "Raise the token budget for automated PR reviews and publish completed results when some review tasks fail."
}
-7
View File
@@ -1,7 +0,0 @@
{
"group": "chores",
"order": 0,
"authors": ["Nwflower"],
"zh": "自动审查要求说明缺陷触发条件、实际后果和代码证据,并在摘要中显示覆盖状态。",
"en": "Require automated review findings to include a trigger, impact, and code evidence, and report coverage in the summary."
}
-7
View File
@@ -1,7 +0,0 @@
{
"group": "chores",
"order": 0,
"authors": ["Nwflower"],
"zh": "自动审查意见优先说明触发条件和实际后果,默认省略代码建议。",
"en": "Automated PR reviews lead with the trigger and impact and omit code suggestions by default."
}
-9
View File
@@ -1,9 +0,0 @@
{
"group": "improvements",
"order": 0,
"authors": [
"Nwflower"
],
"zh": "运行时改从 `reims-go/reims-vgpu` 下载。`REIMS_GO_RELEASES_REPO` 现在只影响应用更新,运行时仓库改用 `REIMS_GO_RUNTIME_RELEASES_REPO` 指定。",
"en": "Runtimes are now downloaded from `reims-go/reims-vgpu`. `REIMS_GO_RELEASES_REPO` now only affects app updates; set the runtime repository with `REIMS_GO_RUNTIME_RELEASES_REPO`."
}
-7
View File
@@ -1,7 +0,0 @@
{
"group": "fixes",
"order": 0,
"authors": ["Nwflower"],
"zh": "修复分段选项在保存期间短暂禁用后,当前选项的高亮可能消失的问题。",
"en": "Keep the highlight on the current option of a segmented control after it was briefly disabled while saving."
}
-7
View File
@@ -1,7 +0,0 @@
{
"group": "new",
"order": 0,
"authors": ["Dnyo666"],
"zh": "「设置」页新增默认关闭的「Hyper-V 启动切换」选项,开启后可确认切换 Windows Hypervisor 下次启动状态以兼容独占模式的 VMware,并在「内核」页区分 Hypervisor 关闭与 BIOS 虚拟化未开启。 [#122](https://github.com/Nwflower/Reims-Go/issues/122)",
"en": "Add an opt-in Hyper-V boot switch in Settings to toggle Windows Hypervisor launch on next boot for exclusive-mode VMware coexistence, and distinguish hypervisor launch off from disabled BIOS virtualization on the Engine page. [#122](https://github.com/Nwflower/Reims-Go/issues/122)"
}
-7
View File
@@ -1,7 +0,0 @@
{
"group": "fixes",
"order": 0,
"authors": ["Nwflower"],
"zh": "从命令行启动虚拟机失败时,一并显示 Guest Tools 和网络相关的日志。",
"en": "Include Guest Tools and network log lines when a VM fails to start from the command line."
}
-9
View File
@@ -1,9 +0,0 @@
{
"group": "removals",
"order": 0,
"authors": [
"Nwflower"
],
"zh": "主题清单不再支持从未生效的 `sounds` 字段。带交互脚本的主题可以自行播放提示音。",
"en": "Theme manifests no longer accept the `sounds` field, which never took effect. Themes with an interactive script can play their own sounds."
}
-9
View File
@@ -1,9 +0,0 @@
{
"group": "fixes",
"order": 0,
"authors": [
"Nwflower"
],
"zh": "修复只用名称指定虚拟机时读不到 SSH 端口等设置的问题。智能体工具此前会因此误报未启用 SSH 端口转发。",
"en": "Fixed missing settings such as the SSH port when a VM is identified by name only. Agent tools used to report that SSH port forwarding was off."
}
-6
View File
@@ -1,6 +0,0 @@
//go:build !windows
package main
// attachConsole is only needed for Windows GUI-subsystem builds.
func attachConsole() {}
+4 -2
View File
@@ -12,12 +12,14 @@ macOS 27.2.1 的实验配置使用 8 个 vCPU 和 16 GiB 内存。首次登录
## 启动
在客户端的运行时页面导入 ARM 运行时包。新建虚拟机时选择「macOS ARM64(预览)」,填写启动目录和虚拟磁盘路径,创建后点击启动。GPU 加速窗口由运行时打开。
在运行时页面导入 ARM64 预览包。它以 `stambha-hosted` 类型单独安装。Intel 虚拟机继续绑定选中的 x86-64 运行时,ARM 虚拟机自动使用已安装且兼容的 ARM64 运行时。
新建虚拟机时选择「macOS ARM64(预览)」。可从 Apple 下载 macOS 27.2.1 恢复镜像,下载支持暂停和续传,文件保存到数据目录的 `images/arm64`,完成后核对 SHA-256。本预览需要先将 IPSW 制作成 Stambha 启动介质。填写准备好的启动目录及对应的可写磁盘路径后即可创建和启动。GPU 加速窗口由运行时打开。
也可在 PowerShell 中操作。将示例路径替换成自己的文件位置。
```powershell
.\reims-go.exe runtime install .\reims-stambha-runtime-win-x64-stambha-arm64-preview.1.tar.zst
.\reims-go.exe runtime install .\reims-stambha-runtime-win-x64-stambha-arm64-preview.2.tar.zst
.\reims-go.exe vm create --driver builtin.driver.stambha --boot-volume .\arm-boot --disk .\arm-system.qcow2 --cpus 8 --memory 16G arm-macos
.\reims-go.exe vm start --driver builtin.driver.stambha arm-macos
.\reims-go.exe vm stop --driver builtin.driver.stambha arm-macos
+2 -2
View File
@@ -1,10 +1,10 @@
# 更新日志编写与发布
[`CHANGELOG.md`](../CHANGELOG.md) 保存已编入版本的客户端变更,也是 GitHub Release 说明的正文来源。待发布的条目随改动提交到仓库根目录的 `changes/`。便携运行时 `runtime-*` 在对应的运行时 Release 中记录。客户端条目只在需要时写明它依赖的运行时版本。
[`CHANGELOG.md`](../CHANGELOG.md) 保存已编入版本的客户端变更,也是 GitHub Release 说明的正文来源。待发布的条目随改动提交到 `.github/changes/`。便携运行时 `runtime-*` 在对应的运行时 Release 中记录。客户端条目只在需要时写明它依赖的运行时版本。
## 写入待发布条目
每项值得告知用户或集成方的变化写一个 `changes/<slug>.json`,文件名用小写英文和连字符。将同一行为涉及的多个提交合为一条。内部重构、纯格式调整和日常依赖更新留在提交记录中。
每项值得告知用户或集成方的变化写一个 `.github/changes/<slug>.json`,文件名用小写英文和连字符。将同一行为涉及的多个提交合为一条。内部重构、纯格式调整和日常依赖更新留在提交记录中。
```json
{
-22
View File
@@ -1,22 +0,0 @@
# Issue 自动化
## 自动分诊
[Issue Triage](../.github/workflows/issue-triage.yml) 在 Issue 新建时运行一次。它提示报告者补充信息,列出疑似重复和路线图中的相关计划,并说明问题或功能是否更适合上游引擎或插件。没有可补充的内容时不评论。
- 模型没有工具,只返回固定的分类值和 Issue 编号。评论全部使用脚本内的固定文案,Issue 中的文字不会进入评论。
- 维护者创建的 Issue、带 `roadmap` 或 `official` 标签的 Issue 以及机器人创建的 Issue 不送审。其他路线图 Issue 只提供编号和标题,供查重使用。
- 垃圾信息、钓鱼、恶意下载和针对 AI 的注入内容,须由模型引用原文并经两次独立判断一致,才会关闭并添加 `invalid` 标签。判断不一致或作者有已合并的贡献时,只在 Actions 中提醒维护者。
- 需要补充信息的 Issue 会添加 `question` 标签。
## 定期代码诊断
[Code Diagnosis](../.github/workflows/code-diagnosis.yml) 在北京时间每周一和周四 2 点扫描 `main` 的一个代码区域,各区域依次轮换。扫描只读取仓库代码,不读取 Issue 和评论。
- 问题须引用文件中真实存在的代码,并经模型二次复核,才会创建 Issue。每次最多创建两个,未关闭的诊断 Issue 达到六个时暂停。
- 涉及安全的问题不公开,只在 Actions 中提示数量和代码区域。
- 移动或重命名代码目录时,同步更新 [`code-diagnosis.mjs`](../.github/scripts/code-diagnosis.mjs) 中的区域列表。
## 配置与手动运行
两个工作流沿用 [PR 自动审核](pr-review-guidelines.md#4-自动审核)的模型密钥和变量,仅支持 `anthropic` 协议。两者都可以在 Actions 页面手动运行,默认只输出结果,勾选 `publish` 后才会发布。
+9 -5
View File
@@ -29,14 +29,17 @@ flowchart TB
1. 除编译期内置扩展外,客户端不在主进程内加载动态库或运行第三方脚本(交互主题受信任脚本除外),用户也无需额外安装外部脚本运行时。
2. Apache-2.0 客户端本体与外部组件仅通过独立子进程和协议交互,插件包、私有数据、缓存与日志全部隔离在数据目录的 `plugins/` 下。
3. 插件无权读取硬件序列号、UUID、ROM 或 MAC 地址,无权静默触发管理员提权或系统重启,也无权直接改写 `vm.toml`;插件贡献的排障数据一律经宿主脱敏后才写入排障包。
4. 插件的标准错误输出和异常审计记录在桌面端同时写入应用日志,来源标为 `plugin:<插件 ID>`,每个插件单独限流。成功的常规宿主调用只写入 `plugins/logs/` 下的插件日志文件。
内置虚拟机交互服务默认启用,通过宿主控制台代理串行处理每台虚拟机的 QMP 操作,每次操作后关闭连接,并与虚拟机生命周期操作共用锁。桌面文本输入期间暂停后台缩略图捕获。该服务不实现 MCP 协议。
内置 macOS 应用窗口插件默认关闭,依赖 Guest Tools 传输与虚拟机交互服务。用户启用后可在运行中的 macOS 虚拟机操作菜单中打开前台应用窗口。停用插件会移除操作入口并关闭独立窗口。
L3 插件可在清单 `contributes.channels` 中声明 `jsonl` 通道。桌面端的 `plugin connect` 经 Windows 当前用户限定的命名管道转发消息,不开放 TCP 或 HTTP MCP 监听。官方 MCP 插件实现工具、虚拟机状态与桌面控制,以及通过 SSH/SFTP 的客体命令和文件传输。
L3 插件可在清单 `contributes.channels` 中声明 `jsonl` 通道。桌面端的 `plugin connect` 经 Windows 当前用户限定的命名管道转发消息,不开放 TCP 或 HTTP MCP 监听。每条连接带一个会话标识,宿主随 `channel/<通道>/message` 一并转发,插件按会话区分请求 ID 和取消。连接结束后,宿主向正在运行的 Sidecar 发送 `channel/<通道>/closed` 通知,插件据此取消该连接的调用并释放按住的输入。官方 MCP 插件实现工具、虚拟机状态与桌面控制,以及通过 SSH/SFTP 的客体命令和文件传输。
Sidecar 的控制台 Host API 只接受 VM 引用,不接受 QMP 套接字或 VM 目录。读取 VM 状态要求 `vm:read`,截图要求 `vm:screen`,输入要求 `qmp:write`,VM 启停要求 `vm:control`。Host API 审核插件权限并记录方法名,不把输入文本写入审计日志。开机、登录和切换显示时画面可能是纯色,此时截图照常返回该帧并标记 `blank`,插件据此继续等待,而不是当作失败。登录密码由 Windows DPAPI 保护,宿主只提供按设置键名键入的操作,不向 MCP 插件返回明文。插件自己的下载器敏感设置仅在下载请求中解密并传给该插件进程。
Sidecar 的控制台 Host API 只接受 VM 引用,不接受 QMP 套接字或 VM 目录。读取 VM 状态和恢复点列表要求 `vm:read`,截图要求 `vm:screen`,输入要求 `qmp:write`,VM 启停要求 `vm:control`。截图可指定一块区域,区域坐标默认按源分辨率计算,也可附带参考图像尺寸,由宿主换算到源分辨率;宿主在全分辨率帧上裁剪区域后再缩放,超出支持范围的宽度会被收进范围内而不是被拒绝。按键可单独按住和松开,按住时可同时带修饰键,宿主一并按住或抬起;释放接口一次抬起指定的按键和鼠标键;驱动控制台只支持按键单击。关机可指定强制停止。宿主记录每个插件在各台虚拟机上仍按住的键与鼠标键,包括驱动控制台上的鼠标键,在插件进程退出、插件停用、虚拟机停止或两分钟不再调用时替它抬起;按住状态只由输入事件维护,不依赖连接存活,虚拟机未运行时记录直接丢弃,不在开机后补发过期的释放。
键入敏感设置对所有持有 `qmp:write` 且用户已按虚拟机授权访问的插件开放,不再只对官方插件开放。宿主只键入该插件自己的设置,不向插件返回明文,审计日志只记录设置名与长度。恢复点还原对已授权访问的虚拟机开放;删除虚拟机仍只限插件自己创建的临时虚拟机,克隆名称由插件自定,宿主以自己写入的归属标记识别临时虚拟机。Host API 审核插件权限并记录方法名,不把输入文本写入审计日志。开机、登录和切换显示时画面可能是纯色,此时截图照常返回该帧并标记 `blank`,插件据此继续等待,而不是当作失败。登录密码由 Windows DPAPI 保护。插件自己的下载器敏感设置仅在下载请求中解密并传给该插件进程。
## 生命周期、参数账本与资源预算
@@ -56,7 +59,7 @@ Sidecar 的控制台 Host API 只接受 VM 引用,不接受 QMP 套接字或 V
已激活的外部主题在重启客户端和升级插件后自动保留,并在脚本变更重新批准后带版本哈希参数重载;仅停用或卸载所属主题插件时回退内置默认主题并清空当前配色方案,安全模式或命令行停用无关插件不会影响当前主题。从市场安装并启用主题插件时,仅当当前仍处于内置默认主题才自动切换为该插件的首个主题,不覆盖用户已选的其他外部主题。
自定义界面优先采用 JSON Schema 声明式设置(支持标记敏感项、全局或按虚拟机作用域及生效时机);确需自绘界面的插件使用 `sandbox="allow-scripts"` 且禁联网的沙箱 `iframe`,通过消息桥请求通知、通用虚拟机列表、插件自有命令与多语种词包,所有本地 HTTP 服务均拒绝来自沙箱 `iframe` 或空来源的跨站请求。`contributes.views` 可在侧栏、VM 标签页、全局设置页或对话框中挂载完整视图,视图随插件作用域注册和释放,停用后自动回退到对应内置页面。视图的 `when` 支持 `vmState==<状态>` 与 `theme==<light|dark>`,条件不满足时宿主隐藏入口和页面。`minWidth` 设置页面的最小宽度,空间不足时横向滚动。
自定义界面优先采用 JSON Schema 声明式设置(支持标记敏感项、全局或按虚拟机作用域及生效时机);确需自绘界面的插件使用 `sandbox="allow-scripts"` 且禁联网的沙箱 `iframe`,通过消息桥请求通知、通用虚拟机列表、插件自有命令与多语种词包,所有本地 HTTP 服务均拒绝来自沙箱 `iframe` 或空来源的跨站请求。`settings.plugin` 槽位的面板与声明式设置一起显示在插件的设置弹窗中。`contributes.views` 可在侧栏、VM 标签页、全局设置页或对话框中挂载完整视图,视图随插件作用域注册和释放,停用后自动回退到对应内置页面。视图的 `when` 支持 `vmState==<状态>` 与 `theme==<light|dark>`,条件不满足时宿主隐藏入口和页面。`minWidth` 设置页面的最小宽度,空间不足时横向滚动。
页面可通过 `ui.confirm` 请求确认框,通过 `ui.showForm` 打开声明式表单,通过 `ui.copy` 复制文本,通过 `ui.openExternal` 打开经宿主校验的 HTTPS 外链,并使用 `ui.setTitle`、`ui.setBadge` 更新当前视图元数据。`ui.openView` 仅打开本插件声明的视图,`ui.close` 关闭当前视图或顶层对话框,`ui.navigate` 进入内置宿主页面;这些操作不会关闭应用窗口。确认框使用 `ui:notify` 权限,其他界面动作使用 `ui:slot` 权限。
@@ -71,12 +74,13 @@ Sidecar 的控制台 Host API 只接受 VM 引用,不接受 QMP 套接字或 V
| 版本面 | 覆盖范围 | 权威契约清单与自动校验 |
| :--- | :--- | :--- |
| `pluginApi` | 清单结构、扩展点、钩子载荷、权限名与子进程 JSON-RPC 协议 | [`internal/plugin/contract.go`](../internal/plugin/contract.go) |
| `pluginApi` 的宿主接口 | Sidecar 可调用的 `host/*` 方法、所需权限与请求和结果的字段 | [`pkg/pluginproto`](../pkg/pluginproto)(宿主、SDK 与插件共用同一份类型) |
| `uiApi` | 主题令牌、部件类名、状态属性、槽位、全窗图层、布局选项、图标名与交互事件 | [`frontend/ui-contract.json`](../frontend/ui-contract.json)(前端构建校验每个稳定项均已渲染) |
| `bridgeApi` | 沙箱面板与宿主之间的消息方法与事件 | [`frontend/bridge-contract.json`](../frontend/bridge-contract.json)(前后端单测双向同步校验) |
每个公开的稳定契约项在发布时均具备宿主实现与契约测试;尚未实现的预留项在契约文件中标记为 `experimental`,清单校验予以放行但 `reims-go plugin doctor` 会给出实验性提示,正式版市场插件不得依赖实验项。主版本内只做向后兼容的可选扩展,插件在握手阶段根据宿主下发的 `features` 特性列表按需降级,未知清单字段忽略并提示。
每个公开的稳定契约项在发布时均具备宿主实现与契约测试;尚未实现的预留项在契约文件中标记为 `experimental`,清单校验予以放行但 `reims-go plugin doctor` 会给出实验性提示,正式版市场插件不得依赖实验项。主版本内只做向后兼容的可选扩展,插件在握手阶段根据宿主下发的 `features` 特性列表按需降级,未知清单字段忽略并提示。宿主接口目录中的每个方法同样以特性名宣告,测试保证目录中的稳定方法都有实现、宿主实现的方法都在目录内。
当前插件契约为 `pluginApi 1.2.0`,界面契约为 `uiApi 2.1.0`。客体驱动在清单中以 `runtimeKind` 为 `external` 声明自带运行环境,并可用 `consoleEndpoint`、`pasteCombo`、`keymap` 声明控制台接入方式、客体粘贴组合键与键位映射。`driver.console`、`host.secret.materialize`、`host.download` 与 `host.elevate.request` 均已进入稳定契约,并在 Sidecar 握手特性列表中宣告。
当前插件契约为 `pluginApi 1.3.0`,界面契约为 `uiApi 2.1.0`。客体驱动在清单中以 `runtimeKind` 为 `external` 声明自带运行环境,并可用 `consoleEndpoint`、`pasteCombo`、`keymap` 声明控制台接入方式、客体粘贴组合键与键位映射。`driver.console`、`host.secret.materialize`、`host.download` 与 `host.elevate.request` 均已进入稳定契约,并在 Sidecar 握手特性列表中宣告。声明 `pluginApi` 1.3 或更高范围的插件,其虚拟机与控制台方法的请求中未定义的字段会以 JSON-RPC `-32602` 拒绝;更早的插件继续忽略未知字段,以便已发布插件在宿主补齐字段前照常工作。
## 客体驱动的 Sidecar 协议
+30 -18
View File
@@ -1,4 +1,4 @@
# PR 变更归属审查
# PR 变更归属审查与 GitHub 自动化
> 以产生行为的实现为准。先定位改动发生在哪个组件,再决定提交仓库和验证范围。桌面或 CLI 是否有入口,只决定客户端是否也需要改动。
@@ -28,22 +28,11 @@
## 3. PR 描述与合并检查
提交者在 PR 描述中附上以下信息。纯文档或纯客户端改动可将无关字段写为「不适用」。
提交者按 [PR 模板](../.github/PULL_REQUEST_TEMPLATE.md) 填写描述,模板是描述结构的唯一来源。纯文档或纯客户端改动可将无关字段写为「不适用」。
```markdown
## 变更归属
- 用户可见行为
- 变更位置与责任仓库
- 上游证据(仓库、commit、文件及行号)
- 跨仓依赖(关联 PR、合并顺序、运行时要求)
- 旧版或缺失运行时的表现
## 验证
- 已通过的检查及运行时版本
- 待验证场景及其影响
```
- 变更说明写明用户可见行为、变更位置与责任仓库、上游证据(仓库、commit、文件及行号)、跨仓依赖(关联 PR、合并顺序、运行时要求)和旧版或缺失运行时的表现。
- 模型与编程工具申报按模板注释逐行填写,缺少申报的 PR 会被 [`pr-model.mjs`](../scripts/ci/pr-model.mjs) 直接关闭。
- 验证记录写明已通过的检查及运行时版本,以及待验证场景及其影响。
审查者在合并前核对以下各项。
@@ -75,9 +64,9 @@ OCR 输出中的 `critical`、`high`、`medium` 且非 style/documentation 问
发布前检查每条缺陷是否说明当前代码中的触发条件、可观察后果,以及已有保护为何无法阻止它。审核规则要求核对实际调用方、权限、掩码和事件过滤。影响本次合并且需要维护者明确约定的问题只在摘要展示。摘要分别显示审查覆盖、已报告缺陷和缺少必需字段的候选意见数。
审核启动后不再等待 CI。发布 Review 前只做一次即时查询,附上当前 PR 提交的 CI 记录和关键步骤。CI 排队、需要人工处理或缺少通过记录时,代码无实质问题的结论为「代码未见阻塞,等待 CI」。OCR 部分完成、存在失败任务、主线对照覆盖不全或 PR 文件列表截断时会标明覆盖限制。回复语言由 PR 正文去除代码块、引用和模板标题后的文字决定,含中文时使用中文,否则参考标题并使用英文。
自动代码审核与 CI 并行运行。Review 摘要只展示代码审查结果,CI 状态和合并条件由 GitHub 的检查列表与合并区展示。OCR 部分完成、存在失败任务、主线对照覆盖不全或 PR 文件列表截断时会标明覆盖限制。回复语言由 PR 正文去除代码块、引用和模板标题后的文字决定,含中文时使用中文,否则参考标题并使用英文。
工作流直接缓存并校验官方 Release 的单个静态二进制,不安装 Node 依赖或运行 `npm install`。全部外部 Action 固定到 commit SHA,workflow 顶层 `permissions` 为空。GitHub App 需要读取 Contents 和 Actions、写入 Pull requests,并仅安装到目标仓库。
工作流直接缓存并校验官方 Release 的单个静态二进制,不安装 Node 依赖或运行 `npm install`。全部外部 Action 固定到 commit SHA,workflow 顶层 `permissions` 为空。GitHub App 需要读取 Contents、写入 Pull requests,并仅安装到目标仓库。
在目标仓库的 **Settings → Secrets and variables → Actions** 配置以下项目。
@@ -96,3 +85,26 @@ OCR 输出中的 `critical`、`high`、`medium` 且非 style/documentation 问
如果公开仓库的 Actions 事件策略阻止 `pull_request_target`,由仓库管理员在 **Settings → Actions → Policies** 为 `.github/workflows/pr-review.yml` 配置允许该事件的策略。[GitHub 事件策略文档](https://docs.github.com/en/actions/how-tos/administer/control-workflow-execution)
工作流合入默认分支并配置密钥后,可在 **Actions → PR Review → Run workflow** 输入一个开放 PR 的编号。手动重审始终使用完整 PR 区间并允许再次发布。缺少 LLM Key 时跳过,二进制校验、模型请求或发布失败时在 Actions 中显示失败。
## 5. Issue 自动化与定期代码诊断
### 自动分诊
[Issue Triage](../.github/workflows/issue-triage.yml) 在 Issue 新建时运行一次。它提示报告者补充信息,列出疑似重复和路线图中的相关计划,并说明问题或功能是否更适合上游引擎或插件。没有可补充的内容时不评论。
- 模型没有工具,只返回固定的分类值和 Issue 编号。评论全部使用脚本内的固定文案,Issue 中的文字不会进入评论。
- 维护者创建的 Issue、带 `roadmap` 或 `official` 标签的 Issue 以及机器人创建的 Issue 不送审。其他路线图 Issue 只提供编号和标题,供查重使用。
- 垃圾信息、钓鱼、恶意下载和针对 AI 的注入内容,须由模型引用原文并经两次独立判断一致,才会关闭并添加 `invalid` 标签。判断不一致或作者有已合并的贡献时,只在 Actions 中提醒维护者。
- 需要补充信息的 Issue 会添加 `question` 标签。
### 定期代码诊断
[Code Diagnosis](../.github/workflows/code-diagnosis.yml) 在北京时间每周一和周四 2 点扫描 `main` 的一个代码区域,各区域依次轮换。扫描只读取仓库代码,不读取 Issue 和评论。
- 问题须引用文件中真实存在的代码,并经模型二次复核,才会创建 Issue。每次最多创建两个,未关闭的诊断 Issue 达到六个时暂停。
- 涉及安全的问题不公开,只在 Actions 中提示数量和代码区域。
- 移动或重命名代码目录时,同步更新 [`code-diagnosis.mjs`](../scripts/ci/code-diagnosis.mjs) 中的区域列表。
### 配置与手动运行
两个工作流沿用 [PR 自动审核](#4-自动审核) 的模型密钥和变量,仅支持 `anthropic` 协议。两者都可以在 Actions 页面手动运行,默认只输出结果,勾选 `publish` 后才会发布。
+4 -3
View File
@@ -8,11 +8,12 @@
| 改动前端 | `node scripts/test.mjs quick frontend` | 界面逻辑、国际化、架构约束和静态检查 |
| 改动持久化或升级 | `node scripts/test.mjs quick storage` | 配置和数据目录、迁移及插件状态存储,使用真实临时文件 |
| 改动调试工具 | `node scripts/test.mjs quick tooling` | 临时目录和工单工具自测 |
| 跨模块改动或提 PR | `node scripts/test.mjs ci` | 前端测试和类型检查、`cmd/`、`internal/`、`pkg/`、`scripts/` 下的 Go 测试与 vet、调试工具自测 |
| 改动 GitHub 自动化脚本 | `node scripts/test.mjs quick automation` | `scripts/ci/` 下 PR 审核、Issue 分诊、代码诊断和申报校验脚本的自测 |
| 跨模块改动或提 PR | `node scripts/test.mjs ci` | 前端测试和类型检查、`internal/`、`pkg/`、`scripts/` 下的 Go 测试与 vet、调试工具自测、GitHub 自动化脚本自测 |
| 核对发布候选 | `node scripts/test.mjs release` | 使用 `desktop,production` 构建标签运行同一套 Go 检查,禁用测试结果缓存并随机化用例顺序 |
| Windows 桌面冒烟 | `node scripts/test.mjs webview2 build/bin/reims-go.exe` | 启动已构建的客户端,在真实 WebView2 中完成首启数据目录设置 |
GitHub CI 额外检查变更日志、工作区纪律、前端生产打包、Windows GUI 可执行文件的 `version` 输出与 WebView2 首启。`main` 的滚动版复用同一提交的 CI 测试,手动构建会跑 CI 测试并冒烟。带版本标签的发布与每日 Alpha 先跑发布候选测试,再对待发布的 EXE 运行桌面冒烟。两个发布流程都在上传前验证实际 EXE 的版本、ZIP 内的文件和 SHA-256 校验和。
GitHub CI 额外检查变更日志、工作区纪律、前端生产打包、Windows GUI 可执行文件的 `version` 输出与 WebView2 首启。滚动开发版检查推送到 `main` 的最新提交消息的第一行,包含 `#` 且不包含 `docs`(忽略大小写)时才复用该提交的 CI 测试自动构建。自动构建跳过有多个父提交的合并提交及纯文档推送。手动构建会跑 CI 测试并冒烟。带版本标签的发布与每日 Alpha 先跑发布候选测试,再对待发布的 EXE 运行桌面冒烟。两个发布流程都在上传前验证实际 EXE 的版本、ZIP 内的文件和 SHA-256 校验和。
桌面冒烟需要已安装 WebView2 Runtime 的 Windows 桌面会话。测试通过 Windows UI Automation 填入独立的数据目录、点击继续,检查配置和目录指针落盘,并等待运行时设置页渲染。每次运行使用独立的 WebView2 配置目录。失败时,测试入口打印保留的目录,应用日志在其中的 `app.log`。
@@ -24,7 +25,7 @@ Go 包并发默认为可用 CPU 数与 4 的较小值,每个包的运行上限
## 覆盖和后续改进
- 前端测试直接加载生产模块验证任务排序、过期事件和键位映射。涉及界面交互时优先覆盖用户可观察的状态切换,不按源码行或正则截取组件源码执行。
- 前端测试直接加载生产模块验证任务排序和过期事件。涉及界面交互时优先覆盖用户可观察的状态切换,不按源码行或正则截取组件源码执行。
- Go 单包测试验证领域规则,跨层测试保留桌面桥接、控制套接字、本地 HTTP、子进程与数据迁移等真实接口用例。异步用例通过完成信号控制时序,超时只用于报告卡死。
- 存储层测试使用真实临时目录验证配置、目录锁、版本升级、插件状态备份与损坏恢复。
- 依赖真实便携运行时、磁盘工具、引导镜像与安装包的集成用例仅在传入对应的 `REIMS_GO_TEST_*` 环境变量时运行,常规档位自动跳过。改动涉及虚拟机运行或磁盘操作时须在 Windows 宿主机实测验证。
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "reims-go-frontend",
"private": true,
"version": "0.2.12",
"version": "0.2.15",
"type": "module",
"scripts": {
"dev": "vite",
+1 -1
View File
@@ -1 +1 @@
548bdba60bd8bd89e3828b675ad94fc2
e81d377cfdb873b5f163107395859d09
+712
View File
@@ -0,0 +1,712 @@
import assert from 'node:assert/strict'
import test from 'node:test'
import { loadTestModule } from './load-test-module.mjs'
const mod = await loadTestModule(`
import './i18n/domains/settings.gen'
import './i18n/domains/wizard.gen'
export * from './i18n'
export * from './lib/format'
export * from './lib/displayResolution'
`)
const host4K150 = {
primary_display: { width: 3840, height: 2160, scale_pct: 150, work_width: 3840, work_height: 2088, primary: true },
display_presets: [
{ resolution: '3200x1800', label: '3200 × 1800', hidpi: true, recommended: true },
{ resolution: '2880x1620', label: '2880 × 1620', hidpi: true },
{ resolution: '2560x1440', label: '2560 × 1440', hidpi: false },
],
fullscreen_hidpi: true,
recommended_gpu: { name: 'NVIDIA GeForce RTX 4070', kind: 'discrete' },
gpus: [{ name: 'NVIDIA GeForce RTX 4070', kind: 'discrete' }],
}
const host32K200 = {
primary_display: { width: 3200, height: 2000, scale_pct: 200, work_width: 3200, work_height: 1904, primary: true },
display_presets: [
{ resolution: '2880x1800', label: '2880 × 1800', hidpi: true, recommended: true },
{ resolution: '2560x1600', label: '2560 × 1600', hidpi: true },
{ resolution: '1920x1200', label: '1920 × 1200', hidpi: false },
],
fullscreen_hidpi: true,
recommended_gpu: { name: 'Intel(R) Arc Graphics', kind: 'integrated' },
gpus: [{ name: 'Intel(R) Arc Graphics', kind: 'integrated' }],
}
test('resolveAutoDisplayPreset matches Go RecommendAutoResolution for 4K 16:9 and 3.2K 16:10', () => {
// 4K 16:9 @ 150%
const win4k = mod.resolveAutoDisplayPreset(host4K150, false, true)
assert.equal(win4k.resolution, '3200x1800')
assert.equal(win4k.hidpi, true)
const fs4kFixed = mod.resolveAutoDisplayPreset(host4K150, true, true)
assert.equal(fs4kFixed.resolution, '5120x2880')
assert.equal(fs4kFixed.hidpi, true)
assert.equal(fs4kFixed.scaleBadge, '1.5×')
const fs4kNoFixed = mod.resolveAutoDisplayPreset(host4K150, true, false)
assert.equal(fs4kNoFixed.resolution, '3840x2160')
assert.equal(fs4kNoFixed.hidpi, true)
assert.equal(fs4kNoFixed.native, true)
// 3.2K 16:10 @ 200% (scale >= 175 -> native fullscreen even with fixedModeSupported)
const win32k = mod.resolveAutoDisplayPreset(host32K200, false, true)
assert.equal(win32k.resolution, '2880x1800')
assert.equal(win32k.hidpi, true)
const fs32kFixed = mod.resolveAutoDisplayPreset(host32K200, true, true)
assert.equal(fs32kFixed.resolution, '3200x2000')
assert.equal(fs32kFixed.hidpi, true)
assert.equal(fs32kFixed.native, true)
const fs32kNoFixed = mod.resolveAutoDisplayPreset(host32K200, true, false)
assert.equal(fs32kNoFixed.resolution, '3200x2000')
assert.equal(fs32kNoFixed.hidpi, true)
assert.equal(fs32kNoFixed.native, true)
})
test('resolveAutoDisplayPreset falls back safely to 1920x1080 non-HiDPI when host display is empty or invalid (#6)', () => {
const emptyHost = {}
const winEmpty = mod.resolveAutoDisplayPreset(emptyHost, false, true)
assert.equal(winEmpty.resolution, '1920x1080')
assert.equal(winEmpty.hidpi, false)
for (const fixedModeSupported of [true, false]) {
const fsEmpty = mod.resolveAutoDisplayPreset(emptyHost, true, fixedModeSupported)
assert.equal(fsEmpty.resolution, '1920x1080')
assert.equal(fsEmpty.label, '1920 × 1080')
assert.equal(fsEmpty.hidpi, false)
assert.equal(fsEmpty.native, true)
assert.equal(fsEmpty.recommended, true)
const zeroHeightHost = {
primary_display: { width: 3200, height: 0, scale_pct: 150, primary: true },
fullscreen_hidpi: true,
}
const fsZeroHeight = mod.resolveAutoDisplayPreset(zeroHeightHost, true, fixedModeSupported)
assert.equal(fsZeroHeight.resolution, '1920x1080')
assert.equal(fsZeroHeight.label, '1920 × 1080')
assert.equal(fsZeroHeight.hidpi, false)
assert.equal(fsZeroHeight.native, true)
}
})
test('SettingsModal auto resolution never falls into custom or resBad across display and borderless switches', () => {
// Auto mode with a resolution from 4K screen, now moved to 3.2K screen where 3200x1800 is not a preset
const onLaptop = mod.deriveSettingsResolutionState({
form: { auto_resolution: true, resolution: '3200x1800', borderless: false },
displayProfile: host32K200,
fixedModeSupported: true,
forceCustomRes: false,
})
assert.equal(onLaptop.presetHit, false)
assert.equal(onLaptop.customRes, false)
assert.equal(onLaptop.resValue, mod.AUTO_RESOLUTION_OPTION)
assert.equal(onLaptop.resBad, false)
assert.equal(onLaptop.autoPreset.resolution, '2880x1800')
// Even empty or invalid resolution string must not trigger resBad while auto_resolution is on
const emptyResAuto = mod.deriveSettingsResolutionState({
form: { auto_resolution: true, resolution: '', borderless: false },
displayProfile: host4K150,
fixedModeSupported: true,
forceCustomRes: true,
})
assert.equal(emptyResAuto.customRes, false)
assert.equal(emptyResAuto.resBad, false)
assert.equal(emptyResAuto.resValue, mod.AUTO_RESOLUTION_OPTION)
// Toggling borderless in auto mode keeps auto_resolution intact and refreshes autoPreset
const borderlessPatch = mod.toggleSettingsBorderless({
borderless: true,
form: { auto_resolution: true, resolution: '3200x1800' },
displayProfile: host4K150,
targetDisplay: host4K150.primary_display,
presets: onLaptop.presets,
fsPresets: onLaptop.fsPresets,
customRes: false,
})
assert.deepEqual(borderlessPatch, { borderless: true })
const afterBorderless = mod.deriveSettingsResolutionState({
form: { auto_resolution: true, resolution: '3200x1800', borderless: true },
displayProfile: host4K150,
fixedModeSupported: true,
forceCustomRes: false,
})
assert.equal(afterBorderless.resValue, mod.AUTO_RESOLUTION_OPTION)
assert.equal(afterBorderless.autoPreset.resolution, '5120x2880')
})
test('SettingsModal dirty count, save payload, reset, and custom blur snap-back behave consistently', () => {
const baseFixed = { name: 'mac', auto_resolution: false, resolution: '3200x1800', borderless: false }
const autoPreset = mod.resolveAutoDisplayPreset(host4K150, false, true)
// Fixed -> Auto: keeps base.resolution so only auto_resolution is dirty (count = 1), save diff omits resolution
const toAuto = mod.selectSettingsResolution({
value: mod.AUTO_RESOLUTION_OPTION,
form: { resolution: '2560x1440' },
base: baseFixed,
autoPreset,
})
assert.equal(toAuto.forceCustomRes, false)
assert.deepEqual(toAuto.patch, { auto_resolution: true, resolution: '3200x1800' })
assert.equal(mod.countChangedSettingsFields(['auto_resolution']), 1)
assert.deepEqual(
mod.buildSettingsSaveDiff('mac', ['auto_resolution', 'resolution'], { ...baseFixed, auto_resolution: true, resolution: '2560x1440' }),
{ name: 'mac', auto_resolution: true },
)
// Auto -> Fixed different resolution: both fields dirty, UI count = 1, save diff sends both
assert.equal(mod.countChangedSettingsFields(['auto_resolution', 'resolution']), 1)
assert.equal(mod.countChangedSettingsFields(['auto_resolution', 'resolution', 'borderless']), 2)
assert.deepEqual(
mod.buildSettingsSaveDiff('mac', ['auto_resolution', 'resolution'], { ...baseFixed, auto_resolution: false, resolution: '2560x1440' }),
{ name: 'mac', auto_resolution: false, resolution: '2560x1440' },
)
// Selecting custom disables auto_resolution and falls back to autoPreset when empty
const toCustom = mod.selectSettingsResolution({
value: mod.CUSTOM_RESOLUTION_OPTION,
form: { resolution: '' },
base: baseFixed,
autoPreset,
})
assert.equal(toCustom.forceCustomRes, true)
assert.deepEqual(toCustom.patch, { auto_resolution: false, resolution: '3200x1800' })
// Typing a known preset in custom input snaps back to preset card on blur
const typedPreset = mod.deriveSettingsResolutionState({
form: { auto_resolution: false, resolution: '3200x1800', borderless: false },
displayProfile: host4K150,
fixedModeSupported: true,
forceCustomRes: true,
})
assert.equal(typedPreset.presetHit, true)
assert.equal(typedPreset.customRes, true)
assert.equal(
mod.shouldExitCustomResOnBlur({ autoResolution: false, forceCustomRes: true, presetHit: typedPreset.presetHit }),
true,
)
// Typing an invalid custom resolution triggers resBad and does not snap back
const typedInvalid = mod.deriveSettingsResolutionState({
form: { auto_resolution: false, resolution: 'not-a-res', borderless: false },
displayProfile: host4K150,
fixedModeSupported: true,
forceCustomRes: true,
})
assert.equal(typedInvalid.presetHit, false)
assert.equal(typedInvalid.resBad, true)
assert.equal(
mod.shouldExitCustomResOnBlur({ autoResolution: false, forceCustomRes: true, presetHit: typedInvalid.presetHit }),
false,
)
})
test('CreateWizard defaults to auto resolution and keeps preview resolution synced on borderless toggle', () => {
const init = mod.initialWizardResolution(host4K150, true)
assert.deepEqual(init, { auto_resolution: true, resolution: '3200x1800' })
const windowPresets = mod.windowDisplayPresets(host4K150, true)
const fullscreenPresets = mod.fullscreenDisplayPresets(host4K150)
// Toggling borderless ON in auto mode updates preview resolution to fullscreen auto preset
const fsOnFixed = mod.toggleWizardBorderless({
borderless: true,
opts: init,
host: host4K150,
fixedModeSupported: true,
windowPresets,
fullscreenPresets,
})
assert.deepEqual(fsOnFixed, { borderless: true, auto_resolution: true, resolution: '5120x2880' })
const fsOnNoFixed = mod.toggleWizardBorderless({
borderless: true,
opts: init,
host: host4K150,
fixedModeSupported: false,
windowPresets,
fullscreenPresets,
})
assert.deepEqual(fsOnNoFixed, { borderless: true, auto_resolution: true, resolution: '3840x2160' })
// Selecting a fixed preset turns auto_resolution off
const fixedChoice = mod.selectWizardResolution('2560x1440', mod.resolveAutoDisplayPreset(host4K150, false, true))
assert.deepEqual(fixedChoice, { auto_resolution: false, resolution: '2560x1440' })
// Selecting AUTO turns auto_resolution back on with current autoPreset
const autoChoice = mod.selectWizardResolution(mod.AUTO_RESOLUTION_OPTION, mod.resolveAutoDisplayPreset(host4K150, true, true))
assert.deepEqual(autoChoice, { auto_resolution: true, resolution: '5120x2880' })
})
test('VM summary, formatResolutionLabel, and pendingChangeText format auto_resolution in zh-CN and en-US', () => {
const trZh = (k, v) => mod.t('zh-CN', k, v)
const trEn = (k, v) => mod.t('en-US', k, v)
assert.equal(mod.formatResolutionLabel('3200x1800', true, trZh), '自动(3200 × 1800)')
assert.equal(mod.formatResolutionLabel('3200x1800', true, trEn), 'Auto (3200 × 1800)')
assert.equal(mod.formatResolutionLabel('3200x1800', false, trZh), '3200 × 1800')
assert.equal(mod.formatResolutionLabel('', true, trEn), 'Auto')
const autoDetail = {
graphics: 'reims-vgpu',
gpu: 'auto',
resolution: '3200x1800',
auto_resolution: true,
displays: 1,
}
assert.equal(mod.graphicsLabel('zh-CN', autoDetail, host4K150), 'RTX 4070 · 自动(3200 × 1800)')
assert.equal(mod.graphicsLabel('en-US', autoDetail, host4K150), 'RTX 4070 · Auto (3200 × 1800)')
const fixedDetail = { ...autoDetail, auto_resolution: false }
assert.equal(mod.graphicsLabel('en-US', fixedDetail, host4K150), 'RTX 4070 · 1800p')
const pendingOnZh = mod.pendingChangeText('zh-CN', { field: 'auto_resolution', from: 'false', to: 'true' }, host4K150)
const pendingOffEn = mod.pendingChangeText('en-US', { field: 'auto_resolution', from: 'true', to: 'false' }, host4K150)
assert.equal(pendingOnZh, '自动分辨率 关闭 → 开启')
assert.equal(pendingOffEn, 'Auto resolution On → Off')
assert.ok(!pendingOnZh.includes('auto_resolution'))
assert.ok(!pendingOffEn.includes('auto_resolution'))
})
test('vmware-svga disables and hides auto resolution across wizard, settings, and summary (#5)', () => {
// Wizard initialization: svga defaults to auto_resolution: false, reims-vgpu defaults to true
assert.deepEqual(mod.initialWizardResolution(host4K150, true, 'vmware-svga'), {
auto_resolution: false,
resolution: '3200x1800',
})
assert.deepEqual(mod.initialWizardResolution(host4K150, true, 'reims-vgpu'), {
auto_resolution: true,
resolution: '3200x1800',
})
// Switching graphics in wizard disables auto on svga, and restores auto on reims-vgpu only if user did not pick a fixed preset
const autoPreset = mod.resolveAutoDisplayPreset(host4K150, false, true)
assert.deepEqual(
mod.switchWizardGraphics({ graphics: 'vmware-svga', manualResolutionPicked: false, autoPreset }),
{ graphics: 'vmware-svga', auto_resolution: false },
)
assert.deepEqual(
mod.switchWizardGraphics({ graphics: 'reims-vgpu', manualResolutionPicked: false, autoPreset }),
{ graphics: 'reims-vgpu', auto_resolution: true, resolution: '3200x1800' },
)
assert.deepEqual(
mod.switchWizardGraphics({ graphics: 'reims-vgpu', manualResolutionPicked: true, autoPreset }),
{ graphics: 'reims-vgpu' },
)
// SettingsModal switching to svga only patches graphics and exits custom input (R2 #11)
assert.deepEqual(mod.switchSettingsGraphics('vmware-svga'), {
patch: { graphics: 'vmware-svga' },
forceCustomRes: false,
})
const svgaState = mod.deriveSettingsResolutionState({
form: { graphics: 'vmware-svga', auto_resolution: true, resolution: 'not-a-res', borderless: false },
displayProfile: host4K150,
fixedModeSupported: true,
forceCustomRes: true,
})
assert.notEqual(svgaState.resValue, mod.AUTO_RESOLUTION_OPTION)
assert.equal(svgaState.customRes, false)
assert.equal(svgaState.resBad, false)
// R2 #2: SVGA never includes the AUTO resolution card in SettingsModal or CreateWizard options
const activePresets = mod.windowDisplayPresets(host4K150, true)
const settingsSvgaOpts = mod.buildResolutionOptions({
graphics: 'vmware-svga',
autoPreset,
activePresets,
includeCustom: true,
})
const wizardSvgaOpts = mod.buildResolutionOptions({
graphics: 'vmware-svga',
autoPreset,
activePresets,
})
assert.equal(settingsSvgaOpts.some((o) => o.value === mod.AUTO_RESOLUTION_OPTION), false)
assert.equal(wizardSvgaOpts.some((o) => o.value === mod.AUTO_RESOLUTION_OPTION), false)
const settingsVgpuOpts = mod.buildResolutionOptions({
graphics: 'reims-vgpu',
autoPreset,
activePresets,
includeCustom: true,
})
const wizardVgpuOpts = mod.buildResolutionOptions({
graphics: 'reims-vgpu',
autoPreset,
activePresets,
})
assert.equal(settingsVgpuOpts[0].value, mod.AUTO_RESOLUTION_OPTION)
assert.equal(wizardVgpuOpts[0].value, mod.AUTO_RESOLUTION_OPTION)
// Settings save diff never sends auto_resolution: true for vmware-svga
assert.deepEqual(
mod.buildSettingsSaveDiff('mac', ['graphics', 'auto_resolution'], {
name: 'mac',
graphics: 'vmware-svga',
auto_resolution: true,
resolution: '1920x1080',
}),
{ name: 'mac', graphics: 'vmware-svga', auto_resolution: false },
)
// graphicsLabel never renders auto resolution label for vmware-svga
const svgaDetail = {
graphics: 'vmware-svga',
gpu: 'auto',
resolution: '3200x1800',
auto_resolution: true,
displays: 1,
}
assert.equal(mod.graphicsLabel('zh-CN', svgaDetail, host4K150), mod.t('zh-CN', 'softwareGraphics'))
assert.equal(mod.graphicsLabel('en-US', svgaDetail, host4K150), mod.t('en-US', 'softwareGraphics'))
})
test('installer wizard draft enables auto resolution by default while preserving user fixed drafts (#7)', () => {
const installerDraftVgpu = mod.initialWizardResolution(host4K150, true, 'reims-vgpu')
assert.deepEqual(installerDraftVgpu, { auto_resolution: true, resolution: '3200x1800' })
const installerDraftSvga = mod.initialWizardResolution(host4K150, true, 'vmware-svga')
assert.deepEqual(installerDraftSvga, { auto_resolution: false, resolution: '3200x1800' })
// Returning from a failed create preserves explicit auto_resolution: false
const failedFixedDraft = {
name: 'macos-tahoe',
graphics: 'reims-vgpu',
auto_resolution: false,
resolution: '2560x1440',
borderless: false,
}
const effectiveFixed = mod.resolveEffectiveWizardOpts(
failedFixedDraft,
mod.resolveAutoDisplayPreset(host32K200, false, true),
)
assert.equal(effectiveFixed.auto_resolution, false)
assert.equal(effectiveFixed.resolution, '2560x1440')
})
test('effective wizard opts track host screen changes in auto mode without mutating fixed mode (#8)', () => {
const autoOptsFrom4K = {
name: 'macos-tahoe',
graphics: 'reims-vgpu',
auto_resolution: true,
resolution: '3200x1800',
borderless: false,
}
// Host switches to 3.2K screen while wizard stays open or restores an auto draft
const effectiveOn32K = mod.resolveEffectiveWizardOpts(
autoOptsFrom4K,
mod.resolveAutoDisplayPreset(host32K200, false, true),
)
assert.equal(effectiveOn32K.auto_resolution, true)
assert.equal(effectiveOn32K.resolution, '2880x1800')
// Borderless auto mode on 4K updates to 5120x2880
const effectiveBorderless = mod.resolveEffectiveWizardOpts(
{ ...autoOptsFrom4K, borderless: true },
mod.resolveAutoDisplayPreset(host4K150, true, true),
)
assert.equal(effectiveBorderless.resolution, '5120x2880')
// Fixed mode keeps user-selected resolution even when host changes
const fixedOpts = { ...autoOptsFrom4K, auto_resolution: false, resolution: '2560x1440' }
const effectiveFixed = mod.resolveEffectiveWizardOpts(
fixedOpts,
mod.resolveAutoDisplayPreset(host32K200, false, true),
)
assert.equal(effectiveFixed.auto_resolution, false)
assert.equal(effectiveFixed.resolution, '2560x1440')
})
test('custom resolution canonicalizes on blur and save diff to match Go validator (#9)', () => {
assert.equal(mod.canonicalResolution('3200 × 1800'), '3200x1800')
assert.equal(mod.canonicalResolution(' 3200X1800 '), '3200x1800')
assert.equal(mod.canonicalResolution('2400 x 1500'), '2400x1500')
assert.equal(mod.canonicalResolution(''), '')
const presets = mod.windowDisplayPresets(host4K150, true)
// Typing a known preset with × or uppercase X snaps back and writes canonical preset value
assert.deepEqual(
mod.resolveCustomResBlur({
resolution: '3200 × 1800',
autoResolution: false,
forceCustomRes: true,
activePresets: presets,
}),
{ exitCustom: true, nextResolution: '3200x1800' },
)
assert.deepEqual(
mod.resolveCustomResBlur({
resolution: '3200X1800',
autoResolution: false,
forceCustomRes: true,
activePresets: presets,
}),
{ exitCustom: true, nextResolution: '3200x1800' },
)
// Typing a non-preset valid size canonicalizes without exiting custom input
assert.deepEqual(
mod.resolveCustomResBlur({
resolution: ' 2400 × 1500 ',
autoResolution: false,
forceCustomRes: true,
activePresets: presets,
}),
{ exitCustom: false, nextResolution: '2400x1500' },
)
// Save diff always canonicalizes resolution even if saved before blur
assert.deepEqual(
mod.buildSettingsSaveDiff('mac', ['auto_resolution', 'resolution'], {
name: 'mac',
graphics: 'reims-vgpu',
auto_resolution: false,
resolution: '3200 × 1800',
}),
{ name: 'mac', auto_resolution: false, resolution: '3200x1800' },
)
})
test('background baseline refresh syncs untouched fields so saving memory never overwrites external auto_resolution (#11)', () => {
const initialBase = {
name: 'mac',
memory: '8G',
graphics: 'reims-vgpu',
auto_resolution: true,
resolution: '3200x1800',
}
// User only edits memory
const touched = new Set(mod.expandTouchedSettingsFields(['memory']))
const editedForm = { ...initialBase, memory: '16G' }
// External CLI disables auto_resolution and sets fixed 2560x1440; background poll refreshes base
const refreshedBase = {
...initialBase,
auto_resolution: false,
resolution: '2560x1440',
}
const syncedForm = mod.syncUntouchedSettingsForm(editedForm, refreshedBase, touched)
assert.equal(syncedForm.memory, '16G')
assert.equal(syncedForm.auto_resolution, false)
assert.equal(syncedForm.resolution, '2560x1440')
// Only memory differs from refreshedBase, so save diff only sends memory
const dirtyFields = ['memory', 'auto_resolution', 'resolution'].filter(
(k) => syncedForm[k] !== refreshedBase[k],
)
assert.deepEqual(dirtyFields, ['memory'])
assert.deepEqual(mod.buildSettingsSaveDiff('mac', dirtyFields, syncedForm), {
name: 'mac',
memory: '16G',
})
// Touching resolution pairs both resolution and auto_resolution so background refresh preserves user edits
const resTouched = new Set(mod.expandTouchedSettingsFields(['resolution']))
assert.ok(resTouched.has('resolution'))
assert.ok(resTouched.has('auto_resolution'))
const editedResForm = { ...initialBase, auto_resolution: false, resolution: '1920x1080' }
const syncedWhileEditingRes = mod.syncUntouchedSettingsForm(editedResForm, refreshedBase, resTouched)
assert.equal(syncedWhileEditingRes.auto_resolution, false)
assert.equal(syncedWhileEditingRes.resolution, '1920x1080')
})
test('R2 #7: switching VMs resets settings draft to target VM baseline without leaking previous VM edits', () => {
const baseA = {
name: 'vm-a',
graphics: 'reims-vgpu',
auto_resolution: true,
resolution: '3200x1800',
memory: '8G',
}
const baseB = {
name: 'vm-b',
graphics: 'reims-vgpu',
auto_resolution: true,
resolution: '2880x1800',
memory: '16G',
}
const touchedA = new Set(mod.expandTouchedSettingsFields(['resolution', 'memory']))
const editedA = { ...baseA, auto_resolution: false, resolution: '2560x1440', memory: '12G' }
const switched = mod.reconcileSettingsFormOnBaseChange({
previousVMKey: 'builtin.driver.reims-macos:vm-a',
nextVMKey: 'builtin.driver.reims-macos:vm-b',
form: editedA,
base: baseB,
touchedFields: touchedA,
})
assert.equal(switched.resetDraft, true)
assert.deepEqual(switched.form, baseB)
const dirtyB = Object.keys(baseB).filter((k) => switched.form[k] !== baseB[k])
assert.deepEqual(dirtyB, [])
assert.deepEqual(mod.buildSettingsSaveDiff('vm-b', dirtyB, switched.form, baseB), { name: 'vm-b' })
})
test('R2 #5: internal digit spaces never match presets, keep custom input visible, and block save', () => {
const hostWith1080 = {
...host4K150,
display_presets: [
...host4K150.display_presets,
{ resolution: '1920x1080', label: '1920 × 1080', hidpi: false },
],
}
assert.equal(mod.canonicalResolution('1 920x1080'), '1 920x1080')
assert.equal(mod.normalizeResolution('1 920x1080'), '1 920x1080')
assert.equal(mod.isValidResolution('1 920x1080'), false)
// Even when forceCustomRes is false (custom input opened automatically due to non-preset old value),
// pasting "1 920x1080" must NOT match 1920x1080 preset, must keep input visible, and must set resBad = true.
const badState = mod.deriveSettingsResolutionState({
form: { graphics: 'reims-vgpu', auto_resolution: false, resolution: '1 920x1080', borderless: false },
displayProfile: hostWith1080,
fixedModeSupported: true,
forceCustomRes: false,
})
assert.equal(badState.presetHit, false)
assert.equal(badState.customRes, true)
assert.equal(badState.resBad, true)
// Spaces around × or uppercase X still match preset and canonicalize to 3200x1800
assert.equal(mod.isValidResolution('3200 × 1800'), true)
assert.equal(mod.isValidResolution('3200X1800'), true)
const goodState = mod.deriveSettingsResolutionState({
form: { graphics: 'reims-vgpu', auto_resolution: false, resolution: '3200 × 1800', borderless: false },
displayProfile: hostWith1080,
fixedModeSupported: true,
forceCustomRes: false,
})
assert.equal(goodState.presetHit, true)
assert.equal(goodState.matchedPreset?.resolution, '3200x1800')
assert.equal(goodState.resBad, false)
assert.deepEqual(
mod.resolveCustomResBlur({
resolution: '3200 × 1800',
autoResolution: false,
forceCustomRes: false,
activePresets: goodState.activePresets,
}),
{ exitCustom: true, nextResolution: '3200x1800' },
)
})
test('R2 #11: switching vGPU+auto to SVGA and resetting graphics leaves 0 changes; saving SVGA disables auto', () => {
const base = {
name: 'mac',
graphics: 'reims-vgpu',
auto_resolution: true,
resolution: '3200x1800',
}
// Temporarily switch to SVGA
const svgaSwitch = mod.switchSettingsGraphics('vmware-svga')
assert.deepEqual(svgaSwitch, { patch: { graphics: 'vmware-svga' }, forceCustomRes: false })
const svgaForm = { ...base, ...svgaSwitch.patch }
assert.equal(svgaForm.auto_resolution, true)
// Resetting graphics row back to reims-vgpu restores clean form with 0 changes
const resetForm = { ...svgaForm, graphics: base.graphics }
const dirtyAfterReset = ['graphics', 'auto_resolution', 'resolution'].filter((k) => resetForm[k] !== base[k])
assert.deepEqual(dirtyAfterReset, [])
assert.equal(mod.countChangedSettingsFields(dirtyAfterReset), 0)
assert.deepEqual(mod.buildSettingsSaveDiff('mac', dirtyAfterReset, resetForm, base), { name: 'mac' })
// Saving SVGA directly sends graphics: 'vmware-svga' and turns off auto_resolution when base had it on
const dirtyOnSvga = ['graphics', 'auto_resolution', 'resolution'].filter((k) => svgaForm[k] !== base[k])
assert.deepEqual(dirtyOnSvga, ['graphics'])
assert.deepEqual(mod.buildSettingsSaveDiff('mac', dirtyOnSvga, svgaForm, base), {
name: 'mac',
graphics: 'vmware-svga',
auto_resolution: false,
})
// If base already had auto_resolution: false, saving SVGA only sends graphics
const baseFixed = { ...base, auto_resolution: false }
assert.deepEqual(mod.buildSettingsSaveDiff('mac', ['graphics'], { ...baseFixed, graphics: 'vmware-svga' }, baseFixed), {
name: 'mac',
graphics: 'vmware-svga',
})
})
test('R2 #3: CreateWizard preserves manual fixed resolution across SVGA create failure and return to vGPU', () => {
const autoPreset = mod.resolveAutoDisplayPreset(host4K150, false, true)
// Step 1: User starts on vGPU and manually picks fixed 2560x1440
let opts = {
name: 'macos-tahoe',
graphics: 'reims-vgpu',
...mod.initialWizardResolution(host4K150, true, 'reims-vgpu'),
borderless: false,
}
let manualResolutionPicked = true
opts = { ...opts, ...mod.selectWizardResolution('2560x1440', autoPreset) }
assert.equal(opts.auto_resolution, false)
assert.equal(opts.resolution, '2560x1440')
// Step 2: User switches to SVGA and submits; create fails and saves draft with manualResolution: true
opts = { ...opts, ...mod.switchWizardGraphics({ graphics: 'vmware-svga', manualResolutionPicked, autoPreset }) }
const failedDraft = {
opts: mod.resolveEffectiveWizardOpts(opts, autoPreset),
step: 5,
manualResolution: manualResolutionPicked,
}
assert.equal(failedDraft.opts.graphics, 'vmware-svga')
assert.equal(failedDraft.opts.auto_resolution, false)
assert.equal(failedDraft.opts.resolution, '2560x1440')
// Step 3: Reopen wizard from failed draft and switch back to vGPU
const restoredManual = mod.initialWizardManualResolution(failedDraft)
assert.equal(restoredManual, true)
const backToVgpu = mod.switchWizardGraphics({
graphics: 'reims-vgpu',
manualResolutionPicked: restoredManual,
autoPreset,
})
const restoredOpts = { ...failedDraft.opts, ...backToVgpu }
assert.equal(restoredOpts.graphics, 'reims-vgpu')
assert.equal(restoredOpts.auto_resolution, false)
assert.equal(restoredOpts.resolution, '2560x1440')
// Fallback behavior when draft.manualResolution is omitted
assert.equal(mod.initialWizardManualResolution(null), false)
assert.equal(
mod.initialWizardManualResolution({ opts: { graphics: 'vmware-svga', auto_resolution: false } }),
false,
)
assert.equal(
mod.initialWizardManualResolution({ opts: { graphics: 'reims-vgpu', auto_resolution: false } }),
true,
)
})
test('R3 #3 & #6: turning off auto includes fixed resolution; switching to SVGA omits hidden invalid resolution', () => {
// R3 #3: switching from auto back to fixed card matching display-0 resolution still submits explicit resolution
// so any per-display list (e.g. 3200x1800,2560x1440) is replaced uniformly.
const baseAuto = { name: 'mac', graphics: 'reims-vgpu', auto_resolution: true, resolution: '3200x1800' }
const formFixed = { ...baseAuto, auto_resolution: false, resolution: '3200x1800' }
assert.deepEqual(mod.buildSettingsSaveDiff('mac', ['auto_resolution'], formFixed, baseAuto), {
name: 'mac',
auto_resolution: false,
resolution: '3200x1800',
})
// R3 #6: typing invalid custom resolution then switching to SVGA does not submit hidden invalid resolution
const baseVgpu = { name: 'mac', graphics: 'reims-vgpu', auto_resolution: false, resolution: '2560x1440' }
const formSvgaWithHiddenInvalid = {
...baseVgpu,
graphics: 'vmware-svga',
resolution: '1 920x1080',
}
assert.deepEqual(
mod.buildSettingsSaveDiff('mac', ['graphics', 'resolution'], formSvgaWithHiddenInvalid, baseVgpu),
{
name: 'mac',
graphics: 'vmware-svga',
},
)
})
+21
View File
@@ -0,0 +1,21 @@
// scripts/brand/wordmark.py is the single source of the icon and the wordmark
// geometry: it copies build/assets/logo.svg into public/ and generates
// wordmark.gen.ts. Neither copy may be edited by hand.
import test from 'node:test'
import assert from 'node:assert/strict'
import fs from 'node:fs'
import path from 'node:path'
const repoRoot = path.resolve(import.meta.dirname, '..', '..')
test('frontend/public/logo.svg is the copy of build/assets/logo.svg', () => {
const source = fs.readFileSync(path.join(repoRoot, 'build', 'assets', 'logo.svg'))
const served = fs.readFileSync(path.join(repoRoot, 'frontend', 'public', 'logo.svg'))
assert.ok(source.equals(served), 'run python scripts/brand/wordmark.py to refresh frontend/public/logo.svg')
})
test('the frontend wordmark geometry is generated', () => {
const generated = fs.readFileSync(path.join(repoRoot, 'frontend', 'src', 'components', 'wordmark.gen.ts'), 'utf8')
assert.match(generated, /^\/\/ Code generated by scripts\/brand\/wordmark\.py; DO NOT EDIT\./)
assert.match(generated, /export const WORDMARK_STROKES: WordmarkStroke\[\] = \[/)
})
-91
View File
@@ -1,91 +0,0 @@
import assert from 'node:assert/strict'
import test from 'node:test'
import { loadTestModule } from './load-test-module.mjs'
const { createKeymapRequests, keymapPresetUpdate, keymapUpdate } = await loadTestModule(`export * from './lib/vmKeymap'`)
const off = { preset: 'off', bindings: {}, capture_host_shortcuts: false }
const custom = { preset: 'custom', bindings: { lwin: 'lcmd' }, capture_host_shortcuts: true }
test('switching presets preserves shortcut capture and carries bindings into custom', () => {
const preset = { ...custom, preset: 'win_to_cmd' }
assert.equal(keymapPresetUpdate(preset, 'win_to_cmd'), undefined)
assert.deepEqual(keymapPresetUpdate(preset, 'custom'), custom)
assert.deepEqual(keymapPresetUpdate(custom, 'off'), { ...off, capture_host_shortcuts: true })
assert.deepEqual(keymapPresetUpdate(off, 'custom'), { ...off, preset: 'custom' })
})
test('editing one binding preserves the other bindings, preset, and shortcut capture', () => {
assert.deepEqual(keymapUpdate(custom, { bindings: { lalt: 'disabled' } }), {
...custom,
bindings: { lwin: 'lcmd', lalt: 'disabled' },
})
})
test('toggling shortcut capture preserves the preset and bindings', () => {
const captureOff = { ...custom, capture_host_shortcuts: false }
assert.deepEqual(keymapUpdate(captureOff, { capture_host_shortcuts: true }), custom)
assert.deepEqual(keymapUpdate(custom, { capture_host_shortcuts: false }), captureOff)
assert.deepEqual(keymapUpdate(off, { capture_host_shortcuts: true }), { ...off, capture_host_shortcuts: true })
})
test('a pending write for one VM does not block or overwrite another VM', async () => {
const saved = Promise.withResolvers()
const writes = []
let active = 'a'
let state = {}
const requests = createKeymapRequests({
async GetVMKeymap(name) {
assert.equal(name, 'b')
return off
},
SetVMKeymap(name, request) {
writes.push([name, request])
return saved.promise
},
}, () => active, (patch) => Object.assign(state, patch))
const write = requests.write('a', custom)
await requests.write('a', off)
assert.deepEqual(writes, [['a', custom]])
assert.equal(state.busy, true)
active = 'b'
state = requests.initial('b')
await requests.watch('b').refresh()
saved.resolve(custom)
await write
assert.deepEqual(state, { keymap: off, busy: false, error: '' })
assert.equal(requests.initial('a').busy, false)
})
test('a failed keymap read recovers on the next refresh', async () => {
let fail = true
const state = {}
const requests = createKeymapRequests({
async GetVMKeymap() {
if (fail) throw new Error('temporary')
return off
},
}, () => 'vm', (patch) => Object.assign(state, patch))
const watch = requests.watch('vm')
await watch.refresh()
assert.equal(state.error, 'temporary')
fail = false
await watch.refresh()
assert.deepEqual(state, { keymap: off, error: '' })
})
test('a read started before a write cannot restore the old keymap', async () => {
const previousRead = Promise.withResolvers()
const state = {}
const requests = createKeymapRequests({
GetVMKeymap: () => previousRead.promise,
SetVMKeymap: async () => custom,
}, () => 'vm', (patch) => Object.assign(state, patch))
const read = requests.watch('vm').refresh()
await requests.write('vm', custom)
previousRead.resolve(off)
await read
assert.deepEqual(state, { keymap: custom, busy: false, error: '' })
})
+31
View File
@@ -0,0 +1,31 @@
import assert from 'node:assert/strict'
import test from 'node:test'
import { loadTestModule } from './load-test-module.mjs'
const { createLogLine } = await loadTestModule(`export * from './lib/logs'`)
const renderSelector = 'newRenderPipelineStateWithDescriptor:error:'
const computeSelector = 'newComputePipelineStateWithDescriptor:options:reflection:error:'
const precisionNote = (selector, code) =>
`[QEMU] reims-vgpu: ${selector}: metal2vulkan-runtime made it with a precision note (metal2vulkan-degrade-${code}): its answers there can differ from Metal's on this device; the first of its kind, each make that carries it counted`
test('successful render and compute precision notes keep their text as informational logs', () => {
for (const line of [
precisionNote(renderSelector, 'device-denormals'),
precisionNote(computeSelector, 'simdgroup-access-order'),
]) {
const row = createLogLine({ line })
assert.equal(row.level, 'info')
assert.equal(row.line, line)
}
})
test('pipeline refusals and fatal errors retain their error level', () => {
for (const line of [
`[QEMU] reims-vgpu: platform call ${renderSelector}: the runtime refused it`,
'[QEMU] reims-vgpu: fatal: Vulkan device was lost',
`${precisionNote(renderSelector, 'device-denormals')}; error: failed to submit the command buffer`,
]) {
assert.equal(createLogLine({ line }).level, 'error')
}
})
+39 -6
View File
@@ -30,11 +30,39 @@ function isEmptyBlock(block) {
return ts.isBlock(block) && block.statements.every((stmt) => ts.isEmptyStatement(stmt))
}
function isEmptyFunctionBody(expr) {
function isSilentLiteralExpr(expr) {
let current = expr
while (ts.isParenthesizedExpression(current)) current = current.expression
if (
current.kind === ts.SyntaxKind.NullKeyword ||
current.kind === ts.SyntaxKind.TrueKeyword ||
current.kind === ts.SyntaxKind.FalseKeyword ||
ts.isStringLiteralLike(current) ||
ts.isNumericLiteral(current) ||
ts.isVoidExpression(current)
) {
return true
}
if (ts.isIdentifier(current) && current.text === 'undefined') return true
if (ts.isArrayLiteralExpression(current) && current.elements.length === 0) return true
if (ts.isObjectLiteralExpression(current) && current.properties.length === 0) return true
return false
}
function isSilentFunctionBody(expr) {
let current = expr
while (ts.isParenthesizedExpression(current)) current = current.expression
if (ts.isArrowFunction(current) || ts.isFunctionExpression(current)) {
return isEmptyBlock(current.body)
if (isEmptyBlock(current.body)) return true
if (!ts.isBlock(current.body) && isSilentLiteralExpr(current.body)) return true
if (
ts.isBlock(current.body) &&
current.body.statements.length === 1 &&
ts.isReturnStatement(current.body.statements[0]) &&
(!current.body.statements[0].expression || isSilentLiteralExpr(current.body.statements[0].expression))
) {
return true
}
}
return false
}
@@ -70,9 +98,9 @@ export function findEmptyCatchesInJS(sourceText, filePath = 'sample.ts') {
record(node, 'empty-catch-clause')
} else if (ts.isCallExpression(node)) {
const method = getCalleeMethodName(node.expression)
if (method === 'catch' && node.arguments.length >= 1 && isEmptyFunctionBody(node.arguments[0])) {
if (method === 'catch' && node.arguments.length >= 1 && isSilentFunctionBody(node.arguments[0])) {
record(node.arguments[0], 'empty-promise-catch')
} else if (method === 'then' && node.arguments.length >= 2 && isEmptyFunctionBody(node.arguments[1])) {
} else if (method === 'then' && node.arguments.length >= 2 && isSilentFunctionBody(node.arguments[1])) {
record(node.arguments[1], 'empty-promise-then-reject')
}
}
@@ -321,10 +349,15 @@ test('detector self-test: catches all empty JS/TS catch forms and allows handled
'p.catch(async () => { ; })',
'p.then(ok, () => {})',
'p.then(ok, (err) => { // noop\n})',
'p.catch(() => null)',
'p.catch(() => "")',
'p.catch(() => false)',
'p.catch(() => [])',
'p.catch(() => { return null })',
].join('\n')
const badFindings = findEmptyCatchesInJS(bad, 'bad.ts')
assert.equal(badFindings.length, 11, `expected 11 findings, got ${JSON.stringify(badFindings)}`)
assert.equal(badFindings.length, 16, `expected 16 findings, got ${JSON.stringify(badFindings)}`)
const good = [
'const text = "try { a() } catch {} .catch(() => {})"',
@@ -332,7 +365,7 @@ test('detector self-test: catches all empty JS/TS catch forms and allows handled
'try { a() } catch (e) { console.warn(e) }',
'try { a() } catch { return fallback }',
'p.catch((e) => console.warn(e))',
'p.catch(() => null)',
'p.catch((e) => { console.warn(e); return null })',
'p.then(ok, (e) => handle(e))',
].join('\n')
+48
View File
@@ -0,0 +1,48 @@
import assert from 'node:assert/strict'
import test from 'node:test'
import { loadTestModule } from './load-test-module.mjs'
const { describeRuntimeStatus, sameRuntimeId } = await loadTestModule(`export * from './lib/runtimeStatus'`)
const rt = (commit, active = false) => ({
commit,
active,
path: `/runtimes/${commit}`,
manifest: { qemu_version: 'QEMU 11.1.90' },
})
const remote = (commit) => ({
commit,
channel: 'stable',
archive_size: 100,
})
test('sameRuntimeId matches full and short commits with matching revision suffix', () => {
assert.equal(sameRuntimeId('6a1f03f', '6a1f03f862b4'), true)
assert.equal(sameRuntimeId('3731afd-p3', '3731afd-p4'), false)
assert.equal(sameRuntimeId('3731afd-p3', '3731afd9-p3'), true)
})
test('active runtime matching remote latest is up to date', () => {
const s = describeRuntimeStatus([rt('6a1f03f', true), rt('2df30ff', false)], remote('6a1f03f'))
assert.equal(s.activeIsLatest, true)
assert.equal(s.latestInstalled, true)
assert.equal(s.updatable, false)
assert.equal(s.switchRecommended, false)
})
test('switching to an older runtime while latest is installed flags not-latest instead of up-to-date', () => {
const s = describeRuntimeStatus([rt('2df30ff', true), rt('6a1f03f', false)], remote('6a1f03f'))
assert.equal(s.activeIsLatest, false)
assert.equal(s.latestInstalled, true)
assert.equal(s.updatable, false)
assert.equal(s.switchRecommended, true)
})
test('missing remote latest marks runtime as updatable', () => {
const s = describeRuntimeStatus([rt('2df30ff', true)], remote('6a1f03f'))
assert.equal(s.activeIsLatest, false)
assert.equal(s.latestInstalled, false)
assert.equal(s.updatable, true)
assert.equal(s.switchRecommended, false)
})
+18 -1
View File
@@ -2,7 +2,7 @@ import assert from 'node:assert/strict'
import test from 'node:test'
import { loadTestModule } from './load-test-module.mjs'
const { currentTask, findActiveOfflineTask, pruneFinishedTasks, upsertTask } =
const { creatingVMTasks, currentTask, findActiveOfflineTask, pruneFinishedTasks, taskDetail, upsertTask } =
await loadTestModule(`export * from './lib/tasks'`)
const task = (id, overrides = {}) => ({
@@ -33,3 +33,20 @@ test('one installer download represents the VM creations waiting for it', () =>
primary: download, waitingVMs: ['vm one'], matchedIDs: ['download', 'vm'],
})
})
test('taskDetail formats download speeds under 1 MB/s in KB/s', () => {
assert.equal(taskDetail(task('slow', { done: 5e6, total: 50e6, rate: 512e3 })), '5 MB / 50 MB · 512 KB/s')
assert.equal(taskDetail(task('tiny', { done: 1e6, total: 10e6, rate: 200 })), '1 MB / 10 MB · 1 KB/s')
assert.equal(taskDetail(task('fast', { done: 2e9, total: 10e9, rate: 12.5e6 })), '2.0 GB / 10.0 GB · 12.5 MB/s')
assert.equal(taskDetail(task('gig', { done: 2e9, total: 10e9, rate: 1.2e9 })), '2.0 GB / 10.0 GB · 1.2 GB/s')
})
test('creatingVMTasks lists only running vm-create tasks not yet present in vms, oldest first', () => {
const first = task('t1', { subject: 'macos-a', started_at: 10 })
const second = task('t2', { subject: 'macos-b', started_at: 20 })
const registered = task('t3', { subject: 'macos-ready', started_at: 5 })
const finished = task('t4', { subject: 'macos-done', status: 'done', started_at: 1 })
const download = task('t5', { kind: 'installer-download', subject: '26.7.3', started_at: 2 })
const got = creatingVMTasks({ second, first, registered, finished, download }, new Set(['macos-ready']))
assert.deepEqual(got.map((x) => x.subject), ['macos-a', 'macos-b'])
})
+185 -198
View File
@@ -1,28 +1,27 @@
import { Minus, Moon, Square, Sun, X } from 'lucide-react'
import React, { Suspense, lazy, useCallback, useEffect, useRef, useState } from 'react'
import type { WizardDraft } from './components/CreateWizard'
import { DeleteDialog } from './components/DeleteDialog'
import { ElevationDialog } from './components/ElevationDialog'
import { CloneDialog } from './components/CloneDialog'
import { AppDialogs } from './components/AppDialogs'
import { OnlineRecoveryDialog } from './macos/OnlineRecoveryDialog'
import { SendTextDialog } from './components/SendTextDialog'
import { LogPanel, LogTab } from './components/LogPanel'
import { TitleMenus } from './components/TitleMenus'
import { UpdateCapsule } from './components/UpdateCapsule'
import { DataRootReadOnly } from './components/DataRootReadOnly'
import { ABOUT_ID, HOST_ID, INSTALLERS_ID, PAGE_IDS, PLUGINS_ID, SETTINGS_ID, Sidebar } from './components/Sidebar'
import { CreatingVMView } from './components/CreatingVMView'
import { VMPage } from './components/VMPage'
import { buildFallbackChain, I18nKey, localeDir, locText, parseAppError, resolveActiveLocale, setPluginLocales, t } from './i18n'
import { defaultGuestLang, recommendedMemoryGB, recommendedResolution } from './lib/format'
import { hasStambhaRuntime, isMacOSDriver, liveVMInfo, splitEndpoints, STAMBHA_DRIVER_ID, vmFeatures } from './lib/endpoints'
import { defaultGuestLang, recommendedMemoryGB } from './lib/format'
import { initialWizardResolution } from './lib/displayResolution'
import { hasStambhaRuntime, isMacOSDriver, liveVMInfo, splitEndpoints, vmFeatures } from './lib/endpoints'
import { resolveFullscreenHotkey } from './lib/fullscreenHotkey'
import { LogLine, appendLog } from './lib/logs'
import { LogLine, appendLog, createLogLine } from './lib/logs'
import { macOSMajor } from './macos/macosRelease'
import { currentTask, finishedTaskTTL, isActiveInstallerTask, pruneFinishedTasks, upsertTask } from './lib/tasks'
import { creatingVMTasks, currentTask, finishedTaskTTL, isActiveInstallerTask, pruneFinishedTasks, upsertTask } from './lib/tasks'
import { applyActiveLocaleFonts, applyActiveTheme, disposeActiveThemeAndLocaleFonts, notifyInteractiveThemeState } from './lib/themeEngine'
import type { UIStateSnapshot } from './lib/uiSdk'
import { hasVisibleDialog } from './lib/dialogState'
import { latestVMStats, refreshSubscribedVMStats, refreshVMStats } from './lib/vmStats'
import { refreshSubscribedVMStats, refreshVMStats } from './lib/vmStats'
import { useAppearance } from './lib/useAppearance'
import { useAppUpdate } from './lib/useAppUpdate'
import { useFileDrop } from './lib/useFileDrop'
@@ -33,18 +32,13 @@ import { closePluginDialog, closePluginView, emptyPluginViewState, matchViewCond
import { publishPluginHostEvent } from './lib/pluginViewEvents'
import { buildSafePluginAssetURL } from './lib/pluginAssets'
import { ActiveThemePayload, AppState, CachedInstaller, CreateOpts, Locale, PluginUIContributions, Task, VMAction, VMBusyAction, VMDetail, VMInfo, VMListItem, ViewContribution } from './types'
import { Button, Tip, TooltipProvider } from './ui/controls'
import { ConfirmDialog, Modal } from './ui/dialog'
import { Tip, TooltipProvider } from './ui/controls'
import { errorToast, Toaster, type ToastInput, useToasts } from './ui/toast'
import { BrandMark, ThemeDecorations, ThemeVisualsProvider } from './ui/themeVisuals'
import { api, DROP_NETWORK_VOLUMES_DENIED, events, WindowMinimise, WindowToggleMaximise, type ElevationPrompt } from './wails'
// Opened on demand, so each is its own chunk and stays out of the startup
// bundle: the wizard, VM settings and affinity dialogs, first-run setup, and
// the Engine / Installers / Settings pages.
const CreateWizard = lazy(() => import('./components/CreateWizard').then((m) => ({ default: m.CreateWizard })))
const SettingsModal = lazy(() => import('./components/SettingsModal').then((m) => ({ default: m.SettingsModal })))
const AffinityDialog = lazy(() => import('./components/AffinityDialog').then((m) => ({ default: m.AffinityDialog })))
// bundle: first-run setup, and the Engine / Installers / Settings pages.
const Setup = lazy(() => import('./components/Setup').then((m) => ({ default: m.Setup })))
const HostView = lazy(() => import('./components/HostView').then((m) => ({ default: m.HostView })))
const ImagesPage = lazy(() => import('./components/ImagesPage').then((m) => ({ default: m.ImagesPage })))
@@ -113,6 +107,7 @@ export const App: React.FC = () => {
const [detailRevision, setDetailRevision] = useState(0)
const [showWizard, setShowWizard] = useState(false)
const [wizardDraft, setWizardDraft] = useState<WizardDraft | null>(null)
const [pendingCreates, setPendingCreates] = useState<string[]>([])
const [showSettings, setShowSettings] = useState(false)
const [affinityTarget, setAffinityTarget] = useState<{ name: string; driverID: string } | null>(null)
const [affinityVersion, setAffinityVersion] = useState(0)
@@ -149,7 +144,7 @@ export const App: React.FC = () => {
// Sidebar can be hidden (Ctrl+B or the title-bar toggle); remembered per user.
const [sidebarOpen, setSidebarOpen] = useState<boolean>(() => {
try { return localStorage.getItem('reims-go-sidebar') !== 'hidden' } catch { return true }
try { return localStorage.getItem('reims-go-sidebar') !== 'hidden' } catch (e) { console.warn('[app] read sidebar state failed:', e); return true }
})
const toggleSidebar = () => setSidebarOpen((open) => {
try { localStorage.setItem('reims-go-sidebar', open ? 'hidden' : 'shown') } catch (e) { console.warn('[app] persist sidebar state failed:', e) }
@@ -200,11 +195,11 @@ export const App: React.FC = () => {
// Logs never pop the panel open (see docs/design-guidelines.md); errors only bump a badge.
const offLog = events.onLog((entry) => {
if (!entry || typeof entry !== 'object') return
const lineText = typeof entry.line === 'string' ? entry.line : String(entry.line ?? '')
if (!logsOpenRef.current && /\b(error|failed|fatal|panic)\b/i.test(lineText)) {
const line = createLogLine(entry)
if (!logsOpenRef.current && line.level === 'error') {
setUnseenErrors((n) => n + 1)
}
setLogLines((prev) => appendLog(prev, entry))
setLogLines((prev) => appendLog(prev, line))
})
// Tasks: seed from the backend, then follow events.
api.GetTasks().then((list) => {
@@ -238,10 +233,22 @@ export const App: React.FC = () => {
}, [refresh])
const vms = state?.vms ?? []
const existingVMNames = new Set(vms.map((v) => v.name))
const creatingTasks = creatingVMTasks(taskMap, existingVMNames)
const creatingByName = new Map(creatingTasks.map((t) => [t.subject, t]))
const creatingItems: { name: string; task?: Task }[] = [
...creatingTasks.map((t) => ({ name: t.subject, task: t })),
...pendingCreates
.filter((name) => !existingVMNames.has(name) && !creatingByName.has(name))
.map((name) => ({ name })),
]
const runningVMCount = vms.filter((v) => (state?.transitions[vmRefKey(v)] ?? v.state) === 'running').length
const selectedVM = !PAGE_IDS.includes(selected)
? vms.find((v) => vmRefKey(v) === selected) ?? vms.find((v) => v.name === selected)
: undefined
const selectedCreating = !selectedVM && !PAGE_IDS.includes(selected)
? creatingItems.find((item) => item.name === selected)
: undefined
const selectedIsMacOS = !!selectedVM && isMacOSDriver(selectedVM.driver_id)
const selectedTransition = state?.transitions[selectedVM ? vmRefKey(selectedVM) : '']
@@ -354,8 +361,15 @@ export const App: React.FC = () => {
useEffect(() => {
if (!selectedVM || !selectedIsMacOS) { setDetail(null); return }
api.GetVMDetail(selectedVM.name).then(setDetail).catch(() => setDetail(null))
}, [selectedVM?.name, selectedVM?.driver_id, selectedVM?.state, selectedTransition, selectedIsMacOS, detailRevision])
let live = true
api.GetVMDetail(selectedVM.name)
.then((d) => { if (live) setDetail(d) })
.catch((e) => {
console.warn('[app] GetVMDetail failed:', selectedVM.name, e)
if (live) setDetail(null)
})
return () => { live = false }
}, [selectedVM?.name, selectedVM?.driver_id, selectedVM?.state, selectedTransition, selectedIsMacOS, detailRevision, state?.active_runtime?.commit, state?.runtime_capture_supported])
useEffect(() => {
if (!selectedVM || selectedIsMacOS) { setVMInfoLoaded(null); return }
@@ -451,6 +465,17 @@ export const App: React.FC = () => {
useEffect(() => () => { disposeActiveThemeAndLocaleFonts() }, [])
const tr = (k: I18nKey, v?: Record<string, string | number>) => t(locale, k, v)
const pushToast = toasts.push
useEffect(() => events.onRuntimeWarning((message) => {
const { summary, code, rawDetail } = parseAppError(message)
pushToast({
kind: 'warning',
title: summary,
errorCode: code,
rawDetail,
detailsLabel: t(locale, 'errRawDetailsToggle'),
copyDetailsLabel: t(locale, 'errCopyDetails'),
})
}), [locale, pushToast])
useEffect(() => events.onHostDrop(({ delivered, mode }) => {
if (mode !== 'l1_share' || delivered.length === 0) return
const title = delivered.length === 1
@@ -462,6 +487,7 @@ export const App: React.FC = () => {
const effectiveState = selectedVM ? (state?.transitions[vmRefKey(selectedVM)] ?? selectedVM.state) : ''
const pending = selectedVM ? (state?.pending_changes[vmRefKey(selectedVM)] ?? []) : []
const fixedModeSupported = state?.active_runtime?.manifest.capabilities?.some((c) => c.trim().toLowerCase() === 'display-fixed-mode') ?? false
const diskCacheSupported = state?.active_runtime?.manifest.capabilities?.some((c) => c.trim().toLowerCase() === 'win32-native-aio') ?? false
const stambhaAvailable = hasStambhaRuntime(state?.runtimes)
const hostReady = !!state && state.host.whpx === 'ready' && (!!state.active_runtime || stambhaAvailable)
const canSuspend = state?.can_suspend ?? false
@@ -506,13 +532,40 @@ export const App: React.FC = () => {
const setChannel = (alpha: boolean) => {
api.SetRuntimeChannel(alpha ? 'alpha' : 'stable').then(() => refresh()).catch((e) => fail(tr('failGeneric'), e))
}
const appChannelSeqRef = useRef(0)
const appChannelPendingRef = useRef<'stable' | 'alpha' | 'dev' | null>(null)
const appChannelFlushRef = useRef<Promise<void> | null>(null)
const appUpdateChannel = state?.config.app_update_channel === 'alpha' || state?.config.app_update_channel === 'dev'
? state.config.app_update_channel
: 'stable'
const setAppUpdateChannel = async (ch: 'stable' | 'alpha' | 'dev') => {
await api.SetAppUpdateChannel(ch)
await refresh()
await update.recheck()
const seq = ++appChannelSeqRef.current
setState((prev) => (prev ? { ...prev, config: { ...prev.config, app_update_channel: ch } } : prev))
appChannelPendingRef.current = ch
if (!appChannelFlushRef.current) {
appChannelFlushRef.current = (async () => {
while (appChannelPendingRef.current !== null) {
const target = appChannelPendingRef.current
appChannelPendingRef.current = null
await api.SetAppUpdateChannel(target)
}
})().finally(() => {
appChannelFlushRef.current = null
})
}
try {
await appChannelFlushRef.current
} catch (e) {
if (appChannelSeqRef.current === seq) {
appChannelPendingRef.current = null
void refresh()
throw e
}
return
}
if (appChannelSeqRef.current !== seq) return
await update.recheck(false)
if (appChannelSeqRef.current === seq) void refresh()
}
const cancelTask = (id: string) => { api.CancelTask(id).catch((e) => fail(tr('failGeneric'), e)) }
@@ -535,13 +588,20 @@ export const App: React.FC = () => {
await api.InstallRuntimeArchive(file)
await refresh()
} catch (e) {
if (parseAppError(e).code === 'E_RUNTIME_ACTIVATION') await refresh()
fail(tr('failRuntime'), e)
}
}
const folderDone = async () => {
const s = await api.GetState().catch(() => null)
if (s) setState(s)
setSetupStage(s?.active_runtime || hasStambhaRuntime(s?.runtimes) ? null : 'runtime')
try {
const s = await api.GetState()
setState(s)
setSetupStage(s?.active_runtime || hasStambhaRuntime(s?.runtimes) ? null : 'runtime')
} catch (e) {
console.warn('[app] GetState after setup failed:', e)
fail(tr('failGeneric'), e)
setSetupStage('runtime')
}
}
const showSetup = !!state && (state.needs_setup || setupStage === 'runtime')
// The data folder opened read-only (internal/dataroot): nothing in it may be
@@ -654,8 +714,10 @@ export const App: React.FC = () => {
const loadQemu = (name?: string) => loadVMLog(false, name)
const fail = (title: string, e: unknown) => {
const toast = errorToast(locale, title, e)
toasts.push({
...errorToast(locale, title, e),
...toast,
title: toast.errorCode === 'E_RUNTIME_ACTIVATION' ? tr('runtimeActivationFailed') : title,
action: { label: tr('viewLogs'), onClick: () => openLogs('app') },
})
}
@@ -897,6 +959,7 @@ export const App: React.FC = () => {
defaultName = `macos-tahoe-${i}`
}
const isOffline = item.kind === 'offline' && !!item.version
const graphics = state.host.recommended_gpu ? 'reims-vgpu' : 'vmware-svga'
setWizardDraft({
step: 1,
opts: {
@@ -911,9 +974,9 @@ export const App: React.FC = () => {
disk_size: '128G',
disk_mode: 'copy',
disk_controller: 'nvme',
graphics: 'reims-vgpu',
graphics,
gpu: state.host.recommended_gpu?.vulkan_icd ?? 'auto',
resolution: recommendedResolution(state.host),
...initialWizardResolution(state.host, fixedModeSupported, graphics),
displays: 1,
borderless: false,
capture: false,
@@ -929,13 +992,15 @@ export const App: React.FC = () => {
setShowWizard(true)
}
// The wizard closes as soon as the create starts; progress lives in the status bar
// (vm-create task). On failure or cancel the toast offers returning to the wizard.
// The wizard closes as soon as the create starts; progress shows in the sidebar,
// main view, and status bar. On failure or cancel the toast offers returning to the wizard.
const submitCreate = (payload: CreateOpts, draft: WizardDraft) => {
setShowWizard(false)
setWizardDraft(null)
const name = payload.name
const hasDownload = payload.source_mode === 'offline' || payload.source_mode === 'apple'
setPendingCreates((prev) => (prev.includes(name) ? prev : [...prev, name]))
setSelected(name)
api.CreateVM(payload)
.then(() => {
toasts.push({ kind: 'ok', title: tr('toastCreated', { name }) })
@@ -968,6 +1033,9 @@ export const App: React.FC = () => {
action: { label: tr('backToEdit'), onClick: () => { setWizardDraft(draft); setShowWizard(true) } },
})
})
.finally(() => {
setPendingCreates((prev) => prev.filter((item) => item !== name))
})
}
const copy = async (text: string) => {
@@ -1172,6 +1240,7 @@ export const App: React.FC = () => {
safeMode={state?.safe_mode}
updateDot={!!update.info?.has_update}
pluginViews={sidebarPluginViews}
creatingVMs={creatingItems.map((item) => ({ name: item.name, percent: item.task?.percent ?? -1 }))}
updateCard={update.shown ? (
<UpdateCapsule
locale={locale}
@@ -1236,6 +1305,14 @@ export const App: React.FC = () => {
onOpenView={openView}
onNavigate={navigateHost}
/>
) : selectedCreating ? (
<CreatingVMView
locale={locale}
name={selectedCreating.name}
task={selectedCreating.task}
onCancel={cancelTask}
onViewLogs={() => openLogs('app')}
/>
) : selectedVM ? (
<>
{renderVMTabs()}
@@ -1336,6 +1413,7 @@ export const App: React.FC = () => {
runtimeTask={runtimeTask}
onChannel={setChannel}
onInstallRuntime={installRuntime}
onImportRuntime={importRuntime}
onCancelTask={cancelTask}
/>
)}
@@ -1371,147 +1449,80 @@ export const App: React.FC = () => {
/>
)}
{showWizard && state && (
<Suspense fallback={null}>
<CreateWizard
locale={locale}
host={state.host}
fixedModeSupported={fixedModeSupported}
initialDriverID={!state.active_runtime && stambhaAvailable ? STAMBHA_DRIVER_ID : undefined}
tasks={Object.values(taskMap)}
draft={wizardDraft}
onClose={() => { setShowWizard(false); setWizardDraft(null) }}
onSubmit={submitCreate}
/>
</Suspense>
)}
{showSettings && state && detail && (
<Suspense fallback={null}>
<SettingsModal
locale={locale}
detail={detail}
driverID={selectedVM?.driver_id ?? ''}
stats={latestVMStats(selectedVM?.driver_id ?? '', detail.name)}
host={state.host}
fixedModeSupported={fixedModeSupported}
optimizations={state.optimizations}
running={effectiveState === 'running'}
onCopy={copy}
onDiskChanged={refresh}
onOpenAffinity={() => setAffinityTarget({ name: detail.name, driverID: selectedVM?.driver_id ?? '' })}
affinityVersion={affinityVersion}
onHostChanged={refresh}
onToast={toasts.push}
onClose={() => setShowSettings(false)}
onSaved={() => {
setShowSettings(false)
toasts.push({ kind: 'ok', title: tr(effectiveState === 'running' ? 'toastSavedNextStart' : 'toastSaved') })
refresh()
}}
/>
</Suspense>
)}
{affinityTarget && state && (
<Suspense fallback={null}>
<AffinityDialog
locale={locale}
vmName={affinityTarget.name}
driverID={affinityTarget.driverID}
vcpus={detail?.name === affinityTarget.name ? detail.cpus : 4}
host={state.host}
globalAutoPin={state.config.auto_pin_pcores}
onClose={() => setAffinityTarget(null)}
onApplied={(st) => {
setAffinityTarget(null)
setAffinityVersion((v) => v + 1)
const count = st.effective_cpus?.length ?? 0
const mask = st.live_mask_hex || st.effective_mask_hex || '0x0'
toasts.push({
kind: 'ok',
title: st.running
? tr('toastAffinityApplied', { count, mask })
: tr('toastAffinitySaved'),
})
refresh()
}}
/>
</Suspense>
)}
{update.confirming && (
<Modal
title={tr('updateConfirmTitle', { v: update.info?.latest ?? '' })}
closeLabel={tr('close')}
onClose={() => update.cancelInstall()}
>
<div className="stack-2" style={{ padding: 'var(--sp-4)', fontSize: 'var(--fs-13)', color: 'var(--text-2)' }}>
<p style={{ margin: 0 }}>{tr('updateConfirmBody', { n: runningVMCount })}</p>
{state?.host.needs_cold_reboot_workaround && <p style={{ margin: 0 }}>{tr('updateConfirmWin10')}</p>}
</div>
<div className="dialog-foot">
<span />
<span className="hstack">
<Button variant="ghost" onClick={() => update.cancelInstall()}>{tr('cancel')}</Button>
<Button variant="primary" onClick={update.confirmInstall}>{tr('updateRestart')}</Button>
</span>
</div>
</Modal>
)}
{deleteTarget && (
<DeleteDialog locale={locale} name={findVM(deleteTarget)?.name ?? deleteTarget} onCancel={() => setDeleteTarget(null)} onConfirm={confirmDelete} />
)}
{closeDownloadsOpen && (
<ConfirmDialog
title={tr('closeDownloadsTitle')}
description={tr('closeDownloadsDesc')}
cancelLabel={tr('cancel')}
confirmLabel={tr('closeDownloadsConfirm')}
onCancel={() => setCloseDownloadsOpen(false)}
onConfirm={() => { setCloseDownloadsOpen(false); void api.QuitApp() }}
/>
)}
{elevationQueue.length > 0 && (
<ElevationDialog
key={elevationQueue[0].id}
locale={locale}
request={elevationQueue[0]}
onResolve={(approved) => {
const active = elevationQueue[0]
setElevationQueue((q) => q.filter((item) => item.id !== active.id))
api.ResolveElevationRequest(active.id, approved).catch((e) => console.warn('[app] ResolveElevationRequest failed:', e))
}}
/>
)}
{discardSuspendTarget && (() => {
const targetVM = findVM(discardSuspendTarget)
const targetName = targetVM?.name ?? discardSuspendTarget
return (
<ConfirmDialog
title={tr('discardSuspendTitle', { name: displayNames[targetVM ? vmRefKey(targetVM) : targetName] || targetName })}
description={tr('discardSuspendDesc')}
cancelLabel={tr('cancel')}
confirmLabel={tr('discardSuspendConfirm')}
onCancel={() => setDiscardSuspendTarget(null)}
onConfirm={confirmDiscardSuspend}
/>
)
})()}
{cloneSource && (
<CloneDialog
locale={locale}
sourceName={cloneSource.name}
defaultCloneName={`${cloneSource.name}-clone`}
onCancel={() => setCloneSource(null)}
onConfirm={confirmClone}
/>
)}
<AppDialogs
locale={locale}
state={state}
detail={detail}
selectedVM={selectedVM}
selectedIsMacOS={selectedIsMacOS}
effectiveState={effectiveState}
fixedModeSupported={fixedModeSupported}
diskCacheSupported={diskCacheSupported}
runningVMCount={runningVMCount}
tasks={Object.values(taskMap)}
displayNames={displayNames}
showWizard={showWizard}
wizardDraft={wizardDraft}
onCloseWizard={() => { setShowWizard(false); setWizardDraft(null) }}
onSubmitCreate={submitCreate}
showSettings={showSettings}
onCloseSettings={() => setShowSettings(false)}
onSavedSettings={() => {
setShowSettings(false)
toasts.push({ kind: 'ok', title: tr(effectiveState === 'running' ? 'toastSavedNextStart' : 'toastSaved') })
refresh()
}}
affinityTarget={affinityTarget}
affinityVersion={affinityVersion}
onOpenAffinity={setAffinityTarget}
onCloseAffinity={() => setAffinityTarget(null)}
onAffinityApplied={(st) => {
setAffinityTarget(null)
setAffinityVersion((v) => v + 1)
const count = st.effective_cpus?.length ?? 0
const mask = st.live_mask_hex || st.effective_mask_hex || '0x0'
toasts.push({
kind: 'ok',
title: st.running
? tr('toastAffinityApplied', { count, mask })
: tr('toastAffinitySaved'),
})
refresh()
}}
updateConfirming={update.confirming}
updateLatest={update.info?.latest ?? ''}
onCancelInstallUpdate={() => update.cancelInstall()}
onConfirmInstallUpdate={update.confirmInstall}
deleteTarget={deleteTarget}
onCancelDelete={() => setDeleteTarget(null)}
onConfirmDelete={confirmDelete}
closeDownloadsOpen={closeDownloadsOpen}
onCancelCloseDownloads={() => setCloseDownloadsOpen(false)}
elevationQueue={elevationQueue}
onResolveElevation={(id, approved) => {
setElevationQueue((q) => q.filter((item) => item.id !== id))
api.ResolveElevationRequest(id, approved).catch((e) => console.warn('[app] ResolveElevationRequest failed:', e))
}}
discardSuspendTarget={discardSuspendTarget}
onCancelDiscardSuspend={() => setDiscardSuspendTarget(null)}
onConfirmDiscardSuspend={confirmDiscardSuspend}
cloneSource={cloneSource}
onCancelClone={() => setCloneSource(null)}
onConfirmClone={confirmClone}
sendTextTarget={sendTextTarget}
onCancelSendText={() => setSendTextTarget(null)}
onConfirmSendText={(key, driverID, name, text) => {
setSendTextTarget(null)
typeInto(key, () => api.TypeText(driverID, name, text))
}}
pluginDialogs={pluginViewState.dialogs}
findRouteView={findRouteView}
renderPluginView={renderPluginView}
findVM={findVM}
onCopy={copy}
onRefresh={refresh}
onToast={toasts.push}
/>
{onlineRecoveryTarget && (
<OnlineRecoveryDialog
@@ -1522,30 +1533,6 @@ export const App: React.FC = () => {
/>
)}
{sendTextTarget && (() => {
const sendVM = findVM(sendTextTarget)
const sendName = sendVM?.name ?? sendTextTarget
return (
<SendTextDialog
locale={locale}
vmName={sendName}
guestToolsConnected={Boolean(latestVMStats(sendVM?.driver_id ?? '', sendName)?.guest_tools_connected ?? (selectedIsMacOS ? detail?.guest_tools_connected : false))}
onCancel={() => setSendTextTarget(null)}
onConfirm={(text) => {
const target = sendTextTarget
setSendTextTarget(null)
typeInto(sendVM ? vmRefKey(sendVM) : target, () => api.TypeText(sendVM?.driver_id ?? '', sendName, text))
}}
/>
)
})()}
{/* Every open dialog stays mounted so the ones underneath keep their state. */}
{pluginViewState.dialogs.map((route) => {
const view = findRouteView(route)
return view && renderPluginView(route, view, true)
})}
<div className="rg-layer rg-layer-overlay" data-rg-layer="layer.overlay" aria-hidden="true" />
</div>
{/* Outside the isolated shell so toasts stay above dialogs and the overlay layer. */}
+28 -34
View File
@@ -43,7 +43,6 @@ export const AboutPage: React.FC<Props> = ({
}) => {
const tr = (k: I18nKey, v?: Record<string, string | number>) => t(locale, k, v)
const [checkingUpdate, setCheckingUpdate] = useState(false)
const [switchingChannel, setSwitchingChannel] = useState(false)
const [updateErr, setUpdateErr] = useState('')
const [qqInstalled, setQQInstalled] = useState<boolean | null>(null)
const [openingQQ, setOpeningQQ] = useState(false)
@@ -99,7 +98,10 @@ export const AboutPage: React.FC<Props> = ({
let cancelled = false
api.CanOpenQQGroup()
.then((ok) => { if (!cancelled) setQQInstalled(!!ok) })
.catch(() => { if (!cancelled) setQQInstalled(false) })
.catch((e) => {
console.warn('[about] CanOpenQQGroup failed:', e)
if (!cancelled) setQQInstalled(false)
})
return () => {
mountedRef.current = false
cancelled = true
@@ -128,54 +130,53 @@ export const AboutPage: React.FC<Props> = ({
}
const handleChannelChange = async (next: AppUpdateChannel) => {
if (next === appUpdateChannel || switchingChannel) return
setSwitchingChannel(true)
if (next === appUpdateChannel) return
setUpdateErr('')
try {
await onAppUpdateChannel(next)
} catch (e) {
setUpdateErr(String(e).replace(/^Error:\s*/, ''))
} finally {
setSwitchingChannel(false)
}
}
const version = appVersion ?? appUpdate?.current ?? ''
const visibleUpdate = appUpdate && (!appUpdate.channel || appUpdate.channel === appUpdateChannel) ? appUpdate : null
const visiblePhase: UpdatePhase = visibleUpdate ? updatePhase : 'none'
const version = appVersion ?? visibleUpdate?.current ?? ''
const pct = updateTask && updateTask.percent >= 0 ? Math.round(updateTask.percent) : null
const updateAvailableKey: I18nKey = appUpdate?.channel === 'dev'
const updateAvailableKey: I18nKey = visibleUpdate?.channel === 'dev'
? 'appUpdateAvailableDev'
: appUpdate?.channel === 'alpha'
: visibleUpdate?.channel === 'alpha'
? 'appUpdateAvailableAlpha'
: 'appUpdateAvailable'
let updateSub: React.ReactNode = null
if (updatePhase === 'downloading') {
if (visiblePhase === 'downloading') {
updateSub = (
<>
<div className="row-sub">{tr('updateDownloadingSub', { v: appUpdate?.latest ?? '' })}{updateTask && taskDetail(updateTask) ? ` · ${taskDetail(updateTask)}` : ''}</div>
<div className="row-sub">{tr('updateDownloadingSub', { v: visibleUpdate?.latest ?? '' })}{updateTask && taskDetail(updateTask) ? ` · ${taskDetail(updateTask)}` : ''}</div>
<span className="progress rg-p-progress about-update-progress" aria-hidden="true">
<span className="progress-fill" style={{ transform: `scaleX(${(pct ?? 0) / 100})` }} />
</span>
</>
)
} else if (updatePhase === 'ready') {
updateSub = <div className="row-sub">{tr('updateReadySub', { v: appUpdate?.latest ?? '' })}</div>
} else if (updatePhase === 'failed') {
} else if (visiblePhase === 'ready') {
updateSub = <div className="row-sub">{tr('updateReadySub', { v: visibleUpdate?.latest ?? '' })}</div>
} else if (visiblePhase === 'failed') {
updateSub = <div className="row-sub warn-text" title={updateTask?.error}>{tr('updateFailedSub')}</div>
} else if (appUpdate?.has_update) {
updateSub = <div className="row-sub">{tr(updateAvailableKey, { v: appUpdate.latest })}</div>
} else if (visibleUpdate?.has_update) {
updateSub = <div className="row-sub">{tr(updateAvailableKey, { v: visibleUpdate.latest })}</div>
} else if (updateErr) {
updateSub = <div className="row-sub" title={updateErr}>{tr('appUpdateLookupFailed')}</div>
}
let updateAction: React.ReactNode
if (updatePhase === 'downloading') {
if (visiblePhase === 'downloading') {
updateAction = <Button onClick={onCancelUpdate}>{tr('updateCancel')}</Button>
} else if (updatePhase === 'ready') {
} else if (visiblePhase === 'ready') {
updateAction = <Button variant="primary" busy={installing} onClick={onInstallUpdate}>{tr('updateRestart')}</Button>
} else if (updatePhase === 'failed') {
} else if (visiblePhase === 'failed') {
updateAction = <Button variant="primary" icon={<RotateCw size={14} aria-hidden="true" />} onClick={onDownloadUpdate}>{tr('updateRetry')}</Button>
} else if (updatePhase === 'available') {
} else if (visiblePhase === 'available') {
updateAction = <Button variant="primary" icon={<Download size={14} aria-hidden="true" />} onClick={onDownloadUpdate}>{tr('updateDownloadInstall')}</Button>
} else {
updateAction = <Button busy={checkingUpdate} onClick={() => void runUpdateCheck(true)}>{tr('appCheckUpdate')}</Button>
@@ -197,15 +198,15 @@ export const AboutPage: React.FC<Props> = ({
<div className="row-main">
<div className="row-title">
{tr('appVersionTitle')} <span className="mono">{version}</span>
{appUpdate && !appUpdate.has_update && (
{visibleUpdate && !visibleUpdate.has_update && (
<span className="badge rg-p-badge badge-ok">{tr('appUpToDate')}</span>
)}
</div>
{updateSub}
</div>
<div className="row-right">
{appUpdate?.has_update && appUpdate.page_url && (
<Button variant="ghost" icon={<ExternalLink size={14} aria-hidden="true" />} onClick={() => openURL(appUpdate.page_url!)}>
{visibleUpdate?.has_update && visibleUpdate.page_url && (
<Button variant="ghost" icon={<ExternalLink size={14} aria-hidden="true" />} onClick={() => openURL(visibleUpdate.page_url!)}>
{tr('updateReleaseNotes')}
</Button>
)}
@@ -229,9 +230,9 @@ export const AboutPage: React.FC<Props> = ({
value={appUpdateChannel}
onChange={(v) => void handleChannelChange(v)}
options={[
{ value: 'stable' as AppUpdateChannel, label: tr('appUpdateChannelStable'), disabled: switchingChannel || checkingUpdate || updatePhase === 'downloading' || installing },
{ value: 'alpha' as AppUpdateChannel, label: tr('appUpdateChannelAlpha'), disabled: switchingChannel || checkingUpdate || updatePhase === 'downloading' || installing },
{ value: 'dev' as AppUpdateChannel, label: tr('appUpdateChannelDev'), disabled: switchingChannel || checkingUpdate || updatePhase === 'downloading' || installing },
{ value: 'stable' as AppUpdateChannel, label: tr('appUpdateChannelStable'), disabled: updatePhase === 'downloading' || installing },
{ value: 'alpha' as AppUpdateChannel, label: tr('appUpdateChannelAlpha'), disabled: updatePhase === 'downloading' || installing },
{ value: 'dev' as AppUpdateChannel, label: tr('appUpdateChannelDev'), disabled: updatePhase === 'downloading' || installing },
]}
/>
</div>
@@ -245,7 +246,6 @@ export const AboutPage: React.FC<Props> = ({
<div className="row">
<div className="row-main">
<div className="row-title">{tr('helpWebsite')}</div>
<div className="row-sub">{tr('aboutWebsiteSub')}</div>
</div>
<div className="row-right">
<Button icon={<ExternalLink size={14} aria-hidden="true" />} onClick={() => openURL(siteURL(locale))}>
@@ -256,7 +256,6 @@ export const AboutPage: React.FC<Props> = ({
<div className="row">
<div className="row-main">
<div className="row-title">{tr('helpProjectPage')}</div>
<div className="row-sub">{tr('aboutProjectSub')}</div>
</div>
<div className="row-right">
<Button icon={<ExternalLink size={14} aria-hidden="true" />} onClick={() => openURL(REPO_URL)}>
@@ -267,7 +266,6 @@ export const AboutPage: React.FC<Props> = ({
<div className="row">
<div className="row-main">
<div className="row-title">{tr('helpReportIssue')}</div>
<div className="row-sub">{tr('aboutIssueSub')}</div>
</div>
<div className="row-right">
<Button icon={<ExternalLink size={14} aria-hidden="true" />} onClick={() => openURL(`${REPO_URL}/issues`)}>
@@ -278,7 +276,6 @@ export const AboutPage: React.FC<Props> = ({
<div className="row">
<div className="row-main">
<div className="row-title">{tr('aboutLicensesTitle')}</div>
<div className="row-sub">{tr('aboutLicensesSub')}</div>
</div>
<div className="row-right">
<Button icon={<Scale size={14} aria-hidden="true" />} onClick={() => void openLicenses()}>
@@ -292,7 +289,6 @@ export const AboutPage: React.FC<Props> = ({
<div className="row">
<div className="row-main">
<div className="row-title">{tr('aboutDiscord')}</div>
<div className="row-sub">{tr('aboutDiscordSub')}</div>
</div>
<div className="row-right">
{onCopy && (
@@ -320,9 +316,7 @@ export const AboutPage: React.FC<Props> = ({
<div className="row-sub">{tr('aboutQQNotInstalledSub')}</div>
) : qqLaunchErr ? (
<div className="row-sub" title={qqLaunchErr}>{tr('aboutQQLaunchFailed')}</div>
) : (
<div className="row-sub">{tr('aboutQQGroupSub')}</div>
)}
) : null}
</div>
<div className="row-right">
{qqInstalled && !qqLaunchErr ? (
+37 -18
View File
@@ -1,5 +1,5 @@
import { AlertTriangle, Check, Cpu } from 'lucide-react'
import React, { useEffect, useMemo, useState } from 'react'
import React, { useEffect, useMemo, useRef, useState } from 'react'
import '../i18n/domains/settings.gen'
import { I18nKey, parseAppError, t } from '../i18n'
import { HostReport, Locale, LogicalCPUInfo, VMAffinityMode, VMAffinityStatus } from '../types'
@@ -85,12 +85,15 @@ export const AffinityDialog: React.FC<Props> = ({
const tr = (k: I18nKey, v?: Record<string, string | number>) => t(locale, k, v)
const topology = useMemo(() => buildTopology(host), [host])
const allIndices = useMemo(() => topology.map((c) => c.index), [topology])
const allIndicesRef = useRef(allIndices)
allIndicesRef.current = allIndices
const hasSMT = useMemo(() => topology.some((c) => c.smt), [topology])
const [status, setStatus] = useState<VMAffinityStatus | null>(null)
const [loading, setLoading] = useState(true)
const [saving, setSaving] = useState(false)
const [err, setErr] = useState('')
const [reloadSeq, setReloadSeq] = useState(0)
const [mode, setMode] = useState<VMAffinityMode>('auto')
const [selected, setSelected] = useState<number[]>(allIndices)
@@ -98,6 +101,7 @@ export const AffinityDialog: React.FC<Props> = ({
useEffect(() => {
let live = true
setStatus(null)
setLoading(true)
setErr('')
api.GetVMAffinity(driverID, vmName)
@@ -107,7 +111,7 @@ export const AffinityDialog: React.FC<Props> = ({
setMode(st.mode || 'auto')
const initial = st.mode === 'custom' && st.cpus?.length > 0
? st.cpus
: (st.effective_cpus?.length > 0 ? st.effective_cpus : allIndices)
: (st.effective_cpus?.length > 0 ? st.effective_cpus : allIndicesRef.current)
setSelected([...initial].sort((a, b) => a - b))
setDisableEcoQoS(st.disable_eco_qos)
})
@@ -118,13 +122,16 @@ export const AffinityDialog: React.FC<Props> = ({
if (live) setLoading(false)
})
return () => { live = false }
}, [vmName, allIndices])
}, [driverID, vmName, reloadSeq])
const locked = loading || saving || !status
const loadFailed = !loading && !status && !!err
const selectedSet = useMemo(() => new Set(selected), [selected])
const effectiveVCPUs = status?.vcpus || vcpus
const maskHex = useMemo(() => maskHexFromCPUs(selected), [selected])
const applyPreset = (nextMode: VMAffinityMode) => {
if (locked) return
setMode(nextMode)
setErr('')
switch (nextMode) {
@@ -150,6 +157,7 @@ export const AffinityDialog: React.FC<Props> = ({
}
const toggleCPU = (idx: number) => {
if (locked) return
setMode('custom')
setErr('')
setSelected((prev) => {
@@ -161,6 +169,7 @@ export const AffinityDialog: React.FC<Props> = ({
}
const pickCustomList = (list: number[]) => {
if (locked) return
setMode('custom')
setErr('')
setSelected([...new Set(list)].sort((a, b) => a - b))
@@ -178,12 +187,12 @@ export const AffinityDialog: React.FC<Props> = ({
return out
}, [topology])
const modeOptions: { value: VMAffinityMode; label: string }[] = [
{ value: 'auto', label: tr('affinityModeAuto') },
{ value: 'all', label: tr('affinityModeAll') },
...(host.has_hybrid_cores ? [{ value: 'pcores' as const, label: tr('affinityModePCores') }] : []),
...((host.lpe_core_count ?? 0) > 0 ? [{ value: 'non_lpe' as const, label: tr('affinityModeNonLPE') }] : []),
{ value: 'custom', label: tr('affinityModeCustom') },
const modeOptions: { value: VMAffinityMode; label: string; disabled?: boolean }[] = [
{ value: 'auto', label: tr('affinityModeAuto'), disabled: locked },
{ value: 'all', label: tr('affinityModeAll'), disabled: locked },
...(host.has_hybrid_cores ? [{ value: 'pcores' as const, label: tr('affinityModePCores'), disabled: locked }] : []),
...((host.lpe_core_count ?? 0) > 0 ? [{ value: 'non_lpe' as const, label: tr('affinityModeNonLPE'), disabled: locked }] : []),
{ value: 'custom', label: tr('affinityModeCustom'), disabled: locked },
]
const modeHintKey: Record<VMAffinityMode, I18nKey> = {
@@ -199,6 +208,7 @@ export const AffinityDialog: React.FC<Props> = ({
const allSelected = selected.length === allIndices.length && allIndices.length > 0
const handleSave = async () => {
if (locked) return
if (emptyCustom) {
setErr(tr('affinityNeedOne'))
return
@@ -254,7 +264,7 @@ export const AffinityDialog: React.FC<Props> = ({
<button
type="button"
className={`affinity-chip${allSelected ? ' is-active' : ''}`}
disabled={loading || saving}
disabled={locked}
onClick={() => pickCustomList(allSelected ? [allIndices[0]] : allIndices)}
>
{tr('affinitySelectAll')}
@@ -263,7 +273,7 @@ export const AffinityDialog: React.FC<Props> = ({
<button
type="button"
className="affinity-chip"
disabled={loading || saving}
disabled={locked}
onClick={() => pickCustomList(physicalOnlyList)}
>
{tr('affinityPhysicalOnly')}
@@ -273,7 +283,7 @@ export const AffinityDialog: React.FC<Props> = ({
<button
type="button"
className="affinity-chip"
disabled={loading || saving}
disabled={locked}
onClick={() => pickCustomList(allIndices.filter((i) => i !== 0))}
>
{tr('affinityExcludeCPU0')}
@@ -283,7 +293,7 @@ export const AffinityDialog: React.FC<Props> = ({
<button
type="button"
className="affinity-chip"
disabled={loading || saving}
disabled={locked}
onClick={() => pickCustomList(topology.filter((c) => c.tier === 'p').map((c) => c.index))}
>
{tr('affinityOnlyPCores')}
@@ -293,7 +303,7 @@ export const AffinityDialog: React.FC<Props> = ({
<button
type="button"
className="affinity-chip"
disabled={loading || saving}
disabled={locked}
onClick={() => pickCustomList(topology.filter((c) => c.tier !== 'lpe').map((c) => c.index))}
>
{tr('affinityAvoidLPE')}
@@ -311,7 +321,7 @@ export const AffinityDialog: React.FC<Props> = ({
type="button"
role="checkbox"
aria-checked={checked}
disabled={loading || saving}
disabled={locked}
className={`affinity-cpu${checked ? ' is-checked' : ''}${cpu.tier === 'lpe' ? ' is-lpe' : ''}`}
onClick={() => toggleCPU(cpu.index)}
>
@@ -357,12 +367,21 @@ export const AffinityDialog: React.FC<Props> = ({
<Switch
label={tr('affinityEcoQoS')}
checked={disableEcoQoS}
disabled={loading || saving}
disabled={locked}
onChange={setDisableEcoQoS}
/>
</div>
{err && <div className="notice notice-error" role="alert">{err}</div>}
{err && (
<div className="notice notice-error" role="alert">
<span className="notice-main">{err}</span>
{loadFailed && (
<Button onClick={() => setReloadSeq((n) => n + 1)}>
{tr('installersRetry')}
</Button>
)}
</div>
)}
</div>
<div className="dialog-foot">
@@ -370,7 +389,7 @@ export const AffinityDialog: React.FC<Props> = ({
<Button
variant="primary"
busy={saving}
disabled={loading || emptyCustom}
disabled={loading || !status || emptyCustom}
onClick={() => void handleSave()}
>
{status?.running ? tr('affinityApplyNow') : tr('affinitySave')}
+259
View File
@@ -0,0 +1,259 @@
import React, { Suspense, lazy } from 'react'
import type { WizardDraft } from './CreateWizard'
import { DeleteDialog } from './DeleteDialog'
import { ElevationDialog } from './ElevationDialog'
import { CloneDialog } from './CloneDialog'
import { SendTextDialog } from './SendTextDialog'
import { I18nKey, t } from '../i18n'
import { hasStambhaRuntime, STAMBHA_DRIVER_ID } from '../lib/endpoints'
import { latestVMStats } from '../lib/vmStats'
import { vmRefKey } from '../lib/vmRef'
import type { PluginViewRoute } from '../lib/pluginViewRouter'
import type { AppState, CreateOpts, Locale, Task, VMDetail, VMListItem, ViewContribution } from '../types'
import { Button } from '../ui/controls'
import { ConfirmDialog, Modal } from '../ui/dialog'
import type { ToastInput } from '../ui/toast'
import { api, type ElevationPrompt } from '../wails'
const CreateWizard = lazy(() => import('./CreateWizard').then((m) => ({ default: m.CreateWizard })))
const SettingsModal = lazy(() => import('./SettingsModal').then((m) => ({ default: m.SettingsModal })))
const AffinityDialog = lazy(() => import('./AffinityDialog').then((m) => ({ default: m.AffinityDialog })))
interface AppDialogsProps {
locale: Locale
state: AppState | null
detail: VMDetail | null
selectedVM: VMListItem | undefined
selectedIsMacOS: boolean
effectiveState: string
fixedModeSupported: boolean
diskCacheSupported: boolean
runningVMCount: number
tasks: Task[]
displayNames: Record<string, string>
showWizard: boolean
wizardDraft: WizardDraft | null
onCloseWizard: () => void
onSubmitCreate: (payload: CreateOpts, draft: WizardDraft) => void
showSettings: boolean
onCloseSettings: () => void
onSavedSettings: () => void
affinityTarget: { name: string; driverID: string } | null
affinityVersion: number
onOpenAffinity: (target: { name: string; driverID: string }) => void
onCloseAffinity: () => void
onAffinityApplied: (st: { running?: boolean; effective_cpus?: number[]; live_mask_hex?: string; effective_mask_hex?: string }) => void
updateConfirming: boolean
updateLatest: string
onCancelInstallUpdate: () => void
onConfirmInstallUpdate: () => void
deleteTarget: string | null
onCancelDelete: () => void
onConfirmDelete: (keepFiles: boolean) => void
closeDownloadsOpen: boolean
onCancelCloseDownloads: () => void
elevationQueue: ElevationPrompt[]
onResolveElevation: (id: string, approved: boolean) => void
discardSuspendTarget: string | null
onCancelDiscardSuspend: () => void
onConfirmDiscardSuspend: () => void
cloneSource: { name: string; driverID: string } | null
onCancelClone: () => void
onConfirmClone: (cloneName: string) => void
sendTextTarget: string | null
onCancelSendText: () => void
onConfirmSendText: (vmKey: string, driverID: string, vmName: string, text: string) => void
pluginDialogs: PluginViewRoute[]
findRouteView: (route: PluginViewRoute) => ViewContribution | undefined
renderPluginView: (route: PluginViewRoute, view: ViewContribution, asDialog: boolean) => React.ReactNode
findVM: (keyOrName: string) => VMListItem | undefined
onCopy: (text: string) => void
onRefresh: () => void
onToast: (toast: ToastInput) => void
}
export const AppDialogs: React.FC<AppDialogsProps> = (props) => {
const {
locale, state, detail, selectedVM, selectedIsMacOS, effectiveState,
fixedModeSupported, diskCacheSupported, runningVMCount, tasks, displayNames,
showWizard, wizardDraft, onCloseWizard, onSubmitCreate,
showSettings, onCloseSettings, onSavedSettings,
affinityTarget, affinityVersion, onOpenAffinity, onCloseAffinity, onAffinityApplied,
updateConfirming, updateLatest, onCancelInstallUpdate, onConfirmInstallUpdate,
deleteTarget, onCancelDelete, onConfirmDelete,
closeDownloadsOpen, onCancelCloseDownloads,
elevationQueue, onResolveElevation,
discardSuspendTarget, onCancelDiscardSuspend, onConfirmDiscardSuspend,
cloneSource, onCancelClone, onConfirmClone,
sendTextTarget, onCancelSendText, onConfirmSendText,
pluginDialogs, findRouteView, renderPluginView,
findVM, onCopy, onRefresh, onToast,
} = props
const tr = (k: I18nKey, v?: Record<string, string | number>) => t(locale, k, v)
return (
<>
{showWizard && state && (
<Suspense fallback={null}>
<CreateWizard
locale={locale}
host={state.host}
fixedModeSupported={fixedModeSupported}
captureSupported={state.runtime_capture_supported}
initialDriverID={!state.active_runtime && hasStambhaRuntime(state.runtimes) ? STAMBHA_DRIVER_ID : undefined}
tasks={tasks}
draft={wizardDraft}
onClose={onCloseWizard}
onSubmit={onSubmitCreate}
/>
</Suspense>
)}
{showSettings && state && detail && (
<Suspense fallback={null}>
<SettingsModal
key={`${selectedVM?.driver_id ?? ''}:${detail.name}`}
locale={locale}
detail={detail}
driverID={selectedVM?.driver_id ?? ''}
stats={latestVMStats(selectedVM?.driver_id ?? '', detail.name)}
host={state.host}
fixedModeSupported={fixedModeSupported}
diskCacheSupported={diskCacheSupported}
optimizations={state.optimizations}
running={effectiveState === 'running'}
onCopy={onCopy}
onDiskChanged={onRefresh}
onOpenAffinity={() => onOpenAffinity({ name: detail.name, driverID: selectedVM?.driver_id ?? '' })}
affinityVersion={affinityVersion}
onHostChanged={onRefresh}
onToast={onToast}
onClose={onCloseSettings}
onSaved={onSavedSettings}
/>
</Suspense>
)}
{affinityTarget && state && (
<Suspense fallback={null}>
<AffinityDialog
locale={locale}
vmName={affinityTarget.name}
driverID={affinityTarget.driverID}
vcpus={detail?.name === affinityTarget.name ? detail.cpus : 4}
host={state.host}
globalAutoPin={state.config.auto_pin_pcores}
onClose={onCloseAffinity}
onApplied={onAffinityApplied}
/>
</Suspense>
)}
{updateConfirming && (
<Modal
title={tr('updateConfirmTitle', { v: updateLatest })}
closeLabel={tr('close')}
onClose={onCancelInstallUpdate}
>
<div className="stack-2" style={{ padding: 'var(--sp-4)', fontSize: 'var(--fs-13)', color: 'var(--text-2)' }}>
<p style={{ margin: 0 }}>{tr('updateConfirmBody', { n: runningVMCount })}</p>
{state?.host.needs_cold_reboot_workaround && <p style={{ margin: 0 }}>{tr('updateConfirmWin10')}</p>}
</div>
<div className="dialog-foot">
<span />
<span className="hstack">
<Button variant="ghost" onClick={onCancelInstallUpdate}>{tr('cancel')}</Button>
<Button variant="primary" onClick={onConfirmInstallUpdate}>{tr('updateRestart')}</Button>
</span>
</div>
</Modal>
)}
{deleteTarget && (
<DeleteDialog
locale={locale}
name={findVM(deleteTarget)?.name ?? deleteTarget}
onCancel={onCancelDelete}
onConfirm={onConfirmDelete}
/>
)}
{closeDownloadsOpen && (
<ConfirmDialog
title={tr('closeDownloadsTitle')}
description={tr('closeDownloadsDesc')}
cancelLabel={tr('cancel')}
confirmLabel={tr('closeDownloadsConfirm')}
onCancel={onCancelCloseDownloads}
onConfirm={() => { onCancelCloseDownloads(); void api.QuitApp() }}
/>
)}
{elevationQueue.length > 0 && (
<ElevationDialog
key={elevationQueue[0].id}
locale={locale}
request={elevationQueue[0]}
onResolve={(approved) => onResolveElevation(elevationQueue[0].id, approved)}
/>
)}
{discardSuspendTarget && (() => {
const targetVM = findVM(discardSuspendTarget)
const targetName = targetVM?.name ?? discardSuspendTarget
return (
<ConfirmDialog
title={tr('discardSuspendTitle', { name: displayNames[targetVM ? vmRefKey(targetVM) : targetName] || targetName })}
description={tr('discardSuspendDesc')}
cancelLabel={tr('cancel')}
confirmLabel={tr('discardSuspendConfirm')}
onCancel={onCancelDiscardSuspend}
onConfirm={onConfirmDiscardSuspend}
/>
)
})()}
{cloneSource && (
<CloneDialog
locale={locale}
sourceName={cloneSource.name}
defaultCloneName={`${cloneSource.name}-clone`}
onCancel={onCancelClone}
onConfirm={onConfirmClone}
/>
)}
{sendTextTarget && (() => {
const sendVM = findVM(sendTextTarget)
const sendName = sendVM?.name ?? sendTextTarget
return (
<SendTextDialog
locale={locale}
vmName={sendName}
guestToolsConnected={Boolean(latestVMStats(sendVM?.driver_id ?? '', sendName)?.guest_tools_connected ?? (selectedIsMacOS ? detail?.guest_tools_connected : false))}
onCancel={onCancelSendText}
onConfirm={(text) => onConfirmSendText(sendVM ? vmRefKey(sendVM) : sendTextTarget, sendVM?.driver_id ?? '', sendName, text)}
/>
)
})()}
{/* Every open dialog stays mounted so the ones underneath keep their state. */}
{pluginDialogs.map((route) => {
const view = findRouteView(route)
return view && renderPluginView(route, view, true)
})}
</>
)
}
+43 -64
View File
@@ -123,9 +123,6 @@ export const AppSettingsPage: React.FC<Props> = ({
const pcoreOpt = findOptimization(optimizations, 'pcore_pin')
const missingFontScript = state.missing_font_hint || ''
const memSpecLabel = host.memory_spec?.speed_mhz
? `${host.memory_spec.speed_mhz} MHz${host.memory_spec.type_name ? ` ${host.memory_spec.type_name}` : ''}`
: ''
const guard = (fn: () => Promise<unknown>) => async () => {
try {
@@ -491,6 +488,49 @@ export const AppSettingsPage: React.FC<Props> = ({
<div className="page-title"><h1>{tr('sidebarSettings')}</h1></div>
</header>
<section className="section">
<div className="section-title">{tr('settingsAppearance')}</div>
<div className="list">
<div className="row">
<div className="row-main">
<div className="row-title">{tr('themeLabel')}</div>
{(!canDark || !canLight) && (
<div className="row-sub">{tr(!canDark ? 'themePluginDarkDisabled' : 'themePluginLightDisabled')}</div>
)}
</div>
<div className="row-right">
<Segmented
label={tr('themeLabel')}
value={themeMode}
onChange={onThemeMode}
options={[
{ value: 'light', label: tr('themeLight'), disabled: !canLight },
{ value: 'dark', label: tr('themeDark'), disabled: !canDark },
{ value: 'system', label: tr('themeSystem'), disabled: !canLight || !canDark },
]}
/>
</div>
</div>
<div className="row">
<div className="row-main">
<div className="row-title">{tr('language')}</div>
<div className="row-sub">{tr('languageSub')}</div>
{missingFontScript && (
<div className="row-sub warn-text">{tr('fontMissingFoDHint', { script: missingFontScript })}</div>
)}
</div>
<div className="row-right">
<PopupSelect
label={tr('language')}
value={config.locale || 'auto'}
onChange={onSetLocale}
options={getLocaleOptions(locales, locale, state.detected_locale)}
/>
</div>
</div>
</div>
</section>
<section className="section">
<div className="section-title">{tr('settingsGeneral')}</div>
<div className="list">
@@ -524,24 +564,6 @@ export const AppSettingsPage: React.FC<Props> = ({
/>
</div>
</div>
<div className="row">
<div className="row-main">
<div className="row-title">{tr('syncHostMemorySMBIOS')}</div>
<div className="row-sub">
{memSpecLabel
? tr('syncHostMemorySMBIOSSub', { spec: memSpecLabel })
: tr('syncHostMemorySMBIOSUnavailable')}
</div>
</div>
<div className="row-right">
<Switch
label={tr('syncHostMemorySMBIOS')}
disabled={!memSpecLabel}
checked={!!memSpecLabel && !!config.sync_host_memory_smbios}
onChange={(checked) => guard(() => api.SetSyncHostMemorySMBIOS(checked))()}
/>
</div>
</div>
<div className="row">
<div className="row-main">
<div className="row-title">{tr('minimizeToTray')}</div>
@@ -826,49 +848,6 @@ export const AppSettingsPage: React.FC<Props> = ({
</div>
</section>
<section className="section">
<div className="section-title">{tr('settingsAppearance')}</div>
<div className="list">
<div className="row">
<div className="row-main">
<div className="row-title">{tr('themeLabel')}</div>
{(!canDark || !canLight) && (
<div className="row-sub">{tr(!canDark ? 'themePluginDarkDisabled' : 'themePluginLightDisabled')}</div>
)}
</div>
<div className="row-right">
<Segmented
label={tr('themeLabel')}
value={themeMode}
onChange={onThemeMode}
options={[
{ value: 'light', label: tr('themeLight'), disabled: !canLight },
{ value: 'dark', label: tr('themeDark'), disabled: !canDark },
{ value: 'system', label: tr('themeSystem'), disabled: !canLight || !canDark },
]}
/>
</div>
</div>
<div className="row">
<div className="row-main">
<div className="row-title">{tr('language')}</div>
<div className="row-sub">{tr('languageSub')}</div>
{missingFontScript && (
<div className="row-sub warn-text">{tr('fontMissingFoDHint', { script: missingFontScript })}</div>
)}
</div>
<div className="row-right">
<PopupSelect
label={tr('language')}
value={config.locale || 'auto'}
onChange={onSetLocale}
options={getLocaleOptions(locales, locale, state.detected_locale)}
/>
</div>
</div>
</div>
</section>
{pluginViews.length > 0 && (
<section className="section">
<div className="section-title">{tr('sidebarPlugins')}</div>
+133 -46
View File
@@ -1,5 +1,5 @@
import { Check, ChevronRight, CircleAlert, CircleCheck, CloudDownload, Copy, Disc3, HardDrive, LucideIcon, Package } from 'lucide-react'
import React, { Suspense, lazy, useEffect, useState } from 'react'
import React, { Suspense, lazy, useEffect, useMemo, useState } from 'react'
import { useNetworkPlan } from '../lib/useNetworkPlan'
import { STAMBHA_DRIVER_ID } from '../lib/endpoints'
import { NpcapDependency } from './NpcapDependency'
@@ -15,6 +15,7 @@ import {
defaultGuestLang,
findGPU,
formatMemory,
formatResolutionLabel,
gpuCompatHint,
gpuLabel,
gpuOptionValue,
@@ -22,22 +23,32 @@ import {
memorySafeLimitGB,
parseMemoryGB,
recommendedCPUs,
canKeepDisplayPreset,
fullscreenDisplayPresets,
FullscreenDisplayPreset,
hidpiLooksLike,
hostDisplayAdvice,
hostDisplayDesc,
resolveAutoDisplayPreset,
windowDisplayPresets,
recommendedMemoryGB,
recommendedResolution,
shortGPUName,
sshCommand,
} from '../lib/format'
import {
AUTO_RESOLUTION_OPTION,
buildResolutionOptions,
initialWizardManualResolution,
initialWizardResolution,
resolveEffectiveWizardOpts,
selectWizardResolution,
supportsAutoResolution,
switchWizardGraphics,
toggleWizardBorderless,
} from '../lib/displayResolution'
import { CachedInstaller, CreateOpts, DriverSummary, HostReport, Locale, Release, Task, ValidationIssue, VMNetworkSettings } from '../types'
import { findActiveOfflineTask, taskInstallerPhase } from '../lib/tasks'
import { Button, IconButton } from '../ui/controls'
import { NumberField, PopupSelect, RangeField, Segmented, SetGroup, SetRow, Switch } from '../ui/settings'
import { NumberField, OptionCards, PopupSelect, RangeField, ScreenArt, Segmented, SetGroup, SetRow, Switch } from '../ui/settings'
import { Modal } from '../ui/dialog'
import { api } from '../wails'
@@ -48,12 +59,14 @@ const BUILTIN_MACOS_DRIVER = 'builtin.driver.reims-macos'
export interface WizardDraft {
opts: CreateOpts
step: number
manualResolution?: boolean
}
interface Props {
locale: Locale
host: HostReport
fixedModeSupported?: boolean
captureSupported?: boolean
initialDriverID?: string
tasks?: Task[]
draft?: WizardDraft | null
@@ -82,7 +95,7 @@ const SOURCES: { mode: 'offline' | 'apple' | 'installer' | 'disk'; icon: LucideI
{ mode: 'disk', icon: HardDrive, title: 'srcDiskTitle', sub: 'srcDiskSub' },
]
export const CreateWizard: React.FC<Props> = ({ locale, host, fixedModeSupported = false, initialDriverID = BUILTIN_MACOS_DRIVER, tasks = [], draft, onClose, onSubmit }) => {
export const CreateWizard: React.FC<Props> = ({ locale, host, fixedModeSupported = false, captureSupported = false, initialDriverID = BUILTIN_MACOS_DRIVER, tasks = [], draft, onClose, onSubmit }) => {
const tr = (k: I18nKey, v?: Record<string, string | number>) => t(locale, k, v)
const [step, setStep] = useState(draft?.step ?? 1)
// Once the user has reached the review step, keep validating so step markers stay current.
@@ -97,15 +110,18 @@ export const CreateWizard: React.FC<Props> = ({ locale, host, fixedModeSupported
const [driverCreating, setDriverCreating] = useState(false)
const [dependencyBusy, setDependencyBusy] = useState(false)
const [dependencyRefresh, setDependencyRefresh] = useState(0)
const [validationRefresh, setValidationRefresh] = useState(0)
useEffect(() => {
let live = true
api.ListDrivers().then((list) => { if (live) setDrivers(list ?? []) }).catch((e) => console.warn('[wizard] ListDrivers failed:', e))
return () => { live = false }
}, [])
const armImageTask = [...tasks].reverse().find((task) => task.installer_kind === 'arm-ipsw')
const activeDriver = drivers.find((d) => d.id === driverID)
const isCustomDriver = driverID !== BUILTIN_MACOS_DRIVER && !!activeDriver
const defaultGraphics = host.recommended_gpu ? 'reims-vgpu' : 'vmware-svga'
const [opts, setOpts] = useState<CreateOpts>(draft?.opts ?? {
name: initialDriverID === STAMBHA_DRIVER_ID ? 'macos-arm64' : 'macos-tahoe',
dir: '',
@@ -120,14 +136,14 @@ export const CreateWizard: React.FC<Props> = ({ locale, host, fixedModeSupported
disk: '',
disk_mode: 'copy',
disk_controller: 'nvme',
graphics: host.recommended_gpu ? 'reims-vgpu' : 'vmware-svga',
graphics: defaultGraphics,
// Default to "auto" rather than a DriverStore FileRepository ICD path so
// Windows GPU driver updates never break existing VM configs.
gpu: 'auto',
resolution: recommendedResolution(host),
...initialWizardResolution(host, fixedModeSupported, defaultGraphics),
displays: 1,
borderless: false,
capture: false,
...(captureSupported ? { capture: false } : {}),
audio: true,
network: false,
network_mode: 'off',
@@ -136,6 +152,9 @@ export const CreateWizard: React.FC<Props> = ({ locale, host, fixedModeSupported
guest_lang: defaultGuestLang(locale),
start: true,
})
const [manualResolutionPicked, setManualResolutionPicked] = useState(() =>
initialWizardManualResolution(draft),
)
const [networkTouched, setNetworkTouched] = useState(!!draft?.opts)
const set = (patch: Partial<CreateOpts>) => setOpts((o) => ({ ...o, ...patch }))
const networkMode = opts.network_mode ?? (opts.network ? 'nat' : 'off')
@@ -157,9 +176,25 @@ export const CreateWizard: React.FC<Props> = ({ locale, host, fixedModeSupported
}, [step, networkMode, locale])
const windowPresets = windowDisplayPresets(host, fixedModeSupported)
const fullscreenPresets = fullscreenDisplayPresets(host)
const activePresets: FullscreenDisplayPreset[] = opts.borderless ? fullscreenPresets : windowPresets
const autoPreset = resolveAutoDisplayPreset(host, !!opts.borderless, fixedModeSupported)
const effectiveOpts = useMemo(
() => resolveEffectiveWizardOpts(opts, autoPreset),
[opts, autoPreset.resolution],
)
const changeGraphics = (graphics: CreateOpts['graphics']) => {
set(switchWizardGraphics({ graphics, manualResolutionPicked, autoPreset }))
}
const resArt = (r: string) => {
const m = /^(\d+)\s*[x×]\s*(\d+)$/i.exec(r)
return m ? <ScreenArt w={Number(m[1])} h={Number(m[2])} /> : <ScreenArt w={16} h={10} />
}
const buildPayload = (): CreateOpts => {
const p: CreateOpts = { ...opts, offline: opts.source_mode === 'offline' }
const p: CreateOpts = { ...effectiveOpts, offline: effectiveOpts.source_mode === 'offline' }
if (!captureSupported) {
delete p.capture
}
if (p.source_mode === 'offline') {
p.installer = ''
p.disk = ''
@@ -206,6 +241,13 @@ export const CreateWizard: React.FC<Props> = ({ locale, host, fixedModeSupported
? Math.ceil((chosenRelease.size * 1.1) / 1e9)
: 0
useEffect(() => {
if (!reviewed || issues.length === 0) return
const onFocus = () => setValidationRefresh((n) => n + 1)
window.addEventListener('focus', onFocus)
return () => window.removeEventListener('focus', onFocus)
}, [reviewed, issues.length])
useEffect(() => {
if (!reviewed && step !== REVIEW_STEP) return
let live = true
@@ -223,7 +265,7 @@ export const CreateWizard: React.FC<Props> = ({ locale, host, fixedModeSupported
.finally(() => { if (live) setChecking(false) })
}, 200)
return () => { live = false; clearTimeout(timer) }
}, [step, reviewed, opts])
}, [step, reviewed, effectiveOpts, validationRefresh, captureSupported])
const pickDir = async () => {
const dir = await api.PickDirectory(tr('vmDir'))
@@ -237,7 +279,7 @@ export const CreateWizard: React.FC<Props> = ({ locale, host, fixedModeSupported
const handleCreate = () => {
if (dependencyBusy || networkBlocked) return
onSubmit(buildPayload(), { opts, step: REVIEW_STEP })
onSubmit(buildPayload(), { opts: effectiveOpts, step: REVIEW_STEP, manualResolution: manualResolutionPicked })
}
const issueSteps = new Set(reviewed ? issues.map(stepOfIssue) : [])
@@ -289,7 +331,7 @@ export const CreateWizard: React.FC<Props> = ({ locale, host, fixedModeSupported
<PopupSelect
label={tr('wizardDriverType')}
value={driverID}
options={drivers.filter((d) => initialDriverID !== STAMBHA_DRIVER_ID || d.id !== BUILTIN_MACOS_DRIVER).map((d) => ({
options={drivers.map((d) => ({
value: d.id,
label: locText(d.name, locale, d.id),
}))}
@@ -307,6 +349,19 @@ export const CreateWizard: React.FC<Props> = ({ locale, host, fixedModeSupported
control={<input className="input rg-p-input" value={opts.name} onChange={(e) => set({ name: e.target.value })} />}
/>
</SetGroup>
{driverID === STAMBHA_DRIVER_ID && (
<SetGroup title={tr('armRestoreGroup')}>
<SetRow title={tr('armRestoreVersion')} desc={tr('armRestoreMediaHint')} control={
<Button busy={armImageTask?.status === 'running'} onClick={() => {
setErr('')
void api.DownloadARMImage().catch((e) => setErr(parseAppError(e).summary))
}}>{tr('armRestoreDownload')}</Button>
} />
{armImageTask?.status === 'done' && armImageTask.result && (
<SetRow title={tr('armRestoreDownloaded')} desc={<span className="mono path-text">{armImageTask.result}</span>} />
)}
</SetGroup>
)}
{activeDriver.create_schema && (
<Suspense fallback={null}>
<SchemaForm
@@ -541,7 +596,7 @@ export const CreateWizard: React.FC<Props> = ({ locale, host, fixedModeSupported
<Segmented
label={tr('graphicsBackend')}
value={opts.graphics}
onChange={(graphics) => set({ graphics })}
onChange={changeGraphics}
options={[
{ value: 'reims-vgpu' as const, label: tr('graphicsReimsShort') },
{ value: 'vmware-svga' as const, label: tr('graphicsSvgaShort') },
@@ -562,7 +617,7 @@ export const CreateWizard: React.FC<Props> = ({ locale, host, fixedModeSupported
<button
type="button"
className="link-btn"
onClick={() => set({ graphics: 'vmware-svga' })}
onClick={() => changeGraphics('vmware-svga')}
>
{tr('gpuSwitchSvga')}
</button>
@@ -598,23 +653,47 @@ export const CreateWizard: React.FC<Props> = ({ locale, host, fixedModeSupported
disabled={opts.graphics !== 'reims-vgpu'}
reason={tr('gpuSvgaReason')}
desc={[hostDisplayDesc(host, tr), !opts.borderless ? hostDisplayAdvice(host, tr, windowPresets) : undefined].filter(Boolean).join(' · ') || undefined}
control={
<PopupSelect
id="vm-res"
block={
<OptionCards
label={tr('resolution')}
value={opts.resolution}
onChange={(resolution) => set({ resolution })}
options={(opts.borderless ? fullscreenPresets : windowPresets).map((p: FullscreenDisplayPreset) => ({
value: p.resolution,
label: p.label,
detail: [
p.hidpi ? `${tr('hidpiPresetBadge')} · ${hidpiLooksLike(p.resolution, tr) ?? ''}` : '',
p.scaleBadge ?? '',
p.native ? tr('resNativeBadge') : '',
p.scaleToFit ? tr('resScaleToFitWindow') : '',
p.recommended ? tr('recommendedBadge') : '',
].filter(Boolean).join(' · ') || undefined,
}))}
value={supportsAutoResolution(opts.graphics) && opts.auto_resolution ? AUTO_RESOLUTION_OPTION : opts.resolution}
onChange={(v) => {
setManualResolutionPicked(v !== AUTO_RESOLUTION_OPTION)
set(selectWizardResolution(v, autoPreset))
}}
options={buildResolutionOptions({
graphics: opts.graphics,
autoPreset,
activePresets,
}).map((item) => {
const p = item.preset!
if (item.kind === 'auto') {
return {
value: item.value,
title: tr('resAuto'),
sub: tr('resAutoSub', { res: p.label }),
art: resArt(p.resolution),
badges: [
p.hidpi ? tr('hidpiPresetBadge') : '',
p.scaleBadge ?? '',
tr('recommendedBadge'),
].filter(Boolean),
}
}
return {
value: item.value,
title: p.label,
sub: p.hidpi ? hidpiLooksLike(p.resolution, tr) : undefined,
art: resArt(p.resolution),
badges: [
p.hidpi ? tr('hidpiPresetBadge') : '',
p.scaleBadge ?? '',
p.native ? tr('resNativeBadge') : '',
p.scaleToFit ? tr('resScaleToFitWindow') : '',
p.recommended ? tr('recommendedBadge') : '',
].filter(Boolean),
}
})}
/>
}
/>
@@ -668,11 +747,13 @@ export const CreateWizard: React.FC<Props> = ({ locale, host, fixedModeSupported
title={tr('enableAudio')}
control={<Switch label={tr('enableAudio')} checked={!!opts.audio} onChange={(audio) => set({ audio })} />}
/>
<SetRow
title={tr('captureInput')}
desc={tr('captureInputHint')}
control={<Switch label={tr('captureInput')} checked={!!opts.capture} onChange={(capture) => set({ capture })} />}
/>
{captureSupported && (
<SetRow
title={tr('captureInput')}
desc={tr('captureInputHint')}
control={<Switch label={tr('captureInput')} checked={!!opts.capture} onChange={(capture) => set({ capture })} />}
/>
)}
<SetRow
title={tr('fullscreenLaunch')}
desc={opts.borderless ? tr('fullscreenDecoupledHint') : tr('fullscreenLaunchHint')}
@@ -680,12 +761,14 @@ export const CreateWizard: React.FC<Props> = ({ locale, host, fixedModeSupported
<Switch
label={tr('fullscreenLaunch')}
checked={!!opts.borderless}
onChange={(borderless) => {
const list = borderless ? fullscreenPresets : windowPresets
const keep = list.some((p) => canKeepDisplayPreset(p, opts.resolution, borderless))
const fallback = list.find((p) => p.recommended)?.resolution ?? list[0]?.resolution ?? opts.resolution
set(keep ? { borderless } : { borderless, resolution: fallback })
}}
onChange={(borderless) => set(toggleWizardBorderless({
borderless,
opts,
host,
fixedModeSupported,
windowPresets,
fullscreenPresets,
}))}
/>
}
/>
@@ -701,7 +784,8 @@ export const CreateWizard: React.FC<Props> = ({ locale, host, fixedModeSupported
<Review
locale={locale}
host={host}
opts={opts}
opts={effectiveOpts}
captureSupported={captureSupported}
networkUplink={networkAdapters?.find((adapter) => adapter.guid === opts.uplink_guid)?.name}
issues={issues}
checking={checking}
@@ -765,6 +849,7 @@ interface ReviewProps {
locale: Locale
host: HostReport
opts: CreateOpts
captureSupported: boolean
issues: ValidationIssue[]
checking: boolean
command: string
@@ -780,7 +865,7 @@ type Row = { label: string; value: string; mono?: boolean }
const fileName = (p?: string) => (p ?? '').split(/[\\/]/).pop() || (p ?? '')
/** Step ⑤: what will be created, grouped by the step that set it, with the CLI equivalent folded away. */
const Review: React.FC<ReviewProps> = ({ locale, host, opts, issues, checking, command, onEdit, onName, onDir, onPickDir, onStartAfter, networkUplink }) => {
const Review: React.FC<ReviewProps> = ({ locale, host, opts, captureSupported, issues, checking, command, onEdit, onName, onDir, onPickDir, onStartAfter, networkUplink }) => {
const tr = (k: I18nKey, v?: Record<string, string | number>) => t(locale, k, v)
const [copied, setCopied] = useState(false)
const onOff = (b?: boolean) => tr(b ? 'summaryOn' : 'off')
@@ -793,7 +878,7 @@ const Review: React.FC<ReviewProps> = ({ locale, host, opts, issues, checking, c
? tr('summaryInstallerSource', { file: fileName(opts.installer) })
: tr('summaryDiskSource', { file: fileName(opts.disk) })
const res = (opts.resolution ?? '').replace(/x/i, ' × ')
const res = formatResolutionLabel(opts.resolution ?? '', !!opts.auto_resolution, tr)
const graphicsRows: Row[] = opts.graphics === 'reims-vgpu'
? [
{ label: tr('factGraphics'), value: `${gpuLabel(locale, opts.gpu, host)} · reims-vgpu` },
@@ -835,7 +920,7 @@ const Review: React.FC<ReviewProps> = ({ locale, host, opts, issues, checking, c
...graphicsRows,
{ label: tr('fieldAudio'), value: onOff(opts.audio) },
{ label: tr('fieldNetwork'), value: opts.network_mode === 'bridge' ? `${tr('networkBridge')} · ${networkUplink ?? tr('bridgeUplink')}` : tr((opts.network_mode ?? (opts.network ? 'nat' : 'off')) === 'off' ? 'off' : 'networkNAT') },
{ label: tr('captureInput'), value: onOff(opts.capture) },
...(captureSupported ? [{ label: tr('captureInput'), value: onOff(opts.capture) }] : []),
{ label: tr('summarySSH'), value: opts.ssh_port ? tr('summarySSHPort', { n: opts.ssh_port }) : tr('off') },
{ label: tr('summaryLogs'), value: onOff(opts.logs) },
],
@@ -843,7 +928,8 @@ const Review: React.FC<ReviewProps> = ({ locale, host, opts, issues, checking, c
]
const nameIssue = issues.find((i) => i.field === 'name')?.message
const general = issues.filter((i) => stepOfIssue(i) === REVIEW_STEP && i.field !== 'name')
const dirIssue = issues.find((i) => i.field === 'dir')?.message
const general = issues.filter((i) => stepOfIssue(i) === REVIEW_STEP && i.field !== 'name' && i.field !== 'dir')
const copy = async () => {
try {
@@ -867,6 +953,7 @@ const Review: React.FC<ReviewProps> = ({ locale, host, opts, issues, checking, c
<SetRow
title={tr('vmDir')}
desc={opts.dir ? <span className="mono path-text" title={opts.dir}>{opts.dir}</span> : tr('summaryDefaultDir')}
error={dirIssue}
control={
<div className="hstack">
{opts.dir && <Button variant="ghost" onClick={() => onDir('')}>{tr('useDefault')}</Button>}
@@ -0,0 +1,71 @@
import { LoaderCircle, Terminal, X } from 'lucide-react'
import React from 'react'
import '../i18n/domains/vm.gen'
import { I18nKey, t } from '../i18n'
import { taskDetail, taskTitle } from '../lib/tasks'
import { Locale, Task } from '../types'
import { Button, StatusShape } from '../ui/controls'
interface Props {
locale: Locale
name: string
task?: Task
onCancel?: (taskId: string) => void
onViewLogs: () => void
}
export const CreatingVMView: React.FC<Props> = ({ locale, name, task, onCancel, onViewLogs }) => {
const tr = (k: I18nKey, v?: Record<string, string | number>) => t(locale, k, v)
const percent = task && typeof task.percent === 'number' ? task.percent : -1
const detail = task ? taskDetail(task) : ''
const stepText = task?.step?.trim() || tr('creatingPreparing')
const heading = task ? taskTitle(locale, task) : tr('taskCreate', { name })
return (
<div className="page">
<div className="page-head">
<div>
<h1 className="page-title">{name}</h1>
<div className="page-sub hstack">
<StatusShape kind="busy" />
<span>{tr('state_creating')}</span>
</div>
</div>
<div className="hstack">
<Button variant="ghost" icon={<Terminal size={14} aria-hidden="true" />} onClick={onViewLogs}>
{tr('viewLogs')}
</Button>
{task?.cancelable && onCancel && (
<Button variant="secondary" icon={<X size={14} aria-hidden="true" />} onClick={() => onCancel(task.id)}>
{tr('cancelCreate')}
</Button>
)}
</div>
</div>
<section className="section">
<div className="section-title">{tr('creatingProgressTitle')}</div>
<div className="list">
<div className="row creating-row">
<div className="creating-head">
<span className="row-title hstack">
<LoaderCircle size={15} className="spin" aria-hidden="true" />
<span>{heading}</span>
</span>
{percent >= 0 && <span className="task-pct mono">{Math.floor(percent)}%</span>}
</div>
{percent >= 0 && (
<span className="progress rg-p-progress creating-progress" aria-hidden="true">
<span className="progress-fill" style={{ transform: `scaleX(${Math.max(0, Math.min(1, percent / 100))})` }} />
</span>
)}
<div className="row-sub">
{stepText}
{detail ? ` · ${detail}` : ''}
</div>
</div>
</div>
</section>
</div>
)
}
+37 -9
View File
@@ -8,26 +8,31 @@ import { describeHostWHPX } from '../lib/hypervisor'
import { hasStambhaRuntime, STAMBHA_RUNTIME_KIND } from '../lib/endpoints'
import { AppState, Locale, StorageBreakdown, Task } from '../types'
import { Button, IconButton } from '../ui/controls'
import { Switch } from '../ui/settings'
import { api } from '../wails'
import { sameRuntimeId } from '../lib/runtimeStatus'
import { RuntimeOnline } from './RuntimeOnline'
interface Props {
state: AppState
locale: Locale
onRefresh: () => void
onRefresh: () => Promise<void>
onNewVM?: () => void
onError: (title: string, e: unknown) => void
onToast?: (title: string) => void
runtimeTask: Task | null
onChannel: (alpha: boolean) => void
onInstallRuntime: (commit: string) => void
onImportRuntime: () => Promise<void>
onCancelTask: (id: string) => void
}
export const HostView: React.FC<Props> = ({ state, locale, onRefresh, onNewVM, onError, onToast, runtimeTask, onChannel, onInstallRuntime, onCancelTask }) => {
export const HostView: React.FC<Props> = ({ state, locale, onRefresh, onNewVM, onError, onToast, runtimeTask, onChannel, onInstallRuntime, onImportRuntime, onCancelTask }) => {
const [importing, setImporting] = useState(false)
const [enabling, setEnabling] = useState(false)
const [savingASLR, setSavingASLR] = useState(false)
const [confirmDelete, setConfirmDelete] = useState('')
const [latestRuntimeCommit, setLatestRuntimeCommit] = useState('')
const [removing, setRemoving] = useState('')
const [storage, setStorage] = useState<StorageBreakdown | null>(null)
const { host, config, runtimes } = state
@@ -44,7 +49,7 @@ export const HostView: React.FC<Props> = ({ state, locale, onRefresh, onNewVM, o
const guard = (fn: () => Promise<unknown>) => async () => {
try {
await fn()
onRefresh()
await onRefresh()
} catch (e) {
onError(tr('failGeneric'), e)
}
@@ -64,13 +69,19 @@ export const HostView: React.FC<Props> = ({ state, locale, onRefresh, onNewVM, o
}
}
const setQEMUASLR = async (enabled: boolean) => {
setSavingASLR(true)
await guard(() => api.SetQEMUASLR(enabled))()
setSavingASLR(false)
}
const importRuntime = async () => {
setImporting(true)
await guard(async () => {
const file = await api.PickFile(tr('importRuntime'), '*.tar.zst;*.zip')
if (file) await api.InstallRuntimeArchive(file)
})()
setImporting(false)
try {
await onImportRuntime()
} finally {
setImporting(false)
}
}
const removeRuntime = async (commit: string) => {
@@ -207,14 +218,31 @@ export const HostView: React.FC<Props> = ({ state, locale, onRefresh, onNewVM, o
onChannel={onChannel}
onInstall={onInstallRuntime}
onCancel={onCancelTask}
onLatestCommit={setLatestRuntimeCommit}
/>
<div className="row">
<div className="row-main">
<div className="row-title">{tr('qemuASLR')}</div>
<div className="row-sub">{tr('qemuASLRHint')}</div>
</div>
<div className="row-right">
<Switch label={tr('qemuASLR')} checked={!!config.qemu_aslr} disabled={savingASLR} onChange={setQEMUASLR} />
</div>
</div>
{(runtimes ?? []).filter((rt) => !rt.active).map((rt) => {
const stambha = rt.kind === STAMBHA_RUNTIME_KIND
const ref = stambha ? STAMBHA_RUNTIME_KIND + '/' + rt.commit : rt.commit
return (
<div className="row" key={ref}>
<div className="row-main">
<div className="row-title"><span className="mono">{stambha ? rt.manifest.name || rt.commit : rt.commit}</span></div>
<div className="row-title">
<span className="mono">{stambha ? rt.manifest.name || rt.commit : rt.commit}</span>
{(stambha || !rt.kind || rt.kind === 'reims-vgpu') &&
<span className="badge rg-p-badge">{tr(stambha ? 'armRuntimeLabel' : 'x86RuntimeLabel')}</span>}
{!stambha && latestRuntimeCommit && sameRuntimeId(rt.commit, latestRuntimeCommit) && (
<span className="badge rg-p-badge badge-ok">{tr('runtimeLatestBadge')}</span>
)}
</div>
<div className="row-sub">{rt.manifest.qemu_version?.replace(/^QEMU emulator version\s*/i, 'QEMU ')}</div>
</div>
<div className="row-right">
+49 -31
View File
@@ -1,15 +1,15 @@
import {
Boxes, Clipboard, Compass, Cpu, Disc3, Globe, Keyboard,
Layers, Monitor, Palette, Puzzle, RotateCcw,
Boxes, Globe, Layers, Monitor, Palette, Puzzle,
} from 'lucide-react'
import React from 'react'
import { PermissionSpec } from '../types'
import { PermissionSpec, PluginIcon } from '../types'
export interface PluginVisualSource {
id?: string
kind?: string
system?: boolean
tier?: string
icon?: PluginIcon
locales?: string[]
permissions?: Array<PermissionSpec | string>
}
@@ -21,12 +21,25 @@ export interface PluginVisual {
const ICON_SIZES = { sm: 16, md: 18, lg: 20 } as const
/**
* Single visual resolver for both installed plugins (PluginInfo) and market
* entries (MarketEntry), so a plugin keeps the same icon and colour across
* Market, Installed and first-run setup.
*/
export function resolvePluginVisual(src: PluginVisualSource, iconSize = 20): PluginVisual {
const PLUGIN_ICON_TONES = new Set([
'indigo', 'purple', 'sky', 'rose', 'emerald', 'amber', 'teal', 'slate',
])
function normalizeTone(tone?: string): string {
const t = (tone ?? '').trim().toLowerCase()
return PLUGIN_ICON_TONES.has(t) ? t : ''
}
function toSafeSvgMaskUrl(raw?: string): string {
const s = (raw ?? '').trim()
if (!s) return ''
const lower = s.toLowerCase()
if (!lower.startsWith('<svg') || !lower.includes('</svg>')) return ''
if (/<script\b|\bon[a-z]+\s*=|javascript:|<foreignobject\b/i.test(s)) return ''
return `url("data:image/svg+xml,${encodeURIComponent(s)}")`
}
function fallbackVisual(src: PluginVisualSource, iconSize: number): PluginVisual {
if (src.system) return { tone: 'indigo', icon: <Boxes size={iconSize} aria-hidden="true" /> }
switch (src.kind) {
case 'theme': return { tone: 'purple', icon: <Palette size={iconSize} aria-hidden="true" /> }
@@ -34,41 +47,46 @@ export function resolvePluginVisual(src: PluginVisualSource, iconSize = 20): Plu
case 'driver':
case 'runtime': return { tone: 'indigo', icon: <Monitor size={iconSize} aria-hidden="true" /> }
}
const id = (src.id ?? '').toLowerCase()
const perms = new Set((src.permissions ?? []).map((x) => (typeof x === 'string' ? x : x.name)))
if ((src.locales?.length ?? 0) > 0 || id.includes('lang') || id.includes('locale')) {
if ((src.locales?.length ?? 0) > 0) {
return { tone: 'sky', icon: <Globe size={iconSize} aria-hidden="true" /> }
}
if (id.includes('theme') || perms.has('ui:script')) {
if (perms.has('ui:script')) {
return { tone: 'purple', icon: <Palette size={iconSize} aria-hidden="true" /> }
}
if (id.includes('driver') || perms.has('driver:vm') || perms.has('runtime:provider')) {
if (perms.has('driver:vm') || perms.has('runtime:provider')) {
return { tone: 'indigo', icon: <Monitor size={iconSize} aria-hidden="true" /> }
}
if (id.includes('clipboard') || perms.has('host:clipboard')) {
return { tone: 'sky', icon: <Clipboard size={iconSize} aria-hidden="true" /> }
}
if (id.includes('ime') || id.includes('input') || id.includes('wheel') || perms.has('input:filter')) {
return { tone: 'rose', icon: <Keyboard size={iconSize} aria-hidden="true" /> }
}
if (id.includes('reboot')) {
return { tone: 'amber', icon: <RotateCcw size={iconSize} aria-hidden="true" /> }
}
if (id.includes('whpx') || id.includes('irq')) {
return { tone: 'emerald', icon: <Cpu size={iconSize} aria-hidden="true" /> }
}
if (id.includes('guide')) {
return { tone: 'teal', icon: <Compass size={iconSize} aria-hidden="true" /> }
}
if (id.includes('offline') || id.includes('installer') || id.includes('helper') || id.includes('image')) {
return { tone: 'teal', icon: <Disc3 size={iconSize} aria-hidden="true" /> }
}
if (src.tier === 'L3') {
return { tone: 'slate', icon: <Layers size={iconSize} aria-hidden="true" /> }
}
return { tone: 'teal', icon: <Puzzle size={iconSize} aria-hidden="true" /> }
}
/**
* Single visual resolver for both installed plugins (PluginInfo) and market
* entries (MarketEntry), prioritizing declared icon tone + monochrome SVG
* foreground with a kind-based fallback for legacy plugins.
*/
export function resolvePluginVisual(src: PluginVisualSource, iconSize = 20): PluginVisual {
const fb = fallbackVisual(src, iconSize)
const tone = normalizeTone(src.icon?.tone) || fb.tone
const maskUrl = toSafeSvgMaskUrl(src.icon?.svg)
if (maskUrl) {
const style: React.CSSProperties = {
width: iconSize,
height: iconSize,
WebkitMaskImage: maskUrl,
maskImage: maskUrl,
}
return {
tone,
icon: <span className="plugin-app-icon-svg" style={style} aria-hidden="true" />,
}
}
return { tone, icon: fb.icon }
}
/** App Store-inspired squircle icon tile shared by Market, Installed and Setup. */
export const PluginAppIcon: React.FC<{
plugin?: PluginVisualSource
+124 -11
View File
@@ -1,10 +1,11 @@
import { AlertTriangle, Check, Download, ShieldAlert } from 'lucide-react'
import { AlertTriangle, Check, Download, ShieldAlert, Star } from 'lucide-react'
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
import '../i18n/domains/plugins.gen'
import { I18nKey, locText, t } from '../i18n'
import { Locale, MarketBrowseResult, MarketCatalogItem, PluginInfo, ScanReport } from '../types'
import { Button, Tip } from '../ui/controls'
import { Modal } from '../ui/dialog'
import { PopupSelect } from '../ui/settings'
import { api, events, MarketInstallProgress } from '../wails'
import { PluginAppIcon, PluginApprovalBody, PluginSearchInput, PluginTrustBadge, RiskList } from './PluginParts'
import { WordmarkLoader } from './WordmarkLoader'
@@ -25,6 +26,28 @@ const KIND_LABELS: Record<string, I18nKey> = {
runtime: 'pluginMarketKindRuntime',
}
type MarketSortMode = 'composite' | 'stars' | 'downloads' | 'recent'
function formatCompactCount(n: number): string {
if (n >= 10000) return `${(n / 1000).toFixed(0)}k`
if (n >= 1000) return `${(n / 1000).toFixed(1).replace(/\.0$/, '')}k`
return String(n)
}
function parseTimestamp(iso?: string): number {
if (!iso) return 0
const ms = Date.parse(iso)
return Number.isNaN(ms) ? 0 : ms
}
function compositeScore(item: MarketCatalogItem, nowMs: number): number {
const ts = parseTimestamp(item.entry.updated_at)
const ageDays = ts > 0 ? Math.max(0, (nowMs - ts) / 86400000) : 3650
const recency = ts > 0 ? 10 / (1 + ageDays / 30) : 0
const downloads = Math.log1p(Math.max(0, item.entry.downloads ?? 0)) * 2
return recency + downloads
}
interface Props {
locale: Locale
safeMode?: boolean
@@ -50,6 +73,7 @@ export const PluginMarket: React.FC<Props> = ({
const tr = (k: I18nKey, v?: Record<string, string | number>) => t(locale, k, v)
const [query, setQuery] = useState('')
const [kind, setKind] = useState('')
const [sortBy, setSortBy] = useState<MarketSortMode>('composite')
const [result, setResult] = useState<MarketBrowseResult | null>(null)
const [syncing, setSyncing] = useState(false)
const [refreshing, setRefreshing] = useState(false)
@@ -79,7 +103,7 @@ export const PluginMarket: React.FC<Props> = ({
const started = Date.now()
if (force) setRefreshing(true)
try {
const res = await api.BrowsePluginMarket(q, k, false, force)
const res = await api.BrowsePluginMarket(q, k, true, force)
if (force) {
const wait = MIN_REFRESH_MS - (Date.now() - started)
if (wait > 0) await new Promise((r) => window.setTimeout(r, wait))
@@ -146,7 +170,40 @@ export const PluginMarket: React.FC<Props> = ({
setProgress((prev) => prev[p.id] ? { ...prev, [p.id]: p } : prev)
}), [])
const items = result?.items ?? []
const items = useMemo(() => {
const raw = result?.items ?? []
if (raw.length <= 1) return raw
const nowMs = Date.now()
return [...raw].sort((a, b) => {
if (a.update_available !== b.update_available) return a.update_available ? -1 : 1
switch (sortBy) {
case 'stars': {
const d = (b.entry.stars ?? 0) - (a.entry.stars ?? 0)
if (d !== 0) return d
break
}
case 'downloads': {
const d = (b.entry.downloads ?? 0) - (a.entry.downloads ?? 0)
if (d !== 0) return d
break
}
case 'recent': {
const d = parseTimestamp(b.entry.updated_at) - parseTimestamp(a.entry.updated_at)
if (d !== 0) return d
break
}
case 'composite':
default: {
const d = compositeScore(b, nowMs) - compositeScore(a, nowMs)
if (Math.abs(d) > 1e-6) return d
break
}
}
const dl = (b.entry.downloads ?? 0) - (a.entry.downloads ?? 0)
if (dl !== 0) return dl
return a.entry.id.localeCompare(b.entry.id)
})
}, [result?.items, sortBy])
const shown = items.slice(0, visible)
const hasMore = items.length > visible
@@ -197,7 +254,7 @@ export const PluginMarket: React.FC<Props> = ({
installingRef.current.add(id)
setProgress((prev) => ({ ...prev, [id]: { id, phase: 'download', done: 0, total: item.entry.size_bytes ?? 0 } }))
try {
const info = await api.InstallMarketPlugin(id, false)
const info = await api.InstallMarketPluginVersion(id, item.entry.version)
await onChanged({})
if (info && !info.enabled) {
if (promptTargetIDRef.current) {
@@ -299,12 +356,27 @@ export const PluginMarket: React.FC<Props> = ({
return (
<section className="section plugin-market">
<div className="market-toolbar">
<PluginSearchInput
value={query}
onChange={setQuery}
placeholder={tr('pluginMarketSearchPlaceholder')}
wide
/>
<div className="market-toolbar-top">
<PluginSearchInput
value={query}
onChange={setQuery}
placeholder={tr('pluginMarketSearchPlaceholder')}
wide
/>
<div className="market-sort">
<PopupSelect
label={tr('pluginMarketSortLabel')}
value={sortBy}
onChange={(v) => setSortBy(v as MarketSortMode)}
options={[
{ value: 'composite', label: tr('pluginMarketSortComposite') },
{ value: 'stars', label: tr('pluginMarketSortStars') },
{ value: 'downloads', label: tr('pluginMarketSortDownloads') },
{ value: 'recent', label: tr('pluginMarketSortRecent') },
]}
/>
</div>
</div>
{facets.length > 1 && (
<div className="market-kinds" role="radiogroup" aria-label={tr('pluginMarketKindAll')}>
{[{ kind: '', count: 0 }, ...facets].map((f) => (
@@ -365,11 +437,52 @@ export const PluginMarket: React.FC<Props> = ({
<div className="market-card-head">
<PluginAppIcon plugin={e} size="lg" />
<div className="market-card-titles">
<h3 className="market-card-name" title={locText(e.name, locale, e.id)}>{locText(e.name, locale, e.id)}</h3>
{(() => {
const title = locText(e.name, locale, e.id)
const rawHref = (e.homepage || e.readme_url || '').trim()
const href = /^https:\/\//i.test(rawHref) ? rawHref : ''
return (
<h3 className="market-card-name" title={href || title}>
{href ? (
<a
className="plugin-title-link"
href={href}
onClick={(ev) => {
ev.preventDefault()
void api.OpenURL(href).catch((err) => onError(tr('failGeneric'), err))
}}
>
{title}
</a>
) : title}
</h3>
)
})()}
<div className="market-card-byline">
<PluginTrustBadge locale={locale} trust={e.trust} publisher={e.publisher} />
<span className="market-card-dot" aria-hidden="true">·</span>
<span className="market-card-version">v{e.version}</span>
{e.channel === 'alpha' && (
<span className="market-alpha-badge">{tr('pluginMarketAlphaTag')}</span>
)}
{(e.stars ?? 0) > 0 && (
<>
<span className="market-card-dot" aria-hidden="true">·</span>
<span className="market-card-stat" title={`${e.stars} stars`}>
<Star size={11} aria-hidden="true" />
{formatCompactCount(e.stars!)}
</span>
</>
)}
{(e.downloads ?? 0) > 0 && (
<>
<span className="market-card-dot" aria-hidden="true">·</span>
<span className="market-card-stat" title={`${e.downloads} downloads`}>
<Download size={11} aria-hidden="true" />
{formatCompactCount(e.downloads!)}
</span>
</>
)}
</div>
</div>
<div className="market-card-action">{action(item)}</div>
+89 -95
View File
@@ -1,6 +1,6 @@
import {
AlertTriangle, CheckCircle2, FolderOpen, PackagePlus, Palette,
RefreshCw, Settings2, Shield, ShieldAlert, Sparkles, Terminal, Trash2,
AlertTriangle, CheckCircle2, ExternalLink, FolderOpen, PackagePlus, Palette,
RefreshCw, Settings2, ShieldAlert, Sparkles, Trash2,
} from 'lucide-react'
import React, { useEffect, useMemo, useRef, useState } from 'react'
import '../i18n/domains/plugins.gen'
@@ -22,6 +22,7 @@ import { SchemaForm } from './SchemaForm'
const SEARCH_THRESHOLD = 12
// A manual refresh spins at least this long so the click visibly lands.
const MIN_SPIN_MS = 500
const PLUGIN_MARKET_SUBMIT_URL = 'https://github.com/reims-go/plugins#如何上架插件'
interface Props {
locale: Locale
@@ -67,17 +68,14 @@ export const PluginsPage: React.FC<Props> = ({
const settingsRuntimeWarning = plugins.find((p) => p.id === settingsTarget?.id)?.runtime_warning
const [settingsValues, setSettingsValues] = useState<Record<string, unknown>>({})
const settingsSaveQueuesRef = useRef(new Map<string, Promise<void>>())
const [logTarget, setLogTarget] = useState<{ id: string; text: string } | null>(null)
const [removeTarget, setRemoveTarget] = useState<PluginInfo | null>(null)
const [disableTarget, setDisableTarget] = useState<PluginInfo | null>(null)
const [deleteSchemeTarget, setDeleteSchemeTarget] = useState<CustomThemeScheme | null>(null)
// Static risk scan modal state (pre-install .zip preview or installed plugin scan)
const [scanModal, setScanModal] = useState<{
mode: 'archive' | 'installed'
archivePath?: string
report: ScanReport
} | null>(null)
// Static risk scan of a .zip, shown before it is installed
const [scanModal, setScanModal] = useState<{ archivePath: string; report: ScanReport } | null>(null)
// Scan verdicts of installed plugins by id, filled when their permission tooltip opens
const [scanVerdicts, setScanVerdicts] = useState<Record<string, string>>({})
const [scanBusy, setScanBusy] = useState(false)
// Mount the market (and touch the network) only after its tab is opened.
@@ -99,6 +97,7 @@ export const PluginsPage: React.FC<Props> = ({
api.GetActiveTheme(),
])
setPlugins(list ?? [])
setScanVerdicts({})
setContribs(ui)
setActiveTheme(th)
return { ui, th }
@@ -223,7 +222,7 @@ export const PluginsPage: React.FC<Props> = ({
if (!path) return
setScanBusy(true)
const report = await api.InspectPluginArchive(path)
setScanModal({ mode: 'archive', archivePath: path, report })
setScanModal({ archivePath: path, report })
} catch (e) {
onError(tr('pluginFailScan'), e)
} finally {
@@ -232,7 +231,7 @@ export const PluginsPage: React.FC<Props> = ({
}
const confirmInstallScannedArchive = async () => {
if (!scanModal || scanModal.mode !== 'archive' || !scanModal.archivePath || scanModal.report.hard_blocked) return
if (!scanModal || scanModal.report.hard_blocked) return
const archivePath = scanModal.archivePath
setScanBusy(true)
try {
@@ -247,16 +246,15 @@ export const PluginsPage: React.FC<Props> = ({
}
}
const inspectInstalledPlugin = async (p: PluginInfo) => {
setScanBusy(true)
const loadScanVerdict = async (p: PluginInfo) => {
if (scanVerdicts[p.id]) return
let verdict = tr('pluginFailScan')
try {
const report = await api.ScanInstalledPlugin(p.id)
setScanModal({ mode: 'installed', report })
verdict = locText((await api.ScanInstalledPlugin(p.id)).headline, locale, verdict)
} catch (e) {
onError(tr('pluginFailScan'), e)
} finally {
setScanBusy(false)
console.warn('[plugins] ScanInstalledPlugin failed:', p.id, e)
}
setScanVerdicts((current) => ({ ...current, [p.id]: verdict }))
}
const linkDevDir = async () => {
@@ -287,7 +285,7 @@ export const PluginsPage: React.FC<Props> = ({
const openPluginSettings = async (p: PluginInfo) => {
try {
const vals = await api.GetPluginSettings(p.id, '')
const vals = hasAppSettings(p) ? await api.GetPluginSettings(p.id, '') : null
setSettingsValues((vals ?? {}) as Record<string, unknown>)
setSettingsTarget(p)
} catch (e) {
@@ -316,15 +314,6 @@ export const PluginsPage: React.FC<Props> = ({
}
}
const openPluginLog = async (p: PluginInfo) => {
try {
const txt = await api.ReadPluginLog(p.id)
setLogTarget({ id: p.id, text: txt || tr('pluginLogEmpty') })
} catch (e) {
onError(tr('pluginFailReadLog'), e)
}
}
const selectTheme = async (themeID: string, schemeID = '') => {
try {
await api.SetActiveTheme(themeID, schemeID)
@@ -385,7 +374,9 @@ export const PluginsPage: React.FC<Props> = ({
const filteredBuiltins = useMemo(() => builtins.filter(matchesFilter), [builtins, q, locale])
const filteredExternal = useMemo(() => external.filter(matchesFilter), [external, q, locale])
const themes = contribs?.themes ?? []
const settingsPanels = (contribs?.panels ?? []).filter((p) => p.slot === 'settings.plugin')
const settingsPanelsOf = (id: string) => contribs?.asset_token
? (contribs.panels ?? []).filter((panel) => panel.slot === 'settings.plugin' && panel.pluginId === id)
: []
const presetSchemes = activeTheme?.theme?.schemes ?? []
const customSchemes = (activeTheme?.custom_schemes ?? []).filter((s) => s.theme_id === activeTheme?.theme_id)
const activeCount = useMemo(() => plugins.filter((p) => p.state === 'active').length, [plugins])
@@ -423,7 +414,26 @@ export const PluginsPage: React.FC<Props> = ({
<PluginAppIcon plugin={p} size="md" />
<div className="row-main">
<div className="row-title">
<span className="plugin-row-name">{locText(p.name, locale, p.id)}</span>
{(() => {
const title = locText(p.name, locale, p.id)
const rawHref = (p.homepage || '').trim()
const href = /^https:\/\//i.test(rawHref) ? rawHref : ''
return href ? (
<a
className="plugin-row-name plugin-title-link"
href={href}
title={href}
onClick={(ev) => {
ev.preventDefault()
void api.OpenURL(href).catch((err) => onError(tr('failGeneric'), err))
}}
>
{title}
</a>
) : (
<span className="plugin-row-name">{title}</span>
)
})()}
{stateBadge(p)}
</div>
{desc && <div className="row-sub plugin-row-desc" title={desc}>{desc}</div>}
@@ -431,11 +441,16 @@ export const PluginsPage: React.FC<Props> = ({
<div className="row-sub plugin-row-meta">
<PluginTrustBadge locale={locale} trust={p.trust} publisher={p.publisher} />
<span className="mono">v{p.version}</span>
{perms.length > 0 && (
<Tip label={tr('pluginPermissionsLabel', { list: perms.map((x) => x.name).join(', ') })}>
<span>{tr('pluginPermCount', { count: perms.length })}</span>
</Tip>
)}
<Tip
label={[
tr('pluginPermissionsLabel', { list: perms.map((x) => x.name).join(', ') || '—' }),
scanVerdicts[p.id],
].filter(Boolean).join('\n')}
>
<span tabIndex={0} onPointerEnter={() => void loadScanVerdict(p)} onFocus={() => void loadScanVerdict(p)}>
{tr('pluginPermCount', { count: perms.length })}
</span>
</Tip>
</div>
)}
{alert && (
@@ -452,15 +467,9 @@ export const PluginsPage: React.FC<Props> = ({
)}
</div>
<div className="row-right">
{!isBuiltin && (
<IconButton label={tr('pluginScanInspect')} icon={<Shield size={15} />} onClick={() => void inspectInstalledPlugin(p)} />
)}
{hasAppSettings(p) && (
{(hasAppSettings(p) || settingsPanelsOf(p.id).length > 0) && (
<IconButton label={tr('pluginSettings')} icon={<Settings2 size={15} />} onClick={() => void openPluginSettings(p)} />
)}
{p.log_path && (
<IconButton label={tr('pluginViewLog')} icon={<Terminal size={15} />} onClick={() => void openPluginLog(p)} />
)}
{p.removable && (
<IconButton
disabled={p.in_use || busyID === p.id}
@@ -626,6 +635,12 @@ export const PluginsPage: React.FC<Props> = ({
onClick={() => activeTab === 'market' ? setMarketRefresh((n) => n + 1) : void manualReload()}
/>
<IconButton label={tr('pluginLinkDevBtn')} icon={<FolderOpen size={16} />} onClick={linkDevDir} />
<Button
icon={<ExternalLink size={14} aria-hidden="true" />}
onClick={() => void api.OpenURL(PLUGIN_MARKET_SUBMIT_URL).catch((e) => onError(tr('failGeneric'), e))}
>
{tr('pluginSubmitBtn')}
</Button>
<Button variant="primary" disabled={scanBusy} icon={<PackagePlus size={14} aria-hidden="true" />} onClick={importLocalZip}>
{tr('pluginImportBtn')}
</Button>
@@ -802,30 +817,13 @@ export const PluginsPage: React.FC<Props> = ({
</section>
)}
{settingsPanels.length > 0 && contribs?.asset_token ? (
<section className="section" data-rg-slot="settings.plugin">
<div className="section-title">{tr('pluginPanelsSection')}</div>
{settingsPanels.map((panel) => (
<PluginPanelFrame
key={`${panel.pluginId}:${panel.id}`}
locale={locale}
panel={panel}
assetToken={contribs.asset_token!}
appearance={appearance}
onOpenView={onOpenView}
onNavigate={onNavigate}
/>
))}
</section>
) : (
<div className="rg-slot-anchor" data-rg-slot="settings.plugin" />
)}
<div className="rg-slot-anchor" data-rg-slot="settings.plugin" />
</>
)}
{scanModal && (
<Modal
title={scanModal.mode === 'archive' ? tr('pluginScanArchiveTitle') : tr('pluginScanModalTitle')}
title={tr('pluginScanArchiveTitle')}
subtitle={scanModal.report.plugin_id ? `${locText(scanModal.report.name, locale, scanModal.report.plugin_id)} · v${scanModal.report.version || '—'}` : scanModal.archivePath}
closeLabel={tr('close')}
onClose={() => { if (!scanBusy) setScanModal(null) }}
@@ -838,20 +836,14 @@ export const PluginsPage: React.FC<Props> = ({
{scanModal.report.tier ? `${scanModal.report.tier} · ${scanModal.report.trust || 'community'}` : ''}
</span>
<span className="hstack">
{scanModal.mode === 'archive' ? (
<>
<Button variant="ghost" disabled={scanBusy} onClick={() => setScanModal(null)}>{tr('cancel')}</Button>
<Button
variant="primary"
disabled={scanBusy || scanModal.report.hard_blocked}
onClick={() => void confirmInstallScannedArchive()}
>
{scanModal.report.hard_blocked ? tr('pluginScanBlockedBtn') : tr('pluginScanInstallConfirm')}
</Button>
</>
) : (
<Button variant="primary" onClick={() => setScanModal(null)}>{tr('pluginDone')}</Button>
)}
<Button variant="ghost" disabled={scanBusy} onClick={() => setScanModal(null)}>{tr('cancel')}</Button>
<Button
variant="primary"
disabled={scanBusy || scanModal.report.hard_blocked}
onClick={() => void confirmInstallScannedArchive()}
>
{scanModal.report.hard_blocked ? tr('pluginScanBlockedBtn') : tr('pluginScanInstallConfirm')}
</Button>
</span>
</div>
</Modal>
@@ -883,7 +875,7 @@ export const PluginsPage: React.FC<Props> = ({
</Modal>
)}
{settingsTarget && settingsTarget.settings && (
{settingsTarget && (
<Modal
title={locText(settingsTarget.name, locale, settingsTarget.id)}
subtitle={tr('pluginGlobalSettings')}
@@ -897,13 +889,27 @@ export const PluginsPage: React.FC<Props> = ({
<span>{settingsRuntimeWarning}</span>
</div>
)}
<SchemaForm
locale={locale}
schema={settingsTarget.settings}
values={settingsValues}
scopeFilter="app"
onChange={(_, patch) => void savePluginSettings(patch)}
/>
{hasAppSettings(settingsTarget) && (
<SchemaForm
locale={locale}
schema={settingsTarget.settings!}
values={settingsValues}
scopeFilter="app"
onChange={(_, patch) => void savePluginSettings(patch)}
/>
)}
{settingsPanelsOf(settingsTarget.id).map((panel) => (
<PluginPanelFrame
key={panel.id}
locale={locale}
panel={panel}
assetToken={contribs!.asset_token!}
appearance={appearance}
// Both lead out of this dialog, so it must not stay on top.
onOpenView={onOpenView && ((view, vm) => { setSettingsTarget(null); onOpenView(view, vm) })}
onNavigate={onNavigate && ((target) => { setSettingsTarget(null); onNavigate(target) })}
/>
))}
</div>
<div className="dialog-foot">
<span />
@@ -961,18 +967,6 @@ export const PluginsPage: React.FC<Props> = ({
/>
)}
{logTarget && (
<Modal
title={tr('pluginLogTitle', { id: logTarget.id })}
closeLabel={tr('close')}
onClose={() => setLogTarget(null)}
>
<div className="dialog-body">
<pre className="plugin-log-pre mono selectable">{logTarget.text}</pre>
</div>
</Modal>
)}
{schemeEditorOpen && (
<Modal
title={tr('pluginSchemeModalTitle')}
+17 -10
View File
@@ -2,6 +2,7 @@ import { Download, LoaderCircle, Pause, RefreshCw } from 'lucide-react'
import React, { useEffect, useState } from 'react'
import '../i18n/domains/wizard.gen'
import { I18nKey, t } from '../i18n'
import { describeRuntimeStatus } from '../lib/runtimeStatus'
import { taskDetail } from '../lib/tasks'
import { InstalledRuntime, Locale, RemoteRuntime, Task } from '../types'
import { Button, IconButton } from '../ui/controls'
@@ -16,6 +17,7 @@ interface Props {
onChannel: (alpha: boolean) => void
onInstall: (commit: string) => void
onCancel: (taskId: string) => void
onLatestCommit?: (commit: string) => void
}
const gb = (b: number) => (b >= 1e9 ? `${(b / 1e9).toFixed(1)} GB` : `${Math.ceil(b / 1e6)} MB`)
@@ -27,7 +29,7 @@ const shortQemu = (v: string) => v.replace(/^QEMU emulator version\s*/i, 'QEMU '
* The runtime rows: the active runtime and whether it is current (or, with
* none installed, the newest release to install), then the alpha switch.
*/
export const RuntimeOnline: React.FC<Props> = ({ locale, channel, installed, task, onChannel, onInstall, onCancel }) => {
export const RuntimeOnline: React.FC<Props> = ({ locale, channel, installed, task, onChannel, onInstall, onCancel, onLatestCommit }) => {
const tr = (k: I18nKey, v?: Record<string, string | number>) => t(locale, k, v)
const [remote, setRemote] = useState<RemoteRuntime[] | null>(null)
const [error, setError] = useState('')
@@ -43,16 +45,13 @@ export const RuntimeOnline: React.FC<Props> = ({ locale, channel, installed, tas
return () => { live = false }
}, [channel, task?.status === 'done', reload])
const active = installed.find((i) => i.active) ?? installed[0]
const latest = remote?.[0]
const sameRuntimeId = (a: string, b: string) => {
const [baseA, revA = ''] = a.split('-', 2)
const [baseB, revB = ''] = b.split('-', 2)
return revA === revB && (baseA.startsWith(baseB) || baseB.startsWith(baseA))
}
const isInstalled = (c: string) => installed.some((i) => sameRuntimeId(i.commit, c))
const { active, latestCommit, activeIsLatest, updatable, switchRecommended } = describeRuntimeStatus(installed, latest)
const running = task?.status === 'running'
const updatable = !!latest && !isInstalled(latest.commit)
useEffect(() => {
onLatestCommit?.(latestCommit)
}, [latestCommit, onLatestCommit])
let sub: React.ReactNode
if (running && task) {
@@ -67,6 +66,12 @@ export const RuntimeOnline: React.FC<Props> = ({ locale, channel, installed, tas
<span>{task.percent >= 0 ? `${Math.floor(task.percent)}%` : ''} {taskDetail(task)}</span>
</div>
)
} else if (switchRecommended && active && latest) {
sub = (
<div className="row-sub">
{shortQemu(active.manifest.qemu_version)} · {tr('runtimeRecommendLatest', { v: latest.commit })}
</div>
)
} else if (active && !updatable) {
sub = <div className="row-sub">{shortQemu(active.manifest.qemu_version)}</div>
} else if (error) {
@@ -107,7 +112,9 @@ export const RuntimeOnline: React.FC<Props> = ({ locale, channel, installed, tas
<Button variant="primary" icon={<Download size={14} />} onClick={() => onInstall(latest!.commit)}>
{tr(active ? 'runtimeUpdate' : 'runtimeInstall')}
</Button>
) : !running && active && remote ? (
) : !running && switchRecommended ? (
<span className="badge rg-p-badge badge-warn">{tr('runtimeNotLatest')}</span>
) : !running && active && activeIsLatest ? (
<span className="badge rg-p-badge badge-ok">{tr('runtimeUpToDate')}</span>
) : null}
</div>
+184 -74
View File
@@ -13,21 +13,29 @@ import {
memorySafeLimitGB,
parseMemoryGB,
recommendedCPUs,
canKeepDisplayPreset,
fullscreenDisplayPresets,
FullscreenDisplayPreset,
hidpiLooksLike,
hostDisplayAdvice,
hostDisplayDesc,
windowDisplayPresets,
recommendedMemoryGB,
recommendedResolution,
shortGPUName,
sshCommand,
} from '../lib/format'
import {
buildResolutionOptions,
buildSettingsSaveDiff,
countChangedSettingsFields,
deriveSettingsResolutionState,
expandTouchedSettingsFields,
normalizeResolution,
reconcileSettingsFormOnBaseChange,
resolveCustomResBlur,
selectSettingsResolution,
switchSettingsGraphics,
toggleSettingsBorderless,
} from '../lib/displayResolution'
import { applyKernelIrqchip, findOptimization, kernelIrqchipHint, parseKernelIrqchip } from '../lib/optimizations'
import { useVMStats } from '../lib/vmStats'
import { HostReport, Locale, Optimization, SetOpts, ValidationIssue, VMAffinityStatus, VMDetail, VMStats } from '../types'
import { HostReport, Locale, Optimization, SetOpts, ValidationIssue, VMAffinityStatus, VMDetail, VMStats, DiskCache } from '../types'
import { Button } from '../ui/controls'
import { Modal } from '../ui/dialog'
import { NumberField, OptionCards, PopupSelect, RangeField, ScreenArt, Segmented, SetGroup, SetRow, SetValue, Switch } from '../ui/settings'
@@ -36,7 +44,7 @@ import { api } from '../wails'
import { formatAffinitySummary } from './AffinityDialog'
import { VMNetworkSettings } from './VMNetworkSettings'
import { DefenderExclusionRow, DiskMaintenanceRows, useDiskMaintenance } from './vmSettings/disk'
import { KeymapSection, useKeymap } from './vmSettings/keymap'
import { DiskCacheRow } from './vmSettings/diskCache'
import { useVMPluginSettings, VMPluginGroup } from './vmSettings/plugins'
import { DriveShareSection, SharedFolderSection, useDriveShares, useSharedFolders, WritableFolderDialog } from './vmSettings/sharing'
import { SMBIOSDialog, SMBIOSSection, useSMBIOS } from './vmSettings/smbios'
@@ -69,9 +77,11 @@ const FIELD_CAT: Record<Field, Cat> = {
graphics: 'display',
gpu: 'display',
resolution: 'display',
auto_resolution: 'display',
displays: 'display',
borderless: 'display',
disk_controller: 'storage',
disk_cache: 'storage',
network: 'storage',
ssh_port: 'storage',
capture: 'input',
@@ -86,21 +96,20 @@ const FIELDS = Object.keys(FIELD_CAT) as Field[]
const LOG_LEVELS = ['error', 'warn', 'info', 'debug', 'trace'] as const
const CUSTOM = '__custom'
const RES_RE = /^\s*\d{3,5}\s*[x×]\s*\d{3,5}\s*$/i
const normPath = (s: string | undefined) => (s ?? '').replace(/\//g, '\\').toLowerCase()
const normRes = (s: string | undefined) => (s ?? '').replace(/\s/g, '').replace(/×/g, 'x').toLowerCase()
/** Whether two values of a field mean the same thing to reims-ctl. */
function same(field: Field, a: SetOpts[Field], b: SetOpts[Field]): boolean {
switch (field) {
case 'memory': return parseMemoryGB(a as string) === parseMemoryGB(b as string)
case 'gpu': return normPath(a as string) === normPath(b as string)
case 'resolution': return normRes(a as string) === normRes(b as string)
case 'resolution': return normalizeResolution(a as string) === normalizeResolution(b as string)
case 'log_level':
case 'extra_args':
case 'audio_backend':
case 'disk_cache':
case 'guest_lang': return String(a ?? '').trim() === String(b ?? '').trim()
default: return a === b
}
@@ -117,9 +126,11 @@ function baseline(detail: VMDetail, host: HostReport): SetOpts {
graphics: detail.graphics,
displays: detail.displays || 1,
disk_controller: detail.disk_controller,
disk_cache: (detail.disk_cache as DiskCache) || 'default',
resolution: detail.resolution,
auto_resolution: !!detail.auto_resolution,
borderless: detail.borderless,
capture: detail.capture,
...(detail.capture_supported ? { capture: detail.capture } : {}),
gpu: icd ?? (detail.gpu || 'auto'),
logs: detail.logs,
log_level: detail.log_level,
@@ -140,6 +151,7 @@ interface Props {
stats?: VMStats | null
host: HostReport
fixedModeSupported?: boolean
diskCacheSupported?: boolean
optimizations?: Optimization[]
running: boolean
onCopy?: (text: string) => void
@@ -153,7 +165,7 @@ interface Props {
onSaved: () => void
}
export const SettingsModal: React.FC<Props> = ({ locale, detail, driverID, stats, host, fixedModeSupported = false, optimizations, running, onCopy, onDiskChanged, onOpenAffinity, affinityVersion = 0, onHostChanged, onToast, onClose, onSaved }) => {
export const SettingsModal: React.FC<Props> = ({ locale, detail, driverID, stats, host, fixedModeSupported = false, diskCacheSupported = false, optimizations, running, onCopy, onDiskChanged, onOpenAffinity, affinityVersion = 0, onHostChanged, onToast, onClose, onSaved }) => {
const tr = (k: I18nKey, v?: Record<string, string | number>) => t(locale, k, v)
const irqOpt = findOptimization(optimizations, 'kernel_irqchip')
const base = useMemo(() => baseline(detail, host), [detail, host])
@@ -170,9 +182,8 @@ export const SettingsModal: React.FC<Props> = ({ locale, detail, driverID, stats
const drives = useDriveShares(detail.name)
const folders = useSharedFolders(detail.name, locale)
const smbios = useSMBIOS(detail, running)
const keymap = useKeymap(detail.name, running, cat === 'input')
const plugins = useVMPluginSettings(`${driverID}:${detail.name}`, setErr)
const disk = useDiskMaintenance({ locale, driverID, vm: detail.name, running, stats, onError: setErr, onDiskChanged })
const disk = useDiskMaintenance({ locale, driverID, vm: detail.name, diskPath: detail.disk, running, stats, onError: setErr, onDiskChanged })
const timezone = useGuestTimezone(driverID, detail.name, running, cat === 'general')
const display = useTargetDisplay({
locale, driverID, vm: detail.name, running, host, shown: cat === 'display', onToast,
@@ -182,45 +193,86 @@ export const SettingsModal: React.FC<Props> = ({ locale, detail, driverID, stats
const tzBusy = timezone.tzBusy
const pane = useRef<HTMLDivElement>(null)
const presets = windowDisplayPresets(displayProfile, fixedModeSupported)
const fsPresets = fullscreenDisplayPresets(displayProfile)
const activePresets: FullscreenDisplayPreset[] = form.borderless ? fsPresets : presets
const presetHit = activePresets.some((p) => same('resolution', p.resolution, form.resolution))
const [forceCustomRes, setCustomRes] = useState(false)
const customRes = forceCustomRes || !presetHit
const { presets, fsPresets, activePresets, autoPreset, customRes, resValue, resBad } = deriveSettingsResolutionState({
form,
displayProfile,
fixedModeSupported,
forceCustomRes,
})
const [customLog, setCustomLog] = useState(!!form.log_level && !(LOG_LEVELS as readonly string[]).includes(form.log_level))
// The detail the panel opened with can be a stale one (reopened right after
// a save, before the refreshed detail arrives): follow newer details until
// the person changes something.
const edited = useRef(false)
// a save, before the refreshed detail arrives) or refreshed in the background:
// sync untouched fields from the latest baseline while preserving user edits.
const vmIdentity = `${driverID}:${detail.name}`
const vmIdentityRef = useRef(vmIdentity)
const touchedFieldsRef = useRef<Set<Field>>(new Set())
useEffect(() => {
if (edited.current) return
setForm(base)
setCustomRes(false)
setCustomLog(!!base.log_level && !(LOG_LEVELS as readonly string[]).includes(base.log_level))
}, [base])
const prevKey = vmIdentityRef.current
vmIdentityRef.current = vmIdentity
if (prevKey !== vmIdentity) {
touchedFieldsRef.current.clear()
setIssues([])
setErr('')
setCustomRes(false)
setCustomLog(!!base.log_level && !(LOG_LEVELS as readonly string[]).includes(base.log_level))
} else {
const touched = touchedFieldsRef.current
if (!touched.has('resolution') && !touched.has('auto_resolution')) {
setCustomRes(false)
}
if (!touched.has('log_level')) {
setCustomLog(!!base.log_level && !(LOG_LEVELS as readonly string[]).includes(base.log_level))
}
}
setForm((cur) => reconcileSettingsFormOnBaseChange({
previousVMKey: prevKey,
nextVMKey: vmIdentity,
form: cur,
base,
touchedFields: touchedFieldsRef.current,
}).form)
}, [base, vmIdentity])
useEffect(() => {
setForm((f) => {
if (!detail.capture_supported) {
return f.capture === undefined ? f : { ...f, capture: undefined }
}
return f.capture === undefined ? { ...f, capture: detail.capture } : f
})
}, [detail.capture_supported, detail.capture])
const set = (patch: Partial<SetOpts>) => {
edited.current = true
const touched = expandTouchedSettingsFields(Object.keys(patch)) as Field[]
for (const f of touched) touchedFieldsRef.current.add(f)
setForm((f) => ({ ...f, ...patch }))
const touched = Object.keys(patch)
setIssues((list) => list.filter((i) => !touched.includes(i.field)))
setIssues((list) => list.filter((i) => !touched.includes(i.field as Field)))
}
const dirty = (f: Field) => !same(f, form[f], base[f])
const dirty = (f: Field) => (f === 'capture' && !detail.capture_supported ? false : !same(f, form[f], base[f]))
const reset = (f: Field) => () => {
set({ [f]: base[f] } as Partial<SetOpts>)
if (f === 'resolution' || f === 'borderless') setCustomRes(false)
const toClear = expandTouchedSettingsFields([f]) as Field[]
for (const field of toClear) touchedFieldsRef.current.delete(field)
setForm((cur) => {
const next = { ...cur }
for (const field of toClear) {
;(next as unknown as Record<string, unknown>)[field] = (base as unknown as Record<string, unknown>)[field]
}
return next
})
setIssues((list) => list.filter((i) => !toClear.includes(i.field as Field)))
if (f === 'resolution' || f === 'auto_resolution' || f === 'borderless') setCustomRes(false)
if (f === 'log_level') setCustomLog(!!base.log_level && !(LOG_LEVELS as readonly string[]).includes(base.log_level))
}
const changed = FIELDS.filter(dirty)
const changedIn = (c: Cat) => changed.filter((f) => FIELD_CAT[f] === c).length
const changedCount = countChangedSettingsFields(changed)
const changedIn = (c: Cat) => countChangedSettingsFields(changed.filter((f) => FIELD_CAT[f] === c))
const issueOf = (f: Field) => issues.find((i) => i.field === f)?.message
const issueIn = (c: Cat) => issues.some((i) => FIELD_CAT[i.field as Field] === c) || (c === 'display' && resBad)
const strayIssues = issues.filter((i) => !(i.field in FIELD_CAT))
// Inline checks the backend would also reject, so the row says it first.
const resBad = customRes && !RES_RE.test(form.resolution ?? '')
const sshOn = (form.ssh_port ?? 0) > 0
const localBlock = resBad
const nestedVirtAvailable = host.whpx === 'ready' && host.whpx_caps?.nested_vmx && !host.needs_cold_reboot_workaround
@@ -269,8 +321,7 @@ export const SettingsModal: React.FC<Props> = ({ locale, detail, driverID, stats
setIssues([])
setBusy(true)
try {
const diff: SetOpts = { name: detail.name }
for (const f of changed) (diff as unknown as Record<string, unknown>)[f] = form[f]
const diff = buildSettingsSaveDiff(detail.name, changed, form, base)
const iss = await api.ValidateSet(diff)
if (iss && iss.length > 0) {
setIssues(iss)
@@ -288,7 +339,7 @@ export const SettingsModal: React.FC<Props> = ({ locale, detail, driverID, stats
}
const resetAll = () => {
edited.current = false
touchedFieldsRef.current.clear()
setForm(base)
setIssues([])
setCustomRes(false)
@@ -485,19 +536,21 @@ export const SettingsModal: React.FC<Props> = ({ locale, detail, driverID, stats
const vgpu = form.graphics !== 'vmware-svga'
const targetDisp = activeTargetDisplay
const hidpiAdvice = hostDisplayAdvice(displayProfile, tr, presets)
const resValue = customRes ? CUSTOM : activePresets.find((p) => same('resolution', p.resolution, form.resolution))?.resolution
const changeGraphics = (graphics: string) => {
const next = switchSettingsGraphics(graphics)
if (next.forceCustomRes !== undefined) setCustomRes(next.forceCustomRes)
set(next.patch)
}
const toggleBorderless = (borderless: boolean) => {
const targetPresets = borderless ? fsPresets : presets
if (!customRes && !targetPresets.some((p) => canKeepDisplayPreset(p, form.resolution, borderless))) {
const nextRes = borderless
? (targetDisp && targetDisp.width > 0 && targetDisp.height > 0
? `${targetDisp.width}x${targetDisp.height}`
: targetPresets[0]?.resolution ?? form.resolution)
: recommendedResolution(displayProfile)
set({ borderless, resolution: nextRes })
return
}
set({ borderless })
set(toggleSettingsBorderless({
borderless,
form,
displayProfile,
targetDisplay: targetDisp,
presets,
fsPresets,
customRes,
}))
}
const resArt = (r: string) => {
const m = /^(\d+)\s*[x×]\s*(\d+)$/i.exec(r)
@@ -516,7 +569,7 @@ export const SettingsModal: React.FC<Props> = ({ locale, detail, driverID, stats
<Segmented
label={tr('graphicsBackend')}
value={form.graphics}
onChange={(graphics) => set({ graphics })}
onChange={changeGraphics}
options={[
{ value: 'reims-vgpu', label: tr('graphicsReimsShort') },
{ value: 'vmware-svga', label: tr('graphicsSvgaShort') },
@@ -539,7 +592,7 @@ export const SettingsModal: React.FC<Props> = ({ locale, detail, driverID, stats
<button
type="button"
className="link-btn"
onClick={() => set({ graphics: 'vmware-svga' })}
onClick={() => changeGraphics('vmware-svga')}
>
{tr('gpuSwitchSvga')}
</button>
@@ -563,7 +616,11 @@ export const SettingsModal: React.FC<Props> = ({ locale, detail, driverID, stats
/>
<SetRow
{...rowProps('resolution')}
error={issueOf('resolution') ?? (resBad ? tr('resInvalid') : undefined)}
dirty={dirty('resolution') || dirty('auto_resolution')}
onReset={reset('resolution')}
disabled={!vgpu}
reason={tr('gpuSvgaReason')}
error={issueOf('resolution') ?? issueOf('auto_resolution') ?? (resBad ? tr('resInvalid') : undefined)}
title={tr('resolution')}
desc={hostDisplayDesc(host, tr, activeTargetDisplay, (d) =>
tr('targetDisplayHint', {
@@ -579,13 +636,41 @@ export const SettingsModal: React.FC<Props> = ({ locale, detail, driverID, stats
label={tr('resolution')}
value={resValue}
onChange={(v) => {
if (v === CUSTOM) { setCustomRes(true); return }
setCustomRes(false)
set({ resolution: v })
const next = selectSettingsResolution({ value: v, form, base, autoPreset })
setCustomRes(next.forceCustomRes)
set(next.patch)
}}
options={[
...activePresets.map((p) => ({
value: p.resolution,
options={buildResolutionOptions({
graphics: form.graphics,
autoPreset,
activePresets,
includeCustom: true,
}).map((item) => {
if (item.kind === 'auto') {
const p = item.preset!
return {
value: item.value,
title: tr('resAuto'),
sub: tr('resAutoSub', { res: p.label }),
art: resArt(p.resolution),
badges: [
p.hidpi ? tr('hidpiPresetBadge') : '',
p.scaleBadge ?? '',
tr('recommendedBadge'),
].filter(Boolean),
}
}
if (item.kind === 'custom') {
return {
value: item.value,
title: tr('resCustom'),
sub: tr('resCustomSub'),
art: <span className="screen-art custom" aria-hidden="true" />,
}
}
const p = item.preset!
return {
value: item.value,
title: p.label,
sub: p.hidpi ? hidpiLooksLike(p.resolution, tr) : undefined,
art: resArt(p.resolution),
@@ -596,9 +681,8 @@ export const SettingsModal: React.FC<Props> = ({ locale, detail, driverID, stats
p.scaleToFit ? tr('resScaleToFitWindow') : '',
p.recommended ? tr('recommendedBadge') : '',
].filter(Boolean),
})),
{ value: CUSTOM, title: tr('resCustom'), sub: tr('resCustomSub'), art: <span className="screen-art custom" aria-hidden="true" /> },
]}
}
})}
/>
{customRes && (
<input
@@ -608,6 +692,20 @@ export const SettingsModal: React.FC<Props> = ({ locale, detail, driverID, stats
autoFocus
value={form.resolution ?? ''}
onChange={(e) => set({ resolution: e.target.value })}
onBlur={() => {
const blurred = resolveCustomResBlur({
resolution: form.resolution,
autoResolution: form.auto_resolution,
forceCustomRes,
activePresets,
})
if (blurred.nextResolution !== undefined && blurred.nextResolution !== form.resolution) {
set({ resolution: blurred.nextResolution })
}
if (blurred.exitCustom) {
setCustomRes(false)
}
}}
/>
)}
{!form.borderless && hidpiAdvice && <div className="srow-desc res-advice">{hidpiAdvice}</div>}
@@ -681,6 +779,17 @@ export const SettingsModal: React.FC<Props> = ({ locale, detail, driverID, stats
/>
}
/>
<DiskCacheRow
locale={locale}
value={(form.disk_cache as DiskCache) || 'default'}
dirty={dirty('disk_cache')}
supported={diskCacheSupported}
reason={tr('diskCacheRequiresRuntime')}
onReset={reset('disk_cache')}
resetLabel={tr('resetField')}
error={issueOf('disk_cache')}
onChange={(disk_cache) => set({ disk_cache })}
/>
<DiskMaintenanceRows locale={locale} running={running} state={disk} onCopy={onCopy} />
{host.defender_realtime_active && <DefenderExclusionRow locale={locale} dataRoot={host.data_root} onCopy={onCopy} onError={setErr} />}
</SetGroup>
@@ -725,15 +834,16 @@ export const SettingsModal: React.FC<Props> = ({ locale, detail, driverID, stats
const input = (
<>
<SetGroup title={tr('catInput')}>
<SetRow
{...rowProps('capture')}
title={tr('captureInput')}
desc={tr('captureInputHint')}
control={<Switch label={tr('captureInput')} checked={!!form.capture} onChange={(capture) => set({ capture })} />}
/>
</SetGroup>
<KeymapSection locale={locale} vm={detail.name} state={keymap} />
{detail.capture_supported && (
<SetGroup title={tr('catInput')}>
<SetRow
{...rowProps('capture')}
title={tr('captureInput')}
desc={tr('captureInputHint')}
control={<Switch label={tr('captureInput')} checked={!!form.capture} onChange={(capture) => set({ capture })} />}
/>
</SetGroup>
)}
<VMPluginGroup locale={locale} group="keyboard" state={plugins} />
<SetGroup title={tr('catAudio')} note={tr('audioTroubleshootNote')}>
<SetRow
@@ -877,10 +987,10 @@ export const SettingsModal: React.FC<Props> = ({ locale, detail, driverID, stats
<div className="dialog-foot">
<span className="foot-status" aria-live="polite">
{changed.length > 0
? <><span className="dirty-dot" aria-hidden="true" />{tr('pendingChanges', { n: changed.length })}</>
{changedCount > 0
? <><span className="dirty-dot" aria-hidden="true" />{tr('pendingChanges', { n: changedCount })}</>
: <span className="muted">{tr('noChanges')}</span>}
{changed.length > 0 && (
{changedCount > 0 && (
<button type="button" className="link-btn" disabled={busy} onClick={resetAll}>{tr('resetAll')}</button>
)}
</span>
+29 -2
View File
@@ -81,8 +81,13 @@ const FolderStep: React.FC<StepProps> = ({ locale, locales, state, tr, onLocale,
}, [selected])
const browse = async () => {
const dir = await api.PickDirectory(tr('setupTitle')).catch(() => '')
if (dir) { setCustom(dir); setCustomMode(true); setSelected(dir) }
try {
const dir = await api.PickDirectory(tr('setupTitle'))
if (dir) { setCustom(dir); setCustomMode(true); setSelected(dir) }
} catch (e) {
console.warn('[setup] PickDirectory failed:', e)
onError(tr('failGeneric'), e)
}
}
const next = async () => {
@@ -204,6 +209,18 @@ const RuntimeStep: React.FC<StepProps> = ({ locale, tr, state, runtimeTask, onCh
const ready = !!state.active_runtime || hasStambhaRuntime(state.runtimes)
const { host } = state
const [enabling, setEnabling] = useState(false)
const [activating, setActivating] = useState('')
const activate = async (commit: string) => {
setActivating(commit)
try {
await api.UseRuntime(commit)
onFolderDone()
} catch (e) {
onError(tr('runtimeActivationFailed'), e)
} finally {
setActivating('')
}
}
const enableWHPX = async () => {
setEnabling(true)
try {
@@ -295,6 +312,16 @@ const RuntimeStep: React.FC<StepProps> = ({ locale, tr, state, runtimeTask, onCh
onInstall={onInstallRuntime}
onCancel={onCancelTask}
/>
{(state.runtimes ?? []).filter((rt) => !rt.active).map((rt) => (
<div className="row" key={rt.commit}>
<div className="row-main"><div className="row-title mono">{rt.commit}</div></div>
<div className="row-right">
<Button busy={activating === rt.commit} disabled={!!activating} onClick={() => activate(rt.commit)}>
{tr('activate')}
</Button>
</div>
</div>
))}
</div>
<div className="setup-foot">
<Button variant="ghost" onClick={onImportRuntime}>{tr('setupImport')}</Button>
+17 -3
View File
@@ -49,15 +49,17 @@ interface Props {
updateDot?: boolean
/** Declared plugin pages shown after the built-in Plugins entry. */
pluginViews?: { id: string; title: string; badge?: string; icon?: string }[]
/** VMs currently being created (not yet in `vms`). */
creatingVMs?: { name: string; percent: number }[]
}
export const Sidebar: React.FC<Props> = ({
locale, vms, transitions, busyActions = {}, selected, hostReady, canSuspend, onSelect, displayNames = {}, macosMajors = {}, onActivate, onNew, onVMContextAction, downloading, safeMode, updateCard, updateDot, pluginViews = [],
locale, vms, transitions, busyActions = {}, selected, hostReady, canSuspend, onSelect, displayNames = {}, macosMajors = {}, onActivate, onNew, onVMContextAction, downloading, safeMode, updateCard, updateDot, pluginViews = [], creatingVMs = [],
}) => {
const tr = (k: I18nKey) => t(locale, k)
const listRef = useRef<HTMLDivElement>(null)
const ctxOpenedByPointerRef = useRef(false)
const ids = [...vms.map((v) => vmRefKey(v)), INSTALLERS_ID, PLUGINS_ID, ...pluginViews.map((view) => view.id), HOST_ID, SETTINGS_ID, ABOUT_ID]
const ids = [...vms.map((v) => vmRefKey(v)), ...creatingVMs.map((v) => v.name), INSTALLERS_ID, PLUGINS_ID, ...pluginViews.map((view) => view.id), HOST_ID, SETTINGS_ID, ABOUT_ID]
// Listbox keyboard model: ↑/↓/Home/End move selection and focus together.
const onKeyDown = (e: React.KeyboardEvent) => {
@@ -131,7 +133,7 @@ export const Sidebar: React.FC<Props> = ({
</div>
<div className="nav rg-p-nav" role="listbox" aria-label={tr('sidebarVMs')} ref={listRef} onKeyDown={onKeyDown}>
<div className="nav-group rg-p-nav-group nav-vms" role="group" aria-label={tr('sidebarVMs')}>
{vms.length === 0 && <div className="nav-empty rg-p-empty" data-rg-slot="empty.state">{tr('emptyVMs')}</div>}
{vms.length === 0 && creatingVMs.length === 0 && <div className="nav-empty rg-p-empty" data-rg-slot="empty.state">{tr('emptyVMs')}</div>}
{vms.map((vm) => {
const key = vmRefKey(vm)
const st = transitions[key] ?? vm.state
@@ -261,6 +263,18 @@ export const Sidebar: React.FC<Props> = ({
</Ctx.Root>
)
})}
{creatingVMs.map((item) => navBtn(
item.name,
item.name,
<VersionArt shape="tile" major={null} name={item.name} />,
'nav-icon-art',
t(locale, 'state_creating'),
statusKind('creating'),
undefined,
undefined,
{ state: 'creating', driver: '', busy: true, family: 'macos' },
item.percent >= 0 ? `${Math.floor(item.percent)}%` : undefined,
))}
</div>
<div className="nav-group rg-p-nav-group nav-system" role="group" aria-label={tr('sidebarSystem')}>
{navBtn(
+1 -1
View File
@@ -534,7 +534,7 @@ export const VMPage: React.FC<Props> = ({
<span className="sep">·</span>
<kbd>Ctrl+Alt+G</kbd> {tr('shortcutBarRelease')}
</p>
) : detail.capture ? (
) : (!detail.capture_supported || detail.capture) ? (
<p className="vm-footnote">
<kbd>Ctrl+Alt+Win</kbd> {tr('shortcutBarRelease')}
</p>
+17 -26
View File
@@ -1,23 +1,14 @@
import React, { useEffect, useId, useRef } from 'react'
import {
WORDMARK_GRADIENT,
WORDMARK_ORIGIN,
WORDMARK_STROKES,
WORDMARK_STROKE_WIDTH,
WORDMARK_VIEWBOX,
} from './wordmark.gen'
// Strokes of the Reims-Go wordmark (scripts/brand/wordmark.py), in pen order.
// Coordinates sit in the generator's baseline frame (translate 4 107).
type Stroke =
| { kind: 'path'; d: string; ink: 'ink' | 'dash' | 'brand' }
| { kind: 'dot'; cx: number; cy: number; r: number }
const STROKES: Stroke[] = [
{ kind: 'path', ink: 'ink', d: 'M7.5 -7.5V-36A24 28.5 0 0 1 31.5 -64.5' },
{ kind: 'path', ink: 'ink', d: 'M50.5 -36H107.5A28.5 28.5 0 1 0 100.18 -16.93' },
{ kind: 'path', ink: 'ink', d: 'M133.5 -64.5V-7.5' },
{ kind: 'dot', cx: 133.5, cy: -94, r: 9 },
{ kind: 'path', ink: 'ink', d: 'M159.5 -7.5V-36A22 28.5 0 0 1 203.5 -36V-7.5M203.5 -36A22 28.5 0 0 1 247.5 -36V-7.5' },
{ kind: 'path', ink: 'ink', d: 'M311.05 -59.02A21 14.25 0 0 0 273.5 -50.25A21 14.25 0 0 0 294.5 -36A21 14.25 0 0 1 315.5 -21.75A21 14.25 0 0 1 277.95 -12.98' },
{ kind: 'path', ink: 'dash', d: 'M340.5 -36H358.5' },
{ kind: 'path', ink: 'brand', d: 'M440.5 -36A28.5 28.5 0 1 1 440.5 -36.01' },
{ kind: 'path', ink: 'brand', d: 'M440.5 -64.5V0A28.5 22.5 0 0 1 387.32 11.25' },
{ kind: 'path', ink: 'brand', d: 'M523.5 -36A28.5 28.5 0 1 1 523.5 -36.01' },
]
// Geometry comes from scripts/brand/wordmark.py through wordmark.gen.ts: the
// strokes are in pen order, in the generator's baseline frame.
// Pen timing, in ms. Writing speed is constant, so long strokes take longer.
const PX_PER_MS = 0.62
@@ -101,20 +92,20 @@ export const WordmarkLoader: React.FC<Props> = ({ width = 168, label, className
<svg
ref={svgRef}
className="wordmark-loader-svg"
viewBox="0 0 539 141"
viewBox={`0 0 ${WORDMARK_VIEWBOX.width} ${WORDMARK_VIEWBOX.height}`}
width={width}
height={Math.round((width * 141) / 539)}
height={Math.round((width * WORDMARK_VIEWBOX.height) / WORDMARK_VIEWBOX.width)}
aria-hidden="true"
>
<defs>
<linearGradient id={gid} gradientUnits="userSpaceOnUse" x1="376" y1="0" x2="531" y2="0">
<stop offset="0" stopColor="#3b8cff" />
<stop offset="0.5" stopColor="#6d5dfc" />
<stop offset="1" stopColor="#ff7a9a" />
<linearGradient id={gid} gradientUnits="userSpaceOnUse" x1={WORDMARK_GRADIENT.x1} y1="0" x2={WORDMARK_GRADIENT.x2} y2="0">
{WORDMARK_GRADIENT.stops.map((color, i) => (
<stop key={color} offset={i / (WORDMARK_GRADIENT.stops.length - 1)} stopColor={color} />
))}
</linearGradient>
</defs>
<g transform="translate(4 107)" fill="none" strokeWidth="15" strokeLinecap="round" strokeLinejoin="round">
{STROKES.map((s, i) => s.kind === 'dot' ? (
<g transform={`translate(${WORDMARK_ORIGIN.x} ${WORDMARK_ORIGIN.y})`} fill="none" strokeWidth={WORDMARK_STROKE_WIDTH} strokeLinecap="round" strokeLinejoin="round">
{WORDMARK_STROKES.map((s, i) => s.kind === 'dot' ? (
<circle
key={i}
data-stroke=""
+6 -1
View File
@@ -32,7 +32,12 @@ export const SnapshotSection: React.FC<Props> = ({ locale, driverID, name, state
const loadSnapshots = () => {
if (!shown) { setSnapshots([]); return }
api.ListSnapshots(driverID, name).then((list) => setSnapshots(list ?? [])).catch(() => setSnapshots([]))
api.ListSnapshots(driverID, name)
.then((list) => setSnapshots(list ?? []))
.catch((e) => {
console.warn('[snapshots] ListSnapshots failed:', driverID, name, e)
setSnapshots([])
})
}
useEffect(() => {
setCreatingSnap(false)
+6 -1
View File
@@ -29,7 +29,12 @@ export function useSSHAccess({ locale, driverID, name, enabled, onToast, onError
useEffect(() => {
if (!enabled) { setSshUser(''); return }
let live = true
api.GetVMSSHUser(driverID, name).then((u) => { if (live) setSshUser(u ?? '') }).catch(() => { if (live) setSshUser('') })
api.GetVMSSHUser(driverID, name)
.then((u) => { if (live) setSshUser(u ?? '') })
.catch((e) => {
console.warn('[ssh] GetVMSSHUser failed:', driverID, name, e)
if (live) setSshUser('')
})
return () => { live = false }
}, [driverID, name, enabled])
+6 -2
View File
@@ -1,6 +1,7 @@
import { ChevronRight, Copy } from 'lucide-react'
import React from 'react'
import { I18nKey, t } from '../../i18n'
import { formatResolutionLabel } from '../../lib/format'
import { Locale, VMDetail, VMInfo } from '../../types'
import { IconButton } from '../../ui/controls'
@@ -16,6 +17,9 @@ interface Props {
/** The raw values upstream tools use for the VM, folded by default. */
export const TechInfo: React.FC<Props> = ({ locale, name, driverID, detail, vmInfo, onCopy }) => {
const tr = (k: I18nKey, v?: Record<string, string | number>) => t(locale, k, v)
const resolutionValue = detail
? (detail.graphics !== 'vmware-svga' && detail.auto_resolution ? formatResolutionLabel(detail.resolution, true, tr) : detail.resolution)
: ''
const copyTechSummary = () => {
if (!detail) {
if (!vmInfo) return
@@ -32,7 +36,7 @@ export const TechInfo: React.FC<Props> = ({ locale, name, driverID, detail, vmIn
`${tr('fieldCPUModel')}: ${detail.cpu_model || 'auto'}`,
`${tr('fieldGraphicsBackend')}: ${detail.graphics}`,
...(detail.gpu && detail.gpu !== 'auto' ? [`${tr('fieldICD')}: ${detail.gpu}`] : []),
`${tr('resolution')}: ${detail.displays} × ${detail.resolution}`,
`${tr('resolution')}: ${detail.displays} × ${resolutionValue}`,
`${tr('fieldController')}: ${detail.disk_controller}`,
`${tr('fieldDisk')}: ${detail.disk}`,
`${tr('fieldNetwork')}: ${detail.network_summary || tr('off')}`,
@@ -71,7 +75,7 @@ export const TechInfo: React.FC<Props> = ({ locale, name, driverID, detail, vmIn
<dt>{tr('fieldCPUModel')}</dt><dd className="mono">{detail.cpu_model || 'auto'}</dd>
<dt>{tr('fieldGraphicsBackend')}</dt><dd>{detail.graphics}</dd>
{detail.gpu && detail.gpu !== 'auto' && (<><dt>{tr('fieldICD')}</dt><dd className="mono">{detail.gpu}</dd></>)}
<dt>{tr('resolution')}</dt><dd>{detail.displays} × {detail.resolution}</dd>
<dt>{tr('resolution')}</dt><dd>{detail.displays} × {resolutionValue}</dd>
<dt>{tr('fieldController')}</dt><dd>{detail.disk_controller}</dd>
<dt>{tr('fieldDisk')}</dt><dd className="mono">{detail.disk}</dd>
<dt>{tr('fieldNetwork')}</dt><dd className="mono">{detail.network_summary || tr('off')}</dd>
+19 -10
View File
@@ -11,14 +11,20 @@ interface DiskOptions {
locale: Locale
driverID: string
vm: string
diskPath?: string
running: boolean
stats?: VMStats | null
onError: (message: string) => void
onDiskChanged?: () => void
}
function isWindowsRawDevicePath(disk?: string): boolean {
const s = (disk ?? '').trim().replace(/\//g, '\\')
return /^\\\\\.\\(physicaldrive|harddiskvolume|harddisk|volume\{)|^\\\\\?\\volume\{/i.test(s)
}
/** Resizing, compacting and optimizing the VM's disk, one at a time. */
export function useDiskMaintenance({ locale, driverID, vm, running, stats, onError, onDiskChanged }: DiskOptions) {
export function useDiskMaintenance({ locale, driverID, vm, diskPath, running, stats, onError, onDiskChanged }: DiskOptions) {
const tr = (k: I18nKey, v?: Record<string, string | number>) => t(locale, k, v)
const activeVMNameRef = useRef(vm)
activeVMNameRef.current = vm
@@ -53,7 +59,10 @@ export function useDiskMaintenance({ locale, driverID, vm, running, stats, onErr
}
}
const isQcow2 = !stats?.disk_format || stats.disk_format === 'qcow2'
const isRawDevice = isWindowsRawDevicePath(diskPath)
const resizeDisabled = running || isRawDevice
const resizeReason = isRawDevice ? tr('diskResizeRawDisabled') : tr('stopBeforeDiskOp')
const isQcow2 = !isRawDevice && (!stats?.disk_format || stats.disk_format === 'qcow2')
const diskRewriteBaseReason = running ? tr('stopBeforeDiskOp')
: (stats?.disk_snapshot_count ?? 0) > 0 ? tr('diskRewriteSnapshots')
: (stats?.disk_backing_depth ?? 0) > 0 ? tr('diskRewriteOverlay')
@@ -93,7 +102,7 @@ export function useDiskMaintenance({ locale, driverID, vm, running, stats, onErr
return {
resizeInput, setResizeInput, diskOpBusy, resizeResult, compactResult, optimizeResult, extendedL2,
compactRowReason, optimizeRowReason, handleResizeDisk, handleCompactDisk,
resizeDisabled, resizeReason, compactRowReason, optimizeRowReason, handleResizeDisk, handleCompactDisk,
}
}
@@ -104,16 +113,16 @@ interface RowsProps {
onCopy?: (text: string) => void
}
export const DiskMaintenanceRows: React.FC<RowsProps> = ({ locale, running, state, onCopy }) => {
export const DiskMaintenanceRows: React.FC<RowsProps> = ({ locale, running: _running, state, onCopy }) => {
const tr = (k: I18nKey, v?: Record<string, string | number>) => t(locale, k, v)
const { resizeInput, setResizeInput, diskOpBusy, resizeResult, compactResult, optimizeResult, extendedL2, compactRowReason, optimizeRowReason, handleResizeDisk, handleCompactDisk } = state
const { resizeInput, setResizeInput, diskOpBusy, resizeResult, compactResult, optimizeResult, extendedL2, resizeDisabled, resizeReason, compactRowReason, optimizeRowReason, handleResizeDisk, handleCompactDisk } = state
return (
<>
<SetRow
title={tr('diskResizeTitle')}
desc={tr('diskResizeDesc')}
disabled={running}
reason={tr('stopBeforeDiskOp')}
disabled={resizeDisabled}
reason={resizeReason}
block={
<div className="stack-2">
<div className="hstack">
@@ -124,7 +133,7 @@ export const DiskMaintenanceRows: React.FC<RowsProps> = ({ locale, running, stat
type="button"
className="preset"
aria-pressed={resizeInput === v}
disabled={running || !!diskOpBusy}
disabled={resizeDisabled || !!diskOpBusy}
onClick={() => setResizeInput(v)}
>
{v}
@@ -139,14 +148,14 @@ export const DiskMaintenanceRows: React.FC<RowsProps> = ({ locale, running, stat
value={resizeInput}
spellCheck={false}
autoComplete="off"
disabled={running || !!diskOpBusy}
disabled={resizeDisabled || !!diskOpBusy}
onChange={(e) => setResizeInput(e.target.value)}
placeholder="+64G / 256G"
/>
<Button
variant="secondary"
busy={diskOpBusy === 'resize'}
disabled={running || !!diskOpBusy || !resizeInput.trim()}
disabled={resizeDisabled || !!diskOpBusy || !resizeInput.trim()}
onClick={handleResizeDisk}
>
{tr('diskResizeAction')}
@@ -0,0 +1,59 @@
import React from 'react'
import { I18nKey, t } from '../../i18n'
import { DiskCache, Locale } from '../../types'
import { Segmented, SetRow } from '../../ui/settings'
interface Props {
locale: Locale
value: DiskCache
dirty: boolean
supported?: boolean
reason?: string
onReset: () => void
resetLabel: string
error?: string
onChange: (cache: DiskCache) => void
}
export const DiskCacheRow: React.FC<Props> = ({ locale, value, dirty, supported = true, reason, onReset, resetLabel, error, onChange }) => {
const tr = (k: I18nKey, v?: Record<string, string | number>) => t(locale, k, v)
const baseDesc = value === 'writeback'
? tr('diskCacheDescWriteback')
: value === 'none'
? tr('diskCacheDescNone')
: value === 'unsafe'
? tr('diskCacheDescUnsafe')
: tr('diskCacheDescDefault')
const rowDisabled = !supported && value === 'default'
const disableNonDefault = !supported
const desc = !supported && value !== 'default' && reason
? `${baseDesc} · ${reason}`
: baseDesc
return (
<SetRow
field="disk_cache"
dirty={dirty}
disabled={rowDisabled}
reason={reason}
onReset={onReset}
resetLabel={resetLabel}
error={error}
title={tr('diskCacheTitle')}
desc={desc}
control={
<Segmented
label={tr('diskCacheTitle')}
value={value}
onChange={onChange}
options={[
{ value: 'default', label: tr('diskCacheOptionDefault') },
{ value: 'writeback', label: tr('diskCacheOptionWriteback'), disabled: disableNonDefault },
{ value: 'none', label: tr('diskCacheOptionNone'), disabled: disableNonDefault },
{ value: 'unsafe', label: tr('diskCacheOptionUnsafe'), disabled: disableNonDefault },
]}
/>
}
/>
)
}
@@ -1,86 +0,0 @@
import React, { useEffect, useRef, useState } from 'react'
import { I18nKey, t } from '../../i18n'
import { createKeymapRequests, keymapPresetUpdate, keymapUpdate, type KeymapState } from '../../lib/vmKeymap'
import { Locale, VMKeymapGuestModifier, VMKeymapHostModifier, VMKeymapPreset } from '../../types'
import { PopupSelect, Segmented, SetGroup, SetRow, Switch } from '../../ui/settings'
import { api } from '../../wails'
/** The VM's modifier key mapping, refreshed while shown. */
export function useKeymap(vm: string, running: boolean, shown: boolean) {
const activeVMNameRef = useRef(vm)
activeVMNameRef.current = vm
const [{ keymap, error: keymapErr, busy: keymapBusy }, setKeymapState] = useState<KeymapState>({ keymap: null, error: '', busy: false })
const [keymapRequests] = useState(() => createKeymapRequests(api, () => activeVMNameRef.current,
(patch) => setKeymapState((state) => ({ ...state, ...patch }))))
useEffect(() => {
setKeymapState(keymapRequests.initial(vm))
}, [vm, keymapRequests])
useEffect(() => {
if (!shown) return
const { refresh, stop } = keymapRequests.watch(vm)
void refresh()
const timer = window.setInterval(refresh, 3000)
return () => { stop(); window.clearInterval(timer) }
}, [shown, vm, running, keymapRequests])
return { keymap, keymapErr, keymapBusy, write: keymapRequests.write }
}
export const KeymapSection: React.FC<{ locale: Locale; vm: string; state: ReturnType<typeof useKeymap> }> = ({ locale, vm, state }) => {
const tr = (k: I18nKey, v?: Record<string, string | number>) => t(locale, k, v)
const { keymap, keymapErr, keymapBusy, write } = state
return (
<SetGroup title={tr('keymapGroupTitle')} note={tr('keymapGroupNote')}>
{keymapErr && <div className="notice notice-error" role="alert">{keymapErr}</div>}
{keymap && <>
<SetRow title={tr('keymapPresetTitle')} disabled={keymapBusy}
desc={keymap.preset === 'off' && !keymap.capture_host_shortcuts ? undefined
: !keymap.input_service_available ? tr('keymapInputServiceRequired')
: !keymap.running ? tr('keymapStopped')
: keymap.needs_guest_tools && !keymap.guest_connected ? tr('keymapWaiting')
: keymap.needs_guest_tools && (keymap.guest_agent_version ?? 0) < keymap.required_agent_version
? tr('keymapUpgrade', { version: keymap.required_agent_version })
: keymap.needs_guest_tools && !keymap.guest_keymap_active ? tr('keymapPending')
: tr(keymap.hook_active ? 'keymapRunning' : 'keymapInactive')}
control={<Segmented<VMKeymapPreset> label={tr('keymapPresetTitle')} value={keymap.preset}
options={[{ value: 'off', label: tr('keymapPresetOff') }, { value: 'win_to_cmd', label: tr('keymapPresetWinToCmd') }, { value: 'swap_alt_win', label: tr('keymapPresetSwapAltWin') }, { value: 'custom', label: tr('keymapPresetCustom') }]}
onChange={(preset) => {
const request = keymapPresetUpdate(keymap, preset)
if (request) void write(vm, request)
}} />}
/>
<SetRow title={tr('keymapCaptureHostShortcutsTitle')} desc={tr('keymapCaptureHostShortcutsDesc')} disabled={keymapBusy}
control={<Switch label={tr('keymapCaptureHostShortcutsTitle')} checked={keymap.capture_host_shortcuts}
onChange={(capture_host_shortcuts) => { void write(vm, keymapUpdate(keymap, { capture_host_shortcuts })) }} />}
/>
{keymap.preset === 'custom' && ([
['lwin', 'keymapHostLwin'],
['rwin', 'keymapHostRwin'],
['lalt', 'keymapHostLalt'],
['ralt', 'keymapHostRalt'],
['lctrl', 'keymapHostLctrl'],
['rctrl', 'keymapHostRctrl'],
['capslock', 'keymapHostCapslock'],
] as const satisfies readonly (readonly [VMKeymapHostModifier, I18nKey])[]).map(([modifier, label]) => (
<SetRow key={modifier} title={tr(label)} disabled={keymapBusy}
control={<PopupSelect<VMKeymapGuestModifier> label={tr(label)} value={keymap.bindings[modifier] ?? 'default'}
options={[
{ value: 'default', label: tr('keymapGuestDefault') },
{ value: 'lcmd', label: tr('keymapGuestLcmd') },
{ value: 'rcmd', label: tr('keymapGuestRcmd') },
{ value: 'lopt', label: tr('keymapGuestLopt') },
{ value: 'ropt', label: tr('keymapGuestRopt') },
{ value: 'lctrl', label: tr('keymapGuestLctrl') },
{ value: 'rctrl', label: tr('keymapGuestRctrl') },
{ value: 'esc', label: tr('keymapGuestEsc') },
{ value: 'disabled', label: tr('keymapGuestDisabled') },
]}
onChange={(target) => { void write(vm, keymapUpdate(keymap, { bindings: { [modifier]: target } })) }} />}
/>
))}
</>}
</SetGroup>
)
}
+33
View File
@@ -0,0 +1,33 @@
// Code generated by scripts/brand/wordmark.py; DO NOT EDIT.
// Run "python scripts/brand/wordmark.py" after changing the wordmark.
export type WordmarkInk = 'ink' | 'dash' | 'brand'
export type WordmarkStroke =
| { kind: 'path'; ink: WordmarkInk; d: string }
| { kind: 'dot'; cx: number; cy: number; r: number }
/** viewBox of the wordmark, in generator units. */
export const WORDMARK_VIEWBOX = { width: 539, height: 141 }
/** Translation that puts the generator's baseline frame into the viewBox. */
export const WORDMARK_ORIGIN = { x: 4, y: 107 }
export const WORDMARK_STROKE_WIDTH = 15
/** Horizontal extent of the brand gradient on the baseline. */
export const WORDMARK_GRADIENT = { x1: 376, x2: 531, stops: ['#3b8cff', '#6d5dfc', '#ff7a9a'] }
/** Strokes in pen order, in the generator's baseline frame. */
export const WORDMARK_STROKES: WordmarkStroke[] = [
{ kind: 'path', ink: 'ink', d: 'M7.5 -7.5V-36A24 28.5 0 0 1 31.5 -64.5' },
{ kind: 'path', ink: 'ink', d: 'M50.5 -36H107.5A28.5 28.5 0 1 0 100.18 -16.93' },
{ kind: 'path', ink: 'ink', d: 'M133.5 -64.5V-7.5' },
{ kind: 'dot', cx: 133.5, cy: -94, r: 9 },
{ kind: 'path', ink: 'ink', d: 'M159.5 -7.5V-36A22 28.5 0 0 1 203.5 -36V-7.5M203.5 -36A22 28.5 0 0 1 247.5 -36V-7.5' },
{ kind: 'path', ink: 'ink', d: 'M311.05 -59.02A21 14.25 0 0 0 273.5 -50.25A21 14.25 0 0 0 294.5 -36A21 14.25 0 0 1 315.5 -21.75A21 14.25 0 0 1 277.95 -12.98' },
{ kind: 'path', ink: 'dash', d: 'M340.5 -36H358.5' },
{ kind: 'path', ink: 'brand', d: 'M440.5 -36A28.5 28.5 0 1 1 440.5 -36.01' },
{ kind: 'path', ink: 'brand', d: 'M440.5 -64.5V0A28.5 22.5 0 0 1 387.32 11.25' },
{ kind: 'path', ink: 'brand', d: 'M523.5 -36A28.5 28.5 0 1 1 523.5 -36.01' },
]
+9 -1
View File
@@ -1,8 +1,9 @@
// Code generated by cmd/i18ngen; DO NOT EDIT.
// Code generated by scripts/i18ngen; DO NOT EDIT.
export const coreZh: Record<string, string> = {
"affinityMenu": "处理器相关性…",
"appearance": "外观",
"autoResolution": "自动分辨率",
"backToEdit": "返回修改",
"borderless": "无边框全屏",
"cancel": "取消",
@@ -138,10 +139,13 @@ export const coreZh: Record<string, string> = {
"quitFailed": "已取消退出",
"quitInProgress": "正在退出…",
"refresh": "刷新",
"resAuto": "自动",
"resAutoValue": "自动({res})",
"resLooksLike": "看起来像 {w} × {h}",
"resizeLogPanel": "拖动调整日志高度",
"resolution": "分辨率",
"restart": "重启",
"runtimeActivationFailed": "运行时激活失败",
"safeModeBanner": "安全模式已启用:已跳过全部第三方插件并回退至内置默认主题",
"safeModeManagePlugins": "管理插件",
"save": "保存",
@@ -214,6 +218,7 @@ export const coreZh: Record<string, string> = {
export const coreEn: Record<string, string> = {
"affinityMenu": "Processor Affinity…",
"appearance": "Appearance",
"autoResolution": "Auto resolution",
"backToEdit": "Edit and retry",
"borderless": "Borderless full screen",
"cancel": "Cancel",
@@ -349,10 +354,13 @@ export const coreEn: Record<string, string> = {
"quitFailed": "Quit canceled",
"quitInProgress": "Quitting…",
"refresh": "Refresh",
"resAuto": "Auto",
"resAutoValue": "Auto ({res})",
"resLooksLike": "Looks like {w} × {h}",
"resizeLogPanel": "Drag to resize log panel",
"resolution": "Resolution",
"restart": "Restart",
"runtimeActivationFailed": "Runtime activation failed",
"safeModeBanner": "Safe mode is active: all third-party plugins are disabled and the built-in theme is restored",
"safeModeManagePlugins": "Manage plugins",
"save": "Save",
+15 -15
View File
@@ -1,4 +1,4 @@
// Code generated by cmd/i18ngen; DO NOT EDIT.
// Code generated by scripts/i18ngen; DO NOT EDIT.
import { registerBuiltinDomain } from '../runtime'
export const pluginsZh: Record<string, string> = {
@@ -34,7 +34,6 @@ export const pluginsZh: Record<string, string> = {
"pluginFailLoadSettings": "读取插件设置失败",
"pluginFailMarketInstall": "安装市场插件失败",
"pluginFailMarketLoad": "加载插件市场失败",
"pluginFailReadLog": "读取插件日志失败",
"pluginFailRemove": "卸载插件失败",
"pluginFailSaveScheme": "保存配色方案失败",
"pluginFailSaveSettings": "保存插件设置失败",
@@ -48,8 +47,7 @@ export const pluginsZh: Record<string, string> = {
"pluginInUse": "使用中不可卸载",
"pluginLinkDevBtn": "链接插件开发目录",
"pluginLinkDevTitle": "链接本地开发插件目录",
"pluginLogEmpty": "暂无日志记录",
"pluginLogTitle": "{id} — 日志",
"pluginMarketAlphaTag": "Alpha",
"pluginMarketDownloading": "下载中",
"pluginMarketEmpty": "当前插件市场暂无可用条目,你仍可导入本地 .zip 插件包或配置自定义市场索引地址",
"pluginMarketFeedEnd": "共 {count} 个插件",
@@ -67,6 +65,11 @@ export const pluginsZh: Record<string, string> = {
"pluginMarketLoading": "正在读取插件市场",
"pluginMarketRefresh": "刷新索引",
"pluginMarketSearchPlaceholder": "搜索市场插件、作者或标签",
"pluginMarketSortComposite": "综合排序",
"pluginMarketSortDownloads": "最多下载",
"pluginMarketSortLabel": "排序方式",
"pluginMarketSortRecent": "最新发布",
"pluginMarketSortStars": "最多 Star",
"pluginMarketStaleBanner": "远程插件市场暂不可达,当前显示本地缓存或内置回退索引",
"pluginMarketSyncing": "正在同步插件市场",
"pluginMarketUpdateShort": "更新",
@@ -75,7 +78,6 @@ export const pluginsZh: Record<string, string> = {
"pluginMarketWithdrawnInstalledWarn": "已安装插件 {id} 已从市场撤回:{reason}",
"pluginMarketWithdrawnInstead": "建议改用:{target}",
"pluginNewScheme": "新建配色方案",
"pluginPanelsSection": "插件面板",
"pluginPermCount": "{count, plural, other {# 项权限}}",
"pluginPermissionsLabel": "权限:{list}",
"pluginPublisherLicense": "发布者 / 许可",
@@ -94,9 +96,7 @@ export const pluginsZh: Record<string, string> = {
"pluginScanBlockedBtn": "已拦截,无法安装",
"pluginScanCapabilitiesSection": "能力与权限说明",
"pluginScanHardSection": "硬性拦截项(禁止安装)",
"pluginScanInspect": "安全扫描",
"pluginScanInstallConfirm": "确认导入安装",
"pluginScanModalTitle": "插件静态安全报告",
"pluginScanMoreItems": "另有 {count} 项已折叠",
"pluginSchemeDefault": "默认",
"pluginSchemeModalTitle": "新建配色方案",
@@ -108,6 +108,7 @@ export const pluginsZh: Record<string, string> = {
"pluginStateDegraded": "已降级",
"pluginStateFailed": "故障",
"pluginStatePending": "等待依赖",
"pluginSubmitBtn": "上架插件",
"pluginSurfaceSeed": "画布种子色(可选)",
"pluginTabInstalled": "已安装",
"pluginTabMarket": "市场",
@@ -120,7 +121,6 @@ export const pluginsZh: Record<string, string> = {
"pluginTrustDev": "开发",
"pluginTrustOfficial": "官方",
"pluginTrustVerified": "已审核",
"pluginViewLog": "查看日志",
}
export const pluginsEn: Record<string, string> = {
@@ -156,7 +156,6 @@ export const pluginsEn: Record<string, string> = {
"pluginFailLoadSettings": "Couldn’t load plugin settings",
"pluginFailMarketInstall": "Couldn’t install plugin from market",
"pluginFailMarketLoad": "Couldn’t load plugin market",
"pluginFailReadLog": "Couldn’t read plugin log",
"pluginFailRemove": "Couldn’t remove plugin",
"pluginFailSaveScheme": "Couldn’t save color scheme",
"pluginFailSaveSettings": "Couldn’t save plugin settings",
@@ -170,8 +169,7 @@ export const pluginsEn: Record<string, string> = {
"pluginInUse": "In use",
"pluginLinkDevBtn": "Link plugin dev folder",
"pluginLinkDevTitle": "Link local dev plugin folder",
"pluginLogEmpty": "No log entries yet",
"pluginLogTitle": "{id} — Log",
"pluginMarketAlphaTag": "Alpha",
"pluginMarketDownloading": "Downloading",
"pluginMarketEmpty": "No plugins available in the market index yet. You can still import local .zip packages or configure a custom index URL.",
"pluginMarketFeedEnd": "{count} plugins",
@@ -189,6 +187,11 @@ export const pluginsEn: Record<string, string> = {
"pluginMarketLoading": "Loading the plugin market",
"pluginMarketRefresh": "Refresh index",
"pluginMarketSearchPlaceholder": "Search market plugins, publishers, or tags",
"pluginMarketSortComposite": "Recommended",
"pluginMarketSortDownloads": "Most downloads",
"pluginMarketSortLabel": "Sort by",
"pluginMarketSortRecent": "Recently updated",
"pluginMarketSortStars": "Most stars",
"pluginMarketStaleBanner": "Remote market index is unreachable; showing cached or offline fallback data",
"pluginMarketSyncing": "Syncing the plugin market",
"pluginMarketUpdateShort": "Update",
@@ -197,7 +200,6 @@ export const pluginsEn: Record<string, string> = {
"pluginMarketWithdrawnInstalledWarn": "Installed plugin {id} has been withdrawn: {reason}",
"pluginMarketWithdrawnInstead": "Recommended replacement: {target}",
"pluginNewScheme": "New scheme",
"pluginPanelsSection": "Plugin panels",
"pluginPermCount": "{count, plural, one {# permission} other {# permissions}}",
"pluginPermissionsLabel": "Permissions: {list}",
"pluginPublisherLicense": "Publisher / License",
@@ -216,9 +218,7 @@ export const pluginsEn: Record<string, string> = {
"pluginScanBlockedBtn": "Blocked — cannot install",
"pluginScanCapabilitiesSection": "Capabilities \u0026 privileges",
"pluginScanHardSection": "Hard blockers (install refused)",
"pluginScanInspect": "Security scan",
"pluginScanInstallConfirm": "Proceed with install",
"pluginScanModalTitle": "Plugin security report",
"pluginScanMoreItems": "...and {count} more",
"pluginSchemeDefault": "Default",
"pluginSchemeModalTitle": "New color scheme",
@@ -230,6 +230,7 @@ export const pluginsEn: Record<string, string> = {
"pluginStateDegraded": "Degraded",
"pluginStateFailed": "Failed",
"pluginStatePending": "Pending",
"pluginSubmitBtn": "Submit plugin",
"pluginSurfaceSeed": "Surface seed (optional)",
"pluginTabInstalled": "Installed",
"pluginTabMarket": "Market",
@@ -242,7 +243,6 @@ export const pluginsEn: Record<string, string> = {
"pluginTrustDev": "Dev",
"pluginTrustOfficial": "Official",
"pluginTrustVerified": "Verified",
"pluginViewLog": "View log",
}
registerBuiltinDomain(pluginsZh, pluginsEn)
+38 -90
View File
@@ -1,4 +1,4 @@
// Code generated by cmd/i18ngen; DO NOT EDIT.
// Code generated by scripts/i18ngen; DO NOT EDIT.
import { registerBuiltinDomain } from '../runtime'
export const settingsZh: Record<string, string> = {
@@ -6,8 +6,6 @@ export const settingsZh: Record<string, string> = {
"aboutCopyDiscord": "复制邀请链接",
"aboutCopyQQGroup": "复制群号",
"aboutDiscord": "Discord 社区",
"aboutDiscordSub": "交流使用体验、硬件兼容反馈、Alpha 测试与插件开发",
"aboutIssueSub": "遇到问题或有功能建议,在 GitHub 提交 Issue",
"aboutJoinDiscord": "加入服务器",
"aboutJoinQQGroup": "加入群聊",
"aboutLicensesOpenGitHub": "在 GitHub 查看",
@@ -16,14 +14,11 @@ export const settingsZh: Record<string, string> = {
"aboutLicensesTabNotice": "第三方声明",
"aboutLicensesTitle": "开源许可与声明",
"aboutLicensesView": "查看",
"aboutProjectSub": "GitHub 上的源码与发布版本",
"aboutQQGroup": "QQ 交流群",
"aboutQQGroupSub": "点击直接拉起 QQ 加群,交流使用与问题反馈",
"aboutQQLaunchFailed": "未能拉起 QQ,可复制群号手动搜索加入",
"aboutQQNotInstalled": "未安装 QQ",
"aboutQQNotInstalledSub": "未检测到本地 QQ,可复制群号手动搜索加入",
"aboutTagline": "在 Windows 上开一台带 GPU 加速的 macOS 虚拟机——免编译,开箱即用。",
"aboutWebsiteSub": "reims.dev 上的下载、使用文档、插件市场与兼容性列表",
"activate": "使用",
"affinityApplyNow": "立即应用",
"affinityAvoidLPE": "避开 LP-E",
@@ -61,12 +56,12 @@ export const settingsZh: Record<string, string> = {
"appCheckUpdate": "检查更新",
"appUpToDate": "已是最新",
"appUpdateAvailable": "发现新版本 {v}(稳定版)",
"appUpdateAvailableAlpha": "发现新版本 {v}(Alpha 测试版)",
"appUpdateAvailableDev": "发现新版本 {v}(Dev 滚动版)",
"appUpdateChannelAlpha": "Alpha",
"appUpdateChannelDev": "Dev",
"appUpdateAvailableAlpha": "发现新版本 {v}(测试版)",
"appUpdateAvailableDev": "发现新版本 {v}(开发版)",
"appUpdateChannelAlpha": "测试版",
"appUpdateChannelDev": "开发版",
"appUpdateChannelStable": "稳定版",
"appUpdateChannelSubKeepOld": "接收 {channel} 预发布版本;启动时不删除旧版程序与已下载安装包,方便随时回退",
"appUpdateChannelSubKeepOld": "接收{channel};启动时不删除旧版程序与已下载安装包,方便随时回退",
"appUpdateChannelSubStable": "仅接收经过验证的正式稳定版本",
"appUpdateChannelTitle": "更新通道",
"appUpdateLookupFailed": "暂时无法连接 GitHub 检查更新",
@@ -104,7 +99,7 @@ export const settingsZh: Record<string, string> = {
"bridgeUplink": "出口网卡",
"bridgeUplinkHint": "每台虚拟机独立选择一张已连接的有线或 WLAN 网卡",
"captureInput": "点击窗口时捕获键鼠",
"captureInputHint": "开启后 ⌘Tab 等快捷键交给 macOS;关闭时 Win 键和 Alt+Tab 留给 Windows",
"captureInputHint": "开启后将指针锁定在窗口内,并将 ⌘Tab 等快捷键交给 macOS;关闭后鼠标可自由移出窗口,Win 键和 Alt+Tab 留给 Windows",
"catAdvanced": "高级",
"catAudio": "音频",
"catCompute": "处理器与内存",
@@ -116,7 +111,7 @@ export const settingsZh: Record<string, string> = {
"catNetwork": "网络",
"catStorage": "存储",
"catStorageNet": "存储与网络",
"choose": "浏览…",
"choose": "选择…",
"configured": "已配置",
"coresUnit": "核",
"cpuOverHint": "留给 Windows 的线程不足 2 个,电脑可能变卡",
@@ -125,6 +120,16 @@ export const settingsZh: Record<string, string> = {
"defenderExclusionDesc": "实时扫描可能拖慢虚拟机磁盘访问。可在 Windows 安全中心为数据目录 {path} 添加排除项。",
"defenderExclusionTitle": "Windows Defender 实时防护排除建议",
"defenderOpenSecurity": "打开 Windows 安全中心",
"diskCacheDescDefault": "跟随运行时默认策略(回写缓存并正常转发刷盘请求)",
"diskCacheDescNone": "绕过宿主机页缓存直通磁盘(Direct I/O),适合裸分区直挂",
"diskCacheDescUnsafe": "警告:忽略 Guest 刷盘指令以换取最高吞吐,宿主机断电或崩溃可能导致磁盘损坏",
"diskCacheDescWriteback": "经宿主机页缓存回写,并安全转发 Guest 刷盘请求",
"diskCacheOptionDefault": "默认",
"diskCacheOptionNone": "直通",
"diskCacheOptionUnsafe": "激进 (Unsafe)",
"diskCacheOptionWriteback": "回写",
"diskCacheRequiresRuntime": "当前运行时版本过旧,请更新到支持磁盘缓存策略的新版运行时",
"diskCacheTitle": "磁盘 I/O 缓存策略",
"diskCompactAction": "立即回收",
"diskCompactDesc": "把 macOS 里已删除文件占用的空间还给 Windows,过程中需要与当前占用差不多的空闲空间",
"diskCompactDone": "已回收 {reclaimed}({before} → {after})",
@@ -149,6 +154,7 @@ export const settingsZh: Record<string, string> = {
"diskResizeAction": "扩容",
"diskResizeDesc": "只能增大。扩大后在 macOS 终端运行提示的命令,新空间才能使用",
"diskResizeDone": "已扩大到 {size}。在 macOS 终端运行:",
"diskResizeRawDisabled": "Windows 裸分区不支持在此调整容量",
"diskResizeTitle": "扩大磁盘",
"diskRewriteBusy": "正在进行另一项磁盘操作。",
"diskRewriteOverlay": "此磁盘共享基础镜像,无法直接重写。",
@@ -362,38 +368,6 @@ export const settingsZh: Record<string, string> = {
"kernelIrqchipLabel": "中断加速",
"kernelIrqchipOff": "关闭",
"kernelIrqchipOn": "开启",
"keymapCaptureHostShortcutsDesc": "虚拟机获得焦点时,拦截 Windows 的 Win 和 Alt 快捷键。未单独映射的 Win 和 Alt 在 macOS 中仍用作 Command 和 Option。",
"keymapCaptureHostShortcutsTitle": "聚焦时拦截宿主机快捷键",
"keymapGroupNote": "仅在此虚拟机窗口位于前台时生效。Ctrl+Alt+Win 保留用于释放捕获。",
"keymapGroupTitle": "修饰键映射",
"keymapGuestDefault": "默认",
"keymapGuestDisabled": "禁用",
"keymapGuestEsc": "Esc",
"keymapGuestLcmd": "左 ⌘ Command",
"keymapGuestLctrl": "左 ⌃ Control",
"keymapGuestLopt": "左 ⌥ Option",
"keymapGuestRcmd": "右 ⌘ Command",
"keymapGuestRctrl": "右 ⌃ Control",
"keymapGuestRopt": "右 ⌥ Option",
"keymapHostCapslock": "Caps Lock",
"keymapHostLalt": "左 Alt",
"keymapHostLctrl": "左 Ctrl",
"keymapHostLwin": "左 Win",
"keymapHostRalt": "右 Alt",
"keymapHostRctrl": "右 Ctrl",
"keymapHostRwin": "右 Win",
"keymapInactive": "修饰键映射未启用",
"keymapInputServiceRequired": "请启用宿主输入服务以使用修饰键映射",
"keymapPending": "等待 Guest Tools 启用修饰键映射",
"keymapPresetCustom": "自定义",
"keymapPresetOff": "关闭",
"keymapPresetSwapAltWin": "Alt ↔ Win",
"keymapPresetTitle": "映射预设",
"keymapPresetWinToCmd": "Win → ⌘",
"keymapRunning": "虚拟机获得焦点时生效",
"keymapStopped": "虚拟机启动后生效",
"keymapUpgrade": "请将 Guest Tools 更新到版本 {version}",
"keymapWaiting": "等待 Guest Tools 连接",
"language": "语言",
"languageSub": "内置简体中文与英语,可通过插件扩展更多语言",
"logLevel": "日志级别",
@@ -443,7 +417,10 @@ export const settingsZh: Record<string, string> = {
"optUnavailable": "不可用",
"pendingChanges": "{n, plural, other {# 项更改,下次启动生效}}",
"platformReadonly": "机型、序列号等平台身份信息不在界面显示",
"qemuASLR": "自动为 QEMU 启用 ASLR",
"qemuASLRHint": "设置随运行时版本切换,虚拟机关机后再启动时生效,可能解决 macOS Dock 图标空白的问题",
"recommendedBadge": "推荐",
"resAutoSub": "当前屏 {res}",
"resCustom": "自定义",
"resCustomSub": "宽 × 高",
"resInvalid": "格式为 宽x高,例如 2560x1600",
@@ -494,9 +471,6 @@ export const settingsZh: Record<string, string> = {
"storageInstallers": "镜像",
"storageRuntimes": "Reims-Go",
"storageVMs": "虚拟机文件",
"syncHostMemorySMBIOS": "同步宿主机内存规格",
"syncHostMemorySMBIOSSub": "在 macOS「关于本机」中显示宿主机真实内存频率与代数(当前:{spec}),下次启动生效",
"syncHostMemorySMBIOSUnavailable": "未能从宿主机 SMBIOS 读取物理内存频率,虚拟机将保持默认的 2666 MHz DDR4",
"targetDisplayDisconnectedOption": "已断开 · 回退至主显示器",
"targetDisplayFallbackHint": "已保存的「{name}」当前未连接,将回退至主显示器",
"targetDisplayHint": "目标显示器:{name}({w}×{h},{scale}% 缩放)",
@@ -548,8 +522,6 @@ export const settingsEn: Record<string, string> = {
"aboutCopyDiscord": "Copy invite link",
"aboutCopyQQGroup": "Copy group ID",
"aboutDiscord": "Discord community",
"aboutDiscordSub": "Chat with users, share hardware compatibility, test alphas and build plugins",
"aboutIssueSub": "Report a problem or suggest a feature on GitHub",
"aboutJoinDiscord": "Join server",
"aboutJoinQQGroup": "Join group",
"aboutLicensesOpenGitHub": "View on GitHub",
@@ -558,14 +530,11 @@ export const settingsEn: Record<string, string> = {
"aboutLicensesTabNotice": "Third-party notices",
"aboutLicensesTitle": "Open-source licenses",
"aboutLicensesView": "View",
"aboutProjectSub": "Source code and releases on GitHub",
"aboutQQGroup": "QQ Group",
"aboutQQGroupSub": "Launch QQ directly to join for community support and feedback",
"aboutQQLaunchFailed": "Couldn’t launch QQ — copy the group ID to join manually",
"aboutQQNotInstalled": "QQ not installed",
"aboutQQNotInstalledSub": "Local QQ wasn’t detected — copy the group ID to join manually",
"aboutTagline": "Run a GPU-accelerated macOS virtual machine on Windows — prebuilt, ready out of the box.",
"aboutWebsiteSub": "Downloads, docs, plugin market and compatibility list on reims.dev",
"activate": "Use",
"affinityApplyNow": "Apply Now",
"affinityAvoidLPE": "Exclude LP-E",
@@ -646,7 +615,7 @@ export const settingsEn: Record<string, string> = {
"bridgeUplink": "Uplink adapter",
"bridgeUplinkHint": "Choose one connected wired or WLAN adapter independently for each VM",
"captureInput": "Capture keyboard and mouse on click",
"captureInputHint": "When on, shortcuts like ⌘Tab go to macOS; when off, Win and Alt+Tab stay with Windows",
"captureInputHint": "When on, locks the pointer inside the window and sends shortcuts like ⌘Tab to macOS; when off, the mouse moves freely outside the window and Win and Alt+Tab stay with Windows",
"catAdvanced": "Advanced",
"catAudio": "Audio",
"catCompute": "CPU \u0026 Memory",
@@ -658,7 +627,7 @@ export const settingsEn: Record<string, string> = {
"catNetwork": "Network",
"catStorage": "Storage",
"catStorageNet": "Storage \u0026 Network",
"choose": "Browse…",
"choose": "Choose…",
"configured": "Configured",
"coresUnit": "cores",
"cpuOverHint": "Leaves Windows fewer than 2 threads; your PC may slow down",
@@ -667,6 +636,16 @@ export const settingsEn: Record<string, string> = {
"defenderExclusionDesc": "Real-time scanning can slow VM disk access. You can exclude the data folder {path} in Windows Security.",
"defenderExclusionTitle": "Windows Defender real-time protection exclusions",
"defenderOpenSecurity": "Open Windows Security",
"diskCacheDescDefault": "Follows the current runtime default (writeback caching, flushes forwarded to host)",
"diskCacheDescNone": "Direct I/O bypassing host page cache; recommended for raw partition passthrough",
"diskCacheDescUnsafe": "Warning: ignores guest flushes for peak throughput; host power loss or crash can corrupt the disk",
"diskCacheDescWriteback": "Uses host page cache and forwards guest flushes safely to disk",
"diskCacheOptionDefault": "Default",
"diskCacheOptionNone": "Direct",
"diskCacheOptionUnsafe": "Unsafe",
"diskCacheOptionWriteback": "Writeback",
"diskCacheRequiresRuntime": "Update to a newer runtime to configure disk I/O cache policy",
"diskCacheTitle": "Disk I/O cache",
"diskCompactAction": "Reclaim now",
"diskCompactDesc": "Gives space from files deleted in macOS back to Windows. Needs about as much free space as the disk uses now",
"diskCompactDone": "Reclaimed {reclaimed} ({before} → {after})",
@@ -691,6 +670,7 @@ export const settingsEn: Record<string, string> = {
"diskResizeAction": "Expand",
"diskResizeDesc": "Grow only. Afterwards, run the command shown in macOS Terminal to use the new space",
"diskResizeDone": "Expanded to {size}. Run this in macOS Terminal:",
"diskResizeRawDisabled": "Windows raw partitions cannot be resized here",
"diskResizeTitle": "Expand disk",
"diskRewriteBusy": "Another disk operation is in progress.",
"diskRewriteOverlay": "This disk shares a backing image and cannot be rewritten directly.",
@@ -904,38 +884,6 @@ export const settingsEn: Record<string, string> = {
"kernelIrqchipLabel": "Interrupt acceleration",
"kernelIrqchipOff": "Off",
"kernelIrqchipOn": "On",
"keymapCaptureHostShortcutsDesc": "Block Windows shortcuts that use Win or Alt while the VM is focused. Unmapped Win and Alt keys act as Command and Option in macOS.",
"keymapCaptureHostShortcutsTitle": "Capture Host Shortcuts",
"keymapGroupNote": "Applies only while this VM is focused. Ctrl+Alt+Win is reserved for releasing capture.",
"keymapGroupTitle": "Modifier keys",
"keymapGuestDefault": "Default",
"keymapGuestDisabled": "Disabled",
"keymapGuestEsc": "Esc",
"keymapGuestLcmd": "Left ⌘ Command",
"keymapGuestLctrl": "Left ⌃ Control",
"keymapGuestLopt": "Left ⌥ Option",
"keymapGuestRcmd": "Right ⌘ Command",
"keymapGuestRctrl": "Right ⌃ Control",
"keymapGuestRopt": "Right ⌥ Option",
"keymapHostCapslock": "Caps Lock",
"keymapHostLalt": "Left Alt",
"keymapHostLctrl": "Left Ctrl",
"keymapHostLwin": "Left Win",
"keymapHostRalt": "Right Alt",
"keymapHostRctrl": "Right Ctrl",
"keymapHostRwin": "Right Win",
"keymapInactive": "Modifier mapping is inactive",
"keymapInputServiceRequired": "Enable Host Input Service to use modifier mapping",
"keymapPending": "Waiting for Guest Tools to activate modifier mapping",
"keymapPresetCustom": "Custom",
"keymapPresetOff": "Off",
"keymapPresetSwapAltWin": "Alt ↔ Win",
"keymapPresetTitle": "Preset",
"keymapPresetWinToCmd": "Win → ⌘",
"keymapRunning": "Active while this VM is focused",
"keymapStopped": "Applies when this VM is running",
"keymapUpgrade": "Update Guest Tools to version {version}",
"keymapWaiting": "Waiting for Guest Tools to connect",
"language": "Language",
"languageSub": "Simplified Chinese and English built in; add more via plugins",
"logLevel": "Log level",
@@ -985,7 +933,10 @@ export const settingsEn: Record<string, string> = {
"optUnavailable": "Unavailable",
"pendingChanges": "{n, plural, one {# change · applies on next start} other {# changes · applies on next start}}",
"platformReadonly": "Model, serial number and other platform identity are never shown",
"qemuASLR": "Automatically enable ASLR for QEMU",
"qemuASLRHint": "Applies to the selected runtime and may restore blank macOS Dock icons after you shut down and start the VM again",
"recommendedBadge": "Recommended",
"resAutoSub": "Follows display · {res}",
"resCustom": "Custom",
"resCustomSub": "Width × height",
"resInvalid": "Use WIDTHxHEIGHT, e.g. 2560x1600",
@@ -1036,9 +987,6 @@ export const settingsEn: Record<string, string> = {
"storageInstallers": "Images",
"storageRuntimes": "Reims-Go",
"storageVMs": "VM files",
"syncHostMemorySMBIOS": "Sync host memory specs",
"syncHostMemorySMBIOSSub": "Show the host's actual memory speed and generation ({spec}) in macOS About This Mac; applies on next start",
"syncHostMemorySMBIOSUnavailable": "Could not read host SMBIOS memory speed; VMs keep the default 2666 MHz DDR4",
"targetDisplayDisconnectedOption": "Disconnected · using primary",
"targetDisplayFallbackHint": "Saved {name} is disconnected; falling back to the primary display",
"targetDisplayHint": "Target display: {name} ({w}×{h} at {scale}%)",
+5 -1
View File
@@ -1,4 +1,4 @@
// Code generated by cmd/i18ngen; DO NOT EDIT.
// Code generated by scripts/i18ngen; DO NOT EDIT.
export const vmZh: Record<string, string> = {
"attachGuestTools": "挂载 Guest Tools",
@@ -13,6 +13,8 @@ export const vmZh: Record<string, string> = {
"connGroup": "连接",
"copyScreenshot": "截屏并复制",
"cores": "{n, plural, other {# 核}}",
"creatingPreparing": "正在准备虚拟机环境与磁盘…",
"creatingProgressTitle": "创建进度",
"deleteConfirm": "删除",
"deleteDesc": "配置和虚拟磁盘会被移除,无法撤销",
"deleteDescKeep": "只移除配置,磁盘文件留在原目录",
@@ -271,6 +273,8 @@ export const vmEn: Record<string, string> = {
"connGroup": "Connection",
"copyScreenshot": "Copy screenshot",
"cores": "{n, plural, one {# core} other {# cores}}",
"creatingPreparing": "Preparing the virtual machine and disk…",
"creatingProgressTitle": "Creation progress",
"deleteConfirm": "Delete",
"deleteDesc": "Its configuration and virtual disk are removed. This can’t be undone",
"deleteDescKeep": "Only the configuration is removed; disk files stay in place",
+23 -3
View File
@@ -1,11 +1,17 @@
// Code generated by cmd/i18ngen; DO NOT EDIT.
// Code generated by scripts/i18ngen; DO NOT EDIT.
import { registerBuiltinDomain } from '../runtime'
export const wizardZh: Record<string, string> = {
"armRestoreDownload": "下载 IPSW",
"armRestoreDownloaded": "已下载的 IPSW",
"armRestoreGroup": "ARM 恢复镜像",
"armRestoreMediaHint": "从 Apple 下载 IPSW。创建虚拟机时,请在下方选择已制作的 Stambha 启动介质和可写虚拟磁盘。",
"armRestoreVersion": "macOS 27.2.1 (26B131) · 25.6 GB",
"armRuntimeLabel": "ARM64 来宾",
"commandToggle": "等效命令",
"commandToggleHint": "在终端运行下面这条命令效果相同",
"createNow": "创建",
"createStartedHint": "创建后窗口会关闭,进度在底部状态栏",
"createStartedHint": "创建后窗口会关闭,进度会显示在侧栏与主界面",
"issuesCount": "{n, plural, other {有 # 项需要修改}}",
"offlineCached": "已下载",
"offlineDownloading": "下载中",
@@ -21,11 +27,14 @@ export const wizardZh: Record<string, string> = {
"runtimeCurrent": "当前运行时",
"runtimeInstall": "安装",
"runtimeLatest": "最新:{v}",
"runtimeLatestBadge": "最新",
"runtimeLookupFailed": "无法读取运行时列表",
"runtimeLookupRateLimit": "GitHub 接口限流(HTTP 403),请稍后重试或手动导入",
"runtimeNewer": "有新版本:{v}",
"runtimeNoneOnChannel": "这个通道还没有发布运行时",
"runtimeNotLatest": "不是最新",
"runtimeOnline": "在线安装",
"runtimeRecommendLatest": "建议切换至最新运行时 {v}",
"runtimeRetry": "重试",
"runtimeUpToDate": "已是最新",
"runtimeUpdate": "更新",
@@ -87,13 +96,20 @@ export const wizardZh: Record<string, string> = {
"wizardDriverGroup": "客体平台驱动",
"wizardDriverType": "驱动类型",
"wizardTitle": "新建虚拟机",
"x86RuntimeLabel": "x86-64 来宾",
}
export const wizardEn: Record<string, string> = {
"armRestoreDownload": "Download IPSW",
"armRestoreDownloaded": "Downloaded IPSW",
"armRestoreGroup": "ARM restore image",
"armRestoreMediaHint": "Download the IPSW from Apple. To create a VM, select prepared Stambha boot media and a writable virtual disk below.",
"armRestoreVersion": "macOS 27.2.1 (26B131) · 25.6 GB",
"armRuntimeLabel": "ARM64 guest",
"commandToggle": "Equivalent command",
"commandToggleHint": "Running this in a terminal does the same thing",
"createNow": "Create",
"createStartedHint": "The window closes once creation starts; progress shows in the status bar",
"createStartedHint": "The window closes once creation starts; progress shows in the sidebar and main view",
"issuesCount": "{n, plural, one {# issue to fix} other {# issues to fix}}",
"offlineCached": "Downloaded",
"offlineDownloading": "Downloading",
@@ -109,11 +125,14 @@ export const wizardEn: Record<string, string> = {
"runtimeCurrent": "Current runtime",
"runtimeInstall": "Install",
"runtimeLatest": "Latest: {v}",
"runtimeLatestBadge": "Latest",
"runtimeLookupFailed": "Couldn’t read the runtime list",
"runtimeLookupRateLimit": "GitHub API rate limit reached (HTTP 403); retry later or import a local bundle",
"runtimeNewer": "New version: {v}",
"runtimeNoneOnChannel": "No runtime published on this channel yet",
"runtimeNotLatest": "Not latest",
"runtimeOnline": "Online install",
"runtimeRecommendLatest": "Switch to latest runtime {v}",
"runtimeRetry": "Retry",
"runtimeUpToDate": "Up to date",
"runtimeUpdate": "Update",
@@ -175,6 +194,7 @@ export const wizardEn: Record<string, string> = {
"wizardDriverGroup": "Guest driver",
"wizardDriverType": "Driver",
"wizardTitle": "New virtual machine",
"x86RuntimeLabel": "x86-64 guest",
}
registerBuiltinDomain(wizardZh, wizardEn)
@@ -1,7 +1,7 @@
import { BuiltinLocale, Locale, LocalizedText, ResolvedLocalePack } from './types'
import { formatICU, ICUVars, pseudoLocalizeICU } from './i18n/icu'
import type { I18nKey } from './i18n/keys.gen'
import { builtinDict, registerBuiltinDomain } from './i18n/runtime'
import { BuiltinLocale, Locale, LocalizedText, ResolvedLocalePack } from '../types'
import { formatICU, ICUVars, pseudoLocalizeICU } from './icu'
import type { I18nKey } from './keys.gen'
import { builtinDict, registerBuiltinDomain } from './runtime'
export type { I18nKey }
export { registerBuiltinDomain }
@@ -350,10 +350,17 @@ export function joinNotices(locale: Locale, items: string[]): string {
export function locText(lt: LocalizedText | undefined, locale: Locale, fallback = ''): string {
if (!lt) return fallback
const firstExtra = () => {
if (!lt.extra) return ''
for (const k of Object.keys(lt.extra).sort()) {
if (lt.extra[k]) return lt.extra[k]
}
return ''
}
const chain = buildFallbackChain(locale)
for (const step of chain) {
if (step === 'en-XA') {
const base = lt['en-US'] || lt['zh-CN'] || fallback
const base = lt['en-US'] || lt['zh-CN'] || firstExtra() || fallback
return base ? pseudoLocalizeICU(base) : fallback
}
if (step === 'zh-CN' && lt['zh-CN']) return lt['zh-CN']
@@ -361,7 +368,7 @@ export function locText(lt: LocalizedText | undefined, locale: Locale, fallback
const hit = lt.extra?.[step]
if (hit) return hit
}
return lt['en-US'] || lt['zh-CN'] || fallback
return lt['en-US'] || lt['zh-CN'] || firstExtra() || fallback
}
/**
Loaded 100 of 423 files, more files were not shown because too many files have changed in this diff. Show more