Files
magpie/internal/gui/assets/plugins/library
yetone 04e8aa8f10 library: typing with an input method no longer moves the page (#2636)
In Library -> Instructions, typing Chinese through an input method made the
page jump up or down while a word was composed. The cause: the textarea's
autosize set height:auto to measure scrollHeight, so the page went short for
a moment and the browser clamped the view's scrollTop. Putting the height
back doesn't undo a clamp. app.js's scroll guard took the clamp for a scroll
the reader didn't make, and its scrollIntoView({block:"nearest"}) pulled a
textarea taller than the view to one of its edges. Every composition step is
an input, so this happened on every keystroke.

autosize (the only one in the GUI, used by a set's text, an agent's own
text, a skill's description and subagent boxes) now holds the textarea's
parent at its height while measuring, so the page never goes short.

What was run:
- New internal/gui/tests/library-ime-scroll.test.cjs covers en/zh, 980/560px,
  a Default set's text and Cline's own text. Chromium composes through CDP
  Input.imeSetComposition/insertText. WebKit gets synthetic
  composition events and inputs.
  - With the fix: 9/9 in both engines, before and after rebasing onto f191d6423.
  - With client.js reverted by hand: red in both engines (4 of 9), set:default
    in every lang/width; the page went e.g. 1000 -> 862, 1401, 1634.
  - extra:cline wasn't red on main: its clamp is put back before paint. It
    stays as a sibling guard.
- library-row-open-scroll and library-instr-sets pass in both engines.
- The whole GUI suite ran in both engines at concurrency 6, load ~150-300.
  - Chromium: 5408/5519. WebKit: 5442/5547.
  - Failed files were rerun at concurrency 2 and on unmodified main
    (c1e95f919). All are red on main too and already filed (codex-predictions
    #2624, segs-glide/lightweight #2683, provider-advanced-fold #2710,
    tray-cell-click #2686, removed-groups-menu-scroll #2172/#2211, others as
    filed).
  - WebKit plugin-moved-signin and update-release-page passed alone.
    removed-groups-menu-scroll went 4/4 three times. No library file
    stayed red.
- gofmt -l: clean. go vet: darwin, and GOOS=linux and GOOS=windows with
  -tags nogui: clean.
- go test -timeout 45m ./... under pipefail in a sandbox HOME: exit 0.

Not tried: a real system input method (macOS Pinyin) in the real app. Only
CDP and synthetic composition were used.
2026-10-17 19:04:59 +08:00
..