chore: fork dsh-better-sidebar v0.18.0 as dsh-apes-sidebar v1.0.0
- Rename dsh-better-sidebar → dsh-apes-sidebar across 74 files (262 occurrences)
- Bump version 0.18.0 → 1.0.0 (package.json + dsh.plugin.json + SIDEBAR_SERVICE_VERSION)
- Add forkedFrom metadata to package.json (upstream pin: commit 9e1a034)
- Add fork notice banner to README.md (MIT attribution preserved)
- Keep original MIT copyright (c) 2026 dsh-external
- Full gate green: typecheck + build (6 bundles) + test (1241 passed / 9 skipped)
This commit is contained in:
@@ -68,7 +68,7 @@ test('right panel keeps desktop session actions in their header positions', asyn
|
||||
const root = page.locator('#root')
|
||||
const frame = page.locator('#root [data-dsh-frame], #root > [data-slot="root"] > div').first()
|
||||
const appSidebarExpanded = root.getByRole('button', { name: /^(Collapse sidebar|收起侧边栏)$/ })
|
||||
const sidebar = page.locator('[data-dsh-better-sidebar]')
|
||||
const sidebar = page.locator('[data-dsh-apes-sidebar]')
|
||||
const sessionLog = page.getByRole('button', { name: 'Session log', exact: true })
|
||||
const sessionLogLabel = sessionLog.getByText('Session log', { exact: true })
|
||||
await expect(sessionLogLabel, 'the desktop session-log action starts as a text button').toBeVisible({ timeout: 30_000 })
|
||||
|
||||
@@ -68,7 +68,7 @@ interface FrameSample {
|
||||
test('width drag tracks the shell 1:1 with transitions disabled (issue #92)', async ({ page }) => {
|
||||
await page.goto(PAGE_URL, { waitUntil: 'domcontentloaded' })
|
||||
await expect(page.locator('#root > *')).not.toHaveCount(0, { timeout: 90_000 })
|
||||
const sidebar = page.locator('[data-dsh-better-sidebar]')
|
||||
const sidebar = page.locator('[data-dsh-apes-sidebar]')
|
||||
await expect(sidebar).toBeAttached({ timeout: 90_000 })
|
||||
|
||||
// Dismiss whatever onboarding takeover is present (same dance as the mount
|
||||
@@ -119,7 +119,7 @@ test('width drag tracks the shell 1:1 with transitions disabled (issue #92)', as
|
||||
// window's tree-dock handle matches too, but the panel strip is always the
|
||||
// LEFTMOST one (the dock sits at the panel's right edge).
|
||||
const locateStrip = `(() => {
|
||||
const host = document.querySelector('[data-dsh-better-sidebar]')
|
||||
const host = document.querySelector('[data-dsh-apes-sidebar]')
|
||||
if (host === null) return null
|
||||
const boxes = [...host.querySelectorAll('*')]
|
||||
.filter(el => getComputedStyle(el).cursor === 'col-resize')
|
||||
@@ -156,7 +156,7 @@ test('width drag tracks the shell 1:1 with transitions disabled (issue #92)', as
|
||||
const samples: Sample[] = []
|
||||
// Same rule as the strip locator above: the LEFTMOST col-resize element
|
||||
// inside the sidebar host (the tree-dock handle is further right).
|
||||
const host = document.querySelector('[data-dsh-better-sidebar]')
|
||||
const host = document.querySelector('[data-dsh-apes-sidebar]')
|
||||
const strip = host === null
|
||||
? null
|
||||
: [...host.querySelectorAll<HTMLElement>('*')]
|
||||
@@ -246,7 +246,7 @@ test('width drag tracks the shell 1:1 with transitions disabled (issue #92)', as
|
||||
test('a very fast width drag still commits the dragged position (no rollback on quick release)', async ({ page }) => {
|
||||
await page.goto(PAGE_URL, { waitUntil: 'domcontentloaded' })
|
||||
await expect(page.locator('#root > *')).not.toHaveCount(0, { timeout: 90_000 })
|
||||
const sidebar = page.locator('[data-dsh-better-sidebar]')
|
||||
const sidebar = page.locator('[data-dsh-apes-sidebar]')
|
||||
await expect(sidebar).toBeAttached({ timeout: 90_000 })
|
||||
|
||||
// Dismiss whatever onboarding takeover is present (same dance as the
|
||||
@@ -296,7 +296,7 @@ test('a very fast width drag still commits the dragged position (no rollback on
|
||||
await expect
|
||||
.poll(async () => {
|
||||
const box = await page.evaluate(() => {
|
||||
const host = document.querySelector('[data-dsh-better-sidebar]')
|
||||
const host = document.querySelector('[data-dsh-apes-sidebar]')
|
||||
const el = [...host!.querySelectorAll('*')]
|
||||
.filter(e => getComputedStyle(e).cursor === 'col-resize')
|
||||
.map(e => e.getBoundingClientRect())
|
||||
@@ -310,7 +310,7 @@ test('a very fast width drag still commits the dragged position (no rollback on
|
||||
}, { timeout: 30_000 })
|
||||
.toBe(true)
|
||||
const stripBox = await page.evaluate(() => {
|
||||
const host = document.querySelector('[data-dsh-better-sidebar]')
|
||||
const host = document.querySelector('[data-dsh-apes-sidebar]')
|
||||
if (host === null) return null
|
||||
const boxes = [...host.querySelectorAll('*')]
|
||||
.filter(el => getComputedStyle(el).cursor === 'col-resize')
|
||||
@@ -394,7 +394,7 @@ async function settleWidthStrip(page: Page): Promise<{ startX: number; startY: n
|
||||
await expect
|
||||
.poll(async () => {
|
||||
const box = await page.evaluate(() => {
|
||||
const host = document.querySelector('[data-dsh-better-sidebar]')
|
||||
const host = document.querySelector('[data-dsh-apes-sidebar]')
|
||||
const el = [...host!.querySelectorAll('*')]
|
||||
.filter(e => getComputedStyle(e).cursor === 'col-resize')
|
||||
.map(e => e.getBoundingClientRect())
|
||||
@@ -408,7 +408,7 @@ async function settleWidthStrip(page: Page): Promise<{ startX: number; startY: n
|
||||
}, { timeout: 30_000 })
|
||||
.toBe(true)
|
||||
const stripBox = await page.evaluate(() => {
|
||||
const host = document.querySelector('[data-dsh-better-sidebar]')
|
||||
const host = document.querySelector('[data-dsh-apes-sidebar]')
|
||||
if (host === null) return null
|
||||
const boxes = [...host.querySelectorAll('*')]
|
||||
.filter(el => getComputedStyle(el).cursor === 'col-resize')
|
||||
@@ -436,7 +436,7 @@ async function dispatchPointerOnStrip(
|
||||
init: { clientX?: number; clientY?: number },
|
||||
): Promise<void> {
|
||||
await page.evaluate(({ type, init }) => {
|
||||
const host = document.querySelector('[data-dsh-better-sidebar]')
|
||||
const host = document.querySelector('[data-dsh-apes-sidebar]')
|
||||
if (host === null) throw new Error('sidebar host missing')
|
||||
const el = [...host.querySelectorAll<HTMLElement>('*')]
|
||||
.filter(el => getComputedStyle(el).cursor === 'col-resize')
|
||||
@@ -458,7 +458,7 @@ async function dispatchPointerOnStrip(
|
||||
test('an interrupted fast drag (pointercancel → lostpointercapture) keeps the dragged width (issue #247)', async ({ page }) => {
|
||||
await page.goto(PAGE_URL, { waitUntil: 'domcontentloaded' })
|
||||
await expect(page.locator('#root > *')).not.toHaveCount(0, { timeout: 90_000 })
|
||||
const sidebar = page.locator('[data-dsh-better-sidebar]')
|
||||
const sidebar = page.locator('[data-dsh-apes-sidebar]')
|
||||
await expect(sidebar).toBeAttached({ timeout: 90_000 })
|
||||
await dismissOnboarding(page)
|
||||
await expandSidebar(page, sidebar)
|
||||
@@ -493,7 +493,7 @@ test('an interrupted fast drag (pointercancel → lostpointercapture) keeps the
|
||||
test('a capture-lost drag with no usable coordinates keeps the last applied width (issue #247)', async ({ page }) => {
|
||||
await page.goto(PAGE_URL, { waitUntil: 'domcontentloaded' })
|
||||
await expect(page.locator('#root > *')).not.toHaveCount(0, { timeout: 90_000 })
|
||||
const sidebar = page.locator('[data-dsh-better-sidebar]')
|
||||
const sidebar = page.locator('[data-dsh-apes-sidebar]')
|
||||
await expect(sidebar).toBeAttached({ timeout: 90_000 })
|
||||
await dismissOnboarding(page)
|
||||
await expandSidebar(page, sidebar)
|
||||
@@ -528,7 +528,7 @@ test('a capture-lost drag with no usable coordinates keeps the last applied widt
|
||||
test('bottom panel never flashes full-width after a width drag release (issue #258)', async ({ page }) => {
|
||||
await page.goto(PAGE_URL, { waitUntil: 'domcontentloaded' })
|
||||
await expect(page.locator('#root > *')).not.toHaveCount(0, { timeout: 90_000 })
|
||||
const sidebar = page.locator('[data-dsh-better-sidebar]')
|
||||
const sidebar = page.locator('[data-dsh-apes-sidebar]')
|
||||
await expect(sidebar).toBeAttached({ timeout: 90_000 })
|
||||
await dismissOnboarding(page)
|
||||
await expandSidebar(page, sidebar)
|
||||
@@ -560,7 +560,7 @@ test('bottom panel never flashes full-width after a width drag release (issue #2
|
||||
await page.evaluate(() => {
|
||||
const samples: Array<{ t: number; bottomRight: number; colRight: number; varW: string; dragging: boolean; iw: number }> = []
|
||||
const loop = (): void => {
|
||||
const bottom = document.querySelector('[data-dsh-better-sidebar] [data-dsh-bottom-panel]')
|
||||
const bottom = document.querySelector('[data-dsh-apes-sidebar] [data-dsh-bottom-panel]')
|
||||
const col = document.querySelector('#root [data-slot="conversation"]')?.parentElement
|
||||
samples.push({
|
||||
t: performance.now(),
|
||||
@@ -621,7 +621,7 @@ test('the bottom-push anchor resolves through the shell-written center-column ta
|
||||
// node: a stale tag on a swapped-out node (boot swap / HMR) would leave
|
||||
// the push rule anchorless or doubled.
|
||||
await page.goto(PAGE_URL, { waitUntil: 'domcontentloaded' })
|
||||
await expect(page.locator('[data-dsh-better-sidebar]')).toBeAttached({ timeout: 90_000 })
|
||||
await expect(page.locator('[data-dsh-apes-sidebar]')).toBeAttached({ timeout: 90_000 })
|
||||
await expect
|
||||
.poll(async () => page.evaluate(() => document.querySelectorAll('#root [data-dsh-center-col]').length), { timeout: 90_000 })
|
||||
.toBe(1)
|
||||
@@ -651,7 +651,7 @@ test('dragging the bottom strip while the right panel is closed keeps the host l
|
||||
// derives from it); only the PUSHED width must ride the panelOpen gate.
|
||||
await page.goto(PAGE_URL, { waitUntil: 'domcontentloaded' })
|
||||
await expect(page.locator('#root > *')).not.toHaveCount(0, { timeout: 90_000 })
|
||||
const sidebar = page.locator('[data-dsh-better-sidebar]')
|
||||
const sidebar = page.locator('[data-dsh-apes-sidebar]')
|
||||
await expect(sidebar).toBeAttached({ timeout: 90_000 })
|
||||
await dismissOnboarding(page)
|
||||
|
||||
@@ -714,7 +714,7 @@ test('dragging the bottom strip while the right panel is closed keeps the host l
|
||||
await expect
|
||||
.poll(async () => {
|
||||
const probe = await page.evaluate(() => {
|
||||
const bottom = document.querySelector('[data-dsh-better-sidebar] [data-dsh-bottom-panel]')
|
||||
const bottom = document.querySelector('[data-dsh-apes-sidebar] [data-dsh-bottom-panel]')
|
||||
if (bottom === null) return null
|
||||
const strip = [...bottom.querySelectorAll<HTMLElement>('*')].find(el => getComputedStyle(el).cursor === 'row-resize')
|
||||
if (strip === undefined) return null
|
||||
@@ -726,7 +726,7 @@ test('dragging the bottom strip while the right panel is closed keeps the host l
|
||||
}, { timeout: 30_000 })
|
||||
.toBeLessThanOrEqual(8)
|
||||
const stripBox = await page.evaluate(() => {
|
||||
const bottom = document.querySelector('[data-dsh-better-sidebar] [data-dsh-bottom-panel]')
|
||||
const bottom = document.querySelector('[data-dsh-apes-sidebar] [data-dsh-bottom-panel]')
|
||||
if (bottom === null) return null
|
||||
const strip = [...bottom.querySelectorAll<HTMLElement>('*')].find(el => getComputedStyle(el).cursor === 'row-resize')
|
||||
if (strip === undefined) return null
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* floats another tab with the hint overlay showing mid-drag.
|
||||
*
|
||||
* Crash discipline mirrors the mount lane: pageerror / plugin console errors
|
||||
* / dsh-better-sidebar strips fail the test at every step.
|
||||
* / dsh-apes-sidebar strips fail the test at every step.
|
||||
*/
|
||||
import { mkdirSync } from 'node:fs'
|
||||
import { tmpdir } from 'node:os'
|
||||
@@ -23,7 +23,7 @@ import { PAGE_URL, createHostApi, hostRpc } from './host'
|
||||
|
||||
const WORKSPACE_PATH = process.env.DSH_E2E_WORKSPACE ?? join(tmpdir(), 'dsh-e2e-float-workspace')
|
||||
|
||||
const CRASH_STRIP_PATTERNS = [/^dsh-better-sidebar:/, /^\[dsh-better-sidebar\]/]
|
||||
const CRASH_STRIP_PATTERNS = [/^dsh-apes-sidebar:/, /^\[dsh-apes-sidebar\]/]
|
||||
|
||||
let api: APIRequestContext
|
||||
|
||||
@@ -84,7 +84,7 @@ const bootExpanded = async (page: Page): Promise<ReturnType<Page['locator']>> =>
|
||||
})
|
||||
await page.goto(PAGE_URL, { waitUntil: 'domcontentloaded' })
|
||||
await expect(page.locator('#root > *')).not.toHaveCount(0, { timeout: 90_000 })
|
||||
const sidebar = page.locator('[data-dsh-better-sidebar]')
|
||||
const sidebar = page.locator('[data-dsh-apes-sidebar]')
|
||||
await expect(sidebar).toBeAttached({ timeout: 90_000 })
|
||||
await dismissTakeovers(page)
|
||||
await expect(sidebar.locator('[title]').first()).toBeAttached({ timeout: 90_000 })
|
||||
@@ -96,13 +96,13 @@ const bootExpanded = async (page: Page): Promise<ReturnType<Page['locator']>> =>
|
||||
), { timeout: 90_000 })
|
||||
.not.toBe('')
|
||||
expect(pageErrors, 'page errors during boot').toEqual([])
|
||||
expect(consoleErrors.filter(text => text.includes('dsh-better-sidebar')), 'plugin console errors during boot').toEqual([])
|
||||
expect(consoleErrors.filter(text => text.includes('dsh-apes-sidebar')), 'plugin console errors during boot').toEqual([])
|
||||
return sidebar
|
||||
}
|
||||
|
||||
/** The crash assertions shared by every step (mount-lane discipline). */
|
||||
async function assertNoCrash(page: Page): Promise<void> {
|
||||
const sidebar = page.locator('[data-dsh-better-sidebar]')
|
||||
const sidebar = page.locator('[data-dsh-apes-sidebar]')
|
||||
const stripTexts = await sidebar.locator('div').evaluateAll(
|
||||
(nodes, patterns) => nodes.filter((node) => {
|
||||
const text = (node.textContent ?? '').trim()
|
||||
@@ -110,7 +110,7 @@ async function assertNoCrash(page: Page): Promise<void> {
|
||||
}).map((node) => (node.textContent ?? '').trim()),
|
||||
CRASH_STRIP_PATTERNS,
|
||||
)
|
||||
expect(stripTexts, 'a dsh-better-sidebar error strip is present').toEqual([])
|
||||
expect(stripTexts, 'a dsh-apes-sidebar error strip is present').toEqual([])
|
||||
}
|
||||
|
||||
/** The conversation column's viewport rect — the production drag-out target
|
||||
@@ -183,7 +183,7 @@ test('float a tab, move the window, reload restores it, dock it back', async ({
|
||||
await page.waitForTimeout(500)
|
||||
await page.reload({ waitUntil: 'domcontentloaded' })
|
||||
await dismissTakeovers(page)
|
||||
const sidebar2 = page.locator('[data-dsh-better-sidebar]')
|
||||
const sidebar2 = page.locator('[data-dsh-apes-sidebar]')
|
||||
await expect(sidebar2.locator('[data-dsh-float-window]')).toHaveCount(1, { timeout: 90_000 })
|
||||
await assertNoCrash(page)
|
||||
|
||||
|
||||
+11
-11
@@ -10,7 +10,7 @@
|
||||
* (the same `workspace.create` / `session.create` calls the UI makes),
|
||||
* so the sidebar has a real session to render;
|
||||
* 2. loads the page in headless Chromium and asserts the shell and the
|
||||
* plugin's `[data-dsh-better-sidebar]` host mount;
|
||||
* plugin's `[data-dsh-apes-sidebar]` host mount;
|
||||
* 3. asserts the plugin's crash markers never appear (no RenderBoundary /
|
||||
* fail() strips, no `pageerror`, no plugin-prefixed console errors);
|
||||
* 4. expands the collapsed panel (openByDefault defaults off), sweeps every
|
||||
@@ -54,7 +54,7 @@ const SEEDED_README_FILE = 'readme-style.md'
|
||||
* renders a strip whose text starts with these prefixes instead of crashing
|
||||
* (see src/client/index.tsx `fail()` and src/client/RenderBoundary.tsx).
|
||||
*/
|
||||
const CRASH_STRIP_PATTERNS = [/^dsh-better-sidebar:/, /^\[dsh-better-sidebar\]/]
|
||||
const CRASH_STRIP_PATTERNS = [/^dsh-apes-sidebar:/, /^\[dsh-apes-sidebar\]/]
|
||||
|
||||
/** Built-in tab titles the sweep drives (en-US copy; follows DSH locale). */
|
||||
const BUILTIN_TABS = ['Files', 'Changes', 'Tasks', 'Side Chat (beta)', 'Terminal', 'Browser']
|
||||
@@ -150,7 +150,7 @@ test('plugin mounts into the DSH shell and survives a built-in tab sweep', async
|
||||
})
|
||||
|
||||
// Load the shell. The app renders into #root; the plugin appends its own
|
||||
// [data-dsh-better-sidebar] host once its client half activates.
|
||||
// [data-dsh-apes-sidebar] host once its client half activates.
|
||||
//
|
||||
// The editor chunk (client-editor.js) loads as soon as ANY files-window tab
|
||||
// renders — the seeded home tab mounts the moment the panel expands, long
|
||||
@@ -162,7 +162,7 @@ test('plugin mounts into the DSH shell and survives a built-in tab sweep', async
|
||||
)
|
||||
await page.goto(PAGE_URL, { waitUntil: 'domcontentloaded' })
|
||||
await expect(page.locator('#root > *')).not.toHaveCount(0, { timeout: 90_000 })
|
||||
const sidebar = page.locator('[data-dsh-better-sidebar]')
|
||||
const sidebar = page.locator('[data-dsh-apes-sidebar]')
|
||||
await expect(sidebar).toBeAttached({ timeout: 90_000 })
|
||||
// The unified panel host: the fixed containing block every panel lives in
|
||||
// (data-dsh-panel-host). Its presence is part of the injection contract.
|
||||
@@ -265,7 +265,7 @@ test('plugin mounts into the DSH shell and survives a built-in tab sweep', async
|
||||
}).map((node) => (node.textContent ?? '').trim()),
|
||||
CRASH_STRIP_PATTERNS,
|
||||
)
|
||||
expect(stripTexts, 'a dsh-better-sidebar error strip is present in the sidebar').toEqual([])
|
||||
expect(stripTexts, 'a dsh-apes-sidebar error strip is present in the sidebar').toEqual([])
|
||||
}
|
||||
|
||||
// Sweep every built-in tab through the "+" menu (the sidebar's own open-tab
|
||||
@@ -429,7 +429,7 @@ test('plugin mounts into the DSH shell and survives a built-in tab sweep', async
|
||||
).toHaveCount(1, { timeout: 30_000 })
|
||||
// The markdown PREVIEW must render before the mermaid chunk can be
|
||||
// requested — this assertion separates a preview/render regression from a
|
||||
// chunk-loading one. (sidebar is already scoped to [data-dsh-better-sidebar].)
|
||||
// chunk-loading one. (sidebar is already scoped to [data-dsh-apes-sidebar].)
|
||||
await expect(
|
||||
sidebar.getByText('tail text'),
|
||||
'the markdown preview must render the seeded document',
|
||||
@@ -540,7 +540,7 @@ test('plugin mounts into the DSH shell and survives a built-in tab sweep', async
|
||||
|
||||
// The plugin's own console prefix must never appear in errors, and no
|
||||
// unhandled rejection may escape the sweep.
|
||||
const pluginErrors = consoleErrors.filter((text) => /dsh-better-sidebar|Unhandled/.test(text))
|
||||
const pluginErrors = consoleErrors.filter((text) => /dsh-apes-sidebar|Unhandled/.test(text))
|
||||
expect(pluginErrors, 'plugin-prefixed or unhandled console errors during the sweep').toEqual([])
|
||||
expect(pageErrors, 'pageerrors during the sweep').toEqual([])
|
||||
|
||||
@@ -556,7 +556,7 @@ test('conservative auto: URL stamps alone never modify the layout; plugin chrome
|
||||
// semantics) — the strip/body attribute appear only for real standard
|
||||
// geometry (see the WCO scenario below) or an opt-in preset.
|
||||
await gotoPage(page, { 'dsh-desktop-mode': 'advanced', 'dsh-desktop-platform': 'win32' })
|
||||
await expect(page.locator('[data-dsh-better-sidebar]')).toBeAttached({ timeout: 90_000 })
|
||||
await expect(page.locator('[data-dsh-apes-sidebar]')).toBeAttached({ timeout: 90_000 })
|
||||
await expect(
|
||||
page.locator('body[data-dsh-title-bar-compat]'),
|
||||
'stamps alone must NOT auto-enable title-bar compatibility under auto',
|
||||
@@ -604,7 +604,7 @@ test('standard WCO geometry drives the strip reactively (issue #257)', async ({
|
||||
}
|
||||
})
|
||||
await page.goto(PAGE_URL, { waitUntil: 'domcontentloaded' })
|
||||
await expect(page.locator('[data-dsh-better-sidebar]')).toBeAttached({ timeout: 90_000 })
|
||||
await expect(page.locator('[data-dsh-apes-sidebar]')).toBeAttached({ timeout: 90_000 })
|
||||
// Real reported height (36px, not a hardcoded 32) drives the strip.
|
||||
await expect(page.locator('body[data-dsh-title-bar-compat]')).toBeAttached({ timeout: 90_000 })
|
||||
await expect
|
||||
@@ -631,7 +631,7 @@ test('opt-in shell preset applies its strip when WCO is absent (data-driven, man
|
||||
expect(update.ok(), `settings.update: ${update.status()}`).toBe(true)
|
||||
try {
|
||||
await gotoPage(page, { 'dsh-desktop-mode': 'advanced', 'dsh-desktop-platform': 'win32' })
|
||||
await expect(page.locator('[data-dsh-better-sidebar]')).toBeAttached({ timeout: 90_000 })
|
||||
await expect(page.locator('[data-dsh-apes-sidebar]')).toBeAttached({ timeout: 90_000 })
|
||||
await expect(page.locator('body[data-dsh-title-bar-compat]')).toBeAttached({ timeout: 90_000 })
|
||||
await expect
|
||||
.poll(() => page.evaluate(() => document.documentElement.style.getPropertyValue('--dsh-title-bar-strip')))
|
||||
@@ -656,7 +656,7 @@ test('custom scheme injects the user stylesheet live', async ({ request, page })
|
||||
expect(update.ok(), `settings.update: ${update.status()}`).toBe(true)
|
||||
try {
|
||||
await page.goto(PAGE_URL, { waitUntil: 'domcontentloaded' })
|
||||
await expect(page.locator('[data-dsh-better-sidebar]')).toBeAttached({ timeout: 90_000 })
|
||||
await expect(page.locator('[data-dsh-apes-sidebar]')).toBeAttached({ timeout: 90_000 })
|
||||
await expect(page.locator('style[data-dsh-custom-css="custom"]')).toBeAttached()
|
||||
// The injected CSS is live (a custom property the page can read back).
|
||||
const marker = await page.evaluate(() => getComputedStyle(document.documentElement).getPropertyValue('--dsh-e2e-marker').trim())
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* It exists to put NUMBERS on the sidebar's client-side cost in a real
|
||||
* mounted `dsh web` (the same scratch-profile boot as scripts/e2e-mount.sh):
|
||||
*
|
||||
* 1. mount latency — navigationStart → `[data-dsh-better-sidebar]`
|
||||
* 1. mount latency — navigationStart → `[data-dsh-apes-sidebar]`
|
||||
* attached, sampled by an init-script probe (rAF loop, so it catches
|
||||
* the attach even before Playwright's first poll);
|
||||
* 2. longtasks — every >50ms main-thread task from first paint
|
||||
@@ -62,7 +62,7 @@ const PERF_PROBE = `(() => {
|
||||
for (const entry of list.getEntries()) perf.longtasks.push({ start: entry.startTime, duration: entry.duration })
|
||||
}).observe({ entryTypes: ['longtask'] })
|
||||
const check = () => {
|
||||
if (document.querySelector('[data-dsh-better-sidebar]') !== null) { perf.mountAt = performance.now(); return }
|
||||
if (document.querySelector('[data-dsh-apes-sidebar]') !== null) { perf.mountAt = performance.now(); return }
|
||||
requestAnimationFrame(check)
|
||||
}
|
||||
requestAnimationFrame(check)
|
||||
@@ -113,7 +113,7 @@ test('measure: mount latency, longtasks and bundle cost through a full tab sweep
|
||||
await page.addInitScript(PERF_PROBE)
|
||||
await page.goto(PAGE_URL, { waitUntil: 'domcontentloaded' })
|
||||
await expect(page.locator('#root > *')).not.toHaveCount(0, { timeout: 90_000 })
|
||||
const sidebar = page.locator('[data-dsh-better-sidebar]')
|
||||
const sidebar = page.locator('[data-dsh-apes-sidebar]')
|
||||
await expect(sidebar).toBeAttached({ timeout: 90_000 })
|
||||
|
||||
const mountLatency = await page.evaluate(() =>
|
||||
@@ -183,7 +183,7 @@ test('measure: bottom-strip drag frame pacing', async ({ page }) => {
|
||||
await page.addInitScript(PERF_PROBE)
|
||||
await page.goto(PAGE_URL, { waitUntil: 'domcontentloaded' })
|
||||
await expect(page.locator('#root > *')).not.toHaveCount(0, { timeout: 90_000 })
|
||||
const sidebar = page.locator('[data-dsh-better-sidebar]')
|
||||
const sidebar = page.locator('[data-dsh-apes-sidebar]')
|
||||
await expect(sidebar).toBeAttached({ timeout: 90_000 })
|
||||
await dismissOnboarding(page)
|
||||
|
||||
@@ -221,7 +221,7 @@ test('measure: bottom-strip drag frame pacing', async ({ page }) => {
|
||||
await expect
|
||||
.poll(async () => {
|
||||
const probe = await page.evaluate(() => {
|
||||
const bottom = document.querySelector('[data-dsh-better-sidebar] [data-dsh-bottom-panel]')
|
||||
const bottom = document.querySelector('[data-dsh-apes-sidebar] [data-dsh-bottom-panel]')
|
||||
if (bottom === null) return null
|
||||
const strip = [...bottom.querySelectorAll<HTMLElement>('*')].find(el => getComputedStyle(el).cursor === 'row-resize')
|
||||
if (strip === undefined) return null
|
||||
@@ -233,7 +233,7 @@ test('measure: bottom-strip drag frame pacing', async ({ page }) => {
|
||||
}, { timeout: 30_000 })
|
||||
.toBeLessThanOrEqual(8)
|
||||
const stripPoint = await page.evaluate(() => {
|
||||
const bottom = document.querySelector('[data-dsh-better-sidebar] [data-dsh-bottom-panel]')
|
||||
const bottom = document.querySelector('[data-dsh-apes-sidebar] [data-dsh-bottom-panel]')
|
||||
if (bottom === null) return null
|
||||
const strip = [...bottom.querySelectorAll<HTMLElement>('*')].find(el => getComputedStyle(el).cursor === 'row-resize')
|
||||
if (strip === undefined) return null
|
||||
|
||||
@@ -51,7 +51,7 @@ interface FrameSample {
|
||||
test('bottom panel tracks the center column during the right-panel toggle transition (issue #315)', async ({ page }) => {
|
||||
await page.goto(PAGE_URL, { waitUntil: 'domcontentloaded' })
|
||||
await expect(page.locator('#root > *')).not.toHaveCount(0, { timeout: 90_000 })
|
||||
const sidebar = page.locator('[data-dsh-better-sidebar]')
|
||||
const sidebar = page.locator('[data-dsh-apes-sidebar]')
|
||||
await expect(sidebar).toBeAttached({ timeout: 90_000 })
|
||||
|
||||
// Dismiss onboarding (same dance as the drag lane).
|
||||
|
||||
Reference in New Issue
Block a user