feat: split the mobile keyboard model by alternate screen #35
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/alternate-screen-viewport"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Read
#{alternate_on}for the active pane from the existinglist-windowscall and expose it asWindow.alternate.On a coarse pointer, a normal-screen window (
alternate = 0) now shrinks its page tovisualViewport.heightwhile the keyboard is open: the terminal resizes above the keyboard andterminal.scrollToBottom()keeps the prompt at the bottom, so the page is no longer taller than the visible area and Safari has nothing to scroll. It deliberately does not useposition: fixed; WebKit mis-handles a focused field inside a fixed subtree when the keyboard opens. Alternate-screen TUIs (pi,nvim,lazygit) keep the existing Collie scroll model. The compact mode uses 150/100 px hysteresis on thevisualViewportbaseline.A real iPhone check with a shell and with
piis still needed.Validated on a temporary instance with mobile Playwright emulation:
/api/treereportsalternate=falsefor a zsh window andalternate=truefor pi. With the fake visual viewport shrunk from 844 to 500 px, the shell WindowPage becomesposition: fixedat height 500; the pi page stays in normal flow. Real iPhone validation is still needed for the keyboard animation and safe-area height.The first version used
position: fixed; on iOS that made the keyboard open and immediately close. Replaced with a height-only compact layout (visualViewport.height, no fixed positioning) plus hysteresis. Mobile Playwright check: shell page becomes 500 px tall at a fake 500 px viewport, terminal 399 px, key bar ends at 500, body scroll stays 0; the pi page stays 844 px.f7a72707e4tob3a93dba4f