Merge pull request #7936 from deepseek-harness/turtle/fix-sidebar-fullscreen-line-a73e32287f80

fix(sidebar-right): clip the fullscreen left divider past the window edge
This commit is contained in:
Turtle authored and GitHub committed 2026-11-11 16:13:54 +08:00
commit c7b2c5e3e5
6 files changed
+36 -22

No files matched your search

@@ -10,7 +10,7 @@ import {
fixtureUserPrompts, launchWebScaffold, seedSession, watchConsole, webSnapshotMode,
type WebScaffold,
} from './scaffold.ts'
import { connectFreshWorkspace, newEnglishPage, saveFailureShot } from './support.ts'
import { connectFreshWorkspace, fullscreenBox, newEnglishPage, saveFailureShot } from './support.ts'
const SNAPSHOT_DIR = fileURLToPath(new URL('../../../snapshots/web/details-session-lifecycle', import.meta.url))
const HANDLES_EXPECTED = join(SNAPSHOT_DIR, 'handles.expected.md')
@@ -110,8 +110,8 @@ async function sidebarSnapshot(page: Page) {
mode: panel.getAttribute('data-sidebar-right-panel'),
panelContentWidth: expanded ? Math.round(Number.parseFloat(style.width)) : 0,
panelOuterWidth: expanded ? Math.round(rect.width) : 0,
coversViewport: expanded && rect.x === 0 && rect.y === 0
&& Math.round(rect.width) === window.innerWidth && Math.round(rect.height) === window.innerHeight,
coversViewport: expanded && rect.x === -1 && rect.y === 0
&& Math.round(rect.width) === window.innerWidth + 1 && Math.round(rect.height) === window.innerHeight,
resizeHandleWidth: handle === null ? 0 : Math.round(handle.getBoundingClientRect().width),
expandedDirectories: [...panel.querySelectorAll('[data-files-entry="directory"] button[aria-expanded="true"]')]
.map(button => button.textContent?.trim()),
@@ -195,7 +195,7 @@ describe.skipIf(MODE === 'record')('web e2e: details panel follows the current S
await expect.poll(() => blankColumn.locator('[data-dockkit-host="dock"]:not([hidden])').evaluate(element => getComputedStyle(element).transform))
.toBe('none')
await expect.poll(() => blankColumn.locator('[data-sidebar-right-panel]').boundingBox())
.toEqual({ x: 0, y: 0, width: 767, height: blankViewport.height })
.toEqual(fullscreenBox({ width: 767, height: blankViewport.height }))
// A preview the files page opened starts with its tree hidden; shown, the tree fills the viewport.
const treeToggle = blankColumn.locator('[data-files-navigator-toggle]')
await expect.poll(() => treeToggle.getAttribute('aria-expanded')).toBe('false')
@@ -360,7 +360,7 @@ describe.skipIf(MODE === 'record')('web e2e: details panel follows the current S
await checkpoint('A normal: two panes')
await column.locator('[data-sidebar-right-mode="fullscreen"]').click()
await expect.poll(() => panel.boundingBox()).toEqual({ x: 0, y: 0, ...viewport })
await expect.poll(() => panel.boundingBox()).toEqual(fullscreenBox(viewport))
expect(await columns(page)).toEqual(normalColumns)
expect(await sidebarSnapshot(page)).toMatchObject({ mode: 'fullscreen', resizeHandleWidth: 0, coversViewport: true })
expect(await paneSnapshot(page)).toEqual(retainedA)
@@ -395,7 +395,7 @@ describe.skipIf(MODE === 'record')('web e2e: details panel follows the current S
expect(await panel.getAttribute('data-sidebar-right-panel')).toBe('fullscreen')
expect(await paneSnapshot(page)).toEqual(retainedA)
await open()
await expect.poll(() => panel.boundingBox()).toEqual({ x: 0, y: 0, ...viewport })
await expect.poll(() => panel.boundingBox()).toEqual(fullscreenBox(viewport))
expect(await paneSnapshot(page)).toEqual(retainedA)
await checkpoint('A restored: manual fullscreen, tabs, and panes')
await column.locator('[data-sidebar-right-mode="push"]').click()
@@ -433,7 +433,7 @@ describe.skipIf(MODE === 'record')('web e2e: details panel follows the current S
await page.locator('[data-sidebar-right-expand]').click()
await expect.poll(() => columns(page)).toEqual([420, viewport.width - 420 - normalWidth, normalWidth])
await page.setViewportSize({ width: 767, height: viewport.height })
await expect.poll(() => panel.boundingBox()).toEqual({ x: 0, y: 0, width: 767, height: viewport.height })
await expect.poll(() => panel.boundingBox()).toEqual(fullscreenBox({ width: 767, height: viewport.height }))
await expect.poll(() => columns(page)).toEqual([0, 767, 0])
expect(await sidebarSnapshot(page)).toMatchObject({ mode: 'fullscreen', resizeHandleWidth: 0, coversViewport: true })
await checkpoint('A automatic fullscreen at 767px')
+6 -6
View File
@@ -26,7 +26,7 @@ import { afterAll, beforeAll, describe, expect, it, onTestFailed } from 'vitest'
import { createMessage, createUserMessage } from '@deepseek-ai/dsh-llm'
import { acknowledgeReloadConnectionLoss, launchWebScaffold, watchConsole, type WebScaffold } from './scaffold.ts'
import {
connectFreshWorkspace, newEnglishPage, saveFailureShot, ZH_BROWSER_LOCALE,
connectFreshWorkspace, fullscreenBox, newEnglishPage, saveFailureShot, ZH_BROWSER_LOCALE,
} from './support.ts'
/** The produced file the seeded turn writes, and what the preview should show. */
@@ -524,7 +524,7 @@ describe('web e2e: shipped right Sidebar', () => {
expect(await width(column)).toBe(trackWidth)
const viewport = page.viewportSize()
if (viewport === null) throw new Error('expected a fixed viewport')
await expect.poll(async () => await panel.boundingBox()).toEqual({ x: 0, y: 0, ...viewport })
await expect.poll(async () => await panel.boundingBox()).toEqual(fullscreenBox(viewport))
expect(await expandOf(page).count()).toBe(0)
expect(await frame.locator('[data-side="rightbar"]').count()).toBe(0)
await shot(page, '03-fullscreen-panel')
@@ -558,7 +558,7 @@ describe('web e2e: shipped right Sidebar', () => {
await frame.evaluate(async (node) => { await Promise.allSettled(node.getAnimations().map(animation => animation.finished)) })
const normalColumns = (await geometry()).columns
await column.locator('[data-sidebar-right-mode="fullscreen"]').click()
await expect.poll(() => panel.boundingBox()).toEqual({ x: 0, y: 0, ...viewport })
await expect.poll(() => panel.boundingBox()).toEqual(fullscreenBox(viewport))
await column.locator('[data-sidebar-right-toggle]').click()
await Promise.all([
panel.evaluate(async (node) => {
@@ -586,7 +586,7 @@ describe('web e2e: shipped right Sidebar', () => {
await held.evaluate((state) => { (state.animation as Animation).finish() })
await expect.poll(() => frame.getAttribute('data-rightbar-fullscreen')).toBe('true')
expect(await panel.boundingBox()).toEqual({ x: 0, y: 0, ...viewport })
expect(await panel.boundingBox()).toEqual(fullscreenBox(viewport))
expect(await geometry()).toEqual({ columns: normalColumns, transition: 'none', handles: ['none'], animatingGrid: false })
const exit = await holdPanelSlide(panel)
@@ -621,7 +621,7 @@ describe('web e2e: shipped right Sidebar', () => {
await expect.poll(() => frame.getAttribute('data-rightbar-fullscreen')).toBeNull()
await expandOf(page).click()
await expect.poll(() => frame.getAttribute('data-rightbar-fullscreen')).toBe('true')
expect(await panel.boundingBox()).toEqual({ x: 0, y: 0, ...viewport })
expect(await panel.boundingBox()).toEqual(fullscreenBox(viewport))
expect((await geometry()).columns).toBe(normalColumns)
expect((await geometry()).animatingGrid).toBe(false)
} finally {
@@ -733,7 +733,7 @@ describe('web e2e: shipped right Sidebar', () => {
await page.setViewportSize({ width: 767, height: viewport.height })
await expect.poll(async () => await panel.getAttribute('data-sidebar-right-panel')).toBe('fullscreen')
await expect.poll(async () => await width(panel)).toBe(767)
await expect.poll(async () => await width(panel)).toBe(768)
await expect.poll(() => frame.getAttribute('data-rightbar-fullscreen')).toBe('true')
expect(await expandOf(page).count()).toBe(0)
expect(await frame.locator('[data-side="rightbar"]').count()).toBe(0)
+10
View File
@@ -479,3 +479,13 @@ export async function openSettings(page: Page, locale: 'en' | 'zh' | 'ja'): Prom
await trigger.click()
await page.getByRole('menuitem', { name: labels[locale][1], exact: true }).click()
}
/**
* The right Sidebar's fullscreen panel box: 1px wider than the viewport, so the
* first column's divider sits past the window's left edge where the frame clips it.
* @param viewport - the page viewport size.
* @returns the panel's expected bounding box.
*/
export function fullscreenBox(viewport: { width: number; height: number }): { x: number; y: number; width: number; height: number } {
return { x: -1, y: 0, width: viewport.width + 1, height: viewport.height }
}
@@ -339,8 +339,11 @@ function SidebarPanel(panel: PanelProps & { width: number; panelRef: RefObject<H
<div
ref={panelRef}
className={css.panel}
style={{ width: fullscreen ? '100vw' : width,
'--dsh-sidebar-width': fullscreen ? '100vw' : `${width}px` } as CSSProperties}
// Fullscreen is 1px wider than the viewport: the first column's divider,
// which separates the panel from the conversation, sits past the window's
// left edge where the frame clips it, and slides into view with the panel.
style={{ width: fullscreen ? 'calc(100vw + 1px)' : width,
'--dsh-sidebar-width': fullscreen ? 'calc(100vw + 1px)' : `${width}px` } as CSSProperties}
data-sidebar-right-session={sessionId}
data-sidebar-right-panel={fullscreen ? 'fullscreen' : 'push'}
data-sidebar-right-open={expanded || undefined}
@@ -653,7 +653,8 @@ describe('RightbarSeat presentation', () => {
expect(panel.style.width).toBe('420px')
fireEvent.click(element(h.view.container, '[data-sidebar-right-mode]'))
expect(h.layout().mode).toBe('fullscreen')
expect(panel.style.width).toBe('100vw')
expect(panel.style.width).toBe('calc(1px + 100vw)')
expect(panel.style.getPropertyValue('--dsh-sidebar-width')).toBe('calc(100vw + 1px)')
expect(panel.dataset['sidebarRightPanel']).toBe('fullscreen')
expect(element(h.view.container, '[data-tab-body]')).toBe(body)
expect(h.frame.openRightbar).toHaveBeenLastCalledWith(true, true)
@@ -64,8 +64,8 @@
"columnTransition": "none",
"expanded": true,
"mode": "fullscreen",
"panelContentWidth": 1680,
"panelOuterWidth": 1680,
"panelContentWidth": 1681,
"panelOuterWidth": 1681,
"coversViewport": true,
"resizeHandleWidth": 0,
"expandedDirectories": [],
@@ -197,8 +197,8 @@
"columnTransition": "none",
"expanded": true,
"mode": "fullscreen",
"panelContentWidth": 1680,
"panelOuterWidth": 1680,
"panelContentWidth": 1681,
"panelOuterWidth": 1681,
"coversViewport": true,
"resizeHandleWidth": 0,
"expandedDirectories": [],
@@ -424,8 +424,8 @@
"columnTransition": "none",
"expanded": true,
"mode": "fullscreen",
"panelContentWidth": 767,
"panelOuterWidth": 767,
"panelContentWidth": 768,
"panelOuterWidth": 768,
"coversViewport": true,
"resizeHandleWidth": 0,
"expandedDirectories": [],