fix: float Git branch picker above workspace content
Render the searchable branch picker in the shared floating portal so opening it no longer pushes down changes or commit history. Clamp it to the viewport and retain search focus, outside dismissal, and Escape focus restoration. Update existing migration fixtures for activity history and supervision schema changes. Focused suites passed: 149 storage tests, 41 UI tests, and the Electron overlay test; typecheck and lint passed. The full suite did not complete cleanly and reported failures outside this change. Release note: The Git branch picker now opens over the workspace without displacing the file list or commit history.
This commit is contained in:
@@ -57,6 +57,25 @@ app.whenReady().then(async () => {
|
||||
await js(`window.dispatchEvent(new CustomEvent('fixture-theme', { detail: '${theme}' }))`)
|
||||
for (const [width, height] of [[1280, 800], [960, 720], [720, 640], [640, 420]]) {
|
||||
win.setContentSize(width, height); await settle()
|
||||
const workspaceBounds = () => js(`['.workspace-git__changes', '.workspace-git__history-dock'].map(selector => {
|
||||
const r = document.querySelector(selector).getBoundingClientRect(); return [r.x, r.y, r.width, r.height]
|
||||
})`)
|
||||
const closedBounds = await workspaceBounds()
|
||||
await click('.workspace-git__branch-trigger')
|
||||
await wait('!!document.querySelector(".workspace-git__branches")')
|
||||
assert.deepEqual(await workspaceBounds(), closedBounds, 'Branch popup moved workspace content')
|
||||
assert(await js(`(() => {
|
||||
const panel = document.querySelector('.workspace-git__branches')
|
||||
const r = panel.getBoundingClientRect()
|
||||
return getComputedStyle(panel).position === 'fixed' && !!panel.closest('.floating-portal') &&
|
||||
!panel.closest('.workspace-git') && r.left >= 16 && r.top >= 16 &&
|
||||
r.right <= innerWidth - 16 && r.bottom <= innerHeight - 16 &&
|
||||
document.activeElement.matches('.workspace-git__branches input')
|
||||
})()`), 'Branch popup must float within viewport and focus search')
|
||||
await click('.workspace-git__branches input')
|
||||
await screenshot(`${theme}-${width}-branch-menu`)
|
||||
await key('Escape')
|
||||
assert(await js('!document.querySelector(".workspace-git__branches") && document.activeElement.matches(".workspace-git__branch-trigger")'))
|
||||
await notify()
|
||||
await click('#settings')
|
||||
await wait('!!document.querySelector("[aria-haspopup=menu][aria-expanded=false]")')
|
||||
|
||||
Reference in New Issue
Block a user