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:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Mirrors the "external consumer" fixture: what is importable here from
|
||||
* `../src/client/service.ts` must also be importable from
|
||||
* `dsh-better-sidebar/client/service` in the built package.
|
||||
* `dsh-apes-sidebar/client/service` in the built package.
|
||||
*/
|
||||
import type {} from '../src/client/service.ts'
|
||||
import {
|
||||
|
||||
@@ -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).
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Fixture aggregate bundle: mounts dsh-better-sidebar under its own entry id,
|
||||
# Fixture aggregate bundle: mounts dsh-apes-sidebar under its own entry id,
|
||||
# the way real aggregate bundles (e.g. @linxin666/dsh-web-ui-all) do. Used by
|
||||
# scripts/e2e-aggregate-mount.sh to prove the plugin's own bundle patch backs
|
||||
# off when another enabled entry already mounts the same package.
|
||||
- insert:
|
||||
- id: aggregate-better-sidebar
|
||||
name: 'dsh-better-sidebar'
|
||||
name: 'dsh-apes-sidebar'
|
||||
|
||||
@@ -6,9 +6,9 @@ import { join, resolve } from 'node:path'
|
||||
import { parseWorktreeList, resolveWorktree, status, worktrees } from '../src/git.ts'
|
||||
|
||||
const IDENTITY = {
|
||||
GIT_AUTHOR_NAME: 'dsh-better-sidebar-test',
|
||||
GIT_AUTHOR_NAME: 'dsh-apes-sidebar-test',
|
||||
GIT_AUTHOR_EMAIL: 'test@dsh.invalid',
|
||||
GIT_COMMITTER_NAME: 'dsh-better-sidebar-test',
|
||||
GIT_COMMITTER_NAME: 'dsh-apes-sidebar-test',
|
||||
GIT_COMMITTER_EMAIL: 'test@dsh.invalid',
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ const canonical = (path: string): string => normalizePath(realpathSync.native(pa
|
||||
|
||||
describe('git parsing', () => {
|
||||
it('discovers and selects direct child repositories under a workspace directory', async () => {
|
||||
const workspace = await mkdtemp(join(tmpdir(), 'dsh-better-sidebar-git-'))
|
||||
const workspace = await mkdtemp(join(tmpdir(), 'dsh-apes-sidebar-git-'))
|
||||
const first = join(workspace, 'first-repo')
|
||||
const second = join(workspace, 'second-repo')
|
||||
try {
|
||||
|
||||
@@ -60,7 +60,7 @@ function assertInMemoryInvocation(executable: string): void {
|
||||
const output = `${result.stdout}\n${result.stderr}`
|
||||
|
||||
expect(result.status, output).toBe(0)
|
||||
expect(output).toContain('dsh-better-sidebar@0.11.0')
|
||||
expect(output).toContain('dsh-apes-sidebar@0.11.0')
|
||||
expect(output).toContain('[dry-run]')
|
||||
expect(output).not.toContain('False False')
|
||||
}
|
||||
@@ -118,7 +118,7 @@ describe('PowerShell installer entry points', () => {
|
||||
const output = `${result.stdout}\n${result.stderr}`
|
||||
|
||||
expect(result.status, output).toBe(0)
|
||||
expect(output).toContain('dsh-better-sidebar@0.11.0')
|
||||
expect(output).toContain('dsh-apes-sidebar@0.11.0')
|
||||
expect(output).toContain('[dry-run]')
|
||||
})
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import * as sidebar from '../src/index.ts'
|
||||
* the official plugin repos ship (dsh-external/turtle-ui,
|
||||
* packages/ui/jsonrpc).
|
||||
*/
|
||||
describe('dsh-better-sidebar plugin export shape', () => {
|
||||
describe('dsh-apes-sidebar plugin export shape', () => {
|
||||
it('has the namespace-plugin export shape (no stray default) so the Loader keeps name/inject/Config/apply', () => {
|
||||
expect('default' in sidebar).toBe(false)
|
||||
expect(typeof sidebar.apply).toBe('function')
|
||||
@@ -16,7 +16,7 @@ describe('dsh-better-sidebar plugin export shape', () => {
|
||||
const loader = Object.create(Loader.prototype) as Loader
|
||||
const unwrapped = loader.unwrapExports(sidebar) as Record<string, unknown>
|
||||
expect(unwrapped).toBe(sidebar)
|
||||
expect(unwrapped.name).toBe('dsh-better-sidebar')
|
||||
expect(unwrapped.name).toBe('dsh-apes-sidebar')
|
||||
expect(unwrapped.inject).toEqual(['webServer', 'sessions', 'webRuntime', 'tools'])
|
||||
expect(unwrapped.Config).toBeDefined()
|
||||
expect(typeof unwrapped.apply).toBe('function')
|
||||
@@ -53,7 +53,7 @@ describe('dsh-better-sidebar plugin export shape', () => {
|
||||
|
||||
it('registers the side card preferences schema with the documented defaults', async () => {
|
||||
const { PrefsSchema, SIDEBAR_PREFS_NS } = await import('../src/config.ts')
|
||||
expect(SIDEBAR_PREFS_NS).toBe('dsh-better-sidebar')
|
||||
expect(SIDEBAR_PREFS_NS).toBe('dsh-apes-sidebar')
|
||||
const resolved = (PrefsSchema as unknown as {
|
||||
(input: Record<string, unknown> | undefined): Record<string, unknown>
|
||||
})(undefined)
|
||||
|
||||
@@ -114,12 +114,12 @@ describe('findProfileDir / findPluginRoot', () => {
|
||||
beforeEach(() => {
|
||||
root = mkdtempSync(join(tmpdir(), 'pty-deps-'))
|
||||
// A fake plugin module deep inside the profile's pnpm node_modules.
|
||||
const pkgRoot = join(root, 'profiles', 'web', 'node_modules', '.pnpm', 'dsh-better-sidebar@0.0.0', 'node_modules', 'dsh-better-sidebar')
|
||||
const pkgRoot = join(root, 'profiles', 'web', 'node_modules', '.pnpm', 'dsh-apes-sidebar@0.0.0', 'node_modules', 'dsh-apes-sidebar')
|
||||
const libDir = join(pkgRoot, 'lib')
|
||||
mkdirSync(libDir, { recursive: true })
|
||||
writeFileSync(join(root, 'profiles', 'web', 'package.json'), JSON.stringify({ name: 'dsh-profile-web' }))
|
||||
writeFileSync(join(root, 'profiles', 'web', 'pnpm-workspace.yaml'), '')
|
||||
writeFileSync(join(pkgRoot, 'package.json'), JSON.stringify({ name: 'dsh-better-sidebar' }))
|
||||
writeFileSync(join(pkgRoot, 'package.json'), JSON.stringify({ name: 'dsh-apes-sidebar' }))
|
||||
moduleFile = join(libDir, 'index.js')
|
||||
writeFileSync(moduleFile, '')
|
||||
})
|
||||
@@ -131,7 +131,7 @@ describe('findProfileDir / findPluginRoot', () => {
|
||||
})
|
||||
|
||||
it('walks up to the plugin package root by package.json name', () => {
|
||||
expect(findPluginRoot(moduleFile)).toBe(realpathSync(join(root, 'profiles', 'web', 'node_modules', '.pnpm', 'dsh-better-sidebar@0.0.0', 'node_modules', 'dsh-better-sidebar')))
|
||||
expect(findPluginRoot(moduleFile)).toBe(realpathSync(join(root, 'profiles', 'web', 'node_modules', '.pnpm', 'dsh-apes-sidebar@0.0.0', 'node_modules', 'dsh-apes-sidebar')))
|
||||
})
|
||||
|
||||
it('falls back to $DSH_HOME/profiles/web when no ancestor looks like a profile', () => {
|
||||
@@ -161,12 +161,12 @@ describe('depsStatus', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
root = mkdtempSync(join(tmpdir(), 'pty-deps-'))
|
||||
const pkgRoot = join(root, 'profiles', 'web', 'node_modules', '.pnpm', 'dsh-better-sidebar@0.0.0', 'node_modules', 'dsh-better-sidebar')
|
||||
const pkgRoot = join(root, 'profiles', 'web', 'node_modules', '.pnpm', 'dsh-apes-sidebar@0.0.0', 'node_modules', 'dsh-apes-sidebar')
|
||||
mkdirSync(join(pkgRoot, 'scripts'), { recursive: true })
|
||||
mkdirSync(join(pkgRoot, 'lib'), { recursive: true })
|
||||
writeFileSync(join(root, 'profiles', 'web', 'package.json'), JSON.stringify({ name: 'dsh-profile-web' }))
|
||||
writeFileSync(join(root, 'profiles', 'web', 'pnpm-workspace.yaml'), '')
|
||||
writeFileSync(join(pkgRoot, 'package.json'), JSON.stringify({ name: 'dsh-better-sidebar' }))
|
||||
writeFileSync(join(pkgRoot, 'package.json'), JSON.stringify({ name: 'dsh-apes-sidebar' }))
|
||||
writeFileSync(join(pkgRoot, 'scripts', 'install.sh'), '#!/usr/bin/env bash\n')
|
||||
writeFileSync(join(pkgRoot, 'scripts', 'install.ps1'), '# repair fixture\n')
|
||||
moduleFile = join(pkgRoot, 'lib', 'index.js')
|
||||
@@ -190,7 +190,7 @@ describe('depsStatus', () => {
|
||||
if (status.ok) throw new Error('unreachable')
|
||||
expect(status.cause).toBe('Cannot find package node-pty')
|
||||
const scriptName = process.platform === 'win32' ? 'install.ps1' : 'install.sh'
|
||||
const script = realpathSync(join(root, 'profiles', 'web', 'node_modules', '.pnpm', 'dsh-better-sidebar@0.0.0', 'node_modules', 'dsh-better-sidebar', 'scripts', scriptName))
|
||||
const script = realpathSync(join(root, 'profiles', 'web', 'node_modules', '.pnpm', 'dsh-apes-sidebar@0.0.0', 'node_modules', 'dsh-apes-sidebar', 'scripts', scriptName))
|
||||
expect(status.command).toBe(process.platform === 'win32'
|
||||
? `powershell -ExecutionPolicy Bypass -File "${script}" -Repair -Profile "web"`
|
||||
: `bash "${script}" --repair --profile "web"`)
|
||||
|
||||
@@ -373,7 +373,7 @@ function threadLog(): Array<ReturnType<typeof ev>> {
|
||||
ev('turn/end', 1, { turn: 0, reason: { kind: 'completed' } }),
|
||||
ev('session/end-seed', 2),
|
||||
ev('subagent/descriptor', 3, { mode: 'continuable' }),
|
||||
ev('user/message', 4, { content: [{ type: 'text', text: 'Side conversation boundary.' }], source: { kind: 'plugin', plugin: 'dsh-better-sidebar' } }),
|
||||
ev('user/message', 4, { content: [{ type: 'text', text: 'Side conversation boundary.' }], source: { kind: 'plugin', plugin: 'dsh-apes-sidebar' } }),
|
||||
ev('user/message', 5, { content: [{ type: 'text', text: 'the side question' }], source: { kind: 'user' } }),
|
||||
ev('assistant/chunk', 6, { turn: 1, step: 1, chunk: { type: 'text-delta', index: 0, text: 'an' } }),
|
||||
ev('assistant/chunk', 7, { turn: 1, step: 1, chunk: { type: 'text-delta', index: 0, text: 'swer' } }),
|
||||
|
||||
+2
-2
@@ -388,9 +388,9 @@ describe('host plugin smoke', () => {
|
||||
*/
|
||||
describe('git destructive operations (scratch repository)', () => {
|
||||
const FIXTURE_IDENTITY = {
|
||||
GIT_AUTHOR_NAME: 'dsh-better-sidebar-test',
|
||||
GIT_AUTHOR_NAME: 'dsh-apes-sidebar-test',
|
||||
GIT_AUTHOR_EMAIL: 'test@dsh.invalid',
|
||||
GIT_COMMITTER_NAME: 'dsh-better-sidebar-test',
|
||||
GIT_COMMITTER_NAME: 'dsh-apes-sidebar-test',
|
||||
GIT_COMMITTER_EMAIL: 'test@dsh.invalid',
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ setupReactAct()
|
||||
const deps = {
|
||||
ok: false as const,
|
||||
cause: 'Cannot find package node-pty',
|
||||
command: 'bash "/Users/u/.dsh/profiles/web/node_modules/.pnpm/dsh-better-sidebar@0.0.0/node_modules/dsh-better-sidebar/scripts/install.sh" --repair --profile "web"',
|
||||
command: 'bash "/Users/u/.dsh/profiles/web/node_modules/.pnpm/dsh-apes-sidebar@0.0.0/node_modules/dsh-apes-sidebar/scripts/install.sh" --repair --profile "web"',
|
||||
profile: 'web',
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ describe('turn-tail interception registration (issue #15)', () => {
|
||||
const { options, component } = fake.registered[0]!
|
||||
expect(options.name).toBe('conversation.chat.turnTail')
|
||||
expect(options.priority).toBe(-1)
|
||||
expect(options.registrant).toBe('dsh-better-sidebar')
|
||||
expect(options.registrant).toBe('dsh-apes-sidebar')
|
||||
expect(options.select).toBeTypeOf('function')
|
||||
expect(options.inject).toBeTypeOf('function')
|
||||
expect(component).toBeTypeOf('function')
|
||||
|
||||
Reference in New Issue
Block a user