From 6af99291a8a15dcf5d891fd33d1d3d4cbc1e0004 Mon Sep 17 00:00:00 2001 From: LegGasai Date: Fri, 13 Nov 2026 11:17:14 +0800 Subject: [PATCH 1/2] refactor(session-panel): size the panel in CSS and render only when the dock decision changes The aside layer now publishes its end gutter through an observable source instead of React state, so neither resizes nor transcript updates re-render it. The panel's docked width comes from --dsh-chat-content-width in CSS, and the panel and its toggle subscribe only to whether the gutter holds the docked panel; a mounted panel registers its source with the shared state instead of pushing measured gutters from an effect. --- packages/client/ui-chat/README.i18n.yaml | 4 +- packages/client/ui-chat/README.md | 2 +- packages/client/ui-chat/README.zh.md | 2 +- .../ui-chat/src/client/chat/ChatAside.tsx | 23 +++-- .../ui-chat/src/client/contract/slots.ts | 12 ++- .../ui-chat/tests/chat-view.client.spec.tsx | 27 +++--- .../client/ui-session-panel/README.i18n.yaml | 8 +- packages/client/ui-session-panel/README.md | 6 +- packages/client/ui-session-panel/README.zh.md | 6 +- .../src/client/SessionPanel.module.css | 13 +-- .../src/client/SessionPanel.tsx | 33 +++---- .../src/client/SessionPanelToggle.tsx | 13 ++- .../ui-session-panel/src/client/index.ts | 6 +- .../ui-session-panel/src/client/slots.ts | 21 ++-- .../ui-session-panel/src/client/visibility.ts | 87 ++++++++++------- .../tests/browser-plugin.client.spec.ts | 10 +- .../tests/components.client.spec.tsx | 73 +++++++++----- .../tests/visibility.client.spec.ts | 96 ++++++++++--------- .../src/client/slot-catalog.ts | 34 +++---- 19 files changed, 264 insertions(+), 212 deletions(-) diff --git a/packages/client/ui-chat/README.i18n.yaml b/packages/client/ui-chat/README.i18n.yaml index 2dc317ad69..f9b09eb73f 100644 --- a/packages/client/ui-chat/README.i18n.yaml +++ b/packages/client/ui-chat/README.i18n.yaml @@ -39,8 +39,8 @@ en: f6d8bbae13a1a8f8 zh: 96c8f400c215e33d /deepseek-ai-dsh-client-ui-chat/scroll-ownership: - en: 983f27806146e9ea - zh: bb60333c7a6736ed + en: 26d32be41a7bb8af + zh: 3a5f8a10ec8a271f /deepseek-ai-dsh-client-ui-chat/model-experience: en: c17b4dd43a61c569 zh: f7414309810c3a08 diff --git a/packages/client/ui-chat/README.md b/packages/client/ui-chat/README.md index e4b1ec62d5..fb0bf43efd 100644 --- a/packages/client/ui-chat/README.md +++ b/packages/client/ui-chat/README.md @@ -160,7 +160,7 @@ Chat restores semantic anchors across history prepend and renderer remounts, wit The turn rail and back-to-bottom button sit outside the clipped transcript. They use the shared conversation scrollport for sticky positioning, or the Chat frame for absolute positioning when Chat owns its scrollport. The rail sits at the scrollport's start edge, which leaves the end gutter to the [Session panel](../ui-session-panel/README.md), and its previews open toward the transcript. The rail hides when the transcript's available width, excluding its horizontal padding, is at most 900px; the browser viewport width is not the criterion. -The `conversation.chat.aside` slot holds one Session-level occupant beside the transcript, such as the [Session panel](../ui-session-panel/README.md). Every Chat View occurrence, main or embedded, renders it in a zero-height layer at the top of the Chat frame, positioned like the turn rail, so it stays in place while the transcript scrolls and inherits `--dsh-composer-height` and `--dsh-conversation-viewport-height` from the shared scrollport. The layer stacks above the turn rail and the back-to-bottom button and passes pointer events through. Its owner prop `endGutter` is half the width the frame leaves around the transcript column, in whole CSS px, computed from the widths a `ResizeObserver` reports for the layer and the column. It follows window and sidebar resizes and dragged column widths without reading element geometry, stays zero without `ResizeObserver`, and re-renders the layer only when it changes. +The `conversation.chat.aside` slot holds one Session-level occupant beside the transcript, such as the [Session panel](../ui-session-panel/README.md). Every Chat View occurrence, main or embedded, renders it in a zero-height layer at the top of the Chat frame, positioned like the turn rail, so it stays in place while the transcript scrolls and inherits `--dsh-composer-height` and `--dsh-conversation-viewport-height` from the shared scrollport. The layer stacks above the turn rail and the back-to-bottom button and passes pointer events through. Its owner prop `endGutter` is an observable source of half the width the frame leaves around the transcript column, in whole CSS px, computed from the widths a `ResizeObserver` reports for the layer and the column. It follows window and sidebar resizes and dragged column widths without reading element geometry and stays zero without `ResizeObserver`. The source keeps its identity, so the layer renders once and a resize re-renders only an occupant whose derived value changes; an occupant sizes itself in CSS, where the same gutter is `(100% - var(--dsh-chat-content-width)) / 2` of the layer. The transcript root uses `overflow-x: visible; overflow-y: clip`: vertical overflow is clipped without creating a scroll container. Sticky Markdown code banners and expanded compaction headers therefore retain the actual conversation scrollport as their reference when no nearer scrolling ancestor exists. Capped process groups and terminal sections keep their own scrollports. diff --git a/packages/client/ui-chat/README.zh.md b/packages/client/ui-chat/README.zh.md index d470865a92..dab40b7fbc 100644 --- a/packages/client/ui-chat/README.zh.md +++ b/packages/client/ui-chat/README.zh.md @@ -160,7 +160,7 @@ Chat 会在历史前插与 renderer 重新挂载时恢复语义锚点,并且 轮次轨道与回到底部按钮位于正文裁剪层外。它们相对共享会话滚动容器做 sticky 定位;Chat 自己持有滚动容器时,则相对 Chat 外框做 absolute 定位。轮次轨道贴在滚动容器的起始边,把末端留白让给[会话面板](../ui-session-panel/README.zh.md),预览朝正文方向弹出。正文扣除水平内边距后的可用宽度不超过 900px 时,隐藏轮次轨道;判断依据不是浏览器视口宽度。 -`conversation.chat.aside` slot 放一个位于正文旁边、面向整个会话的组件,例如[会话面板](../ui-session-panel/README.zh.md)。每个 Chat 视图实例(主正文区或嵌入的)都会渲染它:它位于 Chat 外框顶部的零高度图层中,定位方式与轮次轨道相同,因此不随正文滚动,并从共享滚动容器继承 `--dsh-composer-height` 与 `--dsh-conversation-viewport-height`。该图层叠在轮次轨道与回到底部按钮之上,自身不拦截指针事件。owner 属性 `endGutter` 是外框在正文列两侧留出宽度的一半(整数 CSS px),由 `ResizeObserver` 报告的图层与正文列宽度算出。它跟随窗口、侧栏尺寸变化和拖动后的正文宽度,不读取元素几何;没有 `ResizeObserver` 时保持为 0;只有它变化时图层才重新渲染。 +`conversation.chat.aside` slot 放一个位于正文旁边、面向整个会话的组件,例如[会话面板](../ui-session-panel/README.zh.md)。每个 Chat 视图实例(主正文区或嵌入的)都会渲染它:它位于 Chat 外框顶部的零高度图层中,定位方式与轮次轨道相同,因此不随正文滚动,并从共享滚动容器继承 `--dsh-composer-height` 与 `--dsh-conversation-viewport-height`。该图层叠在轮次轨道与回到底部按钮之上,自身不拦截指针事件。owner 属性 `endGutter` 是一个可订阅的数据源,值为外框在正文列两侧留出宽度的一半(整数 CSS px),由 `ResizeObserver` 报告的图层与正文列宽度算出。它跟随窗口、侧栏尺寸变化和拖动后的正文宽度,不读取元素几何;没有 `ResizeObserver` 时保持为 0。数据源的引用不变,因此图层只渲染一次,尺寸变化只让由它推导出的值发生变化的占位组件重新渲染;占位组件用 CSS 决定自身尺寸,同一留白在图层中为 `(100% - var(--dsh-chat-content-width)) / 2`。 正文根节点使用 `overflow-x: visible; overflow-y: clip`:裁剪纵向溢出,但不创建滚动容器。因此,在没有更近的滚动祖先时,Markdown 代码块的 sticky 头栏和展开的压缩摘要头栏仍以实际会话滚动容器为参照。限高过程组和终端区域保留各自的滚动容器。 diff --git a/packages/client/ui-chat/src/client/chat/ChatAside.tsx b/packages/client/ui-chat/src/client/chat/ChatAside.tsx index fd04a76b3f..99f4ecf6e3 100644 --- a/packages/client/ui-chat/src/client/chat/ChatAside.tsx +++ b/packages/client/ui-chat/src/client/chat/ChatAside.tsx @@ -1,5 +1,6 @@ -/** The Chat View's aside layer: one Session-level occupant beside the transcript, given the end gutter it keeps within. */ +/** The Chat View's aside layer: one Session-level occupant beside the transcript, given the end gutter as an observable source. */ import { memo, useLayoutEffect, useMemo, useRef, useState, type RefObject } from 'react' +import { createSnapshotStore, type ObservableSnapshot } from '@deepseek-ai/dsh-client-store' import type { PropsRenderSlots } from '@deepseek-ai/dsh-client-ui-slots' import type { ChatAsideOwnerProps } from '../contract/slots.ts' import css from './ChatView.module.css' @@ -9,12 +10,16 @@ import css from './ChatView.module.css' * layer, which spans the Chat frame, and for the transcript column, which * covers window and sidebar resizes and a dragged column width. The column * is centered in the frame, so the gutter is half their difference; no - * element geometry is read. Without ResizeObserver the gutter stays zero. + * element geometry is read. Each change is published to the returned source, + * so the layer itself never re-renders for a resize. Without ResizeObserver + * the gutter stays zero. * @param layer - the aside layer, a child of the Chat frame that precedes the transcript column. - * @returns the gutter in whole CSS px, zero until both widths are known. + * @returns the gutter in whole CSS px, zero until both widths are known; one source for the layer's lifetime. */ -function useEndGutter(layer: RefObject): number { - const [gutter, setGutter] = useState(0) +function useEndGutter(layer: RefObject): ObservableSnapshot { + const [gutter] = useState(() => createSnapshotStore(0)) + // Observing before the first paint lets the first report land before that paint, so an occupant that the gutter + // shows, such as a docked panel, does not miss the frame in which its Chat View mounts. useLayoutEffect(() => { if (typeof ResizeObserver === 'undefined') return // The frame's DOM is in place, though its own refs attach after this child's layout effect. @@ -28,19 +33,19 @@ function useEndGutter(layer: RefObject): number { else columnWidth = entry.contentRect.width } if (layerWidth === undefined || columnWidth === undefined) return - setGutter(Math.max(0, Math.round((layerWidth - columnWidth) / 2))) + gutter.set(Math.max(0, Math.round((layerWidth - columnWidth) / 2))) }) observer.observe(layerElement) observer.observe(column) return () => { observer.disconnect() } - }, [layer]) + }, [layer, gutter]) return gutter } /** * Render the aside layer with its occupant. The Chat View's `renderSlot` is - * stable per registration, so the layer re-renders only when the gutter - * changes, not with every transcript update. + * stable per registration and the gutter source keeps its identity, so the + * layer renders once: neither transcript updates nor resizes re-render it. * @param props - the Chat View's slot renderer. * @returns the zero-height aside layer. */ diff --git a/packages/client/ui-chat/src/client/contract/slots.ts b/packages/client/ui-chat/src/client/contract/slots.ts index 47566f6a34..4430c81374 100644 --- a/packages/client/ui-chat/src/client/contract/slots.ts +++ b/packages/client/ui-chat/src/client/contract/slots.ts @@ -391,10 +391,14 @@ export type ChatFlowSlotProps = export interface ChatAsideOwnerProps { /** * Inline space in CSS px between the transcript column's end edge and the - * Chat frame's end edge, measured again whenever the frame or the column - * resizes; zero before the first measurement. + * Chat frame's end edge, followed whenever the frame or the column resizes; + * zero before the first measurement. The source keeps its identity for the + * layer's lifetime and publishes changes without re-rendering the layer, so + * an occupant subscribes for the decisions it derives from the gutter and + * sizes itself in CSS, where the gutter is + * `(100% - var(--dsh-chat-content-width)) / 2` of the layer. */ - readonly endGutter: number + readonly endGutter: ObservableSnapshot } /** Full Chat view props. */ @@ -448,7 +452,7 @@ declare module '@deepseek-ai/dsh-client-ui-slots' { * scrolls and inherits the shared scrollport's composer and viewport * heights. The layer passes pointer events through; the occupant * positions itself in it, enables its own pointer events, and keeps - * within `endGutter` to stay clear of the transcript column. + * within the end gutter to stay clear of the transcript column. */ 'conversation.chat.aside': { kind: 'single'; scope: 'session'; owner: ChatAsideOwnerProps } diff --git a/packages/client/ui-chat/tests/chat-view.client.spec.tsx b/packages/client/ui-chat/tests/chat-view.client.spec.tsx index 26797e8de5..47a58a9660 100644 --- a/packages/client/ui-chat/tests/chat-view.client.spec.tsx +++ b/packages/client/ui-chat/tests/chat-view.client.spec.tsx @@ -869,7 +869,7 @@ describe('Chat node rendering', () => { }) describe('ChatView', () => { - it('renders the aside with half the width the frame leaves around the transcript column, following resizes', () => { + it('gives the aside a gutter source that follows half the width the frame leaves around the transcript column, rendering the aside once', () => { const observers: { callback: ResizeObserverCallback; targets: Element[] }[] = [] vi.stubGlobal('ResizeObserver', class { readonly targets: Element[] = [] @@ -892,31 +892,34 @@ describe('ChatView', () => { const entries = sizes.map(([target, width]) => ({ target, contentRect: { width } }) as ResizeObserverEntry) act(() => { gutter?.callback(entries, {} as ResizeObserver) }) } + expect(h.asideOwners).toHaveLength(1) + const source = (h.asideOwners[0] as ChatAsideOwnerProps).endGutter + const published: number[] = [] + const off = source.subscribe(() => { published.push(source.getSnapshot()) }) // Nothing is known until both widths arrive. deliver([layer, 1600.4]) - expect(h.asideOwners.at(-1)).toEqual({ endGutter: 0 }) + expect(source.getSnapshot()).toBe(0) deliver([column, 760]) - expect(h.asideOwners.at(-1)).toEqual({ endGutter: 420 }) + expect(source.getSnapshot()).toBe(420) deliver([column, 880]) - expect(h.asideOwners.at(-1)).toEqual({ endGutter: 360 }) - // Height-only growth reports the same widths and keeps the owner identity. - const owner = h.asideOwners.at(-1) + expect(source.getSnapshot()).toBe(360) + // Height-only growth reports the same widths and publishes nothing. deliver([column, 880]) - expect(h.asideOwners.at(-1)).toBe(owner) deliver([layer, 700]) - expect(h.asideOwners.at(-1)).toEqual({ endGutter: 0 }) + expect(source.getSnapshot()).toBe(0) + expect(published).toEqual([420, 360, 0]) + off() expect(rect).not.toHaveBeenCalled() - // Transcript updates do not re-render the aside. - const settled = h.asideOwners.length + // Neither resizes nor transcript updates re-render the aside. act(() => { h.setSession({ running: true }) }) - expect(h.asideOwners).toHaveLength(settled) + expect(h.asideOwners).toHaveLength(1) }) it('keeps the aside gutter at zero without ResizeObserver', () => { vi.stubGlobal('ResizeObserver', undefined) const h = makeHarness({}, {}, chatSnapshotFixture({ nodes: [user(1, 'hello')] })) render() - expect(h.asideOwners.at(-1)).toEqual({ endGutter: 0 }) + expect((h.asideOwners.at(-1) as ChatAsideOwnerProps).endGutter.getSnapshot()).toBe(0) }) it('renders only referenced Nodes without deleting unreferenced Node data', () => { diff --git a/packages/client/ui-session-panel/README.i18n.yaml b/packages/client/ui-session-panel/README.i18n.yaml index 046ccc1665..2029add923 100644 --- a/packages/client/ui-session-panel/README.i18n.yaml +++ b/packages/client/ui-session-panel/README.i18n.yaml @@ -24,11 +24,11 @@ en: a297c196bb631928 zh: 523b71276d8f847e /deepseek-ai-dsh-client-ui-session-panel/understand-the-implementation: - en: f996b40c78ce18ba - zh: d66ed6289f8eed50 + en: a6e70aa8e7e3e7fa + zh: 2633f04bbf1e6711 /deepseek-ai-dsh-client-ui-session-panel/further-exploration: - en: 5fa707ada69696c4 - zh: 595d8b2d7de42181 + en: 413e4e321768d4b2 + zh: 85444059cd1dc565 /deepseek-ai-dsh-client-ui-session-panel/model-experience: en: 7e8bbe318a76fd54 zh: c60e87da2a37642a diff --git a/packages/client/ui-session-panel/README.md b/packages/client/ui-session-panel/README.md index 14e46b9f2a..af48338ced 100644 --- a/packages/client/ui-session-panel/README.md +++ b/packages/client/ui-session-panel/README.md @@ -54,7 +54,7 @@ Summary rows from every package use the `PanelRow` primitive, so icon, text, and
Implementation internals — click to expand -The panel is the `conversation.chat.aside` occupant of [`dsh-client-ui-chat`](../ui-chat/README.md#scroll-ownership), so it renders only in Chat Views. The toggle and the panel are separate Slot entries that share one plugin-owned state: the persisted docking preference, the Session whose overlay is open, and the end gutter each mounted panel reports from its `endGutter` owner prop. A panel withdraws its report when it unmounts or its Chat View moves to another Session. The panel decides its presentation from its own gutter; the toggle reads the widest gutter of its Session, and a Session without one shows no Chat View. Both decide with the same pure function, so the toggle's state never disagrees with the panel. The aside layer inherits the scrollport's composer and viewport heights, and the docked width follows the gutter through `--dsh-session-panel-gutter`. +The panel is the `conversation.chat.aside` occupant of [`dsh-client-ui-chat`](../ui-chat/README.md#scroll-ownership), so it renders only in Chat Views. The toggle and the panel are separate Slot entries that share one plugin-owned state: the persisted docking preference, the Session whose overlay is open, and whether each Session has room to dock. Each mounted panel registers the `endGutter` source of its Chat View with that state, and stops when it unmounts or its Chat View moves to another Session; a Session has room while any of its sources holds the docked panel, and a Session without a source shows no Chat View. The panel decides its presentation from its own source, and both decide with the same pure function, so the toggle's state never disagrees with the panel. The panel and the toggle subscribe only to whether the gutter holds the docked panel, so a resize renders them again only when it crosses the 344px threshold, and opening, closing, or docking the panel renders nothing in the Chat View. The aside layer inherits the scrollport's composer and viewport heights and the transcript width `--dsh-chat-content-width`, from which CSS sizes the docked panel. The panel projects the section list's live registrations (`entriesOfSlot`, so a higher-priority registration with the same `id` replaces a shipped section) into `{ id, label }` rows, recomputed only when the ledger version or the locale revision changes. It renders each section through `renderSlot(..., { only: id })` inside its own title and body; a CSS `:has()` rule hides a section whose body outlet stayed empty, including a shared section whose row outlet stayed empty. @@ -62,7 +62,7 @@ The panel projects the section list's live registrations (`entriesOfSlot`, so a |---|---| | [`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) | Docking threshold, presentation, the shared visibility state, and the reported gutters | +| [`src/client/visibility.ts`](src/client/visibility.ts) | Docking threshold, presentation, the shared visibility state, 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 section titles, and Escape handling | | [`src/client/SessionPanelToggle.tsx`](src/client/SessionPanelToggle.tsx) | The header toggle and its indicators | @@ -76,7 +76,7 @@ The panel projects the section list's live registrations (`entriesOfSlot`, so a ## Further Exploration - [Web Client Slots](../../../docs/subsystems/slots.md) — list, keyed, and owner-prop semantics the sections rely on. -- [`dsh-client-ui-chat`](../ui-chat/README.md#scroll-ownership) — the `conversation.chat.aside` layer and its end gutter. +- [`dsh-client-ui-chat`](../ui-chat/README.md#scroll-ownership) — the `conversation.chat.aside` layer and its end gutter source. - [`dsh-client-ui-conversation`](../ui-conversation/README.md) — the Session header utilities. - [`dsh-client-ui-primitives`](../ui-primitives/README.md#component-catalog) — `PanelRow` and `PathLabel`. diff --git a/packages/client/ui-session-panel/README.zh.md b/packages/client/ui-session-panel/README.zh.md index 0940e82797..5a6f62edc0 100644 --- a/packages/client/ui-session-panel/README.zh.md +++ b/packages/client/ui-session-panel/README.zh.md @@ -54,7 +54,7 @@ kind: "package-reference"
实现内幕——点击展开 -面板是 [`dsh-client-ui-chat`](../ui-chat/README.zh.md#scroll-ownership) 中 `conversation.chat.aside` 的占位组件,因此只渲染在 Chat 视图中。开关与面板是两个独立的 Slot 条目,共享一份插件持有的状态:持久化的停靠偏好、打开了浮层的会话,以及每个已挂载面板从 owner 属性 `endGutter` 上报的末端留白。面板卸载或其 Chat 视图换到另一个会话时撤回上报。面板根据自己的留白决定呈现方式;开关读取该会话最宽的留白,没有留白的会话表示没有 Chat 视图在显示它。两者用同一个纯函数决定,因此开关状态始终与面板一致。侧边层从滚动容器继承输入框区域与视口高度,停靠宽度通过 `--dsh-session-panel-gutter` 跟随留白。 +面板是 [`dsh-client-ui-chat`](../ui-chat/README.zh.md#scroll-ownership) 中 `conversation.chat.aside` 的占位组件,因此只渲染在 Chat 视图中。开关与面板是两个独立的 Slot 条目,共享一份插件持有的状态:持久化的停靠偏好、打开了浮层的会话,以及每个会话是否有停靠空间。每个已挂载的面板把所在 Chat 视图的 `endGutter` 数据源登记到这份状态里,面板卸载或其 Chat 视图换到另一个会话时取消登记;会话的任一数据源能容纳停靠面板时,该会话就有停靠空间,没有数据源的会话表示没有 Chat 视图在显示它。面板根据自己的数据源决定呈现方式,两者用同一个纯函数决定,因此开关状态始终与面板一致。面板与开关只订阅留白能否容纳停靠面板,因此尺寸变化只在跨过 344px 阈值时才让它们重新渲染;打开、关闭或停靠面板也不会让 Chat 视图重新渲染。侧边层从滚动容器继承输入框区域与视口高度,以及正文宽度 `--dsh-chat-content-width`,停靠宽度由 CSS 据此算出。 面板把分栏列表的实时注册(`entriesOfSlot`,因此同 `id` 且优先级更高的注册会替换已发布的分栏)投影为 `{ id, label }` 行,只在台账版本或语言版本变化时重新计算。它在各分栏自己的标题和正文容器里用 `renderSlot(..., { only: id })` 渲染内容;CSS `:has()` 规则隐藏正文出口为空的分栏,也包括行出口为空的共享分栏。 @@ -62,7 +62,7 @@ kind: "package-reference" |---|---| | [`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/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) | 标题栏开关及其角标 | @@ -76,7 +76,7 @@ kind: "package-reference" ## 进一步探索 - [Web Client Slots](../../../docs/subsystems/slots.zh.md)——分栏依赖的 list、keyed 与 owner props 语义。 -- [`dsh-client-ui-chat`](../ui-chat/README.zh.md#scroll-ownership)——`conversation.chat.aside` 图层及其末端留白。 +- [`dsh-client-ui-chat`](../ui-chat/README.zh.md#scroll-ownership)——`conversation.chat.aside` 图层及其末端留白数据源。 - [`dsh-client-ui-conversation`](../ui-conversation/README.zh.md)——会话标题栏工具区。 - [`dsh-client-ui-primitives`](../ui-primitives/README.zh.md#component-catalog)——`PanelRow` 与 `PathLabel`。 diff --git a/packages/client/ui-session-panel/src/client/SessionPanel.module.css b/packages/client/ui-session-panel/src/client/SessionPanel.module.css index 69655e3ea6..c54051e831 100644 --- a/packages/client/ui-session-panel/src/client/SessionPanel.module.css +++ b/packages/client/ui-session-panel/src/client/SessionPanel.module.css @@ -1,15 +1,16 @@ -/* The panel floats in the Chat View's aside layer, a zero-height box at the - top of the Chat frame that passes pointer events through. The layer +/* The panel floats in the Chat View's aside layer, a zero-height box across + the top of the Chat frame that passes pointer events through. The layer inherits the scrollport's --dsh-conversation-viewport-height and - --dsh-composer-height; the panel receives the Chat View's end gutter as - --dsh-session-panel-gutter. */ + --dsh-composer-height, and the transcript width --dsh-chat-content-width, + so the end gutter is half the layer width the transcript leaves. */ .panel { position: absolute; top: 12px; right: 16px; box-sizing: border-box; - /* The docked width keeps 48px clear of the transcript column and its width handle. */ - width: clamp(280px, calc(var(--dsh-session-panel-gutter, 0px) - 64px), 340px); + /* The docked width keeps 48px clear of the transcript column and its width handle, + as the back-to-bottom control computes the same gutter. */ + width: clamp(280px, calc((100% - var(--dsh-chat-content-width, 100%)) / 2 - 64px), 340px); /* Stops above the composer stack, whose seat fades and takes presses across the body's full width. */ max-height: calc(var(--dsh-conversation-viewport-height, 100dvh) - var(--dsh-composer-height, 152px) - 24px); overflow-y: auto; diff --git a/packages/client/ui-session-panel/src/client/SessionPanel.tsx b/packages/client/ui-session-panel/src/client/SessionPanel.tsx index 6061155c7f..93000a6266 100644 --- a/packages/client/ui-session-panel/src/client/SessionPanel.tsx +++ b/packages/client/ui-session-panel/src/client/SessionPanel.tsx @@ -1,6 +1,6 @@ /** Floating Session panel in the Chat View's aside: section titles drawn from the section roster, bodies from the section slot. */ import { - useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, type CSSProperties, type FocusEvent, type ReactNode, + useCallback, useEffect, useLayoutEffect, useMemo, useRef, useSyncExternalStore, type FocusEvent, type ReactNode, } from 'react' import { isBehindModal, observeComposition } from '@deepseek-ai/dsh-client-ui-primitives' import { panelElementId, toggleElementId } from './element-ids.ts' @@ -75,33 +75,23 @@ function useFocusReturn(hidden: boolean, toggleId: string): { }), []) } -/** - * Report the Chat View's end gutter for this panel while it is mounted, and - * withdraw it when the panel unmounts or its Chat View moves to another - * Session. A changed gutter replaces the report without withdrawing it. - * @param measure - records one panel's gutter. - * @param sessionId - Session the Chat View shows. - * @param endGutter - the Chat View's end gutter in CSS px. - */ -function useGutterReport(measure: SessionPanelProps['measure'], sessionId: SessionPanelProps['sessionId'], endGutter: number): void { - const instance = useId() - useLayoutEffect(() => () => { measure(sessionId, instance, null) }, [measure, sessionId, instance]) - useLayoutEffect(() => { measure(sessionId, instance, endGutter) }, [measure, sessionId, instance, endGutter]) -} - /** * Render the panel while it docks or shows as an overlay. Each section keeps * its title row and body; CSS hides a section whose body rendered nothing. - * The overlay closes on Escape and on an outside pointerdown. The docked - * width follows the Chat View's end gutter. - * @param props - Session values, the Chat View's end gutter, shared visibility, sections, the gutter report, and copy. + * The overlay closes on Escape and on an outside pointerdown. CSS sizes the + * docked panel from the transcript width; the gutter source decides only + * whether it can dock, so a resize re-renders the panel only when it crosses + * the docking threshold. + * @param props - Session values, the Chat View's end gutter source, shared visibility, sections, the gutter tracking, and copy. * @returns the panel, or null while it is hidden. */ export function SessionPanel({ - sessionId, endGutter, useVisibility, useSections, measure, closeOverlay, renderSlot, t, + sessionId, endGutter, useVisibility, useSections, track, closeOverlay, renderSlot, t, }: SessionPanelProps): ReactNode { - useGutterReport(measure, sessionId, endGutter) - const fits = fitsGutter(endGutter) + // Registered before paint, so a Chat View remount keeps the header toggle available instead of flashing unavailable. + useLayoutEffect(() => track(sessionId, endGutter), [track, sessionId, endGutter]) + const followGutter = useCallback((listener: () => void) => endGutter.subscribe(listener), [endGutter]) + const fits = useSyncExternalStore(followGutter, () => fitsGutter(endGutter.getSnapshot())) const presentation = useVisibility(visibility => presentationOf(fits, visibility, sessionId)) const sections = useSections(entries => entries) const panel = useRef(null) @@ -117,7 +107,6 @@ export function SessionPanel({
@@ -78,7 +79,7 @@ The panel projects the section list's live registrations (`entriesOfSlot`, so a - [Web Client Slots](../../../docs/subsystems/slots.md) — list, keyed, and owner-prop semantics the sections rely on. - [`dsh-client-ui-chat`](../ui-chat/README.md#scroll-ownership) — the `conversation.chat.aside` layer and its end gutter source. - [`dsh-client-ui-conversation`](../ui-conversation/README.md) — the Session header utilities. -- [`dsh-client-ui-primitives`](../ui-primitives/README.md#component-catalog) — `PanelRow` and `PathLabel`. +- [`dsh-client-ui-primitives`](../ui-primitives/README.md#component-catalog) — `Button`, `Tooltip`, the icons, and the modal and composition guards. ----- diff --git a/packages/client/ui-session-panel/README.zh.md b/packages/client/ui-session-panel/README.zh.md index 5a6f62edc0..3ab05b2e91 100644 --- a/packages/client/ui-session-panel/README.zh.md +++ b/packages/client/ui-session-panel/README.zh.md @@ -44,7 +44,7 @@ kind: "package-reference" 面板隐藏时也要可见的标记(例如需要处理的红点)放进 `conversation.session.panel.indicator` 列表。每个占位是一个元素:开关把它定为图标角上的 6px 圆点,占位负责设置 `background`,并带有说明自身的文字,这些文字会成为开关无障碍名称的一部分。占位会重叠,`order` 高的画在低的上方。owner 属性 `panelShown` 让只是重复面板内容的标记在面板显示时不渲染。 -各包的摘要行都使用 `PanelRow` 原语,使不同分栏的图标、文字与尾部区域对齐;行的「更多」按钮放进它的 `menu`,各行就以同样的方式整行高亮并显示操作。 +插件把面板的行作为 Component Factory `conversation.session.panel.row` 提供。各包的分栏与环境行都用 `renderFactorySlot('conversation.session.panel.row', props)` 渲染自己的行,使不同分栏的图标、文字与尾部区域对齐。每行有一个沿用行文字颜色的 16px 装饰图标、单行内容(溢出时以省略号截断),以及可选的尾部数值或控件。`menu` 放在尾部区域之后的行操作(例如「更多」按钮),位于 16px 宽的一列,中心距行末端 14px;其中的普通 `button` 有 24px 点击区和三级文字色图标,悬停时图标变深、没有底色,因此不需要自己的 tooltip。鼠标悬停在行上、焦点在行内或其菜单打开时显示,没有悬停能力的设备上始终显示。传入 `onActivate` 时整行成为一个按钮,尾部区域与 `menu` 仍是各自独立的控件;带操作或行操作的行在悬停时以及菜单打开期间整行填充。`className` 追加到行的类名上,`attributes`(例如 `role`、`data-*` 标记与右键菜单触发属性)落在行元素上,其余属性被忽略。 ----- @@ -60,12 +60,13 @@ kind: "package-reference" | 文件 | 作用 | |---|---| -| [`src/client/index.ts`](src/client/index.ts) | 字典、开关、面板、「环境」分栏与项目行 | +| [`src/client/index.ts`](src/client/index.ts) | 字典、行 Factory、开关、面板、「环境」分栏与项目行 | | [`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/ProjectRow.tsx`](src/client/ProjectRow.tsx) | 工作目录行 |
@@ -78,7 +79,7 @@ kind: "package-reference" - [Web Client Slots](../../../docs/subsystems/slots.zh.md)——分栏依赖的 list、keyed 与 owner props 语义。 - [`dsh-client-ui-chat`](../ui-chat/README.zh.md#scroll-ownership)——`conversation.chat.aside` 图层及其末端留白数据源。 - [`dsh-client-ui-conversation`](../ui-conversation/README.zh.md)——会话标题栏工具区。 -- [`dsh-client-ui-primitives`](../ui-primitives/README.zh.md#component-catalog)——`PanelRow` 与 `PathLabel`。 +- [`dsh-client-ui-primitives`](../ui-primitives/README.zh.md#component-catalog)——`Button`、`Tooltip`、图标,以及模态层与输入法组合的判断。 ----- diff --git a/packages/client/ui-primitives/src/PanelRow.module.css b/packages/client/ui-session-panel/src/client/PanelRow.module.css similarity index 97% rename from packages/client/ui-primitives/src/PanelRow.module.css rename to packages/client/ui-session-panel/src/client/PanelRow.module.css index 48a734fa97..daf68f90ec 100644 --- a/packages/client/ui-primitives/src/PanelRow.module.css +++ b/packages/client/ui-session-panel/src/client/PanelRow.module.css @@ -1,4 +1,4 @@ -/* One summary-panel fact: [16px icon] gap 8 [content 13/28] [trailing] [menu]. +/* 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 diff --git a/packages/client/ui-primitives/src/PanelRow.tsx b/packages/client/ui-session-panel/src/client/PanelRow.tsx similarity index 64% rename from packages/client/ui-primitives/src/PanelRow.tsx rename to packages/client/ui-session-panel/src/client/PanelRow.tsx index 2a2800fb2c..c9bde96e56 100644 --- a/packages/client/ui-primitives/src/PanelRow.tsx +++ b/packages/client/ui-session-panel/src/client/PanelRow.tsx @@ -1,12 +1,20 @@ -// PanelRow: one icon-led fact row of a summary panel, shared by every -// contributor so rows from different packages keep one geometry. +/** + * 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' -/** Props of one summary-panel row. */ -export interface PanelRowProps extends Omit, 'children' | 'onClick'> { +/** Attributes of the row element, such as `role`, `data-*` markers, and a context-menu trigger's handlers. */ +export type PanelRowAttributes = + Omit, '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. */ @@ -21,16 +29,22 @@ export interface PanelRowProps extends Omit, 'childr 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 + /** 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 summary-panel row: icon, single-line content, an optional + * 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. - * @param props - row content, the optional action and row actions, and attributes for the outer element. + * 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, className, ...attributes }: PanelRowProps) { +export function PanelRow({ icon, children, trailing, menu, onActivate, className, attributes }: PanelRowProps): ReactNode { const body = ( <> diff --git a/packages/client/ui-session-panel/src/client/ProjectRow.tsx b/packages/client/ui-session-panel/src/client/ProjectRow.tsx index 6e3dd45b18..add253e0da 100644 --- a/packages/client/ui-session-panel/src/client/ProjectRow.tsx +++ b/packages/client/ui-session-panel/src/client/ProjectRow.tsx @@ -1,8 +1,9 @@ /** Environment row naming the Session's working folder. */ import type { ReactNode } from 'react' -import { IconFolderCloseRegular, PanelRow, Tooltip } from '@deepseek-ai/dsh-client-ui-primitives' +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,10 +35,9 @@ export function ProjectRow({ const target = { kind: 'directory', value: { sessionId, path } } as const return ( } menu={renderFactorySlot('contextMenu.button', { target, label: t('project.actions') })} - data-session-panel-project="" + attributes={{ ...getTriggerProps(target), 'data-session-panel-project': '' }} > diff --git a/packages/client/ui-session-panel/src/client/index.ts b/packages/client/ui-session-panel/src/client/index.ts index a24f01b6be..ad2cb8508e 100644 --- a/packages/client/ui-session-panel/src/client/index.ts +++ b/packages/client/ui-session-panel/src/client/index.ts @@ -1,7 +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 and ships the Environment section with the working + * other plugins register, offers the row Component Factory those sections + * render their rows with, and ships the Environment section with the working * folder row. */ import type { Context as ClientContext } from '@deepseek-ai/cordis' @@ -13,6 +14,7 @@ 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' @@ -28,6 +30,7 @@ declare module '@deepseek-ai/dsh-client-ui-slots' { } } +export type { PanelRowAttributes, PanelRowProps } from './PanelRow.tsx' export type { EnvironmentSectionProps, ProjectRowInjected, ProjectRowProps, SessionPanelDockable, SessionPanelIndicatorOwnerProps, SessionPanelInjected, SessionPanelPresentation, SessionPanelProps, SessionPanelSectionEntry, SessionPanelSectionOwnerProps, @@ -38,8 +41,8 @@ export type { export const inject = ['slots', 'locale', 'remote'] /** - * Client plugin body: register the dictionaries, the header toggle, the panel, - * and the Environment section with its project row. + * Client plugin body: register the dictionaries, the row Component Factory, + * the header toggle, the panel, and the Environment section with its project row. * @param ctx - client root context. */ export function apply(ctx: ClientContext): void { @@ -53,6 +56,8 @@ 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', diff --git a/packages/client/ui-session-panel/src/client/slots.ts b/packages/client/ui-session-panel/src/client/slots.ts index ccc69e4b56..2f409fdc19 100644 --- a/packages/client/ui-session-panel/src/client/slots.ts +++ b/packages/client/ui-session-panel/src/client/slots.ts @@ -10,8 +10,21 @@ 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 diff --git a/packages/client/ui-session-panel/tests/browser-plugin.client.spec.ts b/packages/client/ui-session-panel/tests/browser-plugin.client.spec.ts index 2a488e240d..5bc2eb3fc2 100644 --- a/packages/client/ui-session-panel/tests/browser-plugin.client.spec.ts +++ b/packages/client/ui-session-panel/tests/browser-plugin.client.spec.ts @@ -57,8 +57,9 @@ describe('ui-session-panel browser half', () => { expect(inject).toEqual(['slots', 'locale', 'remote']) }) - it('registers the toggle first among the header utilities, the panel in the Chat aside, the Environment section, and the project row', async () => { + 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 () => { 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) @@ -124,6 +125,7 @@ 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) diff --git a/packages/client/ui-primitives/tests/panel-row.client.spec.tsx b/packages/client/ui-session-panel/tests/panel-row.client.spec.tsx similarity index 72% rename from packages/client/ui-primitives/tests/panel-row.client.spec.tsx rename to packages/client/ui-session-panel/tests/panel-row.client.spec.tsx index b5c1435e04..3195c3d73b 100644 --- a/packages/client/ui-primitives/tests/panel-row.client.spec.tsx +++ b/packages/client/ui-session-panel/tests/panel-row.client.spec.tsx @@ -1,7 +1,8 @@ // @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 '@deepseek-ai/dsh-client-ui-primitives' +import { PanelRow } from '../src/client/PanelRow.tsx' afterEach(cleanup) @@ -43,13 +44,23 @@ describe('PanelRow', () => { expect(staticRow.className).not.toBe(interactive) }) - it('forwards attributes such as context-menu handlers to the outer element', () => { + 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(} className="placed" onContextMenu={onContextMenu} tabIndex={0}>Row) + const view = render( + } className="placed" attributes={{ onContextMenu, tabIndex: 0, 'data-marker': 'on' }}>Row, + ) 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(, children: 'Row', ...extra }} />) + const row = view.container.querySelector('[data-panel-row]') as HTMLElement + expect(row.getAttributeNames().sort()).toEqual(['class', 'data-panel-row']) + }) }) diff --git a/packages/extensions/cordis-client-runner/src/client/slot-catalog.ts b/packages/extensions/cordis-client-runner/src/client/slot-catalog.ts index 2c51d195b3..c365a526e3 100644 --- a/packages/extensions/cordis-client-runner/src/client/slot-catalog.ts +++ b/packages/extensions/cordis-client-runner/src/client/slot-catalog.ts @@ -2469,7 +2469,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:44', + source: 'packages/client/ui-session-panel/src/client/slots.ts:57', }, { key: 'conversation.session.panel.indicator', @@ -2529,7 +2529,7 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [ occupants: [], 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:37', + source: 'packages/client/ui-session-panel/src/client/slots.ts:50', }, { key: 'conversation.session.panel.section', @@ -2593,7 +2593,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:22', + source: 'packages/client/ui-session-panel/src/client/slots.ts:35', }, { key: 'conversation.session.panel.section.actions', @@ -2639,7 +2639,7 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [ occupants: [], replaceRisk: 'none', 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: \'\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}', - source: 'packages/client/ui-session-panel/src/client/slots.ts:28', + source: 'packages/client/ui-session-panel/src/client/slots.ts:41', }, { key: 'conversation.trajectory.images',