## Implementation Plan: Devii Window Shrink on Double-Click ### Changes Required **1. FloatingWindow.js – Floor ResizeObserver recording** File: `components/FloatingWindow.js`, method `_observeResize()` (ca. line 410–414) Modification: Before assigning `this.geometry.width` and `this.geometry.height`, clamp the values to the code-defined minimums (`_minimizeSize` width/height, or explicit 320/220). ```javascript const MIN_W = 320; const MIN_H = 220; this.geometry.width = Math.max(MIN_W, Math.round(rect.width)); this.geometry.height = Math.max(MIN_H, Math.round(rect.height)); ``` **2. FloatingWindow.js – Floor `_clampGeometry()`** File: `components/FloatingWindow.js`, method `_clampGeometry()` (ca. line 296–304) Modification: Add lower bounds for width and height identical to those used in `_observeResize()`. ```javascript g.width = Math.max(MIN_W, Math.min(g.width, window.innerWidth - 16)); g.height = Math.max(MIN_H, Math.min(g.height, safeHeight - 16)); ``` (Define `MIN_W`/`MIN_H` as module constants or inline with context-appropriate reference.) **3. DeviiTerminal.js – Guard `_canOpenOnGesture()`** File: `DeviiTerminal.js`, method `_canOpenOnGesture()` (ca. line 88) Modification: Add early return `false` if Devii is already open, matching pattern used in `_canTriggerOnEscape()`. ```javascript if (this.element && this.element.state !== "closed") return false; ``` ### Definition of Done - All three code changes above are applied to the source files and committed with message `fix: prevent Devii window shrinkage on Firefox double-click` (or equivalent). - `git diff --cached --stat` shows only the expected three file modifications. - Project verification commands execute successfully: - `pip install -e '.[dev]' -q && make test-unit` exits with code 0. - `pip install -q ruff && ruff check .` exits with code 0 and reports zero lint errors. - No new warnings or errors appear in the test output; all previously passing tests continue to pass. - (Environment limitation) Manual verification of Firefox double-click shrink prevention is not required for this plan, but the automated checks confirm the code changes are syntactically correct, consistent with existing patterns, and do not break any regression tests.