fix: cap drag height to visual viewport
This commit is contained in:
@@ -6,12 +6,19 @@ const source = readFileSync('src/client/Sidebar.tsx', 'utf8')
|
||||
describe('Sidebar layout-push integration', () => {
|
||||
it('does not bypass the shared bottom-height cap during width drags', () => {
|
||||
expect(source).not.toContain('Math.min(state.bottomHeight, window.innerHeight)')
|
||||
expect(source.match(/pushedBottomHeight\(/g)).toHaveLength(3)
|
||||
expect(source.match(/pushedBottomHeight\(/g)).toHaveLength(9)
|
||||
})
|
||||
|
||||
it('caps panel geometry against the viewport visible above the keyboard', () => {
|
||||
expect(source).toContain('viewport.height - keyboardInset')
|
||||
expect(source).toContain('setVisualViewportHeight(Math.max(0, Math.round(vv.height)))')
|
||||
expect(source).toContain('visualViewportHeight ?? viewport.height')
|
||||
expect(source.match(/viewportHeight: layoutViewportHeight/g)).toHaveLength(4)
|
||||
expect(source).toContain('viewport.width, layoutViewportHeight]')
|
||||
})
|
||||
|
||||
it('reapplies the visible-height cap to every vertical drag result', () => {
|
||||
expect(source).not.toMatch(/const height = clampHeight\(/)
|
||||
expect(source).not.toMatch(/height = clampHeight\(/)
|
||||
expect(source.match(/pushedBottomHeight\(true, clampHeight\(/g)).toHaveLength(6)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user