Commit 66fdd59
committed
chat-gui: only resize the pty once a zoom gesture actually ends
Applies to every agent equally — this is the shared terminal-view
zoom code, not agent-specific.
Both the touch-pinch and trackpad-wheel zoom handlers sent a resize
WS message on every intermediate frame. The server force-redraws
(Ctrl+L) ~100ms after each resize lands, to fix partial-redraw TUIs
that only re-emit cells they think changed after a SIGWINCH. During a
continuous gesture this meant dozens of staggered Ctrl+L's in flight
at once, most arriving after a LATER resize had already superseded
them — landing the redraw into an already-stale geometry. Reported as
jitter/garbling that stayed unwieldy until a full browser refresh
forced one clean repaint.
Fix: resize the backend only once the gesture has actually settled.
Touch has a real end (touchend/touchcancel) to hook. Wheel doesn't —
a continuous trackpad pinch is just a stream of individual wheel
events with no "gesture" boundary — so that path infers "ended" via a
150ms debounce (no new wheel step) before sending the resize. Both
paths keep doing the live client-side fontSize/fit/refresh on every
frame for smooth visual feedback; only the pty-resize (and therefore
the force-redraw it triggers) is deferred to gesture-end.1 parent 2a3f880 commit 66fdd59
1 file changed
Lines changed: 29 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3578 | 3578 | | |
3579 | 3579 | | |
3580 | 3580 | | |
| 3581 | + | |
| 3582 | + | |
| 3583 | + | |
| 3584 | + | |
| 3585 | + | |
| 3586 | + | |
| 3587 | + | |
| 3588 | + | |
| 3589 | + | |
| 3590 | + | |
| 3591 | + | |
3581 | 3592 | | |
3582 | 3593 | | |
3583 | 3594 | | |
3584 | | - | |
3585 | 3595 | | |
3586 | 3596 | | |
3587 | 3597 | | |
3588 | 3598 | | |
3589 | 3599 | | |
| 3600 | + | |
| 3601 | + | |
| 3602 | + | |
| 3603 | + | |
3590 | 3604 | | |
3591 | 3605 | | |
3592 | 3606 | | |
| |||
3599 | 3613 | | |
3600 | 3614 | | |
3601 | 3615 | | |
| 3616 | + | |
| 3617 | + | |
| 3618 | + | |
| 3619 | + | |
| 3620 | + | |
| 3621 | + | |
| 3622 | + | |
| 3623 | + | |
3602 | 3624 | | |
3603 | 3625 | | |
3604 | 3626 | | |
3605 | 3627 | | |
| 3628 | + | |
| 3629 | + | |
| 3630 | + | |
| 3631 | + | |
| 3632 | + | |
| 3633 | + | |
3606 | 3634 | | |
3607 | 3635 | | |
3608 | 3636 | | |
| |||
3619 | 3647 | | |
3620 | 3648 | | |
3621 | 3649 | | |
3622 | | - | |
3623 | | - | |
3624 | 3650 | | |
3625 | 3651 | | |
3626 | 3652 | | |
| |||
0 commit comments