Files
deepseek-harness/apps
Yichen Jiang b2c9c3ce37 fix(web): derive the caret-delete range from what the draft lost
A caret Backspace or Delete replaces no selection, so `beforeinput` reports
the bare caret and the previous derivation produced a negative inserted
length and fell back to the ambiguous scan. The delete half of the defect
survived, and the component test missed it by pre-expanding the selection to
the span the engines never report.

The range for a caret delete now comes from the direction `inputType` names
and the number of characters the draft actually lost, measured rather than
assumed to be one, so a grapheme, word, or line deletion sizes correctly.
Only the insert and delete families are recorded; a history replay reports
wherever the caret sits and would name a wrong span while passing every check.

Component tests cover the caret Backspace, Delete, and word-delete gestures,
and an assembled browser scenario drives them as real key presses, which is
the only place an engine's reported range is observable.
2026-08-20 17:11:35 +08:00
..