Merge branch 'feat/session-panel' into feat/session-panel-sections

The panel's row Factory is gone on the base branch: rows share their look
through `data-session-panel-row` and `data-row-part` marks that the
panel's stylesheet lays out. This merge carries the rows of this branch
over to it:

- The two-line row moves from PanelRow's stylesheet into the panel's row
  rules as the `lines` and `detail` parts.
- The forge checkout, connection, local changes, and sign-in rows write
  their own marked markup instead of calling the Factory; the connection
  row, the local changes row, and the change requests section no longer
  take `renderFactorySlot`.
- The forge e2e measures the local changes and checkout rows in the real
  panel.
This commit is contained in:
LegGasai committed 2026-11-13 20:22:32 +08:00
commit c64862545f
30 files changed
+808 -774

No files matched your search

@@ -15,8 +15,8 @@
en: 8a97ac8ac0b40d0c
zh: d42fe9c23b9dcd79
/agent-note-session-panel-in-the-chat-view-s-end-gutter/decision/sections-are-registrations-the-panel-draws-titles:
en: d93135868e42f9a0
zh: b3336f9be64ef789
en: d6f85e07351ad90e
zh: f883a99c8ca98522
/agent-note-session-panel-in-the-chat-view-s-end-gutter/decision/the-turn-rail-sits-at-the-start-edge:
en: 08e720a4ea75d4d6
zh: 5e2e5b8452f67d36
@@ -24,7 +24,7 @@ Docking follows one persisted preference shared by every Session and defaults to
Each section is one list registration with `id`, `order`, and a required `label`. The panel projects the live registrations into titles, draws each title, and renders the section body with `renderSlot(..., { only: id })`; a CSS `:has()` rule hides a section whose body rendered nothing, so a section opts out by rendering nothing and no effect reports visibility to the owner. Trailing title controls are a keyed slot addressed by the section `id`, and a section that several plugins share declares its own row slot, as the built-in Environment section does with `conversation.session.panel.environment.row`. Marks that must stay visible while the panel is hidden go in an indicator list over the toggle.
Rows from every contributor render through the plugin's `conversation.session.panel.row` Component Factory so icon, text, and trailing areas align across packages; a feature package cannot share its own row component with another feature package.
Rows from every contributor share one look through the panel's stylesheet instead of a shared component: each contributor writes its row's markup and marks the parts, and the panel lays them out, so icon, text, and trailing areas align across packages. A shared row component would receive each contributor's icon, text, and controls as React nodes in props, which the client rules forbid, and a feature package cannot share its own row component with another feature package.
### The turn rail sits at the start edge
@@ -24,7 +24,7 @@ Status: implemented
每个分栏是一次 list 注册,带 `id`、`order` 和必填的 `label`。面板把实时注册投影成标题并逐个绘制,再用 `renderSlot(..., { only: id })` 渲染分栏正文;CSS `:has()` 规则隐藏正文没有渲染内容的分栏,因此分栏不渲染任何内容即可退出,不需要 effect 向拥有者上报可见性。标题尾部控件是以分栏 `id` 为键的 keyed slot;多个插件共用的分栏声明自己的行 slot,内置「环境」分栏就以 `conversation.session.panel.environment.row` 这样做。面板隐藏时也要可见的标记放进开关上的角标列表。
所有贡献方的行都通过插件的 Component Factory `conversation.session.panel.row` 渲染,使不同包的图标、文字与尾部区域对齐;功能包之间不能共享各自的行组件。
各贡献方的行通过面板的样式表共享同一外观,而不是共享组件:各贡献方自己写行的标记并标出各个部分,由面板统一排版,使不同包的图标、文字与尾部区域对齐。共享的行组件要把各贡献方的图标、文字和控件作为 React 节点从 props 传入,这是客户端规则禁止的;功能包之间也不能共享各自的行组件。
### 轮次轨道位于起始边
+33
View File
@@ -647,6 +647,33 @@ async function chooseCardAction(page: Page, change: Locator, name: string, item:
/** Accessible name of the panel toggle while a change request needs attention. */
const TOGGLE_ATTENTION = '会话面板 本会话的变更请求需要处理'
/**
* A Session panel row as the panel's row rules lay it out: its height, how far
* the centers of its icon and menu columns sit from its start and end edges
* (null for a part that takes no room), and the part a press reaches at its
* start edge and on its trailing part.
*/
function panelRowLayout(row: Locator) {
return row.evaluate((element) => {
const box = element.getBoundingClientRect()
const rectOf = (part: string): DOMRect | null => {
const rect = element.querySelector(`[data-row-part="${part}"]`)?.getBoundingClientRect()
return rect === undefined || rect.width === 0 ? null : rect
}
const partAt = (x: number, y: number): string | null =>
document.elementFromPoint(x, y)?.closest('[data-row-part]')?.getAttribute('data-row-part') ?? null
const [icon, trailing, menu] = [rectOf('icon'), rectOf('trailing'), rectOf('menu')]
return {
marked: element.hasAttribute('data-session-panel-row'),
height: box.height,
iconCenter: icon === null ? null : icon.left + icon.width / 2 - box.left,
menuCenter: menu === null ? null : box.right - (menu.left + menu.width / 2),
startPress: partAt(box.left + 2, box.top + 2),
trailingPress: trailing === null ? null : partAt(trailing.left + trailing.width / 2, trailing.top + trailing.height / 2),
}
})
}
function worktreeRecords(events: readonly SessionEvent[]): unknown[] {
return events.flatMap((event) => {
const record = pluginRecordOf(event)
@@ -684,6 +711,12 @@ it.skipIf(MODE === 'record')('reads local Git with full access when the sandbox
const local = page.locator('[data-forge-local]')
await local.getByRole('button', { name: '本地变更 · 1 个文件,新增 1 行,删除 0 行', exact: true }).waitFor({ timeout: 20_000 })
await compareOrRefreshGolden(join(EXPECTED, 'full-access.expected.md'), await captureStableAria(page, '[data-forge-local]', scaffold.workspaceCwd), MODE)
// The panel lays the row out by its marks: one 28px line with the icon and the More button on the panel columns.
// The body is the row's button, so a press at the row's edge reaches it, while the diff size stays above it.
expect(await panelRowLayout(local)).toEqual({ marked: true, height: 28, iconCenter: 14, menuCenter: 14, startPress: 'body', trailingPress: 'trailing' })
// This composition registers no directory menu entries: the checkout row's menu takes no room, and its body is not a button.
expect(await panelRowLayout(panel.locator('[data-forge-checkout]')))
.toEqual({ marked: true, height: 28, iconCenter: 14, menuCenter: null, startPress: null, trailingPress: 'trailing' })
await local.getByRole('button', { name: '本地变更 · 1 个文件,新增 1 行,删除 0 行', exact: true }).click()
await page.locator('[data-forge-diff-file="README.md"]').getByText('changed', { exact: true }).waitFor()
-161
View File
@@ -1,161 +0,0 @@
/**
* Session panel docking in the shipped Web composition. The panel's stylesheet
* decides whether the Chat View's end gutter holds the docked panel and tells
* the plugin through a 1px dock probe; jsdom cannot evaluate that stylesheet,
* so this measures the probe, the panel, and the toggle around the boundary.
*/
import { readFile } from 'node:fs/promises'
import { fileURLToPath } from 'node:url'
import type { Browser, Page } from 'playwright'
import { chromium } from 'playwright'
import { afterAll, beforeAll, describe, expect, it, onTestFailed } from 'vitest'
import type { SessionId } from '@deepseek-ai/dsh-session'
import { brandString } from '@deepseek-ai/dsh-brand'
import { launchWebScaffold, seedSession, watchConsole, webSnapshotMode, type WebScaffold } from './scaffold.ts'
import { newEnglishPage, saveFailureShot } from './support.ts'
const FIXTURE = fileURLToPath(new URL('../../../snapshots/web/fresh-round-trip/session.v3.jsonl', import.meta.url))
const MODE = webSnapshotMode()
const SEED_ID = brandString<SessionId>('session-panel-dock-web-e2e')
/** The default transcript width in a frame wide enough to dock. */
const TRANSCRIPT = 880
/** The gutter that holds the docked panel: 40px clear of the transcript, its 300px minimum width, and the 8px edge inset. */
const DOCK_GUTTER = 348
/** What the layout says about docking: the gutter, the probe, the panel's presentation and insets, and the toggle. */
function docking(page: Page) {
return page.evaluate(() => {
const layer = document.querySelector<HTMLElement>('[data-chat-aside]')
const column = document.querySelector<HTMLElement>('[data-chat-flow]')
const probe = document.querySelector<HTMLElement>('[data-session-panel-probe]')
const toggle = document.querySelector<HTMLElement>('[data-session-panel-toggle]')
if (layer === null || column === null || probe === null || toggle === null) {
throw new Error('aside layer, transcript column, dock probe, or panel toggle is missing')
}
const frame = layer.getBoundingClientRect()
const flow = column.getBoundingClientRect()
const panel = document.querySelector<HTMLElement>('[data-session-panel]')
const box = panel?.getBoundingClientRect()
return {
gutter: (frame.width - flow.width) / 2,
probe: probe.getBoundingClientRect().width,
presentation: panel?.dataset['sessionPanel'] ?? null,
expanded: toggle.getAttribute('aria-expanded'),
panel: box === undefined ? null : { width: box.width, clear: box.left - flow.right, edge: frame.right - box.right },
}
})
}
describe.skipIf(MODE === 'record')('web e2e: Session panel docking', () => {
let scaffold: WebScaffold
let browser: Browser
let page: Page
let tripwire: ReturnType<typeof watchConsole>
/** Viewport width the application keeps outside the Chat frame. */
let chrome = 0
/** Resize the window so the Chat View's end gutter is exactly `gutter`, and wait for the layout to follow. */
async function setGutter(gutter: number): Promise<void> {
await page.setViewportSize({ width: TRANSCRIPT + 2 * gutter + chrome, height: page.viewportSize()!.height })
await expect.poll(async () => (await docking(page)).gutter, { timeout: 10_000 }).toBe(gutter)
}
/** Wait until the panel shows this way (null: not at all) and its entrance has finished. */
async function shows(presentation: 'docked' | 'overlay' | null): Promise<void> {
await expect.poll(async () => (await docking(page)).presentation, { timeout: 10_000 }).toBe(presentation)
if (presentation === null) return
await page.locator('[data-session-panel]').evaluate(async (element) => {
await Promise.all(element.getAnimations().map(animation => animation.finished))
})
}
beforeAll(async () => {
scaffold = await launchWebScaffold()
await seedSession(scaffold, await readFile(FIXTURE, 'utf8'), SEED_ID)
browser = await chromium.launch()
page = await newEnglishPage(browser)
await page.emulateMedia({ reducedMotion: 'reduce' })
tripwire = watchConsole(page)
await page.goto(scaffold.authenticatedUrl, { waitUntil: 'load' })
}, 120_000)
/** Open the seeded Session and learn how much of the window lies outside the Chat frame. */
async function openSession(): Promise<void> {
if (chrome !== 0) return
const session = page.locator(`[data-row-key="session:${SEED_ID}"]`)
await expect.poll(async () => {
if (await session.isVisible()) return true
const group = page.locator('[role="treeitem"][aria-expanded]').first()
if (await group.count() > 0 && await group.getAttribute('aria-expanded') === 'false') await group.click()
return session.isVisible()
}, { timeout: 15_000 }).toBe(true)
await session.click()
await page.locator('[data-session-panel-probe]').waitFor({ state: 'attached', timeout: 30_000 })
const frame = await page.locator('[data-chat-aside]').evaluate(element => element.getBoundingClientRect().width)
chrome = page.viewportSize()!.width - frame
}
afterAll(async () => {
const failures: unknown[] = []
try { await browser?.close() } catch (error) { failures.push(error) }
try { await scaffold?.close() } catch (error) { failures.push(error) }
if (failures.length > 0) throw new AggregateError(failures, 'Session panel docking teardown failed')
})
it('docks exactly from the gutter that holds the panel at its minimum width', async () => {
onTestFailed(() => saveFailureShot(page, 'web-e2e-session-panel-dock'))
await openSession()
expect(Number.isInteger(chrome)).toBe(true)
await setGutter(DOCK_GUTTER - 1)
await shows(null)
expect(await docking(page)).toEqual({ gutter: DOCK_GUTTER - 1, probe: 0, presentation: null, expanded: 'false', panel: null })
// Half a pixel short, the probe is half a pixel wide and the panel stays hidden.
await setGutter(DOCK_GUTTER - 0.5)
expect(await docking(page)).toEqual({ gutter: DOCK_GUTTER - 0.5, probe: 0.5, presentation: null, expanded: 'false', panel: null })
await setGutter(DOCK_GUTTER)
await shows('docked')
expect(await docking(page)).toEqual({
gutter: DOCK_GUTTER, probe: 1, presentation: 'docked', expanded: 'true', panel: { width: 300, clear: 40, edge: 8 },
})
// A wider gutter widens the panel to its maximum at the same edge inset; the probe stays 1px.
await setGutter(DOCK_GUTTER + 100)
expect(await docking(page)).toEqual({
gutter: DOCK_GUTTER + 100, probe: 1, presentation: 'docked', expanded: 'true', panel: { width: 360, clear: 80, edge: 8 },
})
await setGutter(DOCK_GUTTER - 1)
await shows(null)
expect((await docking(page)).expanded).toBe('false')
expect(tripwire.pageErrors).toEqual([])
})
it('floats narrower than it docks, at the same edge inset, and docks once the gutter holds it', async () => {
onTestFailed(() => saveFailureShot(page, 'web-e2e-session-panel-overlay'))
await openSession()
const toggle = page.locator('[data-session-panel-toggle]')
await setGutter(260)
await shows(null)
await toggle.click()
await shows('overlay')
const overlay = await docking(page)
expect(overlay).toMatchObject({ probe: 0, presentation: 'overlay', expanded: 'true', panel: { width: 280, edge: 8 } })
// The overlay covers part of the transcript instead of keeping clear of it.
expect(overlay.panel?.clear).toBeLessThan(0)
await page.keyboard.press('Escape')
await shows(null)
expect((await docking(page)).expanded).toBe('false')
// An open overlay gives way to the docked panel when the window widens enough.
await toggle.click()
await shows('overlay')
await setGutter(DOCK_GUTTER)
await shows('docked')
expect(await docking(page)).toMatchObject({ probe: 1, expanded: 'true', panel: { width: 300, clear: 40, edge: 8 } })
expect(tripwire.pageErrors).toEqual([])
})
})
+253
View File
@@ -0,0 +1,253 @@
/**
* Session panel layout in the shipped Web composition. The panel's stylesheet
* decides whether the Chat View's end gutter holds the docked panel and tells
* the plugin through a 1px dock probe, and it lays out the rows that
* contributors mark. jsdom cannot evaluate that stylesheet, so this measures
* the probe, the panel, and the toggle around the docking boundary, and the
* working folder row without and with a directory context menu.
*/
import { readFile } from 'node:fs/promises'
import { fileURLToPath } from 'node:url'
import type { Browser, Page } from 'playwright'
import { chromium } from 'playwright'
import { afterAll, beforeAll, describe, expect, it, onTestFailed, onTestFinished } from 'vitest'
import { createLaunchEnvironmentSnapshot } from '@deepseek-ai/dsh-launch-environment'
import type { SessionId } from '@deepseek-ai/dsh-session'
import { brandString } from '@deepseek-ai/dsh-brand'
import { launchWebScaffold, seedSession, watchConsole, webSnapshotMode, type WebScaffold } from './scaffold.ts'
import { newEnglishPage, saveFailureShot } from './support.ts'
const FIXTURE = fileURLToPath(new URL('../../../snapshots/web/fresh-round-trip/session.v3.jsonl', import.meta.url))
const MODE = webSnapshotMode()
const SEED_ID = brandString<SessionId>('session-panel-layout-web-e2e')
/** The default transcript width in a frame wide enough to dock. */
const TRANSCRIPT = 880
/** The gutter that holds the docked panel: 40px clear of the transcript, its 300px minimum width, and the 8px edge inset. */
const DOCK_GUTTER = 348
/** What the layout says about docking: the gutter, the probe, the panel's presentation and insets, and the toggle. */
function docking(page: Page) {
return page.evaluate(() => {
const layer = document.querySelector<HTMLElement>('[data-chat-aside]')
const column = document.querySelector<HTMLElement>('[data-chat-flow]')
const probe = document.querySelector<HTMLElement>('[data-session-panel-probe]')
const toggle = document.querySelector<HTMLElement>('[data-session-panel-toggle]')
if (layer === null || column === null || probe === null || toggle === null) {
throw new Error('aside layer, transcript column, dock probe, or panel toggle is missing')
}
const frame = layer.getBoundingClientRect()
const flow = column.getBoundingClientRect()
const panel = document.querySelector<HTMLElement>('[data-session-panel]')
const box = panel?.getBoundingClientRect()
return {
gutter: (frame.width - flow.width) / 2,
probe: probe.getBoundingClientRect().width,
presentation: panel?.dataset['sessionPanel'] ?? null,
expanded: toggle.getAttribute('aria-expanded'),
panel: box === undefined ? null : { width: box.width, clear: box.left - flow.right, edge: frame.right - box.right },
}
})
}
/** Open the seeded Session through the sidebar and wait for the panel's dock probe. */
async function openSeed(page: Page): Promise<void> {
const session = page.locator(`[data-row-key="session:${SEED_ID}"]`)
await expect.poll(async () => {
if (await session.isVisible()) return true
const group = page.locator('[role="treeitem"][aria-expanded]').first()
if (await group.count() > 0 && await group.getAttribute('aria-expanded') === 'false') await group.click()
return session.isVisible()
}, { timeout: 15_000 }).toBe(true)
await session.click()
await page.locator('[data-session-panel-probe]').waitFor({ state: 'attached', timeout: 30_000 })
}
/** Wait until the panel shows this way (null: not at all) and its entrance has finished. */
async function shows(page: Page, presentation: 'docked' | 'overlay' | null): Promise<void> {
await expect.poll(async () => (await docking(page)).presentation, { timeout: 10_000 }).toBe(presentation)
if (presentation === null) return
await page.locator('[data-session-panel]').evaluate(async (element) => {
await Promise.all(element.getAnimations().map(animation => animation.finished))
})
}
/**
* The working folder row as laid out: its line, how far the centers of its
* icon and menu columns sit from its edges, the room after its text, and what
* the pointer state shows. `menu` is null while the menu part renders nothing.
*/
function rowLayout(page: Page) {
return page.locator('[data-session-panel] [data-session-panel-project]').evaluate((element) => {
const box = element.getBoundingClientRect()
const icon = element.querySelector('[data-row-part="icon"]')!.getBoundingClientRect()
const content = element.querySelector('[data-row-part="content"]')!
const menu = element.querySelector<HTMLElement>('[data-row-part="menu"]')!
const column = menu.getBoundingClientRect()
const button = menu.querySelector('button')?.getBoundingClientRect()
return {
height: box.height,
iconCenter: icon.left + icon.width / 2 - box.left,
iconSize: [icon.width, icon.height],
clipped: getComputedStyle(content).textOverflow,
afterText: box.right - content.getBoundingClientRect().right,
menu: button === undefined
? null
: {
center: box.right - (column.left + column.width / 2),
target: [button.width, button.height],
opacity: getComputedStyle(menu).opacity,
},
hovered: element.matches(':hover'),
highlighted: getComputedStyle(element).backgroundColor !== 'rgba(0, 0, 0, 0)',
}
})
}
describe.skipIf(MODE === 'record')('web e2e: Session panel layout', () => {
let scaffold: WebScaffold
let browser: Browser
let page: Page
let tripwire: ReturnType<typeof watchConsole>
/** Viewport width the application keeps outside the Chat frame. */
let chrome = 0
/** Resize the window so the Chat View's end gutter is exactly `gutter`, and wait for the layout to follow. */
async function setGutter(gutter: number): Promise<void> {
await page.setViewportSize({ width: TRANSCRIPT + 2 * gutter + chrome, height: page.viewportSize()!.height })
await expect.poll(async () => (await docking(page)).gutter, { timeout: 10_000 }).toBe(gutter)
}
beforeAll(async () => {
scaffold = await launchWebScaffold()
await seedSession(scaffold, await readFile(FIXTURE, 'utf8'), SEED_ID)
browser = await chromium.launch()
page = await newEnglishPage(browser)
await page.emulateMedia({ reducedMotion: 'reduce' })
tripwire = watchConsole(page)
await page.goto(scaffold.authenticatedUrl, { waitUntil: 'load' })
}, 120_000)
/** Open the seeded Session and learn how much of the window lies outside the Chat frame. */
async function openSession(): Promise<void> {
if (chrome !== 0) return
await openSeed(page)
const frame = await page.locator('[data-chat-aside]').evaluate(element => element.getBoundingClientRect().width)
chrome = page.viewportSize()!.width - frame
}
afterAll(async () => {
const failures: unknown[] = []
try { await browser?.close() } catch (error) { failures.push(error) }
try { await scaffold?.close() } catch (error) { failures.push(error) }
if (failures.length > 0) throw new AggregateError(failures, 'Session panel layout teardown failed')
})
it('docks exactly from the gutter that holds the panel at its minimum width', async () => {
onTestFailed(() => saveFailureShot(page, 'web-e2e-session-panel-dock'))
await openSession()
expect(Number.isInteger(chrome)).toBe(true)
await setGutter(DOCK_GUTTER - 1)
await shows(page, null)
expect(await docking(page)).toEqual({ gutter: DOCK_GUTTER - 1, probe: 0, presentation: null, expanded: 'false', panel: null })
// Half a pixel short, the probe is half a pixel wide and the panel stays hidden.
await setGutter(DOCK_GUTTER - 0.5)
expect(await docking(page)).toEqual({ gutter: DOCK_GUTTER - 0.5, probe: 0.5, presentation: null, expanded: 'false', panel: null })
await setGutter(DOCK_GUTTER)
await shows(page, 'docked')
expect(await docking(page)).toEqual({
gutter: DOCK_GUTTER, probe: 1, presentation: 'docked', expanded: 'true', panel: { width: 300, clear: 40, edge: 8 },
})
// A wider gutter widens the panel to its maximum at the same edge inset; the probe stays 1px.
await setGutter(DOCK_GUTTER + 100)
expect(await docking(page)).toEqual({
gutter: DOCK_GUTTER + 100, probe: 1, presentation: 'docked', expanded: 'true', panel: { width: 360, clear: 80, edge: 8 },
})
await setGutter(DOCK_GUTTER - 1)
await shows(page, null)
expect((await docking(page)).expanded).toBe('false')
expect(tripwire.pageErrors).toEqual([])
})
it('floats narrower than it docks, at the same edge inset, and docks once the gutter holds it', async () => {
onTestFailed(() => saveFailureShot(page, 'web-e2e-session-panel-overlay'))
await openSession()
const toggle = page.locator('[data-session-panel-toggle]')
await setGutter(260)
await shows(page, null)
await toggle.click()
await shows(page, 'overlay')
const overlay = await docking(page)
expect(overlay).toMatchObject({ probe: 0, presentation: 'overlay', expanded: 'true', panel: { width: 280, edge: 8 } })
// The overlay covers part of the transcript instead of keeping clear of it.
expect(overlay.panel?.clear).toBeLessThan(0)
await page.keyboard.press('Escape')
await shows(page, null)
expect((await docking(page)).expanded).toBe('false')
// An open overlay gives way to the docked panel when the window widens enough.
await toggle.click()
await shows(page, 'overlay')
await setGutter(DOCK_GUTTER)
await shows(page, 'docked')
expect(await docking(page)).toMatchObject({ probe: 1, expanded: 'true', panel: { width: 300, clear: 40, edge: 8 } })
expect(tripwire.pageErrors).toEqual([])
})
it('lays the working folder row out by its marks, with no room or highlight for a menu that renders nothing', async () => {
onTestFailed(() => saveFailureShot(page, 'web-e2e-session-panel-row'))
await openSession()
await setGutter(DOCK_GUTTER + 100)
await shows(page, 'docked')
const row = page.locator('[data-session-panel] [data-session-panel-project]')
await row.waitFor()
await page.mouse.move(5, 5)
// This composition registers no directory menu entries, so the shared More button renders nothing:
// the text runs to the row's 6px padding, and the row has nothing to highlight for.
const resting = { height: 28, iconCenter: 14, iconSize: [16, 16], clipped: 'ellipsis', afterText: 6, menu: null, highlighted: false }
expect(await rowLayout(page)).toEqual({ ...resting, hovered: false })
await row.hover()
expect(await rowLayout(page)).toEqual({ ...resting, hovered: true })
expect(tripwire.pageErrors).toEqual([])
})
it('puts a rendered menu on the panel end column and shows it, with the row highlight, on hover', async () => {
// The directory context menu comes from Open In; SSH facts keep it from probing this runner's native applications.
const withMenu = await launchWebScaffold({ openInAppEnvironment: createLaunchEnvironmentSnapshot([
{ source: 'process', values: { SSH_CONNECTION: '10.0.0.2 55000 10.0.0.9 22' } },
]) })
onTestFinished(() => withMenu.close())
await seedSession(withMenu, await readFile(FIXTURE, 'utf8'), SEED_ID)
const other = await newEnglishPage(browser)
onTestFinished(() => other.close())
onTestFailed(() => saveFailureShot(other, 'web-e2e-session-panel-row-menu'))
await other.emulateMedia({ reducedMotion: 'reduce' })
const errors = watchConsole(other)
// Wide enough for the gutter to hold the docked panel.
await other.setViewportSize({ width: 2200, height: 1000 })
await other.goto(withMenu.authenticatedUrl, { waitUntil: 'load' })
await openSeed(other)
await shows(other, 'docked')
const row = other.locator('[data-session-panel] [data-session-panel-project]')
await row.locator('[data-row-part="menu"] button').waitFor({ state: 'attached' })
await other.mouse.move(5, 5)
// The 16px menu column and the 8px gap before it follow the text; the 24px target reaches past the column.
const resting = { height: 28, iconCenter: 14, iconSize: [16, 16], clipped: 'ellipsis', afterText: 30 }
expect(await rowLayout(other)).toEqual({
...resting, menu: { center: 14, target: [24, 24], opacity: '0' }, hovered: false, highlighted: false,
})
await row.hover()
await expect.poll(async () => (await rowLayout(other)).menu?.opacity).toBe('1')
expect(await rowLayout(other)).toEqual({
...resting, menu: { center: 14, target: [24, 24], opacity: '1' }, hovered: true, highlighted: true,
})
await other.mouse.move(5, 5)
await expect.poll(async () => (await rowLayout(other)).highlighted).toBe(false)
expect(errors.pageErrors).toEqual([])
})
})
+1 -1
View File
@@ -25,7 +25,7 @@
"exclude": [
"tests/home-whale.e2e.ts",
"tests/sidebar-drawer.e2e.ts",
"tests/session-panel-dock.e2e.ts",
"tests/session-panel-layout.e2e.ts",
"tests/creation-recommendations.e2e.ts",
"tests/plugin-recommendations.e2e.ts",
"tests/japanese-plugin-metadata.e2e.ts",
@@ -21,11 +21,11 @@
en: 67b33b9f412a687d
zh: 2a9b8c89c8bb22e4
/deepseek-ai-dsh-client-ui-session-panel/use-this-package/contribute-a-section:
en: d9be9db35539e9b4
zh: c2597c59f94d594e
en: dd2712df8a0455a2
zh: c4d98d0edc2f7d52
/deepseek-ai-dsh-client-ui-session-panel/understand-the-implementation:
en: e3fc397ec6c8ef3b
zh: 097a67dadb267010
en: e414b3b6a3aef7fc
zh: 384ad365ae5529a9
/deepseek-ai-dsh-client-ui-session-panel/further-exploration:
en: 09b403af819bd155
zh: e949998de4794393
+16 -3
View File
@@ -44,7 +44,20 @@ Plugins share a title by registering rows in a section owner's row slot. The bui
Marks that must stay visible while the panel is hidden, such as an attention dot, go in the `conversation.session.panel.indicator` list. Each occupant is one element: the toggle sizes it to a 6px dot at the glyph's corner, and the occupant sets its `background` and includes text that names it, which becomes part of the toggle's accessible name. Occupants overlap, and a higher `order` paints above a lower one. The `panelShown` owner prop lets a mark that only repeats the panel's content render nothing while the panel shows. Subagents and Background jobs show a blue dot while work runs and the panel does not show (orders 10 and 20); the forge bundle's red attention dot (order 100) paints above them and stays while the panel shows.
The plugin offers its row as the `conversation.session.panel.row` Component Factory. Sections and Environment rows from every package render their rows with `renderFactorySlot('conversation.session.panel.row', props)`, so icon, text, and trailing areas line up across sections. A row has a 16px decorative icon that inherits the row ink, single-line content that clips with an ellipsis, and an optional trailing value or control. `menu` holds row actions, such as a More button, after the trailing area in a 16px column whose center sits 14px from the row's end; a plain `button` there gets a 24px target and a tertiary glyph that darkens on hover without a fill, so it needs no tooltip of its own. They show on row hover, on focus inside the row, and while one has its menu open, and always without hover. `onActivate` makes the whole row one button while the trailing area and the menu stay separate controls, and `actionLabel` names that button when its content does not describe the action, starting with the visible text; a row with an action or row actions fills as a whole on hover and while one of its menus is open. `detail` adds a second line in smaller tertiary type that clips with an ellipsis, such as the consequence of a status or a command to run; the icon stays beside the first line and the trailing area and menu center on the row. `className` adds to the row's class, and `attributes`, such as `role`, `data-*` markers, and context-menu trigger props, reach the row element; other props are ignored.
Rows share one look without sharing a component. A section's component, or an Environment row entry, writes its row's markup and marks the parts, and the panel's stylesheet lays them out, so icon, text, and trailing areas line up across packages while each package owns what its row contains.
| Mark | Part |
|---|---|
| `data-session-panel-row` | The row: one 28px line. A row with an action or a menu highlights as a whole on hover and while one of its menus is open. |
| `data-row-part="body"` | The icon and the text. A `<button>` body is the row's action, and its press area covers the whole row; the trailing part and the menu stay separate controls above it. Give the button an `aria-label` that starts with its visible text when that text does not describe the action. |
| `data-row-part="icon"` | A 16px decorative glyph inside the body, in the row ink; mark it `aria-hidden`. |
| `data-row-part="content"` | One line of text inside the body, clipped with an ellipsis. |
| `data-row-part="lines"` | Inside the body of a two-line row, the wrapper of the content and the detail. |
| `data-row-part="detail"` | A second line under the content, in smaller tertiary type clipped with an ellipsis, such as the consequence of a status or a command to run. The row grows to two lines: the icon stays beside the first, and the trailing part and the menu center on the row. |
| `data-row-part="trailing"` | A value or control after the body. |
| `data-row-part="menu"` | Row actions, such as a More button, in a 16px column whose center sits 14px from the row's end. A plain `button` there gets a 24px target and a tertiary glyph that darkens on hover without a fill, so it needs no tooltip of its own. They show on row hover, on focus inside the row, and while one has its menu open, and always without hover. |
Leave out a part the row does not have: a `<button>` body or a menu part is what makes the row highlight. A menu part that renders nothing, such as a shared menu button whose target has no menu entries, counts as absent: it takes no room and the row does not highlight for it. Each rule for a part has the specificity of one class, so a row's own class adjusts it.
-----
@@ -60,13 +73,13 @@ The panel projects the section list's live registrations (`entriesOfSlot`, so a
| File | Role |
|---|---|
| [`src/client/index.ts`](src/client/index.ts) | Dictionaries, the row Factory, the toggle, the panel, the Environment section, and the project row |
| [`src/client/index.ts`](src/client/index.ts) | Dictionaries, the toggle, the panel, the Environment section, and the project row |
| [`src/client/slots.ts`](src/client/slots.ts) | Slot declarations and component props |
| [`src/client/visibility.ts`](src/client/visibility.ts) | Presentation, the shared visibility state, the dock probes, and each Session's room to dock |
| [`src/client/sections.ts`](src/client/sections.ts) | Section roster projection |
| [`src/client/SessionPanel.tsx`](src/client/SessionPanel.tsx) | The panel, its dock probe, its section titles, and Escape handling |
| [`src/client/SessionPanelToggle.tsx`](src/client/SessionPanelToggle.tsx) | The header toggle and its indicators |
| [`src/client/PanelRow.tsx`](src/client/PanelRow.tsx) | The panel row behind the `conversation.session.panel.row` Factory |
| [`src/client/SessionPanel.module.css`](src/client/SessionPanel.module.css) | The panel's geometry, the dock probe, and the rules for marked rows |
| [`src/client/ProjectRow.tsx`](src/client/ProjectRow.tsx) | The working folder row |
</details>
+16 -3
View File
@@ -44,7 +44,20 @@ kind: "package-reference"
面板隐藏时也要可见的标记(例如提示需要处理的圆点)放进 `conversation.session.panel.indicator` 列表。每个占位是一个元素:开关把它定为图标角上的 6px 圆点,占位负责设置 `background`,并带有说明自身的文字,这些文字会成为开关无障碍名称的一部分。占位会重叠,`order` 高的画在低的上方。owner 属性 `panelShown` 让只是重复面板内容的标记在面板显示时不渲染。「子智能体」与「后台任务」在任务运行且面板未显示时显示蓝点(order 10 和 20);forge 套件的红色提醒点(order 100)画在它们上方,面板显示时也保留。
插件把面板的行作为 Component Factory `conversation.session.panel.row` 提供。各包的分栏与环境行都用 `renderFactorySlot('conversation.session.panel.row', props)` 渲染自己的行,使不同分栏的图标、文字与尾部区域对齐。每行有一个沿用行文字颜色的 16px 装饰图标、单行内容(溢出时以省略号截断),以及可选的尾部数值或控件。`menu` 放在尾部区域之后的行操作(例如「更多」按钮),位于 16px 宽的一列,中心距行末端 14px;其中的普通 `button` 有 24px 点击区和三级文字色图标,悬停时图标变深、没有底色,因此不需要自己的 tooltip。鼠标悬停在行上、焦点在行内或其菜单打开时显示,没有悬停能力的设备上始终显示。传入 `onActivate` 时整行成为一个按钮,尾部区域与 `menu` 仍是各自独立的控件,内容不足以说明操作时用 `actionLabel` 为该按钮命名,并以可见文字开头;带操作或行操作的行在悬停时以及菜单打开期间整行填充。`detail` 在内容下方加一行更小的浅灰文字,溢出时以省略号截断,例如某个状态的后果或要运行的命令;图标留在第一行旁边,尾部区域和菜单在整行中垂直居中。`className` 追加到行的类名上,`attributes`(例如 `role`、`data-*` 标记与右键菜单触发属性)落在行元素上,其余属性被忽略。
各行共享同一外观,但不共享组件。分栏的组件或「环境」分栏的行条目自己写行的标记并标出各个部分,由面板的样式表统一排版,因此不同包的图标、文字与尾部区域对齐,而行里放什么由各包自己决定。
| 标记 | 部分 |
|---|---|
| `data-session-panel-row` | 行:占 28px 一行。带操作或菜单的行在悬停时以及其菜单打开期间整行高亮。 |
| `data-row-part="body"` | 图标与文字。用 `<button>` 作为 body 时,它就是这一行的操作,点击区域覆盖整行;尾部区域与菜单仍是位于其上的独立控件。可见文字不足以说明操作时,给按钮一个以可见文字开头的 `aria-label`。 |
| `data-row-part="icon"` | body 内的 16px 装饰图标,沿用行文字颜色;需标记 `aria-hidden`。 |
| `data-row-part="content"` | body 内的单行文字,溢出时以省略号截断。 |
| `data-row-part="lines"` | 两行的行里,body 内包住 content 与 detail 的容器。 |
| `data-row-part="detail"` | content 下方的第二行,使用较小的三级文字并以省略号截断,例如某个状态的后果或要运行的命令。行变为两行:图标留在第一行旁,尾部区域与菜单在整行上居中。 |
| `data-row-part="trailing"` | body 之后的数值或控件。 |
| `data-row-part="menu"` | 行操作(例如「更多」按钮),位于 16px 宽的一列,中心距行末端 14px。其中的普通 `button` 有 24px 点击区和三级文字色图标,悬停时图标变深、没有底色,因此不需要自己的 tooltip。鼠标悬停在行上、焦点在行内或其菜单打开时显示,没有悬停能力的设备上始终显示。 |
行没有的部分就不要写:有 `<button>` body 或菜单部分的行才会高亮。没有渲染任何内容的菜单部分(例如目标没有菜单项时的共享菜单按钮)视同不存在:不占位置,行也不会因它高亮。每条针对某个部分的规则只有一个类的优先级,因此行自己的类可以调整它。
-----
@@ -60,13 +73,13 @@ kind: "package-reference"
| 文件 | 作用 |
|---|---|
| [`src/client/index.ts`](src/client/index.ts) | 字典、行 Factory、开关、面板、「环境」分栏与项目行 |
| [`src/client/index.ts`](src/client/index.ts) | 字典、开关、面板、「环境」分栏与项目行 |
| [`src/client/slots.ts`](src/client/slots.ts) | Slot 声明与组件 props |
| [`src/client/visibility.ts`](src/client/visibility.ts) | 呈现方式、共享可见性状态、停靠探针与每个会话的停靠空间 |
| [`src/client/sections.ts`](src/client/sections.ts) | 分栏名单投影 |
| [`src/client/SessionPanel.tsx`](src/client/SessionPanel.tsx) | 面板、停靠探针、分栏标题与 Esc 处理 |
| [`src/client/SessionPanelToggle.tsx`](src/client/SessionPanelToggle.tsx) | 标题栏开关及其角标 |
| [`src/client/PanelRow.tsx`](src/client/PanelRow.tsx) | `conversation.session.panel.row` Factory 渲染的面板行 |
| [`src/client/SessionPanel.module.css`](src/client/SessionPanel.module.css) | 面板的几何、停靠探针,以及带标记的行的样式规则 |
| [`src/client/ProjectRow.tsx`](src/client/ProjectRow.tsx) | 工作目录行 |
</details>
@@ -55,7 +55,6 @@
"@deepseek-ai/dsh-working-directory": "workspace:*",
"@deepseek-ai/dsh-workspace": "workspace:*",
"@testing-library/react": "^16.3.3",
"clsx": "^2.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
@@ -1,184 +0,0 @@
/* One Session panel fact: [16px icon] gap 8 [content 13/28] [trailing] [menu].
The icon inherits the row ink so a fact and its glyph share one foreground.
A row with an action or row actions highlights as a whole; the action's
button covers the row, and the trailing area and menu sit above it. The
icon's center sits 14px from the row's start and the menu's 14px from its
end, the columns other panel rows align to. */
.row {
position: relative;
display: flex;
align-items: center;
gap: 8px;
box-sizing: border-box;
min-width: 0;
min-height: 28px;
padding: 0 6px;
border-radius: var(--dsw-radius-sm);
color: var(--dsw-alias-label-primary);
font: var(--dsw-font-xs-13);
}
.body {
display: flex;
flex: 1 1 auto;
align-items: center;
gap: 8px;
min-width: 0;
height: 28px;
}
.action {
margin: 0;
padding: 0;
border: 0;
color: inherit;
background: transparent;
font: inherit;
text-align: start;
cursor: pointer;
}
.action::after {
position: absolute;
inset: 0;
border-radius: inherit;
content: '';
}
.action:focus-visible {
outline: none;
}
.row:has(> .action:focus-visible) {
outline: var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary));
outline-offset: -2px;
}
.icon {
display: inline-flex;
flex: none;
align-items: center;
justify-content: center;
width: 16px;
height: 16px;
}
.icon svg {
width: 16px;
height: 16px;
}
.content {
flex: 1 1 auto;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.trailing,
.menu {
position: relative;
z-index: 1;
display: inline-flex;
flex: none;
align-items: center;
gap: 4px;
}
.trailing {
color: var(--dsw-alias-label-tertiary);
}
/* A detail line under the content: the row grows by its 17px line and 4px insets, and the icon keeps the first
line's 20px box, so its center stays level with that line. */
.tall .body {
align-items: flex-start;
height: auto;
padding: 4px 0;
}
.tall .icon {
height: 20px;
}
.lines {
display: flex;
flex: 1 1 auto;
flex-direction: column;
min-width: 0;
}
.detail {
min-width: 0;
overflow: hidden;
color: var(--dsw-alias-label-tertiary);
font-size: 12px;
line-height: 17px;
text-overflow: ellipsis;
white-space: nowrap;
}
/* A 16px column, so the action's 24px target reaches past it without moving the glyph. */
.menu {
justify-content: center;
width: 16px;
}
/* Row actions share the row's highlight: the glyph darkens on hover, without a fill. */
.menu button {
display: inline-flex;
flex: none;
align-items: center;
justify-content: center;
width: 24px;
height: 24px;
margin: -4px;
padding: 0;
border: 0;
border-radius: var(--dsw-radius-xs);
background: transparent;
color: var(--dsw-alias-label-tertiary);
cursor: pointer;
}
.menu button:focus-visible {
outline-offset: -2px;
}
@media (hover: hover) {
.interactive:hover {
background: var(--dsw-alias-interactive-bg-hover);
}
.menu {
opacity: 0;
}
.row:hover .menu,
.row:focus-within .menu {
opacity: 1;
}
.menu button:hover {
color: var(--dsw-alias-label-primary);
}
}
/* An open menu keeps its row highlighted and its trigger visible after the pointer leaves for the menu. */
.interactive:has([aria-expanded='true']) {
background: var(--dsw-alias-interactive-bg-hover);
}
.menu:has([aria-expanded='true']) {
opacity: 1;
}
.menu button[aria-expanded='true'] {
color: var(--dsw-alias-label-primary);
}
.interactive:has(> .action:active) {
background: var(--dsw-alias-interactive-bg-active);
}
@@ -1,84 +0,0 @@
/**
* One icon-led fact row of the Session panel. The plugin offers it as the
* `conversation.session.panel.row` Component Factory, so rows that other
* packages contribute keep one geometry.
*/
import type { HTMLAttributes, ReactNode } from 'react'
import clsx from 'clsx'
import css from './PanelRow.module.css'
/** Attributes of the row element, such as `role`, `data-*` markers, and a context-menu trigger's handlers. */
export type PanelRowAttributes =
Omit<HTMLAttributes<HTMLElement>, 'children' | 'className' | 'onClick'>
& { readonly [marker: `data-${string}`]: string | undefined }
/** Props of one Session panel row. */
export interface PanelRowProps {
/** Leading 16px glyph; decorative, so the row text carries the meaning. */
readonly icon: ReactNode
/** Primary single-line content; overflow clips with an ellipsis. */
readonly children: ReactNode
/** Optional trailing value or control, laid out after the content without shrinking. */
readonly trailing?: ReactNode
/**
* Row actions after the trailing area, such as a More button. They show
* while the pointer is over the row, focus is inside it, or one of them has
* its menu open, and always on devices without hover.
*/
readonly menu?: ReactNode
/** Make the whole row one button with this action; the trailing area and the menu stay separate controls above it. */
readonly onActivate?: (() => void) | undefined
/**
* Accessible name of the `onActivate` button when its visible content does not describe the action; it starts with
* the visible text, so speech input that names what the row shows reaches the button.
*/
readonly actionLabel?: string | undefined
/**
* Second line under the content, in smaller tertiary type that clips with an ellipsis, such as the consequence of a
* status or a command to run; the row grows to two lines with the icon beside the first, and the trailing area and
* the menu centered on the row.
*/
readonly detail?: ReactNode
/** Class of the row element, added to the row's own. */
readonly className?: string | undefined
/** Attributes of the row element; the row keeps its own class and `data-panel-row`. */
readonly attributes?: PanelRowAttributes | undefined
}
/**
* Render one Session panel row: icon, single-line content, an optional
* trailing area, and optional row actions. A row with an action or row
* actions highlights as a whole on hover and while one of its menus is open.
* Props outside {@link PanelRowProps}, such as the ones a Factory occurrence
* adds, are ignored.
* @param props - row content, the optional action and row actions, and attributes for the row element.
* @returns the row element.
*/
export function PanelRow({
icon, children, trailing, menu, onActivate, actionLabel, detail, className, attributes,
}: PanelRowProps): ReactNode {
const body = (
<>
<span className={css.icon} aria-hidden="true">{icon}</span>
{detail === undefined
? <span className={css.content}>{children}</span>
: (
<span className={css.lines}>
<span className={css.content}>{children}</span>
<span className={css.detail}>{detail}</span>
</span>
)}
</>
)
const interactive = onActivate !== undefined || menu !== undefined
return (
<div {...attributes} className={clsx(css.row, interactive && css.interactive, detail !== undefined && css.tall, className)} data-panel-row="">
{onActivate === undefined
? <span className={css.body}>{body}</span>
: <button type="button" className={clsx(css.body, css.action)} aria-label={actionLabel} onClick={onActivate}>{body}</button>}
{trailing !== undefined && <span className={css.trailing}>{trailing}</span>}
{menu !== undefined && <span className={css.menu}>{menu}</span>}
</div>
)
}
@@ -3,7 +3,6 @@ import type { ReactNode } from 'react'
import { IconFolderCloseRegular, Tooltip } from '@deepseek-ai/dsh-client-ui-primitives'
import { abbreviateHomePath, pathPartsOf } from '@deepseek-ai/dsh-util-workspace-path'
import type {} from '@deepseek-ai/dsh-working-directory/types'
import { PanelRow } from './PanelRow.tsx'
import type { ProjectRowProps } from './slots.ts'
import css from './ProjectRow.module.css'
@@ -34,17 +33,19 @@ export function ProjectRow({
const parent = ROOT.test(directory) ? directory : directory.replace(/[/\\]+$/, '')
const target = { kind: 'directory', value: { sessionId, path } } as const
return (
<PanelRow
icon={<IconFolderCloseRegular size={16} />}
menu={renderFactorySlot('contextMenu.button', { target, label: t('project.actions') })}
attributes={{ ...getTriggerProps(target), 'data-session-panel-project': '' }}
>
<Tooltip label={`${t('project.label')}\n${shown}`} side="left" delayMs={500}>
<span className={css.folder} tabIndex={0}>
<span className={css.name}>{name}</span>
{parent !== '' && <span className={css.parent}>{parent}</span>}
<div {...getTriggerProps(target)} data-session-panel-row="" data-session-panel-project="">
<span data-row-part="body">
<span data-row-part="icon" aria-hidden="true"><IconFolderCloseRegular size={16} /></span>
<span data-row-part="content">
<Tooltip label={`${t('project.label')}\n${shown}`} side="left" delayMs={500}>
<span className={css.folder} tabIndex={0}>
<span className={css.name}>{name}</span>
{parent !== '' && <span className={css.parent}>{parent}</span>}
</span>
</Tooltip>
</span>
</Tooltip>
</PanelRow>
</span>
<span data-row-part="menu">{renderFactorySlot('contextMenu.button', { target, label: t('project.actions') })}</span>
</div>
)
}
@@ -137,3 +137,207 @@
animation: none;
}
}
/* Rows. The rows of every section share one look without sharing a
component: each contributor writes its row's markup and marks the parts,
and these rules lay them out.
[data-session-panel-row] the row: one 28px line
[data-row-part='body'] the icon and the text; a <button> body is
the row's action, and its press area
covers the whole row
[data-row-part='icon'] a 16px glyph in the row ink
[data-row-part='content'] one line of text, clipped with an ellipsis
[data-row-part='lines'] in a two-line row, wraps the content and
the detail
[data-row-part='detail'] a second line in smaller tertiary type
[data-row-part='trailing'] a value or control after the text
[data-row-part='menu'] row actions, such as a More button
The icon's center sits 14px from the row's start and the menu's 14px from
its end, the columns the other panel rows align to. A row with an action
or a menu highlights as a whole; the trailing part and the menu sit above
the action's press area. A menu part that renders nothing counts as
absent: it takes no room and does not make the row highlight. A rule for
a part has the specificity of one class, so a row's own class adjusts it. */
.panel :where([data-session-panel-row]) {
position: relative;
display: flex;
align-items: center;
gap: 8px;
box-sizing: border-box;
min-width: 0;
min-height: 28px;
padding: 0 6px;
border-radius: var(--dsw-radius-sm);
color: var(--dsw-alias-label-primary);
font: var(--dsw-font-xs-13);
}
.panel :where([data-session-panel-row] > [data-row-part='body']) {
display: flex;
flex: 1 1 auto;
align-items: center;
gap: 8px;
min-width: 0;
height: 28px;
}
.panel :where([data-session-panel-row] > button[data-row-part='body']) {
margin: 0;
padding: 0;
border: 0;
color: inherit;
background: transparent;
font: inherit;
text-align: start;
cursor: pointer;
}
.panel :where([data-session-panel-row] > button[data-row-part='body'])::after {
position: absolute;
inset: 0;
border-radius: inherit;
content: '';
}
.panel :where([data-session-panel-row] > button[data-row-part='body']:focus-visible) {
outline: none;
}
.panel :where([data-session-panel-row]:has(> button[data-row-part='body']:focus-visible)) {
outline: var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary));
outline-offset: -2px;
}
.panel :where([data-session-panel-row] [data-row-part='icon']) {
display: inline-flex;
flex: none;
align-items: center;
justify-content: center;
width: 16px;
height: 16px;
}
.panel :where([data-session-panel-row] [data-row-part='icon']) svg {
width: 16px;
height: 16px;
}
.panel :where([data-session-panel-row] [data-row-part='content']) {
flex: 1 1 auto;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/* A detail line under the content: the row grows by its 17px line and 4px
insets, and the icon keeps the first line's 20px box, so its center stays
level with that line. */
.panel :where([data-session-panel-row] > [data-row-part='body']:has([data-row-part='detail'])) {
align-items: flex-start;
height: auto;
padding: 4px 0;
}
.panel :where([data-session-panel-row] > [data-row-part='body']:has([data-row-part='detail']) > [data-row-part='icon']) {
height: 20px;
}
.panel :where([data-session-panel-row] [data-row-part='lines']) {
display: flex;
flex: 1 1 auto;
flex-direction: column;
min-width: 0;
}
.panel :where([data-session-panel-row] [data-row-part='detail']) {
min-width: 0;
overflow: hidden;
color: var(--dsw-alias-label-tertiary);
font-size: 12px;
line-height: 17px;
text-overflow: ellipsis;
white-space: nowrap;
}
.panel :where([data-session-panel-row] > [data-row-part='trailing'], [data-session-panel-row] > [data-row-part='menu']) {
position: relative;
z-index: 1;
display: inline-flex;
flex: none;
align-items: center;
gap: 4px;
}
.panel :where([data-session-panel-row] > [data-row-part='trailing']) {
color: var(--dsw-alias-label-tertiary);
}
/* A 16px column, so the action's 24px target reaches past it without moving the glyph. */
.panel :where([data-session-panel-row] > [data-row-part='menu']) {
justify-content: center;
width: 16px;
}
/* A shared menu button renders nothing while its target has no menu entries. */
.panel :where([data-session-panel-row] > [data-row-part='menu']:empty) {
display: none;
}
/* Row actions share the row's highlight: the glyph darkens on hover, without a fill. */
.panel :where([data-session-panel-row] > [data-row-part='menu']) button {
display: inline-flex;
flex: none;
align-items: center;
justify-content: center;
width: 24px;
height: 24px;
margin: -4px;
padding: 0;
border: 0;
border-radius: var(--dsw-radius-xs);
background: transparent;
color: var(--dsw-alias-label-tertiary);
cursor: pointer;
}
.panel :where([data-session-panel-row] > [data-row-part='menu']) button:focus-visible {
outline-offset: -2px;
}
@media (hover: hover) {
.panel :where([data-session-panel-row]:has(> button[data-row-part='body'], > [data-row-part='menu']:not(:empty)):hover) {
background: var(--dsw-alias-interactive-bg-hover);
}
.panel :where([data-session-panel-row] > [data-row-part='menu']) {
opacity: 0;
}
.panel :where([data-session-panel-row]:hover > [data-row-part='menu'], [data-session-panel-row]:focus-within > [data-row-part='menu']) {
opacity: 1;
}
.panel :where([data-session-panel-row] > [data-row-part='menu']) button:hover {
color: var(--dsw-alias-label-primary);
}
}
/* An open menu keeps its row highlighted and its trigger visible after the pointer leaves for the menu. */
.panel :where([data-session-panel-row]:has(> button[data-row-part='body'], > [data-row-part='menu']:not(:empty)):has([aria-expanded='true'])) {
background: var(--dsw-alias-interactive-bg-hover);
}
.panel :where([data-session-panel-row] > [data-row-part='menu']:has([aria-expanded='true'])) {
opacity: 1;
}
.panel :where([data-session-panel-row] > [data-row-part='menu']) button[aria-expanded='true'] {
color: var(--dsw-alias-label-primary);
}
.panel :where([data-session-panel-row]:has(> button[data-row-part='body']:active)) {
background: var(--dsw-alias-interactive-bg-active);
}
@@ -1,9 +1,8 @@
/**
* Session panel plugin, browser half: a Session header toggle and a floating
* panel in the Chat View's aside. The panel draws the titles of the sections
* other plugins register, offers the row Component Factory those sections
* render their rows with, and ships the Environment section with the working
* folder row.
* other plugins register, lays out the rows they mark, and ships the
* Environment section with the working folder row.
*/
import type { Context as ClientContext } from '@deepseek-ai/cordis'
import type { ObservableSnapshot } from '@deepseek-ai/dsh-client-store'
@@ -14,7 +13,6 @@ import type {} from '@deepseek-ai/dsh-client-connection/client'
import type {} from '@deepseek-ai/dsh-client-locale/client'
import type {} from '@deepseek-ai/dsh-client-ui-renderer/client'
import { EnvironmentSection } from './EnvironmentSection.tsx'
import { PanelRow } from './PanelRow.tsx'
import { ProjectRow } from './ProjectRow.tsx'
import { SessionPanel } from './SessionPanel.tsx'
import { SessionPanelToggle } from './SessionPanelToggle.tsx'
@@ -30,7 +28,6 @@ declare module '@deepseek-ai/dsh-client-ui-slots' {
}
}
export type { PanelRowAttributes, PanelRowProps } from './PanelRow.tsx'
export type {
EnvironmentSectionProps, ProjectRowInjected, ProjectRowProps, SessionPanelDockable, SessionPanelIndicatorOwnerProps, SessionPanelInjected,
SessionPanelPresentation, SessionPanelProbes, SessionPanelProps, SessionPanelSectionEntry, SessionPanelSectionOwnerProps,
@@ -41,8 +38,8 @@ export type {
export const inject = ['slots', 'locale', 'remote']
/**
* Client plugin body: register the dictionaries, the row Component Factory,
* the header toggle, the panel, and the Environment section with its project row.
* Client plugin body: register the dictionaries, the header toggle, the panel,
* and the Environment section with its project row.
* @param ctx - client root context.
*/
export function apply(ctx: ClientContext): void {
@@ -56,8 +53,6 @@ export function apply(ctx: ClientContext): void {
subscribe: listener => ctx.on('connection/reset', listener),
}
ctx.slots.registerFactory({ name: 'conversation.session.panel.row', scope: 'root' }, PanelRow)
ctx.slots.inject('conversation.session.header.utilities', () => ctx.slots.register({
name: 'conversation.session.header.utilities',
id: 'session-panel',
@@ -10,21 +10,8 @@ import type {} from '@deepseek-ai/dsh-client-ui-chat/client'
import type {} from '@deepseek-ai/dsh-client-ui-context-menu/client'
import type {} from '@deepseek-ai/dsh-client-ui-session/client'
import type { NS } from './locales.ts'
import type { PanelRowProps } from './PanelRow.tsx'
declare module '@deepseek-ai/dsh-client-ui-slots' {
interface SlotFactoryMap {
/**
* One icon-led fact row of the Session panel, for the rows that sections
* and Environment row entries render: a 16px decorative icon, single-line
* content that clips with an ellipsis, an optional trailing area, row
* actions that show on hover and focus, and an optional whole-row action.
* Rows from every package render through it, so they share one geometry
* and the columns the panel aligns to.
*/
'conversation.session.panel.row': { scope: 'root'; props: PanelRowProps }
}
interface SlotMap {
/**
* Sections of the Session panel. `id` addresses the section, `order` sorts
@@ -57,9 +57,8 @@ describe('ui-session-panel browser half', () => {
expect(inject).toEqual(['slots', 'locale', 'remote'])
})
it('registers the row Factory, the toggle first among the header utilities, the panel in the Chat aside, the Environment section, and the project row', async () => {
it('registers the toggle first among the header utilities, the panel in the Chat aside, the Environment section, and the project row', async () => {
const { ctx } = await bench()
expect(ctx.slots.snapshot('factory:conversation.session.panel.row')).toHaveLength(1)
const toggle = ctx.slots.entries('conversation.session.header.utilities').find(entry => entry.options.id === 'session-panel')
expect(toggle?.options.order).toBe(-10)
expect(ctx.slots.entries('conversation.chat.aside')).toHaveLength(1)
@@ -129,7 +128,6 @@ describe('ui-session-panel browser half', () => {
it('removes every contribution with the fiber (HMR safety)', async () => {
const { ctx, fiber } = await bench()
await fiber.dispose()
expect(ctx.slots.snapshot('factory:conversation.session.panel.row')).toHaveLength(0)
expect(ctx.slots.entries('conversation.session.header.utilities')).toHaveLength(0)
expect(ctx.slots.entries('conversation.chat.aside')).toHaveLength(0)
expect(ctx.slots.entries('conversation.session.panel.section')).toHaveLength(0)
@@ -429,6 +429,19 @@ describe('ProjectRow', () => {
expect(screen.getByRole('button', { name: '工作目录操作' })).toBeTruthy()
})
it('marks its parts for the panel\'s row rules: icon and folder in the body, then the More button as the row menu', () => {
const view = render(<ProjectRow {...rowProps({ cwd: '/srv/app' }).props} />)
const row = view.container.querySelector('[data-session-panel-row]') as HTMLElement
expect(row.hasAttribute('data-session-panel-project')).toBe(true)
expect([...row.children].map(part => part.getAttribute('data-row-part'))).toEqual(['body', 'menu'])
const [body, menu] = [...row.children] as [HTMLElement, HTMLElement]
expect(body.tagName).toBe('SPAN')
expect([...body.children].map(part => part.getAttribute('data-row-part'))).toEqual(['icon', 'content'])
expect(body.children[0]?.getAttribute('aria-hidden')).toBe('true')
expect(body.children[1]?.textContent).toBe('app/srv')
expect(menu.querySelector('button')?.textContent).toBe('工作目录操作')
})
it('falls back to the directory the Session was created in and opens the directory menu on right-click', () => {
const { props, open } = rowProps({ cwd: '/srv/app', workspacePath: '/srv' })
const view = render(<ProjectRow {...props} />)
@@ -1,36 +0,0 @@
/**
* PanelRow's two-line geometry as CSS text: the component suite sees CSS
* Modules as class-name maps, so only the stylesheet proves that a detail line
* grows the row while the icon stays level with the first line.
*/
import { readFileSync } from 'node:fs'
import { fileURLToPath } from 'node:url'
import { describe, expect, it } from 'vitest'
const css = readFileSync(fileURLToPath(new URL('../src/client/PanelRow.module.css', import.meta.url)), 'utf8')
function declarations(selector: string): Map<string, string> {
const found = new Map<string, string>()
for (const [, selectorList = '', body = ''] of css.replace(/\/\*[\s\S]*?\*\//g, ' ').matchAll(/([^{}]+)\{([^{}]*)\}/g)) {
if (!selectorList.split(',').map(value => value.trim()).includes(selector)) continue
for (const part of body.split(';')) {
const colon = part.indexOf(':')
if (colon !== -1) found.set(part.slice(0, colon).trim(), part.slice(colon + 1).trim().replace(/\s+/g, ' '))
}
}
return found
}
describe('PanelRow.module.css', () => {
it('grows a row with a detail line and keeps the icon in the first line', () => {
const body = declarations('.tall .body')
expect([body.get('height'), body.get('align-items'), body.get('padding')]).toEqual(['auto', 'flex-start', '4px 0'])
expect(declarations('.tall .icon').get('height')).toBe('20px')
})
it('sets the detail line in clipped tertiary 12px type', () => {
const detail = declarations('.detail')
expect([detail.get('color'), detail.get('font-size'), detail.get('line-height'), detail.get('text-overflow'), detail.get('white-space')])
.toEqual(['var(--dsw-alias-label-tertiary)', '12px', '17px', 'ellipsis', 'nowrap'])
})
})
@@ -1,85 +0,0 @@
// @vitest-environment jsdom
/** The Session panel row the `conversation.session.panel.row` Factory renders. */
import { cleanup, fireEvent, render, screen } from '@testing-library/react'
import { afterEach, describe, expect, it, vi } from 'vitest'
import { PanelRow } from '../src/client/PanelRow.tsx'
afterEach(cleanup)
describe('PanelRow', () => {
it('renders a static fact with a decorative icon and no button', () => {
const view = render(<PanelRow icon={<svg data-testid="glyph" />}>deepseek-harness</PanelRow>)
expect(screen.getByText('deepseek-harness')).toBeTruthy()
expect(screen.queryByRole('button')).toBeNull()
expect(screen.getByTestId('glyph').parentElement?.getAttribute('aria-hidden')).toBe('true')
expect(view.container.querySelector('[data-panel-row]')?.children).toHaveLength(1)
})
it('makes the icon and content one button while the trailing control stays outside it', () => {
const onActivate = vi.fn()
const onTrailing = vi.fn()
render(
<PanelRow icon={<svg />} onActivate={onActivate} trailing={<button type="button" onClick={onTrailing}>More</button>}>
Local changes
</PanelRow>,
)
fireEvent.click(screen.getByRole('button', { name: 'Local changes' }))
expect(onActivate).toHaveBeenCalledTimes(1)
fireEvent.click(screen.getByRole('button', { name: 'More' }))
expect(onTrailing).toHaveBeenCalledTimes(1)
expect(onActivate).toHaveBeenCalledTimes(1)
})
it('names the button with the action label', () => {
const onActivate = vi.fn()
render(<PanelRow icon={<svg />} onActivate={onActivate} actionLabel="View the changes: 2 files">Local changes</PanelRow>)
fireEvent.click(screen.getByRole('button', { name: 'View the changes: 2 files' }))
expect(onActivate).toHaveBeenCalledTimes(1)
})
it('places row actions after the trailing area and marks only rows with an action or row actions as interactive', () => {
const view = render(
<PanelRow icon={<svg />} trailing={<span>value</span>} menu={<button type="button">More</button>}>Project</PanelRow>,
)
const row = view.container.querySelector('[data-panel-row]') as HTMLElement
expect([...row.children].map(child => child.textContent)).toEqual(['Project', 'value', 'More'])
const interactive = row.className
cleanup()
const plain = render(<PanelRow icon={<svg />} trailing={<span>value</span>}>Project</PanelRow>)
const staticRow = plain.container.querySelector('[data-panel-row]') as HTMLElement
expect(staticRow.children).toHaveLength(2)
expect(staticRow.className).not.toBe(interactive)
})
it('puts a detail line under the content and keeps the trailing area beside both lines', () => {
const view = render(
<PanelRow icon={<svg />} detail={<span>gh auth login</span>} trailing={<button type="button">Copy</button>}>Sign in</PanelRow>,
)
const row = view.container.querySelector('[data-panel-row]') as HTMLElement
const lines = screen.getByText('Sign in').parentElement as HTMLElement
expect([...lines.children].map(line => line.textContent)).toEqual(['Sign in', 'gh auth login'])
expect([...row.children].map(child => child.textContent)).toEqual(['Sign ingh auth login', 'Copy'])
const plain = render(<PanelRow icon={<svg />}>Sign in</PanelRow>).container.querySelector('[data-panel-row]') as HTMLElement
expect(row.className).not.toBe(plain.className)
})
it('puts its attributes, such as context-menu handlers and markers, and its class on the row element', () => {
const onContextMenu = vi.fn()
const view = render(
<PanelRow icon={<svg />} className="placed" attributes={{ onContextMenu, tabIndex: 0, 'data-marker': 'on' }}>Row</PanelRow>,
)
const row = view.container.querySelector('[data-panel-row]') as HTMLElement
expect(row.className).toContain('placed')
expect(row.tabIndex).toBe(0)
expect(row.getAttribute('data-marker')).toBe('on')
fireEvent.contextMenu(row)
expect(onContextMenu).toHaveBeenCalledTimes(1)
})
it('leaves props outside its own, such as a Factory occurrence adds, off the row element', () => {
const extra = { renderFactorySlot: vi.fn(), useFactorySlot: vi.fn(), useWorkspaces: vi.fn() }
const view = render(<PanelRow {...{ icon: <svg />, children: 'Row', ...extra }} />)
const row = view.container.querySelector('[data-panel-row]') as HTMLElement
expect(row.getAttributeNames().sort()).toEqual(['class', 'data-panel-row'])
})
})
@@ -1,8 +1,9 @@
/**
* The Session panel's docking geometry as CSS text. jsdom has no layout, so
* the component suite cannot show that the dock probe is 1px wide exactly
* from the gutter that holds the docked panel; this reads the declarations
* and evaluates them for gutters around that boundary.
* The Session panel's stylesheet as CSS text. jsdom has no layout, so the
* component suite cannot show that the dock probe is 1px wide exactly from
* the gutter that holds the docked panel, or that marked rows get one
* geometry; this reads the declarations and evaluates the docking ones for
* gutters around that boundary.
*/
import { readFileSync } from 'node:fs'
import { fileURLToPath } from 'node:url'
@@ -70,3 +71,64 @@ describe('SessionPanel.module.css docking geometry', () => {
expect(declarationsOf(".panel[data-session-panel='overlay']")['width']).toBe('min(280px, calc(100% - 2 * var(--panel-edge)))')
})
})
describe('SessionPanel.module.css row rules', () => {
/** A rule for marked row markup: `.panel :where(<row selector>)<tail>`. */
const row = (inner: string, tail = ''): Record<string, string> => declarationsOf(`.panel :where(${inner})${tail}`)
it('lays a marked row out as one 28px line with the icon and the menu on fixed columns', () => {
expect(row('[data-session-panel-row]')).toMatchObject({
'display': 'flex', 'align-items': 'center', 'gap': '8px', 'min-height': '28px', 'padding': '0 6px',
})
expect(row("[data-session-panel-row] > [data-row-part='body']")).toMatchObject({ flex: '1 1 auto', height: '28px', gap: '8px' })
// 6px of padding and half of the 16px box put the icon's center 14px from the row's start, and the menu's from its end.
expect(row("[data-session-panel-row] [data-row-part='icon']")).toMatchObject({ width: '16px', height: '16px', flex: 'none' })
expect(row("[data-session-panel-row] > [data-row-part='menu']")).toMatchObject({ 'width': '16px', 'justify-content': 'center' })
expect(row("[data-session-panel-row] [data-row-part='content']")).toMatchObject({
'overflow': 'hidden', 'text-overflow': 'ellipsis', 'white-space': 'nowrap',
})
})
it('grows a row with a detail line and keeps the icon level with the first line', () => {
const tall = "[data-session-panel-row] > [data-row-part='body']:has([data-row-part='detail'])"
expect(row(tall)).toEqual({ 'align-items': 'flex-start', 'height': 'auto', 'padding': '4px 0' })
expect(row(`${tall} > [data-row-part='icon']`)).toEqual({ height: '20px' })
expect(row("[data-session-panel-row] [data-row-part='lines']")).toMatchObject({ 'display': 'flex', 'flex-direction': 'column', 'min-width': '0' })
expect(row("[data-session-panel-row] [data-row-part='detail']")).toMatchObject({
'color': 'var(--dsw-alias-label-tertiary)', 'font-size': '12px', 'line-height': '17px', 'text-overflow': 'ellipsis', 'white-space': 'nowrap',
})
// The two-line rules follow the one-line ones they adjust, since every rule for a part has the same specificity.
const order = (selector: string): number => {
const at = css.indexOf(`.panel :where(${selector}) {`)
expect(at).toBeGreaterThan(-1)
return at
}
expect(order(tall)).toBeGreaterThan(order("[data-session-panel-row] > button[data-row-part='body']"))
expect(order(`${tall} > [data-row-part='icon']`)).toBeGreaterThan(order("[data-session-panel-row] [data-row-part='icon']"))
})
it('makes a button body the action of the whole row and rings the row when it has keyboard focus', () => {
expect(row("[data-session-panel-row] > button[data-row-part='body']", '::after')).toMatchObject({ position: 'absolute', inset: '0' })
expect(row("[data-session-panel-row] > [data-row-part='trailing'], [data-session-panel-row] > [data-row-part='menu']"))
.toMatchObject({ 'position': 'relative', 'z-index': '1' })
expect(row("[data-session-panel-row]:has(> button[data-row-part='body']:focus-visible)")['outline-offset']).toBe('-2px')
})
it('gives a plain button in the menu a 24px target and a tertiary glyph without a fill', () => {
expect(row("[data-session-panel-row] > [data-row-part='menu']", ' button')).toMatchObject({
width: '24px', height: '24px', margin: '-4px', background: 'transparent', color: 'var(--dsw-alias-label-tertiary)',
})
})
it('highlights only a row with an action or a menu that renders something, and keeps an open menu and its row shown', () => {
const interactive = "[data-session-panel-row]:has(> button[data-row-part='body'], > [data-row-part='menu']:not(:empty))"
expect(row("[data-session-panel-row] > [data-row-part='menu']:empty")).toEqual({ display: 'none' })
expect(row(`${interactive}:has([aria-expanded='true'])`)['background']).toBe('var(--dsw-alias-interactive-bg-hover)')
expect(row("[data-session-panel-row] > [data-row-part='menu']:has([aria-expanded='true'])")['opacity']).toBe('1')
// Hover rules stay inside the hover media query, where the menu hides until the row is hovered or focused.
const hover = /@media \(hover: hover\) \{([\s\S]*?)\n\}/.exec(css)?.[1] ?? ''
expect(hover).toContain(`.panel :where(${interactive}:hover)`)
expect(hover).toMatch(/\[data-row-part='menu'\]\) \{\s*opacity: 0;/)
expect(css.replace(/@media \(hover: hover\) \{[\s\S]*?\n\}/g, '')).not.toContain(':hover')
})
})
@@ -5,7 +5,7 @@ import {
Button, IconWarningTriangleOutlineRegular, MarqueeText, useHoverMarquee,
} from '@deepseek-ai/dsh-client-ui-primitives'
import type {
HostObservable, InjectFace, PropsLocale, PropsRenderFactories, PropsRenderSlots, PropsRuntime, PropsStore,
HostObservable, InjectFace, PropsLocale, PropsRenderSlots, PropsRuntime, PropsStore,
} from '@deepseek-ai/dsh-client-ui-slots'
import type { ForgeReadiness, MergeRequest } from '@deepseek-ai/dsh-experimental-forge/types'
import type {} from '@deepseek-ai/dsh-client-ui-session-panel/client'
@@ -59,7 +59,6 @@ export interface ChangeRequestsSectionInjected {
export type ChangeRequestsSectionProps =
PropsRuntime<'conversation.session.panel.section'>
& Pick<PropsRenderSlots<'forge.change-request.card.actions'>, 'renderSlot'>
& PropsRenderFactories
& InjectFace<ChangeRequestsSectionInjected>
& PropsStore<ReturnType<typeof createChangeRequestsSectionStore>>
& PropsLocale<typeof NS>
@@ -97,11 +96,11 @@ function signInNeedOf(state: ForgePanelState): SignInNeed | null {
* sign-in check. A reason the host gave shows from the info button; a clipped
* title or command crawls into view while the pointer rests on the row.
*/
function SignInRow({ need, copyText, renderFactorySlot, t }: {
function SignInRow({ need, copyText, t }: {
readonly need: SignInNeed
readonly copyText: (text: string) => void
readonly t: Translate
} & PropsRenderFactories): ReactNode {
}): ReactNode {
const titleRef = useRef<HTMLSpanElement>(null)
const commandRef = useRef<HTMLSpanElement>(null)
const titleMarquee = useHoverMarquee(titleRef)
@@ -109,21 +108,37 @@ function SignInRow({ need, copyText, renderFactorySlot, t }: {
const { host, forge, readiness } = need
const unavailable = readiness.state === 'unavailable'
const command = !unavailable && forge === 'github' ? `gh auth login --hostname ${host}` : undefined
const reason = command === undefined && readiness.message !== null && readiness.message !== ''
? <ReasonButton reason={readiness.message} label={t('reason.show')} />
: undefined
const marquee = command === undefined ? titleMarquee : commandMarquee
return renderFactorySlot('conversation.session.panel.row', {
icon: <IconWarningTriangleOutlineRegular size={16} />,
attributes: { role: 'status', 'data-forge-signin': readiness.state, onPointerEnter: marquee.enter, onPointerLeave: marquee.leave },
detail: command === undefined ? undefined : <MarqueeText ref={commandRef} className={css.signinCommand}>{command}</MarqueeText>,
trailing: command === undefined ? reason : (
let trailing: ReactNode
if (command !== undefined) {
trailing = (
<Button size="sm" variant="outline" aria-label={t('signin.copy')} onClick={() => { copyText(command) }}>
{t('signin.copyShort')}
</Button>
),
children: <MarqueeText ref={titleRef} className={css.statusTitle}>{t(unavailable ? 'signin.unavailable' : 'signin.title', { host })}</MarqueeText>,
})
)
}
else if (readiness.message !== null && readiness.message !== '') {
trailing = <ReasonButton reason={readiness.message} label={t('reason.show')} />
}
const title = (
<span data-row-part="content">
<MarqueeText ref={titleRef} className={css.statusTitle}>{t(unavailable ? 'signin.unavailable' : 'signin.title', { host })}</MarqueeText>
</span>
)
return (
<div role="status" data-session-panel-row="" data-forge-signin={readiness.state} onPointerEnter={marquee.enter} onPointerLeave={marquee.leave}>
<span data-row-part="body">
<span data-row-part="icon" aria-hidden="true"><IconWarningTriangleOutlineRegular size={16} /></span>
{command === undefined ? title : (
<span data-row-part="lines">
{title}
<span data-row-part="detail"><MarqueeText ref={commandRef} className={css.signinCommand}>{command}</MarqueeText></span>
</span>
)}
</span>
{trailing !== undefined && <span data-row-part="trailing">{trailing}</span>}
</div>
)
}
/**
@@ -139,8 +154,7 @@ function SignInRow({ need, copyText, renderFactorySlot, t }: {
*/
export function ChangeRequestsSection({
usePanel, useLocale, dismissOverlay, refresh, remove, markReady, merge, readChecks,
rerunChecks, requestReviews, reviewerCandidates, updateBranch, openLink, copyText, viewChanges, useStore, actions: store, renderSlot,
renderFactorySlot, t,
rerunChecks, requestReviews, reviewerCandidates, updateBranch, openLink, copyText, viewChanges, useStore, actions: store, renderSlot, t,
}: ChangeRequestsSectionProps): ReactNode {
const snapshot = usePanel(current => current)
const locale = useLocale(value => value)
@@ -164,7 +178,7 @@ export function ChangeRequestsSection({
const now = Date.now()
return (
<div className={css.cards} data-forge-panel="">
{signIn !== null && <SignInRow need={signIn} copyText={copyText} renderFactorySlot={renderFactorySlot} t={t} />}
{signIn !== null && <SignInRow need={signIn} copyText={copyText} t={t} />}
{state.changeRequests.length > 0 && (
<ul className={css.list}>
{state.changeRequests.map(entry => (
@@ -52,7 +52,6 @@ export interface LocalChangesRowInjected {
/** Full props of the local changes row. */
export type LocalChangesRowProps =
PropsRuntime<'conversation.session.panel.environment.row'>
& PropsRenderFactories
& InjectFace<LocalChangesRowInjected>
& PropsLocale<typeof NS>
@@ -91,32 +90,40 @@ export function CheckoutRow({
const label = checkoutLabel(state, home, t)
if (label === undefined) {
if (state.checkout.state !== 'failed') return null
return renderFactorySlot('conversation.session.panel.row', {
className: css.envRow,
icon: <IconWarningTriangleOutlineRegular size={16} />,
attributes: { 'data-forge-checkout': '', 'data-failed': '' },
trailing: <ReasonButton reason={state.checkout.message} label={t('reason.show')} />,
children: <span className={css.envName}>{t('checkout.failed')}</span>,
})
return (
<div className={css.envRow} data-session-panel-row="" data-forge-checkout="" data-failed="">
<span data-row-part="body">
<span data-row-part="icon" aria-hidden="true"><IconWarningTriangleOutlineRegular size={16} /></span>
<span data-row-part="content"><span className={css.envName}>{t('checkout.failed')}</span></span>
</span>
<span data-row-part="trailing"><ReasonButton reason={state.checkout.message} label={t('reason.show')} /></span>
</div>
)
}
const target = { kind: 'directory', value: { sessionId, path: label.path } } as const
const icon = label.missing
? <IconWarningTriangleOutlineRegular size={16} />
: <IconBranchOutlineRegular size={16} />
const name = [label.detached ? t('checkout.detached') : undefined, label.name ?? undefined]
.filter(part => part !== undefined).join(' · ')
return renderFactorySlot('conversation.session.panel.row', {
className: css.envRow,
icon,
attributes: {
...getTriggerProps(target),
'data-forge-checkout': '',
'data-missing': label.missing ? '' : undefined,
onPointerEnter: marquee.enter,
onPointerLeave: marquee.leave,
},
trailing: (
<>
return (
<div
{...getTriggerProps(target)}
className={css.envRow}
data-session-panel-row=""
data-forge-checkout=""
data-missing={label.missing ? '' : undefined}
onPointerEnter={marquee.enter}
onPointerLeave={marquee.leave}
>
<span data-row-part="body">
<span data-row-part="icon" aria-hidden="true">
{label.missing ? <IconWarningTriangleOutlineRegular size={16} /> : <IconBranchOutlineRegular size={16} />}
</span>
<span data-row-part="content">
<Tooltip label={label.tooltip} side="left" delayMs={500}>
<MarqueeText ref={nameRef} className={css.envName} tabIndex={0}>{name}</MarqueeText>
</Tooltip>
</span>
</span>
<span data-row-part="trailing">
<span className={css.envNote}>{label.kind}</span>
{label.missing && (
<Button
@@ -129,18 +136,17 @@ export function CheckoutRow({
{t('checkout.restore')}
</Button>
)}
</>
),
menu: label.missing ? undefined : renderFactorySlot('contextMenu.button', {
target,
label: t(label.worktree ? 'checkout.worktreeActions' : 'checkout.projectActions'),
}),
children: (
<Tooltip label={label.tooltip} side="left" delayMs={500}>
<MarqueeText ref={nameRef} className={css.envName} tabIndex={0}>{name}</MarqueeText>
</Tooltip>
),
})
</span>
{!label.missing && (
<span data-row-part="menu">
{renderFactorySlot('contextMenu.button', {
target,
label: t(label.worktree ? 'checkout.worktreeActions' : 'checkout.projectActions'),
})}
</span>
)}
</div>
)
}
/** Business face of the connection row. */
@@ -154,7 +160,6 @@ export interface ConnectionRowInjected {
/** Full props of the connection row. */
export type ConnectionRowProps =
PropsRuntime<'conversation.session.panel.environment.row'>
& PropsRenderFactories
& InjectFace<ConnectionRowInjected>
& PropsLocale<typeof NS>
@@ -165,17 +170,21 @@ export type ConnectionRowProps =
* @param props - panel snapshot hook, reconnect action, and copy.
* @returns the row, or null while the stream is open.
*/
export function ConnectionRow({ usePanel, reconnect, renderFactorySlot, t }: ConnectionRowProps): ReactNode {
export function ConnectionRow({ usePanel, reconnect, t }: ConnectionRowProps): ReactNode {
const disconnected = usePanel(snapshot => snapshot.disconnected)
if (!disconnected) return null
return renderFactorySlot('conversation.session.panel.row', {
className: css.envRow,
icon: <IconWarningTriangleOutlineRegular size={16} />,
attributes: { role: 'status', 'data-forge-connection': '' },
detail: t('connection.detail'),
trailing: <Button size="sm" variant="outline" onClick={reconnect}>{t('retry')}</Button>,
children: <span className={css.statusTitle}>{t('connection.title')}</span>,
})
return (
<div className={css.envRow} role="status" data-session-panel-row="" data-forge-connection="">
<span data-row-part="body">
<span data-row-part="icon" aria-hidden="true"><IconWarningTriangleOutlineRegular size={16} /></span>
<span data-row-part="lines">
<span data-row-part="content"><span className={css.statusTitle}>{t('connection.title')}</span></span>
<span data-row-part="detail">{t('connection.detail')}</span>
</span>
</span>
<span data-row-part="trailing"><Button size="sm" variant="outline" onClick={reconnect}>{t('retry')}</Button></span>
</div>
)
}
/**
@@ -187,7 +196,7 @@ export function ConnectionRow({ usePanel, reconnect, renderFactorySlot, t }: Con
* @returns the row, or null while the branch changes no files.
*/
export function LocalChangesRow({
usePanel, dismissOverlay, viewLocalChanges, createChangeRequest, renderFactorySlot, t,
usePanel, dismissOverlay, viewLocalChanges, createChangeRequest, t,
}: LocalChangesRowProps): ReactNode {
const local = usePanel(snapshot => snapshot.state?.local ?? null)
const creatable = usePanel(snapshot => snapshot.state !== null && snapshot.state.repository !== null
@@ -205,46 +214,51 @@ export function LocalChangesRow({
viewLocalChanges()
dismissOverlay()
}
return renderFactorySlot('conversation.session.panel.row', {
className: css.envRow,
icon: <IconFilesDiffOutlineRegular size={16} />,
onActivate: view,
actionLabel: t('changes.local.viewAria', { count, added: additions, deleted: deletions }),
attributes: { 'data-forge-local': '' },
trailing: (
<span className={css.diff}>
<span className={css.added}>{`+${String(additions)}`}</span>
<span className={css.deleted}>{`−${String(deletions)}`}</span>
return (
<div className={css.envRow} data-session-panel-row="" data-forge-local="">
<button
type="button"
data-row-part="body"
aria-label={t('changes.local.viewAria', { count, added: additions, deleted: deletions })}
onClick={view}
>
<span data-row-part="icon" aria-hidden="true"><IconFilesDiffOutlineRegular size={16} /></span>
<span data-row-part="content">{t('changes.local.summary', { count })}</span>
</button>
<span data-row-part="trailing">
<span className={css.diff}>
<span className={css.added}>{`+${String(additions)}`}</span>
<span className={css.deleted}>{`−${String(deletions)}`}</span>
</span>
</span>
),
menu: (
<Menu
open={open}
onClose={() => { setOpen(false) }}
portal
align="end"
anchor={(
<button
type="button"
aria-label={t('changes.local.actions')}
aria-haspopup="menu"
aria-expanded={open}
onClick={() => { setOpen(!open) }}
>
<IconEllipsisOutlineRegular />
</button>
)}
items={[
{ id: 'view', label: t('change.viewChanges') },
...creatable ? [{ id: 'create', label: t('changes.local.create') }] : [],
]}
onSelect={(id) => {
setOpen(false)
if (id === 'create') createChangeRequest()
else view()
}}
/>
),
children: t('changes.local.summary', { count }),
})
<span data-row-part="menu">
<Menu
open={open}
onClose={() => { setOpen(false) }}
portal
align="end"
anchor={(
<button
type="button"
aria-label={t('changes.local.actions')}
aria-haspopup="menu"
aria-expanded={open}
onClick={() => { setOpen(!open) }}
>
<IconEllipsisOutlineRegular />
</button>
)}
items={[
{ id: 'view', label: t('change.viewChanges') },
...creatable ? [{ id: 'create', label: t('changes.local.create') }] : [],
]}
onSelect={(id) => {
setOpen(false)
if (id === 'create') createChangeRequest()
else view()
}}
/>
</span>
</div>
)
}
@@ -463,7 +463,7 @@
font-variant-numeric: tabular-nums;
}
/* Environment rows: the kind or size trails the name; PanelRow reveals the More button. */
/* Environment rows: the kind or size trails the name; the Session panel's row rules reveal the More button. */
.envName {
display: block;
overflow: hidden;
@@ -24,7 +24,6 @@ import type { PanelSnapshot } from '../src/client/source.ts'
import type { ForgePanelChangeRequest, ForgePanelState } from '../src/types.ts'
import { createChangeRequestsSectionStore } from '../src/client/change-requests-store.ts'
import { created, entry, ready, removed, snapshot, worktree } from './client-fixtures.client.ts'
import { renderPanelRows } from './panel-row-factory.client.tsx'
afterEach(cleanup)
@@ -35,6 +34,24 @@ function panelStore(state: ForgePanelState | null, disconnected = false) {
return createSnapshotStore<PanelSnapshot>({ state, disconnected })
}
/**
* The parts a row marks for the Session panel's row rules, nested as in its
* markup, with `button:` before a part that is a button.
* @param row - the row element.
* @returns the parts, or null when the element is not marked as a panel row.
*/
function rowParts(row: Element): string | null {
const partsOf = (element: Element): string => [...element.children]
.filter(child => child.hasAttribute('data-row-part'))
.map((child) => {
const name = `${child.tagName === 'BUTTON' ? 'button:' : ''}${child.getAttribute('data-row-part') ?? ''}`
const inner = partsOf(child)
return inner === '' ? name : `${name}(${inner})`
})
.join(' ')
return row.hasAttribute('data-session-panel-row') ? partsOf(row) : null
}
/** One Session's section store, as the registration mints it. */
type SectionStore = ReturnType<ReturnType<typeof createChangeRequestsSectionStore>['create']>
@@ -53,7 +70,6 @@ function section(state: ForgePanelState | null, options: { disconnected?: boolea
dismissOverlay: vi.fn<() => void>(),
// Plugins' card actions: a marker naming the change request it was drawn for.
renderSlot: vi.fn((_name: string, owner: { url: string }) => <span data-plugin-action={owner.url} />),
renderFactorySlot: renderPanelRows(),
}
const props = {
sessionId: SESSION,
@@ -66,7 +82,7 @@ function section(state: ForgePanelState | null, options: { disconnected?: boolea
t,
} as Pick<ChangeRequestsSectionProps,
'sessionId' | 'presentation' | 'usePanel' | 'useLocale' | 'useStore' | 'actions' | 'dismissOverlay' | 'refresh'
| 'remove' | 'markReady' | 'merge' | 'readChecks' | 'openLink' | 'copyText' | 'viewChanges' | 'renderSlot' | 'renderFactorySlot'
| 'remove' | 'markReady' | 'merge' | 'readChecks' | 'openLink' | 'copyText' | 'viewChanges' | 'renderSlot'
| 't'> as ChangeRequestsSectionProps
const view = render(<ChangeRequestsSection {...props} />)
return { view, panel, store, ...handlers }
@@ -202,6 +218,9 @@ describe('ChangeRequestsSection', () => {
const row = b.view.getByRole('status')
expect(root.firstElementChild).toBe(row)
expect(row.getAttribute('data-forge-signin')).toBe('unauthenticated')
// The command is the row's detail line, and Copy its trailing control.
expect(rowParts(row)).toBe('body(icon lines(content detail)) trailing')
expect(row.querySelector('[data-row-part="detail"]')?.textContent).toBe('gh auth login --hostname github.com')
expect(within(row).getByText('Sign in to github.com')).toBeTruthy()
expect(within(row).getByText('gh auth login --hostname github.com')).toBeTruthy()
const copy = within(row).getByRole('button', { name: en['signin.copy'] })
@@ -227,6 +246,7 @@ describe('ChangeRequestsSection', () => {
}))
const row = b.view.getByRole('status')
expect([row.textContent, row.querySelector('code, [data-forge-signin] button:not([data-forge-reason])')]).toEqual([title, null])
expect(rowParts(row)).toBe('body(icon content) trailing')
const reason = within(row).getByRole('button', { name: en['reason.show'] })
fireEvent.click(reason)
expect(screen.getByRole('tooltip').textContent).toBe('token expired')
@@ -242,6 +262,7 @@ describe('ChangeRequestsSection', () => {
readiness: { state, message: null },
}))
expect(within(b.view.getByRole('status')).queryByRole('button')).toBeNull()
expect(rowParts(b.view.getByRole('status'))).toBe('body(icon content)')
})
it.each([
@@ -285,7 +306,7 @@ describe('CheckoutRow', () => {
const restore = vi.fn<() => void>()
const refreshIfStale = vi.fn<() => void>()
const opened: ContextMenuTarget[] = []
const renderFactorySlot = renderPanelRows((_name, input: { label: string }) => <button type="button">{input.label}</button>)
const renderFactorySlot = vi.fn((_name: string, input: { label: string }) => <button type="button">{input.label}</button>)
const props = {
sessionId: SESSION,
usePanel: bindSnapshotSelector(panel),
@@ -337,6 +358,7 @@ describe('CheckoutRow', () => {
const b = row(ready({ checkout: { state: 'failed', message: 'sandbox runner unavailable' } }))
const element = b.element() as HTMLElement
expect(element.hasAttribute('data-failed')).toBe(true)
expect(rowParts(element)).toBe('body(icon content) trailing')
expect(element.textContent).toBe(en['checkout.failed'])
expect(within(element).getByText(en['checkout.failed']).hasAttribute('tabindex')).toBe(false)
const reason = within(element).getByRole('button', { name: en['reason.show'] })
@@ -361,6 +383,11 @@ describe('CheckoutRow', () => {
const b = row(ready(), '/work')
const element = b.element() as HTMLElement
expect(element.textContent).toBe(`main${en['checkout.project']}${en['checkout.projectActions']}`)
// The kind trails the branch name, and the More button is the row menu.
expect(rowParts(element)).toBe('body(icon content) trailing menu')
expect(element.querySelector('[data-row-part="icon"]')?.getAttribute('aria-hidden')).toBe('true')
expect(element.querySelector('[data-row-part="trailing"]')?.textContent).toBe(en['checkout.project'])
expect(element.querySelector('[data-row-part="menu"]')?.textContent).toBe(en['checkout.projectActions'])
vi.useFakeTimers()
fireEvent.pointerEnter(within(element).getByText('main'))
act(() => { vi.advanceTimersByTime(499) })
@@ -419,6 +446,8 @@ describe('CheckoutRow', () => {
const b = row(removed())
const element = b.element() as HTMLElement
expect(element.hasAttribute('data-missing')).toBe(true)
// A removed worktree has no directory to act on, so the row has no menu part.
expect(rowParts(element)).toBe('body(icon content) trailing')
expect(within(element).getByText('dsh/0a1b2c3d')).toBeTruthy()
expect(within(element).getByText(en['missing.title'])).toBeTruthy()
expect(b.renderFactorySlot).not.toHaveBeenCalledWith('contextMenu.button', expect.anything())
@@ -438,8 +467,8 @@ describe('ConnectionRow', () => {
function row(state: ForgePanelState | null, disconnected: boolean) {
const panel = panelStore(state, disconnected)
const reconnect = vi.fn<() => void>()
const props = { sessionId: SESSION, usePanel: bindSnapshotSelector(panel), reconnect, renderFactorySlot: renderPanelRows(), t } as
Pick<ConnectionRowProps, 'sessionId' | 'usePanel' | 'reconnect' | 'renderFactorySlot' | 't'> as ConnectionRowProps
const props = { sessionId: SESSION, usePanel: bindSnapshotSelector(panel), reconnect, t } as
Pick<ConnectionRowProps, 'sessionId' | 'usePanel' | 'reconnect' | 't'> as ConnectionRowProps
return { view: render(<ConnectionRow {...props} />), panel, reconnect }
}
@@ -454,6 +483,8 @@ describe('ConnectionRow', () => {
const b = row(state, true)
const status = b.view.getByRole('status')
expect(status.hasAttribute('data-forge-connection')).toBe(true)
expect(rowParts(status)).toBe('body(icon lines(content detail)) trailing')
expect(status.querySelector('[data-row-part="detail"]')?.textContent).toBe(en['connection.detail'])
expect(within(status).getByText(en['connection.title'])).toBeTruthy()
expect(within(status).getByText(en['connection.detail'])).toBeTruthy()
fireEvent.click(within(status).getByRole('button', { name: en.retry }))
@@ -475,10 +506,9 @@ describe('LocalChangesRow', () => {
const createChangeRequest = vi.fn<() => void>()
const dismissOverlay = vi.fn<() => void>()
const props = {
sessionId: SESSION, usePanel: bindSnapshotSelector(panel), dismissOverlay, viewLocalChanges, createChangeRequest,
renderFactorySlot: renderPanelRows(), t,
sessionId: SESSION, usePanel: bindSnapshotSelector(panel), dismissOverlay, viewLocalChanges, createChangeRequest, t,
} as Pick<LocalChangesRowProps,
'sessionId' | 'usePanel' | 'dismissOverlay' | 'viewLocalChanges' | 'createChangeRequest' | 'renderFactorySlot' | 't'> as LocalChangesRowProps
'sessionId' | 'usePanel' | 'dismissOverlay' | 'viewLocalChanges' | 'createChangeRequest' | 't'> as LocalChangesRowProps
const view = render(<LocalChangesRow {...props} />)
return { view, viewLocalChanges, createChangeRequest, dismissOverlay }
}
@@ -499,6 +529,8 @@ describe('LocalChangesRow', () => {
it('sums the branch changes, opens them, and asks the Agent for a change request', () => {
const b = row(ready({ local }))
const element = b.view.container.querySelector('[data-forge-local]') as HTMLElement
// The body is the row's button; the diff size and the menu stay separate parts after it.
expect(rowParts(element)).toBe('button:body(icon content) trailing menu')
expect(within(element).getByText('Local changes · 2 files')).toBeTruthy()
expect(within(element).getByText('+5')).toBeTruthy()
fireEvent.click(within(element).getByRole('button', { name: 'Local changes · 2 files, 5 lines added, 1 lines deleted' }))
@@ -1,44 +0,0 @@
/**
* The Session panel's `conversation.session.panel.row` Factory as these
* suites render it: the row's parts in the row's order, its attributes on the
* row element, and its action as a button. ui-session-panel's own suite owns
* the row's geometry and interaction states.
*/
import type { ReactNode } from 'react'
import { vi } from 'vitest'
import type { PanelRowProps } from '@deepseek-ai/dsh-client-ui-session-panel/client'
/**
* Render one row the way the Factory lays it out.
* @param props - the row's Factory input.
* @returns the row element.
*/
function PanelRowDouble({
icon, children, trailing, menu, onActivate, actionLabel, detail, className, attributes,
}: PanelRowProps): ReactNode {
const body = (
<>
<span aria-hidden="true">{icon}</span>
<span>{children}</span>
{detail !== undefined && <span>{detail}</span>}
</>
)
return (
<div {...attributes} className={className} data-panel-row="">
{onActivate === undefined ? <span>{body}</span> : <button type="button" aria-label={actionLabel} onClick={onActivate}>{body}</button>}
{trailing}
{menu}
</div>
)
}
/**
* A recording `renderFactorySlot` that renders panel rows and hands every other Factory to `other`.
* @param other - renders the other Factories the component under test uses.
* @returns the mock.
*/
export function renderPanelRows(other: (name: string, input: never) => ReactNode = () => null) {
return vi.fn((name: string, input: object): ReactNode => name === 'conversation.session.panel.row'
? <PanelRowDouble {...input as PanelRowProps} />
: other(name, input as never))
}
@@ -2409,7 +2409,7 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [
],
replaceRisk: 'none',
example: 'return {\n inject: [\'slots\'],\n apply(ctx) {\n ctx.slots.inject(\'conversation.session.panel.environment.row\', () => ctx.slots.register(\n { name: \'conversation.session.panel.environment.row\', id: \'my-entry\', order: 100, label: \'My entry\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}',
source: 'packages/client/ui-session-panel/src/client/slots.ts:57',
source: 'packages/client/ui-session-panel/src/client/slots.ts:44',
},
{
key: 'conversation.session.panel.indicator',
@@ -2473,7 +2473,7 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [
],
replaceRisk: 'none',
example: 'return {\n inject: [\'slots\'],\n apply(ctx) {\n ctx.slots.inject(\'conversation.session.panel.indicator\', () => ctx.slots.register(\n { name: \'conversation.session.panel.indicator\', id: \'my-entry\', order: 100, label: \'My entry\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}',
source: 'packages/client/ui-session-panel/src/client/slots.ts:50',
source: 'packages/client/ui-session-panel/src/client/slots.ts:37',
},
{
key: 'conversation.session.panel.section',
@@ -2541,7 +2541,7 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [
],
replaceRisk: 'none',
example: 'return {\n inject: [\'slots\'],\n apply(ctx) {\n ctx.slots.inject(\'conversation.session.panel.section\', () => ctx.slots.register(\n { name: \'conversation.session.panel.section\', id: \'my-entry\', order: 100, label: \'My entry\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}',
source: 'packages/client/ui-session-panel/src/client/slots.ts:35',
source: 'packages/client/ui-session-panel/src/client/slots.ts:22',
},
{
key: 'conversation.session.panel.section.actions',
@@ -2591,7 +2591,7 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [
],
replaceRisk: 'shadows-shipped-ui',
example: 'return {\n inject: [\'slots\'],\n apply(ctx) {\n ctx.slots.inject(\'conversation.session.panel.section.actions\', () => ctx.slots.register(\n { name: \'conversation.session.panel.section.actions\', key: \'<one key the owner dispatches>\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}',
source: 'packages/client/ui-session-panel/src/client/slots.ts:41',
source: 'packages/client/ui-session-panel/src/client/slots.ts:28',
},
{
key: 'conversation.trajectory.images',
-3
View File
@@ -5830,9 +5830,6 @@ importers:
'@testing-library/react':
specifier: ^16.3.3
version: 16.3.3(@testing-library/[email protected])(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])
clsx:
specifier: ^2.0.0
version: 2.1.1
react:
specifier: ^18.2.0
version: 18.3.1
+1 -1
View File
@@ -11,7 +11,7 @@
"snapshots/session/headless.snapshot.ts",
"apps/web/tests/home-whale.e2e.ts",
"apps/web/tests/sidebar-drawer.e2e.ts",
"apps/web/tests/session-panel-dock.e2e.ts",
"apps/web/tests/session-panel-layout.e2e.ts",
"apps/web/tests/creation-recommendations.e2e.ts",
"apps/web/tests/plugin-recommendations.e2e.ts",
"apps/web/tests/japanese-plugin-metadata.e2e.ts",