fix: restore double-click to copy account ID and hide account ID from row#244
Merged
fix: restore double-click to copy account ID and hide account ID from row#244
Conversation
Collaborator
|
The double-click handler is wiring up the wrong action. According to issue #239, the original WPF The |
lshw54
requested changes
Apr 26, 2026
…dback) Per @lshw54's review on #244: WPF `lstViewAccount_MouseDoubleClick` only called `Clipboard.SetText(selected.sid)` -- it never armed the selection or fetched an OTP. Replace the `handleGetOtp()` chain with a direct `navigator.clipboard.writeText(a.sid)` + `CopyFinished` / `CopyFailed` toast pair, and update the dblclick spec to assert the clipboard write (and the absence of an OTP IPC) instead. Banned-row guard is preserved; the i18n key `DoubleClickCopy` ("雙擊複製帳號" / "Double-click to copy account") already documents this WPF parity. Refs #239
fc60b03 to
207d077
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@dblclickhandler on account rows that copies the row's service-account ID (a.sid) to the clipboard vianavigator.clipboard.writeText, mirroring the WPFlstViewAccount_MouseDoubleClickbehaviour (Clipboard.SetText(selected.sid)) reported missing in #239 (問題一). The existing i18n keyDoubleClickCopy("雙擊複製帳號" / "Double-click to copy account") already documents this WPF semantic.ID: xxxsubtitle from account rows, showing only the account display name. Banned status text is preserved.Changes
src/pages/AccountList.vue:handleRowDblClick(a)async handler:if (!a.is_enable) return) preservedawait navigator.clipboard.writeText(a.sid)thenElMessage.success(t('CopyFinished'))ElMessage.error(t('CopyFailed'))account.selectedSidand does not callhandleGetOtp()— those belong to the single-click + Enter / Get OTP button path@dblclickon each account rowtests/unit/pages/AccountList.spec.ts:'double-clicking an enabled row...'now assertsclipboard.writeText('sid-2')+CopyFinishedtoast, and thatcommands.getOtpwas not called andaccount.selectedSidwas not mutated'double-clicking a banned row...'assertsclipboard.writeTextwas not calledTest plan
Local verification
npm test→ 41 files / 599 tests passednpm run typecheck→ passescode(incorporates 新版本不会默认选择第一个。 #245, fix(AccountList): auto-start game after login when setting enabled (#246) #250, feat(IdPassForm): arrow keys and mouse wheel to cycle saved accounts (#241) #251, chore(ci): split frontend/rust checks with path filters + bump action versions #252, fix(window): high-DPI scaling + tighten Settings/About spacing (#238) #253) — no conflictsCloses #239