fix: recompute terminal layout on mobile breakpoint changes#997
fix: recompute terminal layout on mobile breakpoint changes#997web3dev1337 wants to merge 3 commits into
Conversation
…'t miss them Review feedback: resize events fire in bursts and only the last event's debounced callback runs, so diffing two point-in-time layout snapshots missed crossings that happened mid-burst (continuous window drags, orientation changes) — exactly the scenario this PR exists to handle. syncDesktopMobileLayoutState now latches a crossed flag at the moment of the crossing, and the debounced callback consumes it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Reviewed in the open-PR sweep. Found and fixed a real gap: the debounced resize callback compared two point-in-time snapshots of the layout mode, but resize events come in bursts and only the last event's callback runs — a breakpoint crossing mid-burst (continuous drag through 768px, orientation change) was silently missed, which is the exact scenario the PR targets. The crossing is now latched in syncDesktopMobileLayoutState and consumed by the debounced callback. Also noting for the record: ~70% of this diff is a second, undisclosed feature (terminal history preload from /api/sessions/:id/log + scroll-listener consolidation + 100ms→180ms scroll-settle change). It was verified synchronization-safe and merges cleanly against current main, but the PR description doesn't mention it — worth updating the description before merge. |
Summary
sidebar-openstate and restore desktop preference).Testing
node --check client/app.jsnode --check client/terminal.js