Skip to content

Commit 00a1953

Browse files
ttop32claude
andcommitted
0.1.239: fix stationary double-click select not translating
Regression from the click-to-hide feature (#114): dismissTooltipOnClick sets mouseMoved=false on mouse-down. A stationary double-click never fires a mouse-move afterward, so mouseMoved stays false and stageTooltipText's checkWindowFocus() guard (mouseMoved && visible) blocks the selection tooltip -> no translation. Drag-select worked only because dragging moved the mouse and set mouseMoved=true. Fix: in stageTooltipTextSelect, treat a completed (non-empty) selection as active interaction and set mouseMoved=true before staging. A plain click makes no selection so the flag stays false and click-to-hide is preserved. Verified in Chrome with a faithful replica of the gating: before -> BLOCKED, after -> SHOW (the residual block in automation was only visibilityState =hidden, which is a background-tab artifact, not present for a real user). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 2ca9215 commit 00a1953

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

doc/description.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ Mouseover Translate Any Language At Once
1919
English, Russian, Japanese, Chinese and so on
2020

2121
# Change Log
22+
- 0.1.239
23+
- Fix: double-clicking a word in place (or otherwise selecting without moving the mouse) now shows the translation again. The recent click-to-hide behavior reset the "mouse active" flag on mouse-down and a stationary double-click never fired a mouse-move to restore it, so the selection tooltip was suppressed; a completed selection is now treated as active interaction
2224
- 0.1.238
2325
- Fix store upload rejection: the Bengali (bn) extension name was 76 characters (store limit is 75); trimmed a redundant conjunction to 74 without changing the meaning
2426
- 0.1.237

src/contentScript.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,15 @@ function stageTooltipTextSelect(event, useEvent = true) {
165165
// Collapse whitespace runs (incl. newlines) to a single space so a wrapped
166166
// sentence is translated — and read aloud — as one flowing sentence.
167167
var selectText = selectedText?.replace(/\s+/g, " ").trim();
168+
// A completed selection is explicit interaction with this tab, so mark the
169+
// mouse as active. Without this a stationary double-click never fires
170+
// mousemove, and its mousedown already reset mouseMoved=false via the
171+
// click-to-hide feature (#114), so checkWindowFocus() would block the
172+
// tooltip and the translation would never appear. A plain click makes no
173+
// selection (selectText empty) so it stays hidden — click-to-hide preserved.
174+
if (selectText) {
175+
mouseMoved = true;
176+
}
168177
stageTooltipText(selectText, "select");
169178
}
170179
}

0 commit comments

Comments
 (0)