diff --git a/src-tauri/.gitignore b/src-tauri/.gitignore index b21bd68..61f45a0 100644 --- a/src-tauri/.gitignore +++ b/src-tauri/.gitignore @@ -2,6 +2,10 @@ # will have compiled files and executables /target/ +# Local-only Cargo target dir used when running `cargo test --target-dir target-test` +# to keep test artifacts separate from `cargo tauri dev/build` output. +/target-test/ + # Generated by Tauri # will have schema files for capabilities auto-completion /gen/schemas diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 0b8fb98..4cd93f2 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -330,7 +330,7 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "beanfun" -version = "5.9.3" +version = "5.9.4" dependencies = [ "aes", "anyhow", diff --git a/src/locales/en-US.json b/src/locales/en-US.json index d76c4f8..1a68ee4 100644 --- a/src/locales/en-US.json +++ b/src/locales/en-US.json @@ -84,7 +84,7 @@ "AutoCheckUpdate": "Notify when a new version is available", "RunAfterLogin": "Launch game after login", "MinimizeToTaskbar": "Minimize to system tray", - "DisableHardwareAcceleration": "Disable hardware acceleration (lower GPU usage)", + "DisableHardwareAcceleration": "Disable hardware acceleration", "MsgRestartForHardwareAccelTitle": "Restart required", "MsgRestartForHardwareAccel": "Hardware acceleration settings have changed. Fully exit Beanfun and start it again for the main window to use WPF software rendering.", "Game": "Game", diff --git a/src/locales/zh-CN.json b/src/locales/zh-CN.json index e39dc31..95514d8 100644 --- a/src/locales/zh-CN.json +++ b/src/locales/zh-CN.json @@ -73,7 +73,7 @@ "AutoCheckUpdate": "有新版本时提示更新", "RunAfterLogin": "登录完成后运行游戏", "MinimizeToTaskbar": "最小化到通知中心", - "DisableHardwareAcceleration": "关闭硬件加速(降低 GPU 使用)", + "DisableHardwareAcceleration": "关闭硬件加速", "MsgRestartForHardwareAccelTitle": "需要重新启动", "MsgRestartForHardwareAccel": "已变更硬件加速相关设置。请完全关闭 Beanfun 后再打开,主窗口才会套用 WPF 软件渲染。", "Game": "游戏", diff --git a/src/locales/zh-TW.json b/src/locales/zh-TW.json index 23b4cc9..f0d9f41 100644 --- a/src/locales/zh-TW.json +++ b/src/locales/zh-TW.json @@ -84,7 +84,7 @@ "AutoCheckUpdate": "有新版本時提示更新", "RunAfterLogin": "登入完成後開啟遊戲", "MinimizeToTaskbar": "最小化到通知中心", - "DisableHardwareAcceleration": "關閉硬體加速(降低 GPU 使用)", + "DisableHardwareAcceleration": "關閉硬體加速", "MsgRestartForHardwareAccelTitle": "需要重新啟動", "MsgRestartForHardwareAccel": "已變更硬體加速相關設定。請完全關閉 Beanfun 後再開啟,主視窗才會套用 WPF 軟體渲染。", "Game": "遊戲", diff --git a/src/pages/AccountList.vue b/src/pages/AccountList.vue index ae192e2..6fb25c6 100644 --- a/src/pages/AccountList.vue +++ b/src/pages/AccountList.vue @@ -313,6 +313,46 @@ function selectRow(a: ServiceAccount): void { account.selectedSid = a.sid } +/** + * Double-click on a row → copy the row's service-account ID (`sid`) + * to the clipboard. Mirrors WPF `lstViewAccount_MouseDoubleClick` + * (`AccountList.xaml.cs`), whose only side effect was + * `Clipboard.SetText(selected.sid)` — paired with the WPF tooltip + * resource `DoubleClickCopy` ("雙擊複製帳號 / Double-click to copy + * account") which is still shipped via the `DoubleClickCopy` i18n + * key today. Banned rows fall through silently (same guard as + * {@link selectRow}) so the SPA mirrors WPF's "disabled rows ignore + * input" behaviour. + * + * Selection is intentionally **not** armed here: WPF treats the + * double-click as a one-shot copy, not a row-arm; mutating + * `selectedSid` would also flip the OTP / Start Game UI on top of + * the copy, which the WPF user never saw. Single-click + Enter is + * the ergonomic path for OTP fetch (issue #239 fixes the missing + * keyboard route too). + * + * The SPA bypasses the {@link clipboardWriteOtp} helper because that + * helper's success / failure toasts use the OTP-specific + * `GetOtpSuccessAndCopy` string. A generic `CopyFinished` / + * `CopyFailed` toast pair matches the WPF tooltip wording and keeps + * the OTP helper single-purpose. + */ +async function handleRowDblClick(a: ServiceAccount): Promise { + if (!a.is_enable) return + try { + await navigator.clipboard.writeText(a.sid) + ElMessage.success(t('CopyFinished')) + } catch { + /* + * `navigator.clipboard.writeText` only rejects on permission / + * trust-boundary denial inside our Tauri webview — surface it + * so the user knows the buffer wasn't updated (otherwise + * they'd silently paste stale content into the launcher). + */ + ElMessage.error(t('CopyFailed')) + } +} + /* --------------- logout --------------- */ async function handleLogout(): Promise { @@ -2243,6 +2283,7 @@ onBeforeUnmount(() => { }" :data-test="`account-row-${a.sid}`" @click="selectRow(a)" + @dblclick="handleRowDblClick(a)" >