You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(keyboard): share height state across useKeyboardHeight instances
When the thread drawer is open alongside the main room view, two
RoomInput components each mount their own useKeyboardHeight instance.
On keyboard open the thread instance had savedHeight=0 (freshly mounted),
so its immediate-estimate branch fell back to viewport.height — the
wrong mid-animation value — and overwrote the correct estimate already
written by the main room instance. This produced a third layout change
(wrong height → correct height) visible as jank on every keyboard open.
Fix: promote savedHeight, cssVarsSet, and the mount reference counter to
module-level variables so all instances share them.
- sharedSavedHeight: all instances read and write the same value, so the
estimate is always correct even for newly-mounted instances.
- cssVarsApplied: the 'only set once while keyboard open' guard now works
across instances, preventing double setCSSVars calls.
- mountCount: reference-counted so only the last instance to unmount
clears the CSS variables — prevents the thread drawer unmounting while
the main room keyboard is still open from wiping --sable-visible-height.
0 commit comments