refactor(panel): mount the Session panel in the Chat aside

The panel now occupies `conversation.chat.aside` instead of a seat in the
Conversation shell, and `ui-conversation` returns to its master state: no
`conversation.session.panel` seat, no `layouts` source, no end-gutter
reports from the width controls, and the composer and viewport height
variables back on the scrollport.

Each mounted panel reports its Chat View's end gutter into the plugin's
state; the toggle reads the widest gutter of its Session and is unavailable
while no Chat View shows it. The overlay still closes once the gutter can dock
the panel or no Chat View shows the Session, and keeps the composition and
focus-return behavior.
This commit is contained in:
LegGasai committed 2026-11-06 18:53:14 +08:00
1 parent 6501670efc
commit 3500261d0d
35 files changed
+502 -680

No files matched your search

@@ -2,27 +2,27 @@
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
# After editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write .agents/notes/implemented/feature/2026-11-05-session-panel.md
/agent-note-session-panel-over-the-conversation-body-s-end-gutter:
en: e4548a86fa537e4a
zh: 87821d4285485faa
/agent-note-session-panel-over-the-conversation-body-s-end-gutter/problem:
/agent-note-session-panel-in-the-chat-view-s-end-gutter:
en: 1dc9957a0c9336e0
zh: 88d41c8490c2710c
/agent-note-session-panel-in-the-chat-view-s-end-gutter/problem:
en: c69d9843bc6f0b87
zh: c31bb1b2b4d9b781
/agent-note-session-panel-over-the-conversation-body-s-end-gutter/decision:
en: 547fe8129b027892
zh: dc0807d782f551ae
/agent-note-session-panel-over-the-conversation-body-s-end-gutter/decision/docking-follows-the-transcript-gutter:
en: f406a8821cdc8dc9
zh: 42178c0188cb0f2b
/agent-note-session-panel-over-the-conversation-body-s-end-gutter/decision/sections-are-registrations-the-panel-draws-titles:
/agent-note-session-panel-in-the-chat-view-s-end-gutter/decision:
en: c2ddf417ea56b626
zh: 44c30091ade7e5bf
/agent-note-session-panel-in-the-chat-view-s-end-gutter/decision/docking-follows-the-transcript-gutter:
en: 07c10fdcece41352
zh: 10abcf21ec8a8e89
/agent-note-session-panel-in-the-chat-view-s-end-gutter/decision/sections-are-registrations-the-panel-draws-titles:
en: f8e69329e832c764
zh: 2453aa8e794f46f5
/agent-note-session-panel-over-the-conversation-body-s-end-gutter/decision/the-turn-rail-sits-at-the-start-edge:
/agent-note-session-panel-in-the-chat-view-s-end-gutter/decision/the-turn-rail-sits-at-the-start-edge:
en: 08e720a4ea75d4d6
zh: 5e2e5b8452f67d36
/agent-note-session-panel-over-the-conversation-body-s-end-gutter/alternatives-considered:
en: 9cf81cde02bf900b
zh: 549d92a260541e3d
/agent-note-session-panel-over-the-conversation-body-s-end-gutter/consequences:
en: c1f661c6a62953b6
zh: 8642f081c2879307
/agent-note-session-panel-in-the-chat-view-s-end-gutter/alternatives-considered:
en: ad58acac0310b15e
zh: 24926860a74898fe
/agent-note-session-panel-in-the-chat-view-s-end-gutter/consequences:
en: 522aa44b4a369eeb
zh: 2756b3df6c659832
@@ -1,4 +1,4 @@
# Agent Note: Session panel over the Conversation body's end gutter
# Agent Note: Session panel in the Chat View's end gutter
Status: implemented
@@ -10,15 +10,15 @@ Facts about the current Session — its project directory, the change requests i
## Decision
[`dsh-client-ui-session-panel`](../../../../packages/client/ui-session-panel/README.md) adds a Session header toggle (`conversation.session.header.utilities`, order −10) and a floating panel that [`ui-conversation`](../../../../packages/client/ui-conversation/README.md) seats inside the main Conversation body as `conversation.session.panel`. The seat renders only for the main occurrence of an active Session, beside the width handles and outside the scrollport, so the panel neither scrolls with the transcript nor appears in embedded occurrences or on the blank home.
[`dsh-client-ui-session-panel`](../../../../packages/client/ui-session-panel/README.md) adds a Session header toggle (`conversation.session.header.utilities`, order −10) and a floating panel that occupies `conversation.chat.aside`, a slot that [`ui-chat`](../../../../packages/client/ui-chat/README.md#scroll-ownership) renders in the Chat View beside the turn rail. The aside is a zero-height layer at the top of the Chat frame and, like the turn rail, is sticky inside the shared scrollport: the panel does not scroll with the transcript, inherits the scrollport's composer and viewport heights, and needs no seat in the Conversation shell. Views other than Chat show no panel.
### Docking follows the transcript gutter
The panel docks only while the gutter between the transcript column and the body's end edge can hold it (344px: 48px clear of the column and its width handle, a 280px minimum width, and a 16px margin). The gutter, not the viewport width, decides because the column width is adaptive and user-draggable and the right sidebar shares the frame: the same viewport can leave 75px or 600px. The Conversation width controls already measure the body and resolve the column width, so they report the gutter after each measurement and drag frame into `ctx.uiConversation.layouts`, a per-Session source on the existing Conversation service. View activation reports whether the active View follows the transcript column; every View other than Chat fills the body, so the gutter reads zero there.
The panel docks only while the gutter between the transcript column and the Chat frame's end edge can hold it (344px: 48px clear of the column and its width handle, a 280px minimum width, and a 16px margin). The gutter, not the viewport width, decides because the column width is adaptive and user-draggable and the right sidebar shares the frame: the same viewport can leave 75px or 600px. The Chat View owns the frame and the transcript column, so it computes the gutter from the widths a `ResizeObserver` reports for both and passes it to the aside occupant as the `endGutter` owner prop.
The toggle and the panel read that source and one plugin-owned visibility state and decide the presentation with the same pure function. The toggle therefore reports `aria-expanded` truthfully and knows whether a press flips docking or opens the overlay, which a CSS-only container query cannot tell an element outside the body.
Each mounted panel reports its gutter into the plugin's state, and the toggle reads the widest gutter reported for its Session; a Session without a report shows no Chat View. The toggle and the panel decide the presentation with the same pure function, so the toggle reports `aria-expanded` truthfully and knows whether a press flips docking or opens the overlay, which a CSS-only container query cannot tell an element outside the Chat View. While no Chat View shows the Session, as in the trajectory View, the toggle is unavailable and its tooltip asks for the Chat view; `ui-conversation` keeps View selection inside its shell, so the toggle does not switch Views itself.
Docking follows one persisted preference shared by every Session and defaults to on. Without room, a press opens a transient overlay for that Session above the transcript and the composer stack; it never changes the preference, and it closes once its gutter can dock the panel or the main body shows another Session, so it never reappears on its own. The panel state follows the open overlay's layout source, which the Conversation shell marks as no longer shown when the main body leaves the Session, instead of a component cleanup that React's double mount would also run. Hiding automatically and overlaying on request keeps the transcript uncovered without making the facts unreachable on laptop widths.
Docking follows one persisted preference shared by every Session and defaults to on. Without room, a press opens a transient overlay for that Session above the transcript; it never changes the preference, and it closes once its gutter can dock the panel or no Chat View shows the Session any longer, so it never reappears on its own. The panel state follows the reported gutter of the open overlay's Session. A panel withdraws its report when it unmounts or its Chat View moves to another Session, in a layout-effect cleanup kept apart from the gutter update, so a changed gutter never reads as an unmount. Hiding automatically and overlaying on request keeps the transcript uncovered without making the facts unreachable on laptop widths.
### Sections are registrations; the panel draws titles
@@ -32,16 +32,18 @@ The turn rail sits at the scrollport's start edge with its marks, focus ring, an
## Alternatives considered
- **A seat in `conversation.content`.** Rejected: it made `ui-conversation` render the panel beside the width handles and outside the scrollport, have its width controls measure the gutter into a per-Session `ctx.uiConversation.layouts` source, and move the composer and viewport height variables from the scrollport to the content body so the seat could read them. The Conversation shell would carry geometry and variable placement for one feature, while chrome that must not scroll can sit sticky inside the scrollport as the turn rail does, and the Chat View already owns the column it would measure.
- **A right-sidebar tab.** It already exists for change requests, but it narrows the transcript while shown, shows one tab at a time, and the [UI guidance](../../../skills/dsh-client-ui-ux/SKILL.md#reuse-before-adding) reserves the sidebar for content opened on demand rather than a resident summary.
- **The dock kit's floating window.** `FloatLayer` windows are draggable, resizable, and positioned in viewport coordinates; a summary anchored to the transcript gutter needs none of that and would have to fight the window's own placement rules.
- **Viewport-width breakpoints.** The transcript width is adaptive and draggable and the right sidebar takes a variable track, so a viewport breakpoint either covers the transcript or hides the panel with room to spare.
- **CSS-only hiding with a click-time read.** A container query on the gutter can hide the docked panel, and the toggle could read the computed result when pressed, as the background-job trigger does. The toggle would still render without knowing whether the panel shows, so `aria-expanded` and its tooltip would be wrong whenever the preference says dock but the gutter is too narrow.
- **Squeezing the transcript to make room.** Docking on laptop widths by moving the transcript column aside changes the centered column, the composer, and both width handles; it remains a separate layout decision.
- **A Session-scoped standard hook for the layout.** Adding `useConversationLayout` to every Session-scoped Slot made every component fixture in the client restate it; the layout has two readers, so a source on the existing Conversation service serves them without widening the standard props.
- **A Session-scoped standard hook for the gutter.** Adding a hook to every Session-scoped Slot would make every component fixture in the client restate it; the gutter has two readers, the panel through its owner props and the toggle through the plugin's own state.
## Consequences
- With the default transcript width the body must be about 1608px wide to dock, so laptop widths use the overlay; the panel never covers the transcript unless the user opens it.
- Sections from independent plugins share one surface, ordering, and title style without depending on each other, and an occupied section id can be replaced by a higher-priority registration.
- The Conversation width controls gained one callback and the Conversation service one per-Session source; the composer stack height now lands on the content body so chrome outside the scrollport can read it.
- `ui-chat` gained one slot and one `ResizeObserver` per Chat View; `ui-conversation` is unchanged.
- The panel shows only in Chat Views; elsewhere the toggle stays in the header, unavailable. Every Chat View occurrence renders the aside, so a Session shown in the main body and in an embedded Conversation at once shows its overlay in both.
- The turn rail's position changed for every user; its behavior and hiding rule did not.
@@ -1,4 +1,4 @@
# Agent Note: 停靠在对话正文末端留白的会话面板
# Agent Note: 停靠在 Chat 视图末端留白的会话面板
Status: implemented
@@ -10,15 +10,15 @@ Status: implemented
## Decision
[`dsh-client-ui-session-panel`](../../../../packages/client/ui-session-panel/README.zh.md) 新增一个会话标题栏开关(`conversation.session.header.utilities`,order −10)和一块悬浮面板,由 [`ui-conversation`](../../../../packages/client/ui-conversation/README.zh.md) 以 `conversation.session.panel` 落位在主对话正文内。落位只为活跃会话的主 occurrence 渲染,与宽度拖拽条同层、位于滚动容器之外,因此面板不随正文滚动,也不会出现在嵌入式 occurrence 或空白首页。
[`dsh-client-ui-session-panel`](../../../../packages/client/ui-session-panel/README.zh.md) 新增一个会话标题栏开关(`conversation.session.header.utilities`,order −10)和一块悬浮面板,面板占用 `conversation.chat.aside`:这是 [`ui-chat`](../../../../packages/client/ui-chat/README.zh.md#scroll-ownership) 在 Chat 视图中、轮次轨道旁渲染的 slot。侧边层是 Chat 外框顶部的零高度图层,与轮次轨道一样在共享滚动容器内 sticky 定位:面板不随正文滚动,继承滚动容器的输入框区域与视口高度,也不需要 Conversation 外壳提供落位。Chat 以外的视图不显示面板。
### 停靠取决于正文留白
只有正文列到正文末端边缘的留白放得下面板时才停靠(344px:与正文列及其宽度拖拽条保持 48px,最小宽度 280px,外加 16px 边距)。判断依据是留白而不是视口宽度,因为正文列宽度可自适应、可由用户拖拽,右侧栏也会占用框架宽度:同一个视口可能只剩 75px,也可能有 600px。Conversation 宽度控件本来就测量正文并计算正文列宽度,因此它在每次测量和拖拽帧后把留白上报给 `ctx.uiConversation.layouts`,这是现有 Conversation 服务上的一个按会话划分的 source。View 激活时上报当前 View 是否跟随正文列;Chat 以外的 View 都占满正文,所以此时留白读数为零。
只有正文列到 Chat 外框末端边缘的留白放得下面板时才停靠(344px:与正文列及其宽度拖拽条保持 48px,最小宽度 280px,外加 16px 边距)。判断依据是留白而不是视口宽度,因为正文列宽度可自适应、可由用户拖拽,右侧栏也会占用框架宽度:同一个视口可能只剩 75px,也可能有 600px。Chat 视图持有外框和正文列,因此由它根据 `ResizeObserver` 报告的两者宽度算出留白,并作为 owner 属性 `endGutter` 交给侧边层的占位组件。
开关和面板读取同一个 source 和同一份插件持有的可见性状态,并用同一个纯函数决定呈现方式。因此开关能如实报告 `aria-expanded`,也知道按下后是切换停靠还是打开浮层;纯 CSS 的容器查询无法把结果告诉正文之外的元素。
每个已挂载的面板把自己的留白上报到插件状态中,开关读取为其会话上报的最宽留白;没有上报的会话表示没有 Chat 视图在显示它。开关和面板用同一个纯函数决定呈现方式,因此开关能如实报告 `aria-expanded`,也知道按下后是切换停靠还是打开浮层;纯 CSS 的容器查询无法把结果告诉 Chat 视图之外的元素。没有 Chat 视图显示该会话时(例如在轨迹视图中),开关不可用,悬停提示请用户切到「对话」视图;`ui-conversation` 把视图选择留在其外壳内部,因此开关不自行切换视图。
停靠遵循所有会话共用的一个持久化偏好,默认开启。没有空间时,按下开关会为该会话在正文和 composer 区域上方打开临时浮层;它从不改变偏好;该会话的留白可以停靠面板,或主正文切到其他会话时,浮层关闭,因此不会自己重新出现。面板状态跟随打开浮层的会话的布局 source,主正文离开该会话时 Conversation 外壳会把它标记为不再显示;不用组件清理函数实现,因为 React 的双重挂载也会运行它。自动隐藏加按需浮层,既保证正文不被遮挡,也让笔记本宽度下的信息依然可达。
停靠遵循所有会话共用的一个持久化偏好,默认开启。没有空间时,按下开关会为该会话在正文上方打开临时浮层;它从不改变偏好;该会话的留白可以停靠面板,或不再有 Chat 视图显示该会话时,浮层关闭,因此不会自己重新出现。面板状态跟随打开浮层的会话所上报的留白。面板卸载或其 Chat 视图换到另一个会话时撤回上报;撤回放在与留白更新分开的 layout effect 清理中,因此留白变化永远不会被当成卸载。自动隐藏加按需浮层,既保证正文不被遮挡,也让笔记本宽度下的信息依然可达。
### 分栏是注册项;面板绘制标题
@@ -32,16 +32,18 @@ Status: implemented
## Alternatives considered
- **落位在 `conversation.content`。** 已否决:这种做法让 `ui-conversation` 在宽度拖拽条旁、滚动容器之外渲染面板,由宽度控件把留白测量结果写入按会话划分的 `ctx.uiConversation.layouts` source,并把输入框区域与视口高度变量从滚动容器挪到正文容器上,使落位能读到它们。Conversation 外壳因此要为单个功能承担几何测量和变量位置;而不随滚动的界面元素可以像轮次轨道那样在滚动容器内 sticky 定位,要测量的正文列也本来就归 Chat 视图所有。
- **右侧栏标签页。** 变更请求已有这种实现,但它显示时会压窄正文,一次只显示一个标签页,而且 [UI 指南](../../../skills/dsh-client-ui-ux/SKILL.md#reuse-before-adding)把侧栏留给按需打开的内容,而不是常驻摘要。
- **dock kit 的悬浮窗。** `FloatLayer` 窗口可拖拽、可缩放、按视口坐标定位;锚定在正文留白的摘要用不上这些能力,还要对抗窗口自身的定位规则。
- **按视口宽度断点。** 正文宽度自适应、可拖拽,右侧栏占用可变宽度,视口断点要么遮挡正文,要么在空间充足时也隐藏面板。
- **纯 CSS 隐藏加点击时读取。** 对留白做容器查询可以隐藏停靠面板,开关在按下时读取计算结果,与后台任务按钮的做法相同。但开关渲染时仍不知道面板是否显示,偏好为停靠而留白不足时,`aria-expanded` 与提示文字都会出错。
- **挤压正文腾出空间。** 在笔记本宽度下把正文列移开来停靠,会改变居中的正文列、composer 和两侧宽度拖拽条;这仍是另一项布局决策。
- **会话作用域标准 hook。** 给每个会话作用域 Slot 增加 `useConversationLayout`,会让客户端所有组件测试夹具都要补上它;布局只有两个读取方,所以放在现有 Conversation 服务上的 source 即可满足,无需扩大标准 props。
- **会话作用域标准 hook。** 给每个会话作用域 Slot 增加一个留白 hook,会让客户端所有组件测试夹具都要补上它;留白只有两个读取方:面板通过 owner 属性读取,开关通过插件自己的状态读取。
## Consequences
- 在默认正文宽度下,对话区要约 1608px 宽才能停靠,因此笔记本宽度使用浮层;除非用户主动打开,面板不会遮挡正文。
- 独立插件的分栏共享同一界面、排序和标题样式,彼此不依赖;已占用的分栏 id 可以被更高优先级的注册替换。
- Conversation 宽度控件多了一个回调,Conversation 服务多了一个按会话划分的 source;composer 区域高度现在写在正文容器上,滚动容器之外的界面元素也能读取。
- `ui-chat` 多了一个 slot,每个 Chat 视图多一个 `ResizeObserver`;`ui-conversation` 没有改动。
- 面板只出现在 Chat 视图中;其他视图下开关仍在标题栏中,但不可用。每个 Chat 视图实例都会渲染侧边层,因此同一会话同时显示在主正文区和嵌入的对话中时,两处都会显示浮层。
- 轮次轨道的位置对所有用户都变了;行为和隐藏规则不变。
+8 -8
View File
@@ -149,8 +149,8 @@ root [AppFrame]
│ ├─ conversation.session.header.lineage
│ ├─ conversation.session.header.actions
│ ├─ conversation.session.header.utilities
│ │ └─ id=session-panel [SessionPanelToggle]
│ │ └─ conversation.session.panel.indicator [list, inline]
│ │ └─ id=session-panel [SessionPanelToggle]
│ │ └─ conversation.session.panel.indicator [list, inline]
│ ├─ conversation.session.header.views.actions
│ └─ conversation.session.header.corner
└─ calls Factory: conversation.content
@@ -161,6 +161,11 @@ Factory: conversation.content [ConversationContent]
│ ├─ id=chat [ChatView]
│ │ ├─ conversation.chat.text-interaction [list]
│ │ ├─ conversation.chat.markdown.fence [hoc, keyed by fence language]
│ │ ├─ conversation.chat.aside [SessionPanel]
│ │ │ ├─ conversation.session.panel.section [list]
│ │ │ │ └─ id=environment [EnvironmentSection]
│ │ │ │ └─ conversation.session.panel.environment.row [list]
│ │ │ └─ conversation.session.panel.section.actions [keyed]
│ │ └─ conversation.chat.flow [ChatFlow]
│ │ └─ conversation.chat.node [ChatNodeSeat dispatch]
│ │ ├─ key=user [UserMessageNodeView]
@@ -207,12 +212,7 @@ Factory: conversation.content [ConversationContent]
├─ conversation.hero.workspace
│ └─ conversation.hero.workspace.directoryFlow
├─ conversation.hero.agentPreset
├─ conversation.hero.options
└─ conversation.session.panel [SessionPanel]
├─ conversation.session.panel.section [list]
│ └─ id=environment [EnvironmentSection]
│ └─ conversation.session.panel.environment.row [list]
└─ conversation.session.panel.section.actions [keyed]
└─ conversation.hero.options
Factory: conversation.chat.user.content [UserContent]
├─ conversation.chat.user.images [MessageImages]
+8 -8
View File
@@ -151,8 +151,8 @@ root [AppFrame]
│ ├─ conversation.session.header.lineage
│ ├─ conversation.session.header.actions
│ ├─ conversation.session.header.utilities
│ │ └─ id=session-panel [SessionPanelToggle]
│ │ └─ conversation.session.panel.indicator [list, inline]
│ │ └─ id=session-panel [SessionPanelToggle]
│ │ └─ conversation.session.panel.indicator [list, inline]
│ ├─ conversation.session.header.views.actions
│ └─ conversation.session.header.corner
└─ calls Factory: conversation.content
@@ -163,6 +163,11 @@ Factory: conversation.content [ConversationContent]
│ ├─ id=chat [ChatView]
│ │ ├─ conversation.chat.text-interaction [list]
│ │ ├─ conversation.chat.markdown.fence [hoc, keyed by fence language]
│ │ ├─ conversation.chat.aside [SessionPanel]
│ │ │ ├─ conversation.session.panel.section [list]
│ │ │ │ └─ id=environment [EnvironmentSection]
│ │ │ │ └─ conversation.session.panel.environment.row [list]
│ │ │ └─ conversation.session.panel.section.actions [keyed]
│ │ └─ conversation.chat.flow [ChatFlow]
│ │ └─ conversation.chat.node [ChatNodeSeat dispatch]
│ │ ├─ key=user [UserMessageNodeView]
@@ -209,12 +214,7 @@ Factory: conversation.content [ConversationContent]
├─ conversation.hero.workspace
│ └─ conversation.hero.workspace.directoryFlow
├─ conversation.hero.agentPreset
├─ conversation.hero.options
└─ conversation.session.panel [SessionPanel]
├─ conversation.session.panel.section [list]
│ └─ id=environment [EnvironmentSection]
│ └─ conversation.session.panel.environment.row [list]
└─ conversation.session.panel.section.actions [keyed]
└─ conversation.hero.options
Factory: conversation.chat.user.content [UserContent]
├─ conversation.chat.user.images [MessageImages]
@@ -21,8 +21,8 @@
en: 4a094cd97426ad18
zh: 5faadddb7e2b0a43
/deepseek-ai-dsh-client-ui-conversation/shell-and-standard-props:
en: b39232aa55a211dd
zh: b71668328899bcdb
en: 7c45c9c9767b3184
zh: 290037aa8a71b1df
/deepseek-ai-dsh-client-ui-conversation/temporary-composer-entries:
en: 59cd63057dfb6eeb
zh: b2e2c86e810b7bb8
@@ -120,8 +120,6 @@ Active transcripts in the main occurrence expose content-width drag handles in t
The width-handle indicator follows the pointer only during a captured drag; ordinary hover leaves its position unchanged.
The main occurrence of an active Session also renders the `conversation.session.panel` seat inside its body, beside the width handles and outside the scrollport; embedded occurrences and the blank home omit it. Its occupant positions itself against the body, which carries the transcript axis and the composer stack height `--dsh-composer-height`. `ctx.uiConversation.layouts.source(sessionId)` publishes that Session's `ConversationLayout`: `endGutter` is the space between the transcript column's end edge and the body's end edge, written by the main width controls after each measurement and drag frame, again when the body adopts its first Session, and reset to zero when they stop showing the Session; `shown` says whether the main body shows the Session. The gutter stays zero while a View other than the shipped Chat View (`chat`) is active, because those Views fill the body; a View registered under another id reads zero as well. A Session's layout is dropped when its binding scope is released.
The resident composer survives no-Session and Session transitions. Whitespace hides its placeholder; a whitespace-only draft without attachments cannot be sent. The no-Session state keeps the same composer surface mounted but inert while the Workspace picker connects a blank Session. The surface is a shell-owned Lexical editor: reference chips are atomic decorator nodes carrying the owner's serialization identity (submission expands them through the owner codec), the claimed slash command is an atomic leading chip that carries its claim, folder text references carry the folder glyph as an icon prefix, and the draft's text and semantic references are persisted by the per-Session Conversation store. QueueDock reads `next-turn` from the Session `inbox` projection, including cold recovered messages, and excludes only requestIds still owned by local transcript submissions. Other queued rows retain their normal display and actions. Queue operations address exact queue occurrences through the scoped `ctx.conversation` service; queue previews use the [UserText Factory](#sent-user-text) (wire session forms fold to their label) and show local or durable images and files in original attachment order. Images use thumbnails; files use compact name-and-size cards. An edit exposes the literal sent text in the ui-primitives `InlineEditor`, so line breaks survive re-editing. Durable thumbnails resolve through the session image URL cache. Busy Enter behavior is stored in the Host-backed `ui-conversation` settings namespace. The composer keymap arbitrates the trigger menu's keys through the slash pipeline — Tab settles the highlighted completion (or drills a drillable one), Escape and Shift+Tab leave the menu without settling — and leaves every other key to the editor. An overlay that takes the keyboard hands it back through `SessionInput.focus()`, which rides Lexical's own focus so the caret returns where the draft left it rather than at the start.
In narrow browser settings, the busy-state Enter preference uses a smaller label gutter. Windows and macOS desktop windows retain the standard spacing.
@@ -120,8 +120,6 @@ Session 首次绑定或缓存的 Session 成为 current 时,shell 会在渲染
宽度拖拽条的指示线只在已捕获指针的拖拽期间跟随指针,普通悬停不改变其位置。
活跃 Session 的主 occurrence 还会在正文内渲染 `conversation.session.panel` 落位,与宽度拖拽条同层,位于滚动容器之外;嵌入式 occurrence 和空白首页不渲染它。占位组件相对正文定位,正文持有正文轴线与 composer 区域高度 `--dsh-composer-height`。`ctx.uiConversation.layouts.source(sessionId)` 发布该 Session 的 `ConversationLayout`:`endGutter` 是正文列末端边缘到正文末端边缘的距离,由主宽度控件在每次测量与拖拽帧后写入,正文接上第一个 Session 时也会写入一次,不再显示该 Session 时归零;`shown` 表示主正文当前是否显示该 Session。激活的是内置 Chat View(`chat`)以外的 View 时留白保持为零,因为这类 View 占满正文;以其他 id 注册的 View 同样读到零。Session 的绑定 scope 释放时,它的布局随之丢弃。
常驻 composer 在无 Session 与有 Session 之间保持挂载。输入空白字符会隐藏占位提示;没有附件的纯空白草稿无法发送。无 Session 时,同一个编辑器表面保持 inert,Workspace picker 连接 blank Session。该表面是 shell 所有的 Lexical 编辑器:引用 chip 是携带 owner 序列化身份的原子 decorator 节点(提交时经 owner codec 展开),已认领的 slash command 是携带认领的行首原子 chip,文件夹文本引用以图标前缀携带文件夹图形,草稿文字和引用语义字段由逐 Session Conversation store 持久化。QueueDock 从 Session 的 `inbox` 投影读取 `next-turn`,包含从冷状态恢复的消息,仅排除仍由本地 transcript 提交承接的 requestId。其他排队行保留正常展示和操作。Queue 操作通过 scoped `ctx.conversation` service 寻址准确的 queue occurrence;queue 预览使用 [UserText Factory](#sent-user-text)(wire 会话形式折叠为其标签),并按原始附件顺序展示本地或持久化的图片和文件。图片使用缩略图,文件使用紧凑的名称与大小卡片。编辑态在 ui-primitives 的 `InlineEditor` 中展示字面发送文本,因此重新编辑不会丢失换行。持久化缩略图通过会话图片 URL 缓存解析。繁忙时 Enter 行为保存在 Host-backed `ui-conversation` settings namespace。 composer 键盘映射经斜杠流水线裁决触发菜单的按键——Tab 确认高亮补全项(可下钻项则下钻),Escape 与 Shift+Tab 离开菜单且不选定——其余按键交给编辑器自身。 接管键盘的浮层通过 `SessionInput.focus()` 把键盘还回来,该路径走 Lexical 自己的 focus,因此光标回到草稿原来的位置而不是开头。
窄屏浏览器设置中,繁忙时 Enter 偏好的标签与控件间距缩小;Windows 和 macOS 桌面窗口保留标准间距。
@@ -46,7 +46,7 @@ import { ConversationSession, ConversationSessionHeader } from './skeleton/Conve
import { InputBar } from './skeleton/InputBar.tsx'
import { todoDockEntry } from './skeleton/TodoPanel.tsx'
import { installStopShortcut } from './stop-shortcut.ts'
import { DEFAULT_VIEW_ID, TRAJECTORY_VIEW_ID, resolveActiveView } from './view-selection.ts'
import { TRAJECTORY_VIEW_ID, resolveActiveView } from './view-selection.ts'
import { createViewPins } from './view-pins.ts'
import { en, ja, es, fr, de, ru, pt, NS, zh, type ConversationKey } from './locales.ts'
import { CONVERSATION_SETTINGS_NAMESPACE, type ConversationSettings } from '../submission-settings.ts'
@@ -222,10 +222,7 @@ export function apply(ctx: Context, config: Config = Config({})): void {
}
const activateView = (sessionId: SessionId, preferred: string | null): void => {
const active = resolveActiveView(viewTabs(), preferred)
if (active === undefined) return
uiConversation.binding(sessionId).activate(active.id)
// Chat is the View laid out on the transcript column.
uiConversation.layouts.activate(sessionId, active.id === DEFAULT_VIEW_ID)
if (active !== undefined) uiConversation.binding(sessionId).activate(active.id)
}
const restoreView = (sessionId: SessionId): void => {
activateView(sessionId, readConversationViewPreference(sessionId))
@@ -358,7 +355,6 @@ export function apply(ctx: Context, config: Config = Config({})): void {
'conversation.hero.workspace': { kind: 'single', scope: 'root' },
'conversation.hero.agentPreset': { kind: 'single', scope: 'session-maybe' },
'conversation.hero.options': { kind: 'list', scope: 'session' },
'conversation.session.panel': { kind: 'single', scope: 'session' },
},
slots: {
views: { scope: 'session' },
@@ -368,9 +364,6 @@ export function apply(ctx: Context, config: Config = Config({})): void {
hooks: {
composerBlock: sessionId === undefined ? ABSENT_BLOCK : composerBlocks.storeFor(sessionId),
},
reportEndGutter: (endGutter) => {
if (sessionId !== undefined) uiConversation.layouts.measure(sessionId, endGutter)
},
selectWorkspace: workspaceId => workspaceNavigation.openWorkspace(workspaceId, (nextId) => {
if (sessionId !== undefined && nextId !== sessionId) {
const from = inputHub.shell(sessionId)
@@ -279,13 +279,6 @@ declare module '@deepseek-ai/dsh-client-ui-slots' {
scope: 'session'
owner: ConversationHeaderCornerOwnerProps
}
/**
* One floating panel over the main Conversation body's end gutter. It renders
* only for the main occurrence of a Session in its active phase, never for an
* embedded occurrence or the blank home; the occupant positions itself against
* the body and reads `ctx.uiConversation.layouts` to keep clear of the transcript.
*/
'conversation.session.panel': { kind: 'single'; scope: 'session'; owner: ConversationSessionPanelOwnerProps }
/** Rows of the View tab row's More menu; the header shows More only while this list has registrations. */
'conversation.session.header.views.actions': { kind: 'list'; scope: 'root'; owner: ConversationViewActionsOwnerProps }
/** Registered Conversation target Views, rendered one at a time. */
@@ -384,7 +377,6 @@ declare module '@deepseek-ai/dsh-client-ui-slots' {
'conversation.hero.workspace': { kind: 'single'; scope: 'root' }
'conversation.hero.agentPreset': { kind: 'single'; scope: 'session-maybe' }
'conversation.hero.options': { kind: 'list'; scope: 'session' }
'conversation.session.panel': { kind: 'single'; scope: 'session' }
}
inject: ConversationInjected
locale: 'conversation'
@@ -431,26 +423,6 @@ export interface ConversationHeaderActionOwnerProps {
children?: never
}
/** The Session panel's occupant derives its state from standard Session props. */
export interface ConversationSessionPanelOwnerProps {
/** Marker field: the occupant receives no owner-specific values. */
children?: never
}
/** Geometry that floating chrome over the main Conversation body keeps clear of. */
export interface ConversationLayout {
/**
* Inline space in CSS px between the transcript column's end edge and the
* body's end edge. Zero before the first measurement, while the main body
* shows another Session, and while the active View does not follow the
* transcript column. Only the shipped Chat View (`chat`) follows it; a View
* registered under another id, and any View that fills the body, reads zero.
*/
readonly endGutter: number
/** Whether the main Conversation body currently shows the Session. */
readonly shown: boolean
}
/** The header corner's occupant derives its state from standard Session props. */
export interface ConversationHeaderCornerOwnerProps {
/** Marker field: the occupant receives no owner-specific values. */
@@ -500,13 +472,6 @@ export interface ConversationInjected {
selectWorkspace: (workspaceId: WorkspaceId) => Promise<void>
/** Session-addressed composer block source, or the stable absent source. */
hooks: { composerBlock: ObservableSnapshot<ComposerBlock | undefined> }
/**
* Record the end gutter the main body measured for this occurrence's Session;
* no effect without a Session.
* @param endGutter - space between the transcript column's end edge and the body's end edge, in CSS px;
* null when the body stops showing the Session.
*/
reportEndGutter: (endGutter: number | null) => void
}
/** Business callbacks injected into the strict Session body. */
@@ -726,13 +691,6 @@ export interface ConversationWidthControlsInputProps {
container: HTMLDivElement | null
/** Current body phase; handles render only for an active transcript. */
phase: ConversationContentInputProps['phase']
/**
* Receive the end gutter after each measurement and drag frame, and null when
* the controls unmount or a new callback replaces this one.
* @param endGutter - space between the transcript column's end edge and the body's end edge, in CSS px;
* null when the body stops showing the Session.
*/
onEndGutter: (endGutter: number | null) => void
}
/** Full props of the reusable Conversation Factory definition. */
@@ -26,7 +26,6 @@ import { ConversationViewRegistry } from './view-registry.ts'
import { ConversationGroupRegistry } from './group-registry.ts'
import { ConversationInteractionRegistry } from './interaction-registry.ts'
import { UserTextRegistry } from './user-text-registry.ts'
import { ConversationLayouts } from './layouts.ts'
/** Observable faces published for one Session's Conversation assembly. */
export interface ConversationBinding {
@@ -212,8 +211,6 @@ export class UiConversation extends Service {
readonly userText: UserTextRegistry
/** Plugin-owned handlers for selection and context-menu gestures. */
readonly interactions: ConversationInteractionRegistry
/** Main Conversation body geometry per Session; the Conversation shell writes it and floating chrome reads it. */
readonly layouts: ConversationLayouts
private readonly bindings = new WeakMapWithValues<SessionBinding, BindingRecord>()
private readonly images: HistoricalImageCache
@@ -229,7 +226,6 @@ export class UiConversation extends Service {
this.userText = new UserTextRegistry(ctx)
this.interactions = new ConversationInteractionRegistry(ctx)
this.images = new HistoricalImageCache(ctx, sessions)
this.layouts = new ConversationLayouts(sessionId => sessions.binding(sessionId)?.ctx)
const rebuild = (): void => {
for (const record of this.bindings.values) record.binding.rebuild()
}
@@ -251,7 +247,6 @@ export class UiConversation extends Service {
disposeViews()
disposeEvents()
for (const record of [...this.bindings.values]) this.drop(record, true)
this.layouts.dispose()
}
}, 'ui-conversation assembly')
}
@@ -1,105 +0,0 @@
/** Per-Session geometry of the main Conversation body, published through `ctx.uiConversation.layouts`. */
import type { Context } from '@deepseek-ai/cordis'
import { createSnapshotStore, type ObservableSnapshot, type SnapshotStore } from '@deepseek-ai/dsh-client-store'
import type { SessionId } from '@deepseek-ai/dsh-session/types'
import type { ConversationLayout } from '../contract/slots.ts'
const NO_LAYOUT: ConversationLayout = Object.freeze({ endGutter: 0, shown: false })
interface LayoutEntry {
/** Last end gutter the main body's width controls measured, in CSS px. */
measured: number
/** Whether the main body shows the Session. */
shown: boolean
/** Whether the Session's active View follows the transcript column; false before the first activation. */
followsTranscript: boolean
readonly store: SnapshotStore<ConversationLayout>
/** Withdraw the release registered on the Session's scope. */
release: () => void
}
/**
* Layout facts of the main Conversation body, kept per Session until the
* Session's binding scope is released. The Conversation shell writes them:
* the main body's width controls report the measured end gutter and when the
* body stops showing the Session, and View activation reports whether the
* active View follows the transcript column (only Chat does). The published
* gutter is zero while it does not, because such a View fills the body.
* Floating chrome reads one Session's facts through `source`.
*/
export class ConversationLayouts {
private readonly entries = new Map<SessionId, LayoutEntry>()
/**
* @param scopeOf - the binding scope of a Session, whose release drops the
* Session's layout; undefined keeps the layout until `dispose`.
*/
constructor(private readonly scopeOf: (sessionId: SessionId) => Context | undefined) {}
/**
* Read one Session's layout source.
* @param sessionId - Session whose main body geometry is read.
* @returns a source whose identity is stable while the Session stays bound and whose snapshot keeps its identity until a fact changes.
*/
source(sessionId: SessionId): ObservableSnapshot<ConversationLayout> {
return this.entryOf(sessionId).store
}
/**
* Record the end gutter the main body measured while showing a Session, or that it stopped showing it.
* @param sessionId - Session the main body shows or showed.
* @param endGutter - space between the transcript column's end edge and the body's end edge, in CSS px;
* null when the body stops showing the Session.
*/
measure(sessionId: SessionId, endGutter: number | null): void {
// A Session already released is not shown; recording that would only recreate its entry.
if (endGutter === null && !this.entries.has(sessionId)) return
const entry = this.entryOf(sessionId)
entry.shown = endGutter !== null
entry.measured = endGutter === null ? 0 : Math.max(0, endGutter)
this.publish(entry)
}
/**
* Record whether the View a Session activated follows the transcript column.
* @param sessionId - Session whose View changed.
* @param followsTranscript - true for a View laid out on the transcript column.
*/
activate(sessionId: SessionId, followsTranscript: boolean): void {
const entry = this.entryOf(sessionId)
entry.followsTranscript = followsTranscript
this.publish(entry)
}
/** Drop every Session's layout and withdraw the releases registered on their scopes. */
dispose(): void {
for (const entry of [...this.entries.values()]) entry.release()
this.entries.clear()
}
private entryOf(sessionId: SessionId): LayoutEntry {
const existing = this.entries.get(sessionId)
if (existing !== undefined) return existing
const entry: LayoutEntry = {
measured: 0, shown: false, followsTranscript: false, store: createSnapshotStore(NO_LAYOUT), release: () => {},
}
this.entries.set(sessionId, entry)
const scope = this.scopeOf(sessionId)
if (scope !== undefined) {
// Readers holding the source learn that a released Session is no longer shown.
const dispose = scope.effect(() => () => {
this.entries.delete(sessionId)
entry.store.set(NO_LAYOUT)
}, 'ui-conversation layout')
entry.release = () => { void dispose() }
}
return entry
}
private publish(entry: LayoutEntry): void {
const endGutter = entry.followsTranscript ? entry.measured : 0
const current = entry.store.getSnapshot()
if (current.endGutter === endGutter && current.shown === entry.shown) return
entry.store.set(endGutter === 0 && !entry.shown ? NO_LAYOUT : { endGutter, shown: entry.shown })
}
}
@@ -86,8 +86,8 @@ export type {
ComposerFileAttachment, ComposerImageAttachment, DraftFileUpload, DraftFileUploads,
ComposerBarInjected, ComposerBarOwnerProps, ComposerBarProps, ComposerChainProps,
ConversationHeaderActionOwnerProps, ConversationHeaderCornerOwnerProps, ConversationHeaderLineageOwnerProps,
ConversationContentInputProps, ConversationContentProps, ConversationLayout,
ConversationInjected, ConversationSessionPanelOwnerProps, ConversationSessionHeaderInjected, ConversationSessionHeaderSlotProps,
ConversationContentInputProps, ConversationContentProps,
ConversationInjected, ConversationSessionHeaderInjected, ConversationSessionHeaderSlotProps,
ConversationSessionInjected, ConversationSessionSlotProps, ConversationSlotProps,
ConversationViewActionEntry, ConversationViewActionsOwnerProps, ConversationViewsProps,
ConversationWidthControlsInputProps, ConversationWidthControlsProps,
@@ -23,7 +23,7 @@ export function ConversationContent(props: ConversationContentProps) {
const {
sessionId, phase, hero, useSession, useSessions, useSessionStatus,
useWorkspaces, useInput, useComposerBlock, renderSlot, renderSlotChain,
selectWorkspace, reportEndGutter, t, useFactorySlot,
selectWorkspace, t, useFactorySlot,
} = props
const session = useSession(snapshot => snapshot)
const Views = useFactorySlot('views', ConversationSessionView)
@@ -42,25 +42,22 @@ export function ConversationContent(props: ConversationContentProps) {
const [pendingWorkspaceId, setPendingWorkspaceId] = useState<WorkspaceId | undefined>()
const pickerAnchor = useRef<HTMLButtonElement>(null)
// Publishes the two live measurements floating chrome reads: the seat's
// height as --dsh-composer-height, so controls clear the composer as it
// grows, and the scrollport's own height as
// Publishes the two live measurements floating View chrome reads off the
// scroll body: the seat's height as --dsh-composer-height, so controls clear
// the composer as it grows, and the scrollport's own height as
// --dsh-conversation-viewport-height, so a control can sit in the band the
// seat leaves visible. They land on the content body, so View chrome inside
// the scrollport and the Session panel beside it read the same values.
// Callback ref, not an effect; stable identity prevents observer churn while
// the first blank session fills the resident body outlet.
// seat leaves visible. Callback ref, not an effect; stable identity prevents
// observer churn while the first blank session fills the resident body
// outlet.
const seatObserver = useRef<ResizeObserver | null>(null)
const seatResizeRef = useCallback((seat: HTMLDivElement | null): void => {
seatObserver.current?.disconnect()
seatObserver.current = null
const scroller = seat?.parentElement ?? null
if (seat === null || scroller === null) return
/* v8 ignore next -- the seat always renders inside the content body. */
const target = scroller.closest<HTMLElement>('[data-conversation-content]') ?? scroller
seatObserver.current = new ResizeObserver(() => {
target.style.setProperty('--dsh-composer-height', `${seat.offsetHeight}px`)
target.style.setProperty(
scroller.style.setProperty('--dsh-composer-height', `${seat.offsetHeight}px`)
scroller.style.setProperty(
'--dsh-conversation-viewport-height',
`${scroller.clientHeight}px`,
)
@@ -208,9 +205,7 @@ export function ConversationContent(props: ConversationContentProps) {
</div>
),
})}
<WidthControls container={body} phase={phase} onEndGutter={reportEndGutter} />
{props.variant === 'main' && sessionId !== undefined && phase === 'active'
&& renderSlot('conversation.session.panel', {})}
<WidthControls container={body} phase={phase} />
</div>
)
}
@@ -20,12 +20,7 @@ function readWidthPreference(): number | null {
return Number.isFinite(value) && value > 0 ? value : null
}
/**
* Resolve the width displayed for one measured Conversation column.
* @param columnWidth - measured body width in CSS px.
* @param preference - persisted dragged width, or null for the adaptive default.
* @returns the transcript column width in CSS px.
*/
/** Resolve the width displayed for one measured Conversation column. */
function resolveContentWidth(columnWidth: number, preference: number | null): number {
const max = Math.max(CONTENT_MIN, columnWidth - CONTENT_EDGE_BUDGET)
if (preference !== null) return Math.min(Math.max(preference, CONTENT_MIN), max)
@@ -134,14 +129,11 @@ function WidthHandle(props: {
}
/**
* Install the main Conversation width axis, report its end gutter, and render its drag handles.
* Install the main Conversation width axis and render its drag handles.
* @param props - Mounted Conversation body and current presentation phase.
* @returns two active-phase width handles, or no controls outside the active phase.
*/
export function ConversationWidthControls({ container, phase, onEndGutter }: ConversationWidthControlsProps) {
// The observer outlives renders; it reports through the latest callback.
const report = useRef(onEndGutter)
report.current = onEndGutter
export function ConversationWidthControls({ container, phase }: ConversationWidthControlsProps) {
const publishWidths = useCallback((container: HTMLDivElement): void => {
const target = container.parentElement ?? container
const column = container.offsetWidth
@@ -149,22 +141,15 @@ export function ConversationWidthControls({ container, phase, onEndGutter }: Con
const preference = readWidthPreference()
if (preference === null) target.style.removeProperty('--dsh-chat-user-width')
else target.style.setProperty('--dsh-chat-user-width', `${resolveContentWidth(column, preference)}px`)
report.current((column - resolveContentWidth(column, preference)) / 2)
}, [])
// A new callback means the body adopted a Session without remounting or
// resizing: the measurement restarts so that Session gets the current gutter,
// and the callback it replaces receives its final zero.
useLayoutEffect(() => {
if (container === null) return
const observer = new ResizeObserver(() => { publishWidths(container) })
observer.observe(container)
publishWidths(container)
return () => {
observer.disconnect()
onEndGutter(null)
}
}, [container, onEndGutter, publishWidths])
return () => { observer.disconnect() }
}, [container, publishWidths])
const onStart = useCallback((): number => {
if (container === null) return 680
@@ -173,10 +158,7 @@ export function ConversationWidthControls({ container, phase, onEndGutter }: Con
const onDrag = useCallback((width: number): void => {
if (container === null) return
const target = container.parentElement ?? container
const column = container.offsetWidth
const content = resolveContentWidth(column, width)
target.style.setProperty('--dsh-chat-user-width', `${content}px`)
report.current((column - content) / 2)
target.style.setProperty('--dsh-chat-user-width', `${resolveContentWidth(container.offsetWidth, width)}px`)
}, [container])
const onCommit = useCallback((width: number): void => {
if (container === null) return
@@ -1,75 +0,0 @@
import { Context } from '@deepseek-ai/cordis'
import type { SessionId } from '@deepseek-ai/dsh-session/types'
import { describe, expect, it } from 'vitest'
import { ConversationLayouts } from '../src/client/conversation/layouts.ts'
const S1 = 's1' as SessionId
const S2 = 's2' as SessionId
describe('ConversationLayouts', () => {
it('publishes the measured gutter and whether the body shows the Session, while Chat is active', () => {
const layouts = new ConversationLayouts(() => undefined)
const source = layouts.source(S1)
expect(source.getSnapshot()).toEqual({ endGutter: 0, shown: false })
layouts.measure(S1, 400)
// Before a View activates, nothing follows the transcript column.
expect(source.getSnapshot()).toEqual({ endGutter: 0, shown: true })
layouts.activate(S1, true)
expect(source.getSnapshot()).toEqual({ endGutter: 400, shown: true })
layouts.measure(S1, -5)
expect(source.getSnapshot()).toEqual({ endGutter: 0, shown: true })
layouts.measure(S1, 360)
layouts.activate(S1, false)
expect(source.getSnapshot()).toEqual({ endGutter: 0, shown: true })
layouts.activate(S1, true)
layouts.measure(S1, null)
expect(source.getSnapshot()).toEqual({ endGutter: 0, shown: false })
expect(layouts.source(S2).getSnapshot()).toEqual({ endGutter: 0, shown: false })
})
it('keeps the snapshot identity until a fact changes and notifies only on changes', () => {
const layouts = new ConversationLayouts(() => undefined)
const source = layouts.source(S1)
layouts.activate(S1, true)
layouts.measure(S1, 400)
const first = source.getSnapshot()
let notified = 0
const off = source.subscribe(() => { notified += 1 })
layouts.measure(S1, 400)
layouts.activate(S1, true)
expect(source.getSnapshot()).toBe(first)
expect(notified).toBe(0)
layouts.measure(S1, 380)
expect(notified).toBe(1)
off()
})
it('drops a Session layout when its scope is released, and every layout on dispose', async () => {
const root = new Context()
const one = root.plugin(() => {})
const two = root.plugin(() => {})
await Promise.all([one, two])
const scopes = new Map([[S1, one], [S2, two]])
const layouts = new ConversationLayouts(sessionId => scopes.get(sessionId)?.ctx)
const first = layouts.source(S1)
expect(layouts.source(S1)).toBe(first)
layouts.activate(S1, true)
layouts.measure(S1, 400)
const seen: unknown[] = []
first.subscribe(() => { seen.push(first.getSnapshot()) })
// A released Session no longer resolves a binding scope, and its readers see it hidden.
await scopes.get(S1)?.dispose()
scopes.delete(S1)
expect(seen).toEqual([{ endGutter: 0, shown: false }])
// The body's final report after the release recreates nothing.
layouts.measure(S1, null)
expect(layouts.source(S1)).not.toBe(first)
expect(layouts.source(S1).getSnapshot()).toEqual({ endGutter: 0, shown: false })
const second = layouts.source(S2)
layouts.dispose()
expect(layouts.source(S2)).not.toBe(second)
// A Session without a scope keeps its layout until dispose.
const unscoped = layouts.source('s3' as SessionId)
expect(layouts.source('s3' as SessionId)).toBe(unscoped)
})
})
@@ -22,7 +22,6 @@ import { createConversationStore } from '../src/client/stores.ts'
import { SessionInputShell } from '../src/client/input/facade.ts'
import { en, zh } from '../src/client/locales.ts'
import { ConversationContent } from '../src/client/skeleton/ConversationContent.tsx'
import { ConversationWidthControls } from '../src/client/skeleton/ConversationWidthControls.tsx'
import { ConversationHeader } from '../src/client/skeleton/ConversationHeader.tsx'
import { ConversationMainPanel } from '../src/client/skeleton/ConversationMainPanel.tsx'
import { ConversationSession, ConversationSessionHeader } from '../src/client/skeleton/ConversationSession.tsx'
@@ -34,7 +33,7 @@ import type { InputBarProps } from '../src/client/skeleton/InputBar.tsx'
import type {
ComposerBarOwnerProps, ConversationContentInputProps, ConversationContentProps,
ConversationHeaderLineageOwnerProps, ConversationSessionHeaderSlotProps, ConversationSessionSlotProps, ConversationSlotProps,
ConversationViewActionsOwnerProps, ConversationViewsProps, HeroFrameOwnerProps, ConversationWidthControlsProps,
ConversationViewActionsOwnerProps, ConversationViewsProps, HeroFrameOwnerProps,
} from '../src/client/contract/slots.ts'
import type { ViewTab } from '../src/client/contract/views.ts'
import { createComposerFileIntake } from '../src/client/input/file-intake.ts'
@@ -149,8 +148,6 @@ function mount(
entryActions?: boolean
/** Isolate header capability checks from the composer's required layout observers. */
headerOnly?: boolean
/** Render the content Factory as another presentation host would. */
contentVariant?: 'embedded'
} = {},
) {
const sessionId = 'sessionId' in options ? options.sessionId : SID
@@ -208,8 +205,6 @@ function mount(
const frameOwners: HeroFrameOwnerProps[] = []
let actionsOwner: ConversationViewActionsOwnerProps | undefined
const setPinned = vi.fn<(id: string, pinned: boolean) => void>()
/** End gutters the main width controls reported, in order. */
const gutters: (number | null)[] = []
const renderSlot = ((key: string, owner: object, opts?: { only?: string; fallback?: ReactNode; children?: ReactNode }) => {
slotCalls.push(key)
if (key === 'conversation.input.model' || key === 'conversation.input.plan') {
@@ -383,7 +378,6 @@ function mount(
renderSlotChain,
renderFactorySlot,
selectWorkspace: retargetWorkspace,
reportEndGutter: (gutter) => { gutters.push(gutter) },
t,
}
const useFactorySlot = ((name: string, fallback: (props: never) => ReactNode) => (
@@ -391,11 +385,7 @@ function mount(
)) as ConversationContentProps['useFactorySlot']
return (
<FactoryViewsTestContext.Provider value={common}>
<ConversationContent {...({
...common, ...runtimeProps, ...input,
...options.contentVariant === undefined ? {} : { variant: options.contentVariant },
useFactorySlot,
})} />
<ConversationContent {...({ ...common, ...runtimeProps, ...input, useFactorySlot })} />
</FactoryViewsTestContext.Provider>
)
}) as ConversationSlotProps['renderFactorySlot']
@@ -419,7 +409,7 @@ function mount(
const props: ConversationSlotProps = { ...runtimeProps, renderSlot, renderFactorySlot }
const view = render(<ConversationMainPanel {...props} />)
return {
view, store, wiring, sink, retargetWorkspace, session, conversation, slotCalls, headerFactory, lineageOwners, seatOwners, open, gutters,
view, store, wiring, sink, retargetWorkspace, session, conversation, slotCalls, headerFactory, lineageOwners, seatOwners, open,
pickerOwner: () => pickerOwner,
frameOwner: () => frameOwners.at(-1),
setPinned,
@@ -1086,73 +1076,4 @@ describe('ConversationRoot resident composer', () => {
const b = mount(sessionSnapshotOf({ blank: true }))
expect(b.view.container.querySelector('[data-width-handle]')).toBeNull()
})
it('reports the end gutter after each measurement and drag frame, and that it stops showing the Session on unmount', () => {
const b = mount(sessionSnapshotOf())
const content = b.view.container.querySelector('[data-conversation-content]') as HTMLElement
Object.defineProperty(content, 'offsetWidth', { value: 1600, configurable: true })
act(() => { fireResize(content) })
// Adaptive width min(1600 × 0.64, 920) = 920 leaves (1600 − 920) / 2.
expect(b.gutters.at(-1)).toBe(340)
const handle = b.view.container.querySelector('[data-width-handle="right"]') as HTMLElement
const names = ['setPointerCapture', 'releasePointerCapture', 'hasPointerCapture'] as const
const originals = names.map(name => [name, Object.getOwnPropertyDescriptor(Element.prototype, name)] as const)
const captured = new Set<Element>()
Element.prototype.setPointerCapture = function () { captured.add(this) }
Element.prototype.releasePointerCapture = function () { captured.delete(this) }
Element.prototype.hasPointerCapture = function () { return captured.has(this) }
try {
fireEvent.pointerDown(handle, { pointerId: 1, clientX: 800, clientY: 300 })
fireEvent.pointerMove(handle, { pointerId: 1, clientX: 825, clientY: 300 })
fireEvent.pointerUp(handle, { pointerId: 1, clientX: 825, clientY: 300 })
// The dragged width 970 leaves (1600 − 970) / 2.
expect(b.gutters.at(-1)).toBe(315)
} finally {
for (const [name, descriptor] of originals) {
if (descriptor === undefined) Reflect.deleteProperty(Element.prototype, name)
else Object.defineProperty(Element.prototype, name, descriptor)
}
}
b.view.unmount()
expect(b.gutters.at(-1)).toBeNull()
})
it('reports the end gutter to a newly adopted Session without a resize, and only once per callback', () => {
const body = document.createElement('div')
document.body.append(body)
Object.defineProperty(body, 'offsetWidth', { value: 1600, configurable: true })
const props = (onEndGutter: (gutter: number | null) => void) => ({ container: body, phase: 'active', onEndGutter }) as
Pick<ConversationWidthControlsProps, 'container' | 'phase' | 'onEndGutter'> as ConversationWidthControlsProps
const blank = vi.fn<(gutter: number | null) => void>()
const adopted = vi.fn<(gutter: number | null) => void>()
const view = render(<ConversationWidthControls {...props(blank)} />)
expect(blank).toHaveBeenLastCalledWith(340)
view.rerender(<ConversationWidthControls {...props(adopted)} />)
expect(blank).toHaveBeenLastCalledWith(null)
expect(adopted.mock.calls).toEqual([[340]])
view.rerender(<ConversationWidthControls {...props(adopted)} />)
expect(adopted).toHaveBeenCalledOnce()
view.unmount()
expect(adopted).toHaveBeenLastCalledWith(null)
body.remove()
})
it('renders the Session panel seat only for the main occurrence of an active Session', () => {
expect(mount(sessionSnapshotOf()).slotCalls).toContain('conversation.session.panel')
cleanup()
expect(mount(sessionSnapshotOf({ blank: true })).slotCalls).not.toContain('conversation.session.panel')
cleanup()
expect(mount(sessionSnapshotOf(), undefined, undefined, { contentVariant: 'embedded' }).slotCalls)
.not.toContain('conversation.session.panel')
})
it('publishes the composer stack measurements on the content body', () => {
const b = mount(sessionSnapshotOf())
const content = b.view.container.querySelector('[data-conversation-content]') as HTMLElement
const seat = content.querySelector('[data-composer-seat]') as HTMLElement
Object.defineProperty(seat, 'offsetHeight', { value: 140, configurable: true })
act(() => { fireResize(seat) })
expect(content.style.getPropertyValue('--dsh-composer-height')).toBe('140px')
expect(content.style.getPropertyValue('--dsh-conversation-viewport-height')).toBe('0px')
})
})
@@ -3,14 +3,14 @@
# After editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write packages/client/ui-session-panel/README.md
/:
en: b40a112d76d02bc9
zh: 1c004debcd32eeea
en: 8409e6477f312897
zh: b982bc13dfe0e002
/deepseek-ai-dsh-client-ui-session-panel:
en: aff5b9d70836e810
zh: 2cb8c75d3c82fba9
/deepseek-ai-dsh-client-ui-session-panel/summary:
en: eb774a2ea4bd2201
zh: 97f3d8dae6207eae
en: b5a091528bf5375a
zh: 48a22fec747fb07a
/deepseek-ai-dsh-client-ui-session-panel/table-of-contents:
en: d152484eb41ac6b4
zh: 09388d293f9be9cb
@@ -18,17 +18,17 @@
en: d7818d67e981be3c
zh: c7c0c704d5ef8b34
/deepseek-ai-dsh-client-ui-session-panel/use-this-package/docking-and-the-overlay:
en: c10ebd54b9412ac1
zh: a5e878ab049c44a9
en: 2acbacabf911a652
zh: b4b6304f76675655
/deepseek-ai-dsh-client-ui-session-panel/use-this-package/contribute-a-section:
en: f647c3b91e1641be
zh: a3833301a89d27ed
/deepseek-ai-dsh-client-ui-session-panel/understand-the-implementation:
en: 9febcfb17c4f9980
zh: 68e18512cad0a261
en: f996b40c78ce18ba
zh: d66ed6289f8eed50
/deepseek-ai-dsh-client-ui-session-panel/further-exploration:
en: 4ae4610263ad0c16
zh: df16dc60d5af7740
en: 5fa707ada69696c4
zh: 595d8b2d7de42181
/deepseek-ai-dsh-client-ui-session-panel/model-experience:
en: 7e8bbe318a76fd54
zh: c60e87da2a37642a
@@ -36,8 +36,8 @@
en: 47f982e326fe77fd
zh: 275b2ef7eec3ab19
/deepseek-ai-dsh-client-ui-session-panel/known-limitations-and-deferred-work:
en: 7efe51190770aadf
zh: 88a7412b14ba5ec2
en: d5cf7883b7f7e0ab
zh: f5407439447acc44
/deepseek-ai-dsh-client-ui-session-panel/known-limitations-and-deferred-work/dev-note:
en: e67f633dc6fe7773
zh: b532016223ceceef
+12 -7
View File
@@ -1,5 +1,5 @@
---
description: "The Session panel: a header toggle and a floating panel over the main Conversation body whose sections other plugins register, with the built-in Environment section."
description: "The Session panel: a header toggle and a floating panel in the Chat View's aside whose sections other plugins register, with the built-in Environment section."
kind: "package-reference"
---
@@ -9,7 +9,7 @@ English | [中文](README.zh.md)
## Summary
`dsh-client-ui-session-panel` adds a Session header toggle that shows or hides a floating panel of facts about the current Session. The panel docks in the main Conversation body's end gutter when the gutter can hold it, and otherwise opens over the transcript on request. It draws section titles and leaves section content to the plugins that register sections; it ships the Environment section with the working folder row.
`dsh-client-ui-session-panel` adds a Session header toggle that shows or hides a floating panel of facts about the current Session. The panel lives in the Chat View: it docks in the Chat View's end gutter when the gutter can hold it, and otherwise opens over the transcript on request. It draws section titles and leaves section content to the plugins that register sections; it ships the Environment section with the working folder row.
## Table of Contents
@@ -29,9 +29,11 @@ The `@deepseek-ai/dsh-web-app` bundle loads this package by default. The toggle
### Docking and the overlay
The panel docks while the gutter between the transcript column and the body's end edge is at least 344px: 48px clear of the column and its width handle, the panel's 280px minimum width, and a 16px edge margin. Docked, it is 280–340px wide, starts 12px below the header, and scrolls inside itself. Pressing the toggle then flips one docking preference that every Session shares and that persists in `localStorage` under `dsh.sessionPanel.pinned`; the panel docks by default.
The panel docks while the gutter between the transcript column and the Chat frame's end edge is at least 344px: 48px clear of the column and its width handle, the panel's 280px minimum width, and a 16px edge margin. Docked, it is 280–340px wide, starts 12px below the header, and scrolls inside itself. Pressing the toggle then flips one docking preference that every Session shares and that persists in `localStorage` under `dsh.sessionPanel.pinned`; the panel docks by default.
A narrower gutter hides the docked panel, so it never covers the transcript. This includes a narrow window, an expanded right sidebar, a dragged-wide transcript column, and every View other than Chat, because those Views fill the body. Pressing the toggle then opens the panel over the transcript with the prominent elevation, above the composer stack and not covering it. The overlay closes from the toggle, on Escape, and on a pointer press outside the panel, the toggle, and any open menu, such as a row's context menu; Escape returns focus to the toggle when focus was inside the panel. A modal above the page, an input method composing text, and a handler that already took the key, such as an open menu's, keep Escape; otherwise the overlay takes it first, so with the overlay open the first Escape from the composer closes the overlay and does not count toward stopping a running turn. Closing it does not change the docking preference. At most one Session's overlay is open; it closes once the gutter widens enough to dock and once the main body shows another Session, and switching back does not reopen it. When the panel hides while focus is inside it, focus moves to the toggle.
A narrower gutter hides the docked panel, so it never covers the transcript. This includes a narrow window, an expanded right sidebar, and a dragged-wide transcript column. Pressing the toggle then opens the panel over the transcript with the prominent elevation, above the composer stack and not covering it. The overlay closes from the toggle, on Escape, and on a pointer press outside the panel, the toggle, and any open menu, such as a row's context menu; Escape returns focus to the toggle when focus was inside the panel. A modal above the page, an input method composing text, and a handler that already took the key, such as an open menu's, keep Escape; otherwise the overlay takes it first, so with the overlay open the first Escape from the composer closes the overlay and does not count toward stopping a running turn. Closing it does not change the docking preference. At most one Session's overlay is open; it closes once the gutter widens enough to dock and once no Chat View shows the Session, as after switching to another Session or View, and switching back does not reopen it. When the panel hides while focus is inside it, focus moves to the toggle.
Other Views, such as the trajectory View, show no panel. While no Chat View shows the Session, the toggle is unavailable: it stays in the header with its indicators, dimmed, and its tooltip asks to switch to the Chat view.
<a id="contribute-a-section"></a>
### Contribute a section
@@ -52,7 +54,7 @@ Summary rows from every package use the `PanelRow` primitive, so icon, text, and
<details>
<summary>Implementation internals — click to expand</summary>
The toggle and the panel are separate Slot entries that share one plugin-owned visibility source: the persisted docking preference and the Session whose overlay is open. Both read the Session's main body geometry from `ctx.uiConversation.layouts`, which the Conversation width controls write from their existing measurement, and decide the presentation with the same pure function, so the toggle's state never disagrees with the panel. The panel renders inside the main Conversation body, which owns its positioning context, the transcript axis, and the composer stack height.
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 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.
@@ -60,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, and the shared visibility state |
| [`src/client/visibility.ts`](src/client/visibility.ts) | Docking threshold, presentation, the shared visibility state, and the reported gutters |
| [`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 |
@@ -74,7 +76,8 @@ 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-conversation`](../ui-conversation/README.md) — the Session header utilities, the panel seat, and the main body geometry.
- [`dsh-client-ui-chat`](../ui-chat/README.md#scroll-ownership) — the `conversation.chat.aside` layer and its end gutter.
- [`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`.
-----
@@ -97,6 +100,8 @@ These limits define current package constraints, not a task backlog.
- **Laptop widths overlay rather than dock** — with the default transcript width the body must be at least about 1608px wide to dock; narrower bodies use the overlay. Docking by moving the transcript column aside is a separate layout decision.
- **No execution environment row** — the Client has no per-Session fact for the local machine, an SSH host, or the sandbox mode, so the Environment section names only the working folder.
- **No section customization** — every live section shows; hiding or reordering sections from the panel is not offered.
- **No switch back to Chat from other Views** — `dsh-client-ui-conversation` exposes no View selection to plugins, so the toggle in the trajectory View cannot select the Chat View for the user.
- **An overlay shows in each Chat View of its Session** — every Chat View occurrence, main or embedded, renders the aside, so a Session shown in the main body and in an embedded Conversation at once shows its overlay in both.
<a id="dev-note"></a>
### Dev Note
+12 -7
View File
@@ -1,5 +1,5 @@
---
description: "会话面板:会话标题栏开关与主对话区上方的悬浮面板,分栏由其他插件注册,并内置「环境」分栏。"
description: "会话面板:会话标题栏开关与 Chat 视图侧边层中的悬浮面板,分栏由其他插件注册,并内置「环境」分栏。"
kind: "package-reference"
---
@@ -9,7 +9,7 @@ kind: "package-reference"
## 概述
`dsh-client-ui-session-panel` 在会话标题栏加一个开关,用来显示或隐藏一块汇总当前会话信息的悬浮面板。主对话区末端留白放得下面板时,面板停靠在留白里;放不下时,按需浮在对话正文上方。面板只绘制分栏标题,分栏内容交给注册分栏的插件;本包内置「环境」分栏及其工作目录行。
`dsh-client-ui-session-panel` 在会话标题栏加一个开关,用来显示或隐藏一块汇总当前会话信息的悬浮面板。面板只出现在 Chat 视图中:Chat 视图末端留白放得下面板时,面板停靠在留白里;放不下时,按需浮在对话正文上方。面板只绘制分栏标题,分栏内容交给注册分栏的插件;本包内置「环境」分栏及其工作目录行。
## 目录
@@ -29,9 +29,11 @@ kind: "package-reference"
### 停靠与浮层
正文列到对话区末端边缘的留白不少于 344px 时,面板停靠:与正文列及其宽度手柄保持 48px 间距,面板最小宽度 280px,外加 16px 边距。停靠时面板宽 280–340px,位于标题栏下方 12px,内容在面板内滚动。此时按开关会切换所有会话共用的停靠偏好,偏好存放在 `localStorage` 的 `dsh.sessionPanel.pinned` 中;默认停靠。
正文列到 Chat 外框末端边缘的留白不少于 344px 时,面板停靠:与正文列及其宽度手柄保持 48px 间距,面板最小宽度 280px,外加 16px 边距。停靠时面板宽 280–340px,位于标题栏下方 12px,内容在面板内滚动。此时按开关会切换所有会话共用的停靠偏好,偏好存放在 `localStorage` 的 `dsh.sessionPanel.pinned` 中;默认停靠。
留白更窄时隐藏停靠面板,保证不遮挡正文。窗口变窄、展开右侧栏、把正文列拖宽,以及切换到 Chat 以外的视图(这些视图占满对话区)都会如此。此时按开关,面板以更强的阴影浮在正文上方,位于输入框区域之上,且不遮挡输入框。浮层可以用开关关闭,也会在按 Esc 时,或在面板、开关和任何已打开的菜单(例如行的上下文菜单)之外按下指针时关闭;焦点原本在面板内时,按 Esc 后焦点回到开关。页面上方有模态框、输入法正在组字,或已有处理程序(例如打开的菜单)接手了这次按键时,Esc 不归浮层;其余情况由浮层先处理,因此浮层打开时,在输入框按下的第一次 Esc 只关闭浮层,不计入停止当前轮次的连按。关闭浮层不改变停靠偏好。同一时间最多一个会话的浮层处于打开状态;留白变宽到可以停靠时,以及主正文切到其他会话时,浮层都会关闭,切回来也不会重新打开。面板隐藏时如果焦点在面板内,焦点移到开关。
留白更窄时隐藏停靠面板,保证不遮挡正文。窗口变窄、展开右侧栏、把正文列拖宽都会如此。此时按开关,面板以更强的阴影浮在正文上方,位于输入框区域之上,且不遮挡输入框。浮层可以用开关关闭,也会在按 Esc 时,或在面板、开关和任何已打开的菜单(例如行的上下文菜单)之外按下指针时关闭;焦点原本在面板内时,按 Esc 后焦点回到开关。页面上方有模态框、输入法正在组字,或已有处理程序(例如打开的菜单)接手了这次按键时,Esc 不归浮层;其余情况由浮层先处理,因此浮层打开时,在输入框按下的第一次 Esc 只关闭浮层,不计入停止当前轮次的连按。关闭浮层不改变停靠偏好。同一时间最多一个会话的浮层处于打开状态;留白变宽到可以停靠时,以及没有 Chat 视图再显示该会话时(例如切到其他会话或其他视图),浮层都会关闭,切回来也不会重新打开。面板隐藏时如果焦点在面板内,焦点移到开关。
轨迹等其他视图不显示面板。没有 Chat 视图显示该会话时,开关不可用:它连同角标留在标题栏中并变淡,悬停提示请用户切换到「对话」视图。
<a id="contribute-a-section"></a>
### 贡献分栏
@@ -52,7 +54,7 @@ kind: "package-reference"
<details>
<summary>实现内幕——点击展开</summary>
开关与面板是两个独立的 Slot 条目,共享一个插件持有的可见性 source:持久化的停靠偏好,以及打开了浮层的会话。两者都从 `ctx.uiConversation.layouts` 读取该会话的主对话区几何信息(由 Conversation 宽度控件在已有的测量中写入),并用同一个纯函数决定呈现方式,因此开关状态始终与面板一致。面板渲染在主对话区内部,对话区持有其定位上下文、正文轴线和输入框区域高度。
面板是 [`dsh-client-ui-chat`](../ui-chat/README.zh.md#scroll-ownership) 中 `conversation.chat.aside` 的占位组件,因此只渲染在 Chat 视图中。开关与面板是两个独立的 Slot 条目,共享一份插件持有的状态:持久化的停靠偏好、打开了浮层的会话,以及每个已挂载面板从 owner 属性 `endGutter` 上报的末端留白。面板卸载或其 Chat 视图换到另一个会话时撤回上报。面板根据自己的留白决定呈现方式;开关读取该会话最宽的留白,没有留白的会话表示没有 Chat 视图在显示它。两者用同一个纯函数决定,因此开关状态始终与面板一致。侧边层从滚动容器继承输入框区域与视口高度,停靠宽度通过 `--dsh-session-panel-gutter` 跟随留白。
面板把分栏列表的实时注册(`entriesOfSlot`,因此同 `id` 且优先级更高的注册会替换已发布的分栏)投影为 `{ id, label }` 行,只在台账版本或语言版本变化时重新计算。它在各分栏自己的标题和正文容器里用 `renderSlot(..., { only: id })` 渲染内容;CSS `:has()` 规则隐藏正文出口为空的分栏,也包括行出口为空的共享分栏。
@@ -60,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) | 标题栏开关及其角标 |
@@ -74,7 +76,8 @@ kind: "package-reference"
## 进一步探索
- [Web Client Slots](../../../docs/subsystems/slots.zh.md)——分栏依赖的 list、keyed 与 owner props 语义。
- [`dsh-client-ui-conversation`](../ui-conversation/README.zh.md)——会话标题栏工具区、面板落位与主对话区几何信息。
- [`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`。
-----
@@ -97,6 +100,8 @@ kind: "package-reference"
- **笔记本宽度下使用浮层而非停靠**——在默认正文宽度下,对话区宽度需约 1608px 以上才能停靠;更窄时使用浮层。通过把正文列移开来停靠属于另一项布局决策。
- **没有运行环境行**——客户端没有区分本机、SSH 主机或沙箱模式的会话级信息,因此「环境」分栏只显示工作目录。
- **不能自定义分栏**——所有有内容的分栏都会显示;面板不提供隐藏或重新排序分栏的功能。
- **不能从其他视图切回 Chat**——`dsh-client-ui-conversation` 没有向插件开放视图选择,因此轨迹视图中的开关无法替用户切换到 Chat 视图。
- **浮层会出现在其会话的每个 Chat 视图中**——每个 Chat 视图实例(主正文区或嵌入的)都会渲染侧边层,因此同一会话同时显示在主正文区和嵌入的对话中时,两处都会显示浮层。
<a id="dev-note"></a>
### 开发备注
@@ -43,6 +43,7 @@
"@deepseek-ai/dsh-client-locale": "workspace:*",
"@deepseek-ai/dsh-client-store": "workspace:*",
"@deepseek-ai/dsh-client-test-runtime": "workspace:*",
"@deepseek-ai/dsh-client-ui-chat": "workspace:*",
"@deepseek-ai/dsh-client-ui-context-menu": "workspace:*",
"@deepseek-ai/dsh-client-ui-conversation": "workspace:*",
"@deepseek-ai/dsh-client-ui-primitives": "workspace:*",
@@ -73,6 +74,7 @@
"@deepseek-ai/dsh-api-remotes",
"@deepseek-ai/dsh-client-connection",
"@deepseek-ai/dsh-client-locale",
"@deepseek-ai/dsh-client-ui-chat",
"@deepseek-ai/dsh-client-ui-context-menu",
"@deepseek-ai/dsh-client-ui-conversation",
"@deepseek-ai/dsh-client-ui-primitives"
@@ -1,17 +1,16 @@
/* The panel floats over the main Conversation body (position: relative),
which defines the transcript axis --dsh-chat-content-width and publishes
the composer stack height --dsh-composer-height. */
/* 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
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. */
.panel {
position: absolute;
top: 12px;
right: 16px;
/* Above the turn rail (7), level with the back-to-bottom control (8), and
below the composer seat (9); the docked width keeps 48px clear of the
transcript column and its width handle. */
z-index: 8;
box-sizing: border-box;
width: clamp(280px, calc((100% - var(--dsh-chat-content-width)) / 2 - 64px), 340px);
max-height: calc(100% - 24px);
/* 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);
max-height: calc(var(--dsh-conversation-viewport-height, 100dvh) - 24px);
overflow-y: auto;
overscroll-behavior: contain;
padding: 6px 8px;
@@ -21,6 +20,7 @@
color: var(--dsw-alias-label-primary);
background: var(--dsw-alias-bg-layer-1);
box-shadow: var(--dsw-elevation-panel);
pointer-events: auto;
animation: dsh-session-panel-enter 120ms ease-out;
}
@@ -28,9 +28,8 @@
the composer stack, whose card it would otherwise cover. */
.panel[data-session-panel='overlay'] {
right: 12px;
z-index: 10;
width: min(340px, calc(100% - 24px));
max-height: calc(100% - var(--dsh-composer-height, 152px) - 24px);
max-height: calc(var(--dsh-conversation-viewport-height, 100dvh) - var(--dsh-composer-height, 152px) - 24px);
box-shadow: var(--dsw-elevation-prominent);
}
@@ -1,9 +1,11 @@
/** Floating Session panel: section titles drawn from the section roster, bodies from the section slot. */
import { useCallback, useEffect, useMemo, useRef, type FocusEvent, type ReactNode } from 'react'
/** 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,
} from 'react'
import { isBehindModal, observeComposition } from '@deepseek-ai/dsh-client-ui-primitives'
import { panelElementId, toggleElementId } from './element-ids.ts'
import type { SessionPanelProps, SessionPanelSectionOwnerProps } from './slots.ts'
import { fitsLayout, presentationOf } from './visibility.ts'
import { fitsGutter, presentationOf } from './visibility.ts'
import css from './SessionPanel.module.css'
/**
@@ -73,17 +75,33 @@ 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.
* @param props - Session values, the main body layout, shared visibility, sections, and copy.
* 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.
* @returns the panel, or null while it is hidden.
*/
export function SessionPanel({
sessionId, useLayout, useVisibility, useSections, closeOverlay, renderSlot, t,
sessionId, endGutter, useVisibility, useSections, measure, closeOverlay, renderSlot, t,
}: SessionPanelProps): ReactNode {
const fits = useLayout(fitsLayout)
useGutterReport(measure, sessionId, endGutter)
const fits = fitsGutter(endGutter)
const presentation = useVisibility(visibility => presentationOf(fits, visibility, sessionId))
const sections = useSections(entries => entries)
const panel = useRef<HTMLElement>(null)
@@ -99,6 +117,7 @@ export function SessionPanel({
<aside
id={panelElementId(sessionId)}
className={css.panel}
style={{ '--dsh-session-panel-gutter': `${endGutter}px` } as CSSProperties}
aria-label={t('panel.name')}
ref={panel}
onFocus={focus.onFocus}
@@ -20,6 +20,16 @@
color: var(--dsw-alias-label-primary);
background: var(--dsw-alias-interactive-bg-active);
}
.trigger[aria-disabled='true']:hover:not(:disabled) {
background: transparent;
}
}
/* No Chat View shows the Session: the toggle stays focusable for its tooltip. */
.trigger[aria-disabled='true'] {
cursor: default;
opacity: 0.4;
}
/* The name reaches assistive technology; the tooltip carries it visually. */
@@ -3,30 +3,37 @@ import type { ReactNode } from 'react'
import { Button, IconFlatListOutlineRegular, Tooltip } from '@deepseek-ai/dsh-client-ui-primitives'
import { panelElementId, toggleElementId } from './element-ids.ts'
import type { SessionPanelToggleProps } from './slots.ts'
import { fitsLayout, presentationOf } from './visibility.ts'
import { fitsGutter, presentationOf } from './visibility.ts'
import css from './SessionPanelToggle.module.css'
/**
* Render the toggle. Its accessible name is the panel name followed by the
* text of any indicator; the expanded state says whether the panel shows.
* @param props - Session values, the main body layout, shared visibility, the toggle action, and copy.
* While no Chat View shows the Session, as in the trajectory View, the panel
* has no place to show: the toggle is unavailable and its tooltip says so.
* @param props - Session values, the Chat View gutters, shared visibility, the toggle action, and copy.
* @returns the header entry.
*/
export function SessionPanelToggle({
sessionId, useLayout, useVisibility, toggle, renderSlot, t,
sessionId, useGutters, useVisibility, toggle, renderSlot, t,
}: SessionPanelToggleProps): ReactNode {
const fits = useLayout(fitsLayout)
const open = useVisibility(visibility => presentationOf(fits, visibility, sessionId) !== 'hidden')
const gutter = useGutters(gutters => gutters.get(sessionId))
const fits = gutter !== undefined && fitsGutter(gutter)
const shown = useVisibility(visibility => presentationOf(fits, visibility, sessionId) !== 'hidden')
const available = gutter !== undefined
const open = available && shown
const label = available ? t(open ? 'toggle.hide' : 'toggle.show') : t('toggle.unavailable')
return (
<Tooltip label={t(open ? 'toggle.hide' : 'toggle.show')} side="bottom">
<Tooltip label={label} side="bottom">
<Button
size="sm"
id={toggleElementId(sessionId)}
className={css.trigger}
aria-expanded={open}
aria-controls={open ? panelElementId(sessionId) : undefined}
aria-disabled={available ? undefined : true}
data-session-panel-toggle=""
onClick={() => { toggle(sessionId, fits) }}
onClick={() => { toggle(sessionId) }}
>
<IconFlatListOutlineRegular size={16} />
<span className={css.name}>{t('panel.name')}</span>
@@ -1,13 +1,13 @@
/**
* Session panel plugin, browser half: a Session header toggle and a floating
* panel over the main Conversation body. The panel draws the titles of the
* sections other plugins register and ships the Environment section with the
* project directory row.
* 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
* folder row.
*/
import type { Context as ClientContext } from '@deepseek-ai/cordis'
import type { ObservableSnapshot } from '@deepseek-ai/dsh-client-store'
import type { SessionId } from '@deepseek-ai/dsh-session/types'
import type {} from '@deepseek-ai/dsh-client-ui-conversation/client'
import type {} from '@deepseek-ai/dsh-client-ui-chat/client'
import type { RemoteHostFacts } from '@deepseek-ai/dsh-api-remotes/client'
import type {} from '@deepseek-ai/dsh-client-connection/client'
import type {} from '@deepseek-ai/dsh-client-locale/client'
@@ -29,13 +29,13 @@ declare module '@deepseek-ai/dsh-client-ui-slots' {
}
export type {
EnvironmentSectionProps, ProjectRowInjected, ProjectRowProps, SessionPanelInjected,
EnvironmentSectionProps, ProjectRowInjected, ProjectRowProps, SessionPanelGutters, SessionPanelInjected,
SessionPanelPresentation, SessionPanelProps, SessionPanelSectionEntry, SessionPanelSectionOwnerProps,
SessionPanelToggleInjected, SessionPanelToggleProps, SessionPanelVisibility,
} from './slots.ts'
/** Required services: the slot registry, dictionaries, Conversation layout, and the Host facts of the Remote carrier. */
export const inject = ['slots', 'locale', 'uiConversation', 'remote']
/** Required services: the slot registry, dictionaries, and the Host facts of the Remote carrier. */
export const inject = ['slots', 'locale', 'remote']
/**
* Client plugin body: register the dictionaries, the header toggle, the panel,
@@ -45,8 +45,8 @@ export const inject = ['slots', 'locale', 'uiConversation', 'remote']
export function apply(ctx: ClientContext): void {
ctx.effect(() => ctx.locale.register(NS, { zh, en, ja, es, fr, de, ru, pt }), 'ui-session-panel: dictionaries')
const t = ctx.locale.bind(NS)
const state = new SessionPanelState(sessionId => ctx.uiConversation.layouts.source(sessionId))
ctx.effect(() => () => { state.dispose() }, 'ui-session-panel: overlay layout')
const state = new SessionPanelState()
ctx.effect(() => () => { state.dispose() }, 'ui-session-panel: overlay gutter')
const sections = sectionSource(ctx)
const host: ObservableSnapshot<RemoteHostFacts> = {
getSnapshot: () => ctx.remote.$host,
@@ -62,21 +62,22 @@ export function apply(ctx: ClientContext): void {
children: {
'conversation.session.panel.indicator': { kind: 'list', scope: 'session', inline: true },
},
inject: (sessionId: SessionId): SessionPanelToggleInjected => ({
hooks: { visibility: state.visibility, layout: ctx.uiConversation.layouts.source(sessionId) },
toggle: (sessionId, fits) => { state.toggle(sessionId, fits) },
inject: (): SessionPanelToggleInjected => ({
hooks: { visibility: state.visibility, gutters: state.gutters },
toggle: (sessionId) => { state.toggle(sessionId) },
}),
}, SessionPanelToggle))
ctx.slots.inject('conversation.session.panel', () => ctx.slots.register({
name: 'conversation.session.panel',
ctx.slots.inject('conversation.chat.aside', () => ctx.slots.register({
name: 'conversation.chat.aside',
locale: NS,
children: {
'conversation.session.panel.section': { kind: 'list', scope: 'session' },
'conversation.session.panel.section.actions': { kind: 'keyed', scope: 'session' },
},
inject: (sessionId: SessionId): SessionPanelInjected => ({
hooks: { visibility: state.visibility, layout: ctx.uiConversation.layouts.source(sessionId), sections },
inject: (): SessionPanelInjected => ({
hooks: { visibility: state.visibility, sections },
measure: (sessionId, instance, endGutter) => { state.measure(sessionId, instance, endGutter) },
closeOverlay: (sessionId) => { state.closeOverlay(sessionId) },
}),
}, SessionPanel))
@@ -8,6 +8,7 @@ export const zh = {
'panel.name': '会话面板',
'toggle.show': '显示会话面板',
'toggle.hide': '隐藏会话面板',
'toggle.unavailable': '切换到「对话」视图后可显示会话面板',
'section.environment': '环境',
'project.label': '工作目录',
'project.actions': '工作目录操作',
@@ -21,6 +22,7 @@ export const en: Record<SessionPanelKey, string> = {
'panel.name': 'Session panel',
'toggle.show': 'Show session panel',
'toggle.hide': 'Hide session panel',
'toggle.unavailable': 'Switch to the Chat view to show the session panel',
'section.environment': 'Environment',
'project.label': 'Working folder',
'project.actions': 'Working folder actions',
@@ -31,6 +33,7 @@ export const ja = {
'panel.name': 'セッションパネル',
'toggle.show': 'セッションパネルを表示',
'toggle.hide': 'セッションパネルを非表示',
'toggle.unavailable': '「チャット」ビューに切り替えるとセッションパネルを表示できます',
'section.environment': '環境',
'project.label': '作業フォルダー',
'project.actions': '作業フォルダーの操作',
@@ -41,6 +44,7 @@ export const es = {
'panel.name': 'Panel de la sesión',
'toggle.show': 'Mostrar el panel de la sesión',
'toggle.hide': 'Ocultar el panel de la sesión',
'toggle.unavailable': 'Cambia a la vista Chat para mostrar el panel de la sesión',
'section.environment': 'Entorno',
'project.label': 'Carpeta de trabajo',
'project.actions': 'Acciones de la carpeta de trabajo',
@@ -51,6 +55,7 @@ export const fr = {
'panel.name': 'Panneau de session',
'toggle.show': 'Afficher le panneau de session',
'toggle.hide': 'Masquer le panneau de session',
'toggle.unavailable': 'Passez à la vue Discussion pour afficher le panneau de session',
'section.environment': 'Environnement',
'project.label': 'Dossier de travail',
'project.actions': 'Actions sur le dossier de travail',
@@ -61,6 +66,7 @@ export const de = {
'panel.name': 'Sitzungsbereich',
'toggle.show': 'Sitzungsbereich anzeigen',
'toggle.hide': 'Sitzungsbereich ausblenden',
'toggle.unavailable': 'Wechseln Sie zur Ansicht „Chat“, um den Sitzungsbereich anzuzeigen',
'section.environment': 'Umgebung',
'project.label': 'Arbeitsordner',
'project.actions': 'Aktionen für den Arbeitsordner',
@@ -71,6 +77,7 @@ export const ru = {
'panel.name': 'Панель сеанса',
'toggle.show': 'Показать панель сеанса',
'toggle.hide': 'Скрыть панель сеанса',
'toggle.unavailable': 'Переключитесь на вид «Чат», чтобы показать панель сеанса',
'section.environment': 'Среда',
'project.label': 'Рабочая папка',
'project.actions': 'Действия с рабочей папкой',
@@ -81,6 +88,7 @@ export const pt = {
'panel.name': 'Painel da sessão',
'toggle.show': 'Mostrar painel da sessão',
'toggle.hide': 'Ocultar painel da sessão',
'toggle.unavailable': 'Mude para a visualização Chat para mostrar o painel da sessão',
'section.environment': 'Ambiente',
'project.label': 'Pasta de trabalho',
'project.actions': 'Ações da pasta de trabalho',
@@ -5,7 +5,8 @@ import type {
} from '@deepseek-ai/dsh-client-ui-slots'
import type { RemoteHostFacts } from '@deepseek-ai/dsh-api-remotes/client'
import type { SessionId } from '@deepseek-ai/dsh-session/types'
import type { ConversationLayout } from '@deepseek-ai/dsh-client-ui-conversation/client'
import type {} from '@deepseek-ai/dsh-client-ui-conversation/client'
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'
@@ -38,7 +39,7 @@ declare module '@deepseek-ai/dsh-client-ui-slots' {
/** How the panel currently shows. */
export type SessionPanelPresentation =
/** Beside the transcript in the body's end gutter. */
/** Beside the transcript in the Chat View's end gutter. */
| 'docked'
/** Over the transcript, opened from the toggle while the gutter is too narrow. */
| 'overlay'
@@ -67,31 +68,43 @@ export interface SessionPanelVisibility {
readonly overlay: SessionId | null
}
/**
* End gutter of each Session whose Chat View holds a panel, in CSS px; the
* widest one when several Chat Views show the Session. A Session without an
* entry shows no Chat View.
*/
export type SessionPanelGutters = ReadonlyMap<SessionId, number>
/** Business face of the header toggle. */
export interface SessionPanelToggleInjected {
/** Shared visibility and the Session's main body layout; the renderer binds them as `useVisibility` and `useLayout`. */
/** Shared visibility and the Chat View gutters; the renderer binds them as `useVisibility` and `useGutters`. */
readonly hooks: {
readonly visibility: ObservableSnapshot<SessionPanelVisibility>
readonly layout: ObservableSnapshot<ConversationLayout>
readonly gutters: ObservableSnapshot<SessionPanelGutters>
}
/**
* Show or hide the panel. With room to dock this flips the docking
* preference and closes any overlay; otherwise it opens or closes the
* Session's overlay.
* Session's overlay. No effect while no Chat View shows the Session.
* @param sessionId - Session whose header holds the toggle.
* @param fits - whether the main body's gutter can hold the docked panel now.
*/
readonly toggle: (sessionId: SessionId, fits: boolean) => void
readonly toggle: (sessionId: SessionId) => void
}
/** Business face of the panel. */
export interface SessionPanelInjected {
/** Shared visibility, the Session's main body layout, and the projected section roster. */
/** Shared visibility and the projected section roster. */
readonly hooks: {
readonly visibility: ObservableSnapshot<SessionPanelVisibility>
readonly layout: ObservableSnapshot<ConversationLayout>
readonly sections: ObservableSnapshot<readonly SessionPanelSectionEntry[]>
}
/**
* Record the end gutter of one mounted panel, or that it unmounted.
* @param sessionId - Session the panel's Chat View shows.
* @param instance - identity of the panel within the page.
* @param endGutter - the Chat View's end gutter in CSS px; null when the panel unmounts or leaves the Session.
*/
readonly measure: (sessionId: SessionId, instance: string, endGutter: number | null) => void
/**
* Close the Session's overlay.
* @param sessionId - Session whose overlay closes; another Session's overlay stays.
@@ -114,7 +127,7 @@ export type SessionPanelToggleProps =
/** Full props of the panel. */
export type SessionPanelProps =
PropsRuntime<'conversation.session.panel'>
PropsRuntime<'conversation.chat.aside'>
& PropsRenderSlots<'conversation.session.panel.section' | 'conversation.session.panel.section.actions'>
& InjectFace<SessionPanelInjected>
& PropsLocale<typeof NS>
@@ -1,8 +1,7 @@
/** Session panel visibility: the persisted docking preference, the transient overlay, and their presentation. */
/** Session panel visibility: the persisted docking preference, the transient overlay, the Chat View gutters, and their presentation. */
import { createSnapshotStore, type ObservableSnapshot } from '@deepseek-ai/dsh-client-store'
import type { SessionId } from '@deepseek-ai/dsh-session/types'
import type { ConversationLayout } from '@deepseek-ai/dsh-client-ui-conversation/client'
import type { SessionPanelPresentation, SessionPanelVisibility } from './slots.ts'
import type { SessionPanelGutters, SessionPanelPresentation, SessionPanelVisibility } from './slots.ts'
/** localStorage key of the docking preference. */
export const PINNED_STORAGE_KEY = 'dsh.sessionPanel.pinned'
@@ -14,13 +13,15 @@ export const PINNED_STORAGE_KEY = 'dsh.sessionPanel.pinned'
*/
export const DOCK_MIN_GUTTER = 344
const NO_GUTTERS: SessionPanelGutters = new Map()
/**
* Whether the main body's end gutter can hold the docked panel.
* @param layout - main body geometry of the Session.
* Whether a Chat View's end gutter can hold the docked panel.
* @param endGutter - the gutter in CSS px.
* @returns true when the panel can dock without covering the transcript.
*/
export function fitsLayout(layout: ConversationLayout): boolean {
return layout.endGutter >= DOCK_MIN_GUTTER
export function fitsGutter(endGutter: number): boolean {
return endGutter >= DOCK_MIN_GUTTER
}
/**
@@ -38,22 +39,23 @@ export function presentationOf(
}
/**
* Visibility shared by every Session's toggle and panel. Docking follows one
* Visibility shared by every Session's toggle and panel, and the end gutter
* each mounted panel reports from its Chat View. Docking follows one
* preference for all Sessions; at most one Session's overlay is open, and it
* closes once its Session's gutter can hold the docked panel or the main body
* stops showing that Session.
* closes once its Session's gutter can hold the docked panel or no Chat View
* shows that Session any longer.
*/
export class SessionPanelState {
// A stored value other than `false` keeps the default: the panel docks.
private readonly pinned = createSnapshotStore<unknown>(true, { persist: { name: PINNED_STORAGE_KEY } })
private readonly overlay = createSnapshotStore<SessionId | null>(null)
private readonly widest = createSnapshotStore<SessionPanelGutters>(NO_GUTTERS)
/** Gutter of every mounted panel, by Session and panel instance. */
private readonly reports = new Map<SessionId, Map<string, number>>()
private current: SessionPanelVisibility = { pinned: this.pinned.getSnapshot() !== false, overlay: null }
/** Stops following the open overlay's layout. */
/** Stops following the open overlay's gutter. */
private unfollow: () => void = () => {}
/** @param layoutOf - main body layout of a Session, which an open overlay follows. */
constructor(private readonly layoutOf: (sessionId: SessionId) => ObservableSnapshot<ConversationLayout>) {}
/** Combined visibility; the snapshot keeps its identity until a member changes. */
readonly visibility: ObservableSnapshot<SessionPanelVisibility> = {
getSnapshot: () => {
@@ -72,13 +74,40 @@ export class SessionPanelState {
},
}
/** The widest gutter of each Session with a mounted panel; the snapshot keeps its identity until one changes. */
readonly gutters: ObservableSnapshot<SessionPanelGutters> = this.widest
/**
* Show or hide the panel from a Session's toggle.
* @param sessionId - Session whose header holds the toggle.
* @param fits - whether the gutter can hold the docked panel now.
* Record the end gutter of one mounted panel, or that it unmounted.
* @param sessionId - Session the panel's Chat View shows.
* @param instance - identity of the panel within the page.
* @param endGutter - the gutter in CSS px, or null when the panel unmounts or leaves the Session.
*/
toggle(sessionId: SessionId, fits: boolean): void {
if (fits) {
measure(sessionId: SessionId, instance: string, endGutter: number | null): void {
const panels = this.reports.get(sessionId) ?? new Map<string, number>()
if (endGutter === null) panels.delete(instance)
else panels.set(instance, endGutter)
if (panels.size === 0) this.reports.delete(sessionId)
else this.reports.set(sessionId, panels)
const widest = panels.size === 0 ? undefined : Math.max(...panels.values())
const gutters = this.widest.getSnapshot()
if (gutters.get(sessionId) === widest) return
const next = new Map(gutters)
if (widest === undefined) next.delete(sessionId)
else next.set(sessionId, widest)
this.widest.set(next)
}
/**
* Show or hide the panel from a Session's toggle. With room to dock this
* flips the docking preference and closes any overlay; otherwise it opens
* or closes the Session's overlay. No effect while no Chat View shows the Session.
* @param sessionId - Session whose header holds the toggle.
*/
toggle(sessionId: SessionId): void {
const gutter = this.widest.getSnapshot().get(sessionId)
if (gutter === undefined) return
if (fitsGutter(gutter)) {
this.pinned.set(!this.visibility.getSnapshot().pinned)
this.setOverlay(null)
return
@@ -94,7 +123,7 @@ export class SessionPanelState {
if (this.overlay.getSnapshot() === sessionId) this.setOverlay(null)
}
/** Stop following the open overlay's layout. */
/** Stop following the open overlay's gutter. */
dispose(): void {
this.unfollow()
this.unfollow = () => {}
@@ -104,11 +133,10 @@ export class SessionPanelState {
this.dispose()
this.overlay.set(sessionId)
if (sessionId === null) return
const layout = this.layoutOf(sessionId)
const check = (): void => {
const current = layout.getSnapshot()
if (fitsLayout(current) || !current.shown) this.closeOverlay(sessionId)
const gutter = this.widest.getSnapshot().get(sessionId)
if (gutter === undefined || fitsGutter(gutter)) this.closeOverlay(sessionId)
}
this.unfollow = layout.subscribe(check)
this.unfollow = this.widest.subscribe(check)
}
}
@@ -11,7 +11,6 @@ import { createSnapshotStore } from '@deepseek-ai/dsh-client-store'
import { SlotRegistry } from '@deepseek-ai/dsh-client-ui-renderer/client'
import { stubConfigForm } from '@deepseek-ai/dsh-client-test-runtime'
import { apply as applyLocale, inject as localeInject } from '@deepseek-ai/dsh-client-locale/client'
import type { ConversationLayout } from '@deepseek-ai/dsh-client-ui-conversation/client'
import type { SessionId } from '@deepseek-ai/dsh-session/types'
import { apply, inject } from '../src/client/index.ts'
import type { ProjectRowInjected, SessionPanelInjected, SessionPanelToggleInjected } from '../src/client/slots.ts'
@@ -23,7 +22,7 @@ afterEach(() => {
vi.restoreAllMocks()
})
/** Boot the browser half over a real slot tree that declares the header utilities and the panel seat. */
/** Boot the browser half over a real slot tree that declares the header utilities and the Chat aside. */
async function bench() {
const ctx = new Context()
await ctx.plugin(SlotRegistry).await()
@@ -31,19 +30,9 @@ async function bench() {
name: 'root',
children: {
'conversation.session.header.utilities': { kind: 'list', scope: 'session' },
'conversation.session.panel': { kind: 'single', scope: 'session' },
'conversation.chat.aside': { kind: 'single', scope: 'session' },
},
} as never, () => null)
const layout = createSnapshotStore<ConversationLayout>({ endGutter: 400, shown: true })
const layoutSources: SessionId[] = []
ctx.provide('uiConversation', {
layouts: {
source: (sessionId: SessionId) => {
layoutSources.push(sessionId)
return layout
},
},
} as never)
const host = { home: '/Users/me', isLoopback: true }
ctx.provide('connection', { api: { settings: {} }, isLoopback: false } as never)
ctx.provide('remote', { $on: () => () => {}, $host: host } as never)
@@ -52,7 +41,7 @@ async function bench() {
ctx.locale.setLocale('zh')
const fiber = ctx.plugin({ inject: [...inject], apply })
await fiber.await()
return { ctx, fiber, layout, layoutSources, host }
return { ctx, fiber, host }
}
/** Inject face of one registration, called for the test Session. */
@@ -65,36 +54,40 @@ function faceOf(ctx: Context, slot: string, id: string | undefined): unknown {
describe('ui-session-panel browser half', () => {
it('declares the services it binds', () => {
expect(inject).toEqual(['slots', 'locale', 'uiConversation', 'remote'])
expect(inject).toEqual(['slots', 'locale', 'remote'])
})
it('registers the toggle first among the header utilities, the panel, 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()
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.session.panel')).toHaveLength(1)
expect(ctx.slots.entries('conversation.chat.aside')).toHaveLength(1)
const section = ctx.slots.entries('conversation.session.panel.section').find(entry => entry.options.id === 'environment')
expect(section?.options.order).toBe(0)
expect(ctx.slots.entries('conversation.session.panel.environment.row').map(entry => entry.options.id)).toEqual(['project'])
})
it('hands the toggle and the panel the shared visibility and the Session layout source', async () => {
const { ctx, layout, layoutSources } = await bench()
it('hands the toggle the gutters the panel reports, and both the shared visibility', async () => {
const { ctx, fiber } = await bench()
const toggle = faceOf(ctx, 'conversation.session.header.utilities', 'session-panel') as SessionPanelToggleInjected
const panel = faceOf(ctx, 'conversation.session.panel', undefined) as SessionPanelInjected
expect(toggle.hooks.layout).toBe(layout)
expect(panel.hooks.layout).toBe(layout)
expect(layoutSources).toEqual([SID, SID])
const panel = faceOf(ctx, 'conversation.chat.aside', undefined) as SessionPanelInjected
expect(toggle.hooks.visibility).toBe(panel.hooks.visibility)
toggle.toggle(SID, false)
panel.measure(SID, 'main', 300)
expect(toggle.hooks.gutters.getSnapshot().get(SID)).toBe(300)
toggle.toggle(SID)
expect(panel.hooks.visibility.getSnapshot()).toEqual({ pinned: true, overlay: SID })
panel.closeOverlay(SID)
expect(panel.hooks.visibility.getSnapshot().overlay).toBeNull()
toggle.toggle(SID)
// Disposing the plugin stops the open overlay from following the gutters.
await fiber.dispose()
panel.measure(SID, 'main', null)
expect(panel.hooks.visibility.getSnapshot().overlay).toBe(SID)
})
it('projects the section roster in the active locale and keeps it stable between changes', async () => {
const { ctx } = await bench()
const panel = faceOf(ctx, 'conversation.session.panel', undefined) as SessionPanelInjected
const panel = faceOf(ctx, 'conversation.chat.aside', undefined) as SessionPanelInjected
const roster = panel.hooks.sections
const first = roster.getSnapshot()
expect(first).toEqual([{ id: 'environment', label: '环境' }])
@@ -132,7 +125,7 @@ describe('ui-session-panel browser half', () => {
const { ctx, fiber } = await bench()
await fiber.dispose()
expect(ctx.slots.entries('conversation.session.header.utilities')).toHaveLength(0)
expect(ctx.slots.entries('conversation.session.panel')).toHaveLength(0)
expect(ctx.slots.entries('conversation.chat.aside')).toHaveLength(0)
expect(ctx.slots.entries('conversation.session.panel.section')).toHaveLength(0)
})
})
@@ -4,14 +4,13 @@ import { cleanup, fireEvent, render, screen } from '@testing-library/react'
import { useRef, type ReactNode } from 'react'
import { useModalLayer } from '@deepseek-ai/dsh-client-ui-primitives'
import { contextMenuHook, makeTranslate } from '@deepseek-ai/dsh-client-test-runtime'
import type { ConversationLayout } from '@deepseek-ai/dsh-client-ui-conversation/client'
import type { SessionId } from '@deepseek-ai/dsh-session/types'
import { EnvironmentSection } from '../src/client/EnvironmentSection.tsx'
import { ProjectRow } from '../src/client/ProjectRow.tsx'
import { SessionPanel } from '../src/client/SessionPanel.tsx'
import { SessionPanelToggle } from '../src/client/SessionPanelToggle.tsx'
import type {
EnvironmentSectionProps, ProjectRowProps, SessionPanelProps, SessionPanelSectionEntry,
EnvironmentSectionProps, ProjectRowProps, SessionPanelGutters, SessionPanelProps, SessionPanelSectionEntry,
SessionPanelSectionOwnerProps, SessionPanelToggleProps, SessionPanelVisibility,
} from '../src/client/slots.ts'
import { DOCK_MIN_GUTTER } from '../src/client/visibility.ts'
@@ -19,8 +18,8 @@ import { en, zh } from '../src/client/locales.ts'
const SID = 'session-1' as SessionId
const t = makeTranslate(zh) as SessionPanelToggleProps['t']
const WIDE: ConversationLayout = { endGutter: DOCK_MIN_GUTTER, shown: true }
const NARROW: ConversationLayout = { endGutter: DOCK_MIN_GUTTER - 1, shown: true }
const WIDE = DOCK_MIN_GUTTER
const NARROW = DOCK_MIN_GUTTER - 1
const DOCKED: SessionPanelVisibility = { pinned: true, overlay: null }
function selectorOf<T>(value: T) {
@@ -42,10 +41,11 @@ afterEach(() => {
})
describe('SessionPanelToggle', () => {
function toggleProps(layout: ConversationLayout, visibility: SessionPanelVisibility, toggle = vi.fn()) {
function toggleProps(gutter: number | undefined, visibility: SessionPanelVisibility, toggle = vi.fn()) {
const renderSlot = vi.fn(() => <span>需要处理</span>)
const gutters: SessionPanelGutters = new Map(gutter === undefined ? [] : [[SID, gutter]])
const props = {
sessionId: SID, useLayout: selectorOf(layout), useVisibility: selectorOf(visibility), toggle, renderSlot, t,
sessionId: SID, useGutters: selectorOf(gutters), useVisibility: selectorOf(visibility), toggle, renderSlot, t,
} as SessionPanelToggleProps
return { props, toggle, renderSlot }
}
@@ -63,7 +63,7 @@ describe('SessionPanelToggle', () => {
const wide = toggleProps(WIDE, DOCKED)
render(<SessionPanelToggle {...wide.props} />)
fireEvent.click(screen.getByRole('button'))
expect(wide.toggle).toHaveBeenCalledWith(SID, true)
expect(wide.toggle).toHaveBeenCalledWith(SID)
cleanup()
const narrow = toggleProps(NARROW, DOCKED)
render(<SessionPanelToggle {...narrow.props} />)
@@ -71,7 +71,7 @@ describe('SessionPanelToggle', () => {
expect(button.getAttribute('aria-expanded')).toBe('false')
expect(button.hasAttribute('aria-controls')).toBe(false)
fireEvent.click(button)
expect(narrow.toggle).toHaveBeenCalledWith(SID, false)
expect(narrow.toggle).toHaveBeenCalledWith(SID)
})
it('reports an open overlay as expanded', () => {
@@ -79,6 +79,18 @@ describe('SessionPanelToggle', () => {
render(<SessionPanelToggle {...props} />)
expect(screen.getByRole('button').getAttribute('aria-expanded')).toBe('true')
})
it('is unavailable and says why while no Chat View shows the Session', () => {
const { props } = toggleProps(undefined, { pinned: true, overlay: SID })
render(<SessionPanelToggle {...props} />)
const button = screen.getByRole('button')
expect(button.getAttribute('aria-disabled')).toBe('true')
expect(button.getAttribute('aria-expanded')).toBe('false')
expect(button.hasAttribute('aria-controls')).toBe(false)
fireEvent.keyDown(document.body, { key: 'Tab' })
fireEvent.focus(button)
expect(screen.getByRole('tooltip', { hidden: true }).textContent).toBe('切换到「对话」视图后可显示会话面板')
})
})
describe('SessionPanel', () => {
@@ -87,7 +99,7 @@ describe('SessionPanel', () => {
{ id: 'change-requests', label: '变更请求' },
]
function panelProps(layout: ConversationLayout, visibility: SessionPanelVisibility, closeOverlay = vi.fn()) {
function panelProps(endGutter: number, visibility: SessionPanelVisibility, closeOverlay = vi.fn(), measure = vi.fn()) {
const owners: SessionPanelSectionOwnerProps[] = []
const renderSlot = ((key: string, owner: object, opts?: { only?: string; entryKey?: string }): ReactNode => {
if (key === 'conversation.session.panel.section.actions') {
@@ -98,16 +110,33 @@ describe('SessionPanel', () => {
}) as SessionPanelProps['renderSlot']
const props = {
sessionId: SID,
useLayout: selectorOf(layout),
endGutter,
useVisibility: selectorOf(visibility),
useSections: selectorOf(SECTIONS),
measure,
closeOverlay,
renderSlot,
t,
} as SessionPanelProps
return { props, owners, closeOverlay }
return { props, owners, closeOverlay, measure }
}
it('reports its Chat View gutter while mounted, replacing it on change and withdrawing it on a Session change and unmount', () => {
const measure = vi.fn()
const view = render(<SessionPanel {...panelProps(420, DOCKED, vi.fn(), measure).props} />)
expect(measure.mock.calls).toEqual([[SID, expect.any(String), 420]])
const instance = measure.mock.calls[0]?.[1] as string
expect(screen.getByRole('complementary').style.getPropertyValue('--dsh-session-panel-gutter')).toBe('420px')
view.rerender(<SessionPanel {...panelProps(400, DOCKED, vi.fn(), measure).props} />)
expect(measure.mock.calls.at(-1)).toEqual([SID, instance, 400])
expect(measure.mock.calls.some(call => call[2] === null)).toBe(false)
const other = 'session-2' as SessionId
view.rerender(<SessionPanel {...{ ...panelProps(400, DOCKED, vi.fn(), measure).props, sessionId: other }} />)
expect(measure.mock.calls.slice(-2)).toEqual([[SID, instance, null], [other, instance, 400]])
view.unmount()
expect(measure.mock.calls.at(-1)).toEqual([other, instance, null])
})
it('renders nothing while hidden', () => {
const { props } = panelProps(WIDE, { pinned: false, overlay: null })
const view = render(<SessionPanel {...props} />)
@@ -1,42 +1,31 @@
// @vitest-environment jsdom
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
import { createSnapshotStore, type SnapshotStore } from '@deepseek-ai/dsh-client-store'
import type { ConversationLayout } from '@deepseek-ai/dsh-client-ui-conversation/client'
import type { SessionId } from '@deepseek-ai/dsh-session/types'
import {
DOCK_MIN_GUTTER, PINNED_STORAGE_KEY, SessionPanelState, fitsLayout, presentationOf,
DOCK_MIN_GUTTER, PINNED_STORAGE_KEY, SessionPanelState, fitsGutter, presentationOf,
} from '../src/client/visibility.ts'
const A = 'session-a' as SessionId
const B = 'session-b' as SessionId
const NARROW = 200
const WIDE = DOCK_MIN_GUTTER
/** Main body layout of each Session, as `ctx.uiConversation.layouts` publishes it. */
let layouts: Map<SessionId, SnapshotStore<ConversationLayout>>
function layoutOf(sessionId: SessionId): SnapshotStore<ConversationLayout> {
let store = layouts.get(sessionId)
if (store === undefined) {
store = createSnapshotStore<ConversationLayout>({ endGutter: 200, shown: true })
layouts.set(sessionId, store)
}
return store
}
/** A state whose Chat Views show `A` and `B` with narrow gutters. */
function newState(): SessionPanelState {
return new SessionPanelState(layoutOf)
const state = new SessionPanelState()
state.measure(A, 'main', NARROW)
state.measure(B, 'main', NARROW)
return state
}
beforeEach(() => {
localStorage.clear()
layouts = new Map()
})
beforeEach(() => { localStorage.clear() })
afterEach(() => { localStorage.clear() })
describe('fitsLayout', () => {
describe('fitsGutter', () => {
it('docks only from the minimum gutter up', () => {
expect(fitsLayout({ endGutter: DOCK_MIN_GUTTER - 1, shown: true })).toBe(false)
expect(fitsLayout({ endGutter: DOCK_MIN_GUTTER, shown: true })).toBe(true)
expect(fitsLayout({ endGutter: 0, shown: false })).toBe(false)
expect(fitsGutter(DOCK_MIN_GUTTER - 1)).toBe(false)
expect(fitsGutter(DOCK_MIN_GUTTER)).toBe(true)
expect(fitsGutter(0)).toBe(false)
})
})
@@ -56,7 +45,41 @@ describe('presentationOf', () => {
})
})
describe('SessionPanelState', () => {
describe('SessionPanelState gutters', () => {
it('keeps the widest gutter of each Session and drops a Session once its last panel unmounts', () => {
const state = new SessionPanelState()
const empty = state.gutters.getSnapshot()
expect(empty.size).toBe(0)
state.measure(A, 'main', 420)
state.measure(A, 'embedded', 16)
expect(state.gutters.getSnapshot().get(A)).toBe(420)
state.measure(A, 'main', null)
expect(state.gutters.getSnapshot().get(A)).toBe(16)
state.measure(A, 'embedded', null)
expect(state.gutters.getSnapshot().has(A)).toBe(false)
// A withdrawal for a panel that never reported changes nothing.
const before = state.gutters.getSnapshot()
state.measure(B, 'main', null)
expect(state.gutters.getSnapshot()).toBe(before)
})
it('keeps the snapshot identity until a widest gutter changes', () => {
const state = new SessionPanelState()
state.measure(A, 'main', 420)
const first = state.gutters.getSnapshot()
let calls = 0
const off = state.gutters.subscribe(() => { calls += 1 })
state.measure(A, 'embedded', 16)
state.measure(A, 'main', 420)
expect(state.gutters.getSnapshot()).toBe(first)
expect(calls).toBe(0)
state.measure(A, 'main', 400)
expect(calls).toBe(1)
off()
})
})
describe('SessionPanelState visibility', () => {
it('docks by default and keeps the snapshot identity until a member changes', () => {
const state = newState()
const first = state.visibility.getSnapshot()
@@ -66,30 +89,39 @@ describe('SessionPanelState', () => {
it('flips and persists the docking preference when the gutter has room, closing any overlay', () => {
const state = newState()
state.toggle(A, false)
state.toggle(A)
expect(state.visibility.getSnapshot().overlay).toBe(A)
state.toggle(A, true)
state.measure(A, 'main', WIDE)
expect(state.visibility.getSnapshot().overlay).toBeNull()
state.toggle(A)
expect(state.visibility.getSnapshot()).toEqual({ pinned: false, overlay: null })
expect(localStorage.getItem(PINNED_STORAGE_KEY)).toBe('false')
expect(newState().visibility.getSnapshot().pinned).toBe(false)
state.toggle(A, true)
expect(new SessionPanelState().visibility.getSnapshot().pinned).toBe(false)
state.toggle(A)
expect(state.visibility.getSnapshot().pinned).toBe(true)
})
it('opens and closes one Session overlay without touching the docking preference', () => {
const state = newState()
state.toggle(A, false)
state.toggle(B, false)
state.toggle(A)
state.toggle(B)
expect(state.visibility.getSnapshot()).toEqual({ pinned: true, overlay: B })
state.closeOverlay(A)
expect(state.visibility.getSnapshot().overlay).toBe(B)
state.toggle(B, false)
state.toggle(B)
expect(state.visibility.getSnapshot().overlay).toBeNull()
state.toggle(A, false)
state.toggle(A)
state.closeOverlay(A)
expect(state.visibility.getSnapshot().overlay).toBeNull()
})
it('ignores the toggle of a Session that no Chat View shows', () => {
const state = new SessionPanelState()
const before = state.visibility.getSnapshot()
state.toggle(A)
expect(state.visibility.getSnapshot()).toBe(before)
})
it('treats a stored value other than false as the default', () => {
localStorage.setItem(PINNED_STORAGE_KEY, '"yes"')
expect(newState().visibility.getSnapshot().pinned).toBe(true)
@@ -99,44 +131,45 @@ describe('SessionPanelState', () => {
const state = newState()
let calls = 0
const off = state.visibility.subscribe(() => { calls += 1 })
state.toggle(A, false)
state.toggle(A, true)
state.toggle(A)
state.measure(A, 'main', WIDE)
state.toggle(A)
const seen = calls
expect(seen).toBeGreaterThanOrEqual(2)
off()
state.toggle(A, true)
state.toggle(A)
expect(calls).toBe(seen)
})
it('closes an overlay once its gutter can dock the panel, without reopening it when the gutter narrows again', () => {
const state = newState()
state.toggle(A, false)
layoutOf(A).set({ endGutter: 300, shown: true })
state.toggle(A)
state.measure(A, 'main', 300)
expect(state.visibility.getSnapshot().overlay).toBe(A)
layoutOf(A).set({ endGutter: DOCK_MIN_GUTTER, shown: true })
state.measure(A, 'main', WIDE)
expect(state.visibility.getSnapshot()).toEqual({ pinned: true, overlay: null })
layoutOf(A).set({ endGutter: 200, shown: true })
state.measure(A, 'main', NARROW)
expect(presentationOf(false, state.visibility.getSnapshot(), A)).toBe('hidden')
})
it('closes an overlay once the main body stops showing its Session, so returning to it shows no overlay', () => {
it('closes an overlay once no Chat View shows its Session, so returning to it shows no overlay', () => {
const state = newState()
state.toggle(A, false)
layoutOf(A).set({ endGutter: 0, shown: false })
state.toggle(A)
state.measure(A, 'main', null)
expect(state.visibility.getSnapshot().overlay).toBeNull()
layoutOf(A).set({ endGutter: 200, shown: true })
state.measure(A, 'main', NARROW)
expect(presentationOf(false, state.visibility.getSnapshot(), A)).toBe('hidden')
})
it('follows only the open overlay, and nothing after dispose', () => {
const state = newState()
state.toggle(A, false)
state.toggle(B, false)
// A's layout no longer matters once B holds the overlay.
layoutOf(A).set({ endGutter: 0, shown: false })
state.toggle(A)
state.toggle(B)
// A's Chat View no longer matters once B holds the overlay.
state.measure(A, 'main', null)
expect(state.visibility.getSnapshot().overlay).toBe(B)
state.dispose()
layoutOf(B).set({ endGutter: 0, shown: false })
state.measure(B, 'main', null)
expect(state.visibility.getSnapshot().overlay).toBe(B)
})
})
@@ -29,6 +29,9 @@
{
"path": "../store"
},
{
"path": "../ui-chat/tsconfig.client.json"
},
{
"path": "../ui-context-menu"
},
@@ -216,6 +216,49 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [
example: 'return {\n inject: [\'slots\'],\n apply(ctx) {\n ctx.slots.inject(\'conversation.approval.detail\', () => ctx.slots.register(\n { name: \'conversation.approval.detail\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}',
source: 'packages/client/ui-approval/src/client/contract/slots.ts:47',
},
{
key: 'conversation.chat.aside',
kind: 'single',
scope: 'session',
summary: 'One Session-level occupant beside the transcript, such as a summary panel.',
doc: 'One Session-level occupant beside the transcript, such as a summary\npanel. Every Chat View occurrence renders it in a zero-height layer at\nthe top of the Chat frame, which stays in place while the transcript\nscrolls and inherits the shared scrollport\'s composer and viewport\nheights. The layer passes pointer events through; the occupant\npositions itself in it, enables its own pointer events, and keeps\nwithin `endGutter` to stay clear of the transcript column.',
registerOptions: [],
ownerProps: [
'/** Geometry the Chat View gives its aside occupant. */\nexport interface ChatAsideOwnerProps {\n /**\n * Inline space in CSS px between the transcript column\'s end edge and the\n * Chat frame\'s end edge, measured again whenever the frame or the column\n * resizes; zero before the first measurement.\n */\n readonly endGutter: number\n}',
],
ownerPropsReferences: [],
standardProps: [
'useRemoteAccess: (action: RemoteEndpoint) => boolean',
'useResource: UseResource',
'useContextMenu: UseContextMenu',
'useWorkspaces: SnapshotSelectorHook<WorkspaceSnapshot>',
'usePanelInfo: UsePanelInfo',
'useSessions: UseSessions',
'useSessionStatus: UseSessionStatus',
'useSessionRetainInfo: UseSessionRetainInfo',
'useSessionAccess: (sessionId: SessionId, action: RemoteEndpoint) => boolean',
'useWorkspaceAccess: (workspaceId: WorkspaceId, action: RemoteEndpoint) => boolean',
'useChat: UseChat',
'useConversation: UseConversation',
'useInput: SnapshotSelectorHook<InputState>',
'inputActions: InputActions',
'useSession: SessionSnapshotSelector',
'sessionId: SessionId',
'useProjection: UseProjection',
'useAccess: (action: RemoteEndpoint) => boolean',
'useTrajectory: UseTrajectory',
],
keyDomain: '',
hookContext: '',
slotInject: '',
declaredBy: 'an entry in \'conversation.view\' (client-ui-chat), so it exists while that entry is mounted',
occupants: [
'client-ui-session-panel SessionPanel',
],
replaceRisk: 'shadows-shipped-ui',
example: 'return {\n inject: [\'slots\'],\n apply(ctx) {\n ctx.slots.inject(\'conversation.chat.aside\', () => ctx.slots.register(\n { name: \'conversation.chat.aside\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}',
source: 'packages/client/ui-chat/src/client/contract/slots.ts:450',
},
{
key: 'conversation.chat.assistant-actions',
kind: 'list',
@@ -278,7 +321,7 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [
],
replaceRisk: 'none',
example: 'return {\n inject: [\'slots\'],\n apply(ctx) {\n ctx.slots.inject(\'conversation.chat.assistant-actions\', () => ctx.slots.register(\n { name: \'conversation.chat.assistant-actions\', id: \'my-entry\', order: 100, label: \'My entry\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}',
source: 'packages/client/ui-chat/src/client/contract/slots.ts:495',
source: 'packages/client/ui-chat/src/client/contract/slots.ts:515',
},
{
key: 'conversation.chat.commandview',
@@ -332,7 +375,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.chat.commandview\', () => ctx.slots.register(\n { name: \'conversation.chat.commandview\', key: \'<one key the owner dispatches>\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}',
source: 'packages/client/ui-chat/src/client/contract/slots.ts:477',
source: 'packages/client/ui-chat/src/client/contract/slots.ts:497',
},
{
key: 'conversation.chat.flow',
@@ -379,7 +422,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.chat.flow\', () => ctx.slots.register(\n { name: \'conversation.chat.flow\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}',
source: 'packages/client/ui-chat/src/client/contract/slots.ts:433',
source: 'packages/client/ui-chat/src/client/contract/slots.ts:453',
},
{
key: 'conversation.chat.markdown.fence',
@@ -445,7 +488,7 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [
],
replaceRisk: 'wraps-owner-content',
example: 'return {\n inject: [\'slots\'],\n apply(ctx) {\n ctx.slots.inject(\'conversation.chat.markdown.fence\', () => ctx.slots.register(\n { name: \'conversation.chat.markdown.fence\', id: \'my-layer\', order: 100 },\n ({ children }) => React.createElement(\'div\', null, children),\n ))\n },\n}',
source: 'packages/client/ui-chat/src/client/contract/slots.ts:430',
source: 'packages/client/ui-chat/src/client/contract/slots.ts:440',
},
{
key: 'conversation.chat.message.images',
@@ -492,7 +535,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.chat.message.images\', () => ctx.slots.register(\n { name: \'conversation.chat.message.images\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}',
source: 'packages/client/ui-chat/src/client/contract/slots.ts:469',
source: 'packages/client/ui-chat/src/client/contract/slots.ts:489',
},
{
key: 'conversation.chat.node',
@@ -564,7 +607,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.chat.node\', () => ctx.slots.register(\n { name: \'conversation.chat.node\', key: \'<one key the owner dispatches>\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}',
source: 'packages/client/ui-chat/src/client/contract/slots.ts:445',
source: 'packages/client/ui-chat/src/client/contract/slots.ts:465',
},
{
key: 'conversation.chat.reasoning.body',
@@ -608,7 +651,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.chat.reasoning.body\', () => ctx.slots.register(\n { name: \'conversation.chat.reasoning.body\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}',
source: 'packages/client/ui-chat/src/client/contract/slots.ts:483',
source: 'packages/client/ui-chat/src/client/contract/slots.ts:503',
},
{
key: 'conversation.chat.text-interaction',
@@ -660,7 +703,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.chat.text-interaction\', () => ctx.slots.register(\n { name: \'conversation.chat.text-interaction\', key: \'<one key the owner dispatches>\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}',
source: 'packages/client/ui-chat/src/client/contract/slots.ts:428',
source: 'packages/client/ui-chat/src/client/contract/slots.ts:438',
},
{
key: 'conversation.chat.turnTail',
@@ -727,7 +770,7 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [
],
replaceRisk: 'none',
example: 'return {\n inject: [\'slots\'],\n apply(ctx) {\n ctx.slots.inject(\'conversation.chat.turnTail\', () => ctx.slots.register(\n { name: \'conversation.chat.turnTail\', id: \'my-entry\', order: 100, label: \'My entry\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}',
source: 'packages/client/ui-chat/src/client/contract/slots.ts:489',
source: 'packages/client/ui-chat/src/client/contract/slots.ts:509',
},
{
key: 'conversation.chat.user.before',
@@ -777,7 +820,7 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [
],
replaceRisk: 'none',
example: 'return {\n inject: [\'slots\'],\n apply(ctx) {\n ctx.slots.inject(\'conversation.chat.user.before\', () => ctx.slots.register(\n { name: \'conversation.chat.user.before\', select: owner => null },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}',
source: 'packages/client/ui-chat/src/client/contract/slots.ts:459',
source: 'packages/client/ui-chat/src/client/contract/slots.ts:479',
},
{
key: 'conversation.chat.user.images',
@@ -824,7 +867,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.chat.user.images\', () => ctx.slots.register(\n { name: \'conversation.chat.user.images\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}',
source: 'packages/client/ui-chat/src/client/contract/slots.ts:471',
source: 'packages/client/ui-chat/src/client/contract/slots.ts:491',
},
{
key: 'conversation.composer',
@@ -881,7 +924,7 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [
],
replaceRisk: 'none',
example: 'return {\n inject: [\'slots\'],\n apply(ctx) {\n ctx.slots.inject(\'conversation.composer\', () => ctx.slots.register(\n { name: \'conversation.composer\', select: owner => null },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}',
source: 'packages/client/ui-conversation/src/client/contract/slots.ts:297',
source: 'packages/client/ui-conversation/src/client/contract/slots.ts:290',
},
{
key: 'conversation.composer.bar',
@@ -925,7 +968,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.composer.bar\', () => ctx.slots.register(\n { name: \'conversation.composer.bar\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}',
source: 'packages/client/ui-conversation/src/client/contract/slots.ts:343',
source: 'packages/client/ui-conversation/src/client/contract/slots.ts:336',
},
{
key: 'conversation.composer.dock',
@@ -986,7 +1029,7 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [
],
replaceRisk: 'none',
example: 'return {\n inject: [\'slots\'],\n apply(ctx) {\n ctx.slots.inject(\'conversation.composer.dock\', () => ctx.slots.register(\n { name: \'conversation.composer.dock\', id: \'my-entry\', order: 100, label: \'My entry\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}',
source: 'packages/client/ui-conversation/src/client/contract/slots.ts:322',
source: 'packages/client/ui-conversation/src/client/contract/slots.ts:315',
},
{
key: 'conversation.header',
@@ -1098,7 +1141,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.hero.agentPreset\', () => ctx.slots.register(\n { name: \'conversation.hero.agentPreset\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}',
source: 'packages/client/ui-conversation/src/client/contract/slots.ts:305',
source: 'packages/client/ui-conversation/src/client/contract/slots.ts:298',
},
{
key: 'conversation.hero.brand.mark',
@@ -1130,7 +1173,7 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [
occupants: [],
replaceRisk: 'none',
example: 'return {\n inject: [\'slots\'],\n apply(ctx) {\n ctx.slots.inject(\'conversation.hero.brand.mark\', () => ctx.slots.register(\n { name: \'conversation.hero.brand.mark\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}',
source: 'packages/client/ui-conversation/src/client/contract/slots.ts:303',
source: 'packages/client/ui-conversation/src/client/contract/slots.ts:296',
},
{
key: 'conversation.hero.frame',
@@ -1183,7 +1226,7 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [
],
replaceRisk: 'wraps-owner-content',
example: 'return {\n inject: [\'slots\'],\n apply(ctx) {\n ctx.slots.inject(\'conversation.hero.frame\', () => ctx.slots.register(\n { name: \'conversation.hero.frame\', id: \'my-layer\', order: 100 },\n ({ children }) => React.createElement(\'div\', null, children),\n ))\n },\n}',
source: 'packages/client/ui-conversation/src/client/contract/slots.ts:301',
source: 'packages/client/ui-conversation/src/client/contract/slots.ts:294',
},
{
key: 'conversation.hero.options',
@@ -1243,7 +1286,7 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [
],
replaceRisk: 'none',
example: 'return {\n inject: [\'slots\'],\n apply(ctx) {\n ctx.slots.inject(\'conversation.hero.options\', () => ctx.slots.register(\n { name: \'conversation.hero.options\', id: \'my-entry\', order: 100, label: \'My entry\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}',
source: 'packages/client/ui-conversation/src/client/contract/slots.ts:307',
source: 'packages/client/ui-conversation/src/client/contract/slots.ts:300',
},
{
key: 'conversation.hero.workspace',
@@ -1279,7 +1322,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.hero.workspace\', () => ctx.slots.register(\n { name: \'conversation.hero.workspace\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}',
source: 'packages/client/ui-conversation/src/client/contract/slots.ts:299',
source: 'packages/client/ui-conversation/src/client/contract/slots.ts:292',
},
{
key: 'conversation.hero.workspace.directoryFlow',
@@ -1359,7 +1402,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.input.activity\', () => ctx.slots.register(\n { name: \'conversation.input.activity\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}',
source: 'packages/client/ui-conversation/src/client/contract/slots.ts:338',
source: 'packages/client/ui-conversation/src/client/contract/slots.ts:331',
},
{
key: 'conversation.input.attachments',
@@ -1404,7 +1447,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.input.attachments\', () => ctx.slots.register(\n { name: \'conversation.input.attachments\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}',
source: 'packages/client/ui-conversation/src/client/contract/slots.ts:348',
source: 'packages/client/ui-conversation/src/client/contract/slots.ts:341',
},
{
key: 'conversation.input.dock',
@@ -1473,7 +1516,7 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [
],
replaceRisk: 'none',
example: 'return {\n inject: [\'slots\'],\n apply(ctx) {\n ctx.slots.inject(\'conversation.input.dock\', () => ctx.slots.register(\n { name: \'conversation.input.dock\', id: \'my-entry\', order: 100, label: \'My entry\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}',
source: 'packages/client/ui-conversation/src/client/contract/slots.ts:312',
source: 'packages/client/ui-conversation/src/client/contract/slots.ts:305',
},
{
key: 'conversation.input.left',
@@ -1531,7 +1574,7 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [
occupants: [],
replaceRisk: 'none',
example: 'return {\n inject: [\'slots\'],\n apply(ctx) {\n ctx.slots.inject(\'conversation.input.left\', () => ctx.slots.register(\n { name: \'conversation.input.left\', id: \'my-entry\', order: 100, label: \'My entry\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}',
source: 'packages/client/ui-conversation/src/client/contract/slots.ts:327',
source: 'packages/client/ui-conversation/src/client/contract/slots.ts:320',
},
{
key: 'conversation.input.model',
@@ -1575,7 +1618,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.input.model\', () => ctx.slots.register(\n { name: \'conversation.input.model\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}',
source: 'packages/client/ui-conversation/src/client/contract/slots.ts:369',
source: 'packages/client/ui-conversation/src/client/contract/slots.ts:362',
},
{
key: 'conversation.input.model.label',
@@ -1741,7 +1784,7 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [
],
replaceRisk: 'none',
example: 'return {\n inject: [\'slots\'],\n apply(ctx) {\n ctx.slots.inject(\'conversation.input.overlay\', () => ctx.slots.register(\n { name: \'conversation.input.overlay\', id: \'my-entry\', order: 100, label: \'My entry\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}',
source: 'packages/client/ui-conversation/src/client/contract/slots.ts:317',
source: 'packages/client/ui-conversation/src/client/contract/slots.ts:310',
},
{
key: 'conversation.input.permission',
@@ -1785,7 +1828,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.input.permission\', () => ctx.slots.register(\n { name: \'conversation.input.permission\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}',
source: 'packages/client/ui-conversation/src/client/contract/slots.ts:362',
source: 'packages/client/ui-conversation/src/client/contract/slots.ts:355',
},
{
key: 'conversation.input.plan',
@@ -1828,7 +1871,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.input.plan\', () => ctx.slots.register(\n { name: \'conversation.input.plan\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}',
source: 'packages/client/ui-conversation/src/client/contract/slots.ts:357',
source: 'packages/client/ui-conversation/src/client/contract/slots.ts:350',
},
{
key: 'conversation.input.right',
@@ -1886,7 +1929,7 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [
occupants: [],
replaceRisk: 'none',
example: 'return {\n inject: [\'slots\'],\n apply(ctx) {\n ctx.slots.inject(\'conversation.input.right\', () => ctx.slots.register(\n { name: \'conversation.input.right\', id: \'my-entry\', order: 100, label: \'My entry\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}',
source: 'packages/client/ui-conversation/src/client/contract/slots.ts:332',
source: 'packages/client/ui-conversation/src/client/contract/slots.ts:325',
},
{
key: 'conversation.plan-review.actions',
@@ -2363,50 +2406,7 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [
],
replaceRisk: 'none',
example: 'return {\n inject: [\'slots\'],\n apply(ctx) {\n ctx.slots.inject(\'conversation.session.header.views.actions\', () => ctx.slots.register(\n { name: \'conversation.session.header.views.actions\', id: \'my-entry\', order: 100, label: \'My entry\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}',
source: 'packages/client/ui-conversation/src/client/contract/slots.ts:290',
},
{
key: 'conversation.session.panel',
kind: 'single',
scope: 'session',
summary: 'One floating panel over the main Conversation body\'s end gutter.',
doc: 'One floating panel over the main Conversation body\'s end gutter. It renders\nonly for the main occurrence of a Session in its active phase, never for an\nembedded occurrence or the blank home; the occupant positions itself against\nthe body and reads `ctx.uiConversation.layouts` to keep clear of the transcript.',
registerOptions: [],
ownerProps: [
'/** The Session panel\'s occupant derives its state from standard Session props. */\nexport interface ConversationSessionPanelOwnerProps {\n /** Marker field: the occupant receives no owner-specific values. */\n children?: never\n}',
],
ownerPropsReferences: [],
standardProps: [
'useRemoteAccess: (action: RemoteEndpoint) => boolean',
'useResource: UseResource',
'useContextMenu: UseContextMenu',
'useWorkspaces: SnapshotSelectorHook<WorkspaceSnapshot>',
'usePanelInfo: UsePanelInfo',
'useSessions: UseSessions',
'useSessionStatus: UseSessionStatus',
'useSessionRetainInfo: UseSessionRetainInfo',
'useSessionAccess: (sessionId: SessionId, action: RemoteEndpoint) => boolean',
'useWorkspaceAccess: (workspaceId: WorkspaceId, action: RemoteEndpoint) => boolean',
'useChat: UseChat',
'useConversation: UseConversation',
'useInput: SnapshotSelectorHook<InputState>',
'inputActions: InputActions',
'useSession: SessionSnapshotSelector',
'sessionId: SessionId',
'useProjection: UseProjection',
'useAccess: (action: RemoteEndpoint) => boolean',
'useTrajectory: UseTrajectory',
],
keyDomain: '',
hookContext: '',
slotInject: '',
declaredBy: 'factory \'conversation.content\' (client-ui-conversation), so it exists while that definition is registered',
occupants: [
'client-ui-session-panel SessionPanel',
],
replaceRisk: 'shadows-shipped-ui',
example: 'return {\n inject: [\'slots\'],\n apply(ctx) {\n ctx.slots.inject(\'conversation.session.panel\', () => ctx.slots.register(\n { name: \'conversation.session.panel\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}',
source: 'packages/client/ui-conversation/src/client/contract/slots.ts:288',
source: 'packages/client/ui-conversation/src/client/contract/slots.ts:283',
},
{
key: 'conversation.session.panel.environment.row',
@@ -2466,7 +2466,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:35',
source: 'packages/client/ui-session-panel/src/client/slots.ts:36',
},
{
key: 'conversation.session.panel.indicator',
@@ -2524,7 +2524,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:33',
source: 'packages/client/ui-session-panel/src/client/slots.ts:34',
},
{
key: 'conversation.session.panel.section',
@@ -2582,13 +2582,13 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [
keyDomain: '',
hookContext: '',
slotInject: '',
declaredBy: 'an entry in \'conversation.session.panel\' (client-ui-session-panel), so it exists while that entry is mounted',
declaredBy: 'an entry in \'conversation.chat.aside\' (client-ui-session-panel), so it exists while that entry is mounted',
occupants: [
'client-ui-session-panel EnvironmentSection id \'environment\'',
],
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:21',
source: 'packages/client/ui-session-panel/src/client/slots.ts:22',
},
{
key: 'conversation.session.panel.section.actions',
@@ -2630,11 +2630,11 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [
keyDomain: 'open: any string the owner dispatches (no compile-time key set), none are taken yet',
hookContext: '',
slotInject: '',
declaredBy: 'an entry in \'conversation.session.panel\' (client-ui-session-panel), so it exists while that entry is mounted',
declaredBy: 'an entry in \'conversation.chat.aside\' (client-ui-session-panel), so it exists while that entry is mounted',
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: \'<one key the owner dispatches>\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}',
source: 'packages/client/ui-session-panel/src/client/slots.ts:27',
source: 'packages/client/ui-session-panel/src/client/slots.ts:28',
},
{
key: 'conversation.trajectory.images',
@@ -2804,7 +2804,7 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [
],
replaceRisk: 'none',
example: 'return {\n inject: [\'slots\'],\n apply(ctx) {\n ctx.slots.inject(\'conversation.view\', () => ctx.slots.register(\n { name: \'conversation.view\', id: \'my-entry\', order: 100, label: \'My entry\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}',
source: 'packages/client/ui-conversation/src/client/contract/slots.ts:292',
source: 'packages/client/ui-conversation/src/client/contract/slots.ts:285',
},
{
key: 'deliverables.file.actions',
@@ -4388,7 +4388,7 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [
],
replaceRisk: 'none',
example: 'return {\n inject: [\'slots\'],\n apply(ctx) {\n ctx.slots.inject(\'shell.quota-notice\', () => ctx.slots.register(\n { name: \'shell.quota-notice\', select: owner => null },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}',
source: 'packages/client/ui-chat/src/client/contract/slots.ts:503',
source: 'packages/client/ui-chat/src/client/contract/slots.ts:523',
},
{
key: 'sidebar',
+3
View File
@@ -5710,6 +5710,9 @@ importers:
'@deepseek-ai/dsh-client-test-runtime':
specifier: workspace:*
version: link:../../test-support/client-runtime
'@deepseek-ai/dsh-client-ui-chat':
specifier: workspace:*
version: link:../ui-chat
'@deepseek-ai/dsh-client-ui-context-menu':
specifier: workspace:*
version: link:../ui-context-menu