deepseek-harness/apps/web
creatixchu e465806120 fix(web): scroll to the caret after an edit the composer performs itself
Pasting a long block left the view where it was while the caret sat at the
end of what was pasted. Paste, ctrl/meta-Enter newline and cut all suppress
the native edit — the machine owns the draft and the undo log — and restore
the caret with `setSelectionRange`, which reveals nothing: measured in
chromium and WebKit, before this branch as well as on it. Firefox happened to
reveal it, in the old geometry only.

The three restores now share one helper that measures the caret against the
hidden mirror — same draft, same metrics, same wrap width, so a Range
collapsed at the caret's index reports where the caret is without a caret API
— and scrolls the scrollport the minimum that brings the line inside, which
is what the browser does for typing. One scrollport is what makes this
possible at all: the reveal is finally a single offset to move.

Also from review: the composer's own focus() on unlock and session switch
passes preventScroll, so a session switch cannot move the transcript through
the taller textarea's reveal chain.
2026-07-31 16:07:55 +08:00
..
public feat(web): add favicon and update IconActions behavior 2026-07-30 19:59:16 +08:00
src Merge remote-tracking branch 'origin/master' into codex/trim-redundant-comments 2026-07-25 13:06:40 +08:00
tests fix(web): scroll to the caret after an edit the composer performs itself 2026-07-31 16:07:55 +08:00
index.html feat(web): add favicon and update IconActions behavior 2026-07-30 19:59:16 +08:00
package.json refactor(web): collapse the shell boot into the AppWebEntry class 2026-07-25 10:23:40 +08:00
tsconfig.json Merge remote-tracking branch 'origin/master' into worktree/composer-scroll-sync 2026-07-31 13:22:52 +08:00
vite.config.ts refactor(web): collapse the shell boot into the AppWebEntry class 2026-07-25 10:23:40 +08:00