fix(web): keep sidebar borders visible and quiet idle pane targets

Co-authored-by: liukx0205 <69756503+liukx0205@users.noreply.github.com>
Co-authored-by: Yifffan <133629972+Yifffan@users.noreply.github.com>
This commit is contained in:
committed 2026-11-20 17:58:28 +08:00
1 parent 28a4dc72a1
commit f6c1be6c63
6 files changed
+31 -19

No files matched your search

+2 -2
View File
@@ -15,8 +15,8 @@
en: d152484eb41ac6b4
zh: 09388d293f9be9cb
/deepseek-ai-dsh-client-ui-subagent/use-this-package:
en: 1db14b45b7b0676f
zh: bc0d093b3fc49620
en: f84d90b7cbf653e5
zh: e49313ff82710c2f
/deepseek-ai-dsh-client-ui-subagent/use-this-package/browsing-the-tree:
en: da87d582146106c4
zh: f640b3a3fcc11209
+1 -1
View File
@@ -29,7 +29,7 @@ The session header uses the session title for ordinary breadcrumbs. Subagent bre
This package registers the `dsh-resource://subagentchat/session/<child>?parent=<parent>&mode=<mode>` resource and builtin Sidebar tab type. The resource retains the child `SessionReference` directly from its address without refreshing the parent catalog, and releases the reference when the tab record closes. The tab renders the shared `conversation.content` Factory through `sidebar.chat.conversation`, fixes the local View to Chat, and omits the main Conversation header and width controls. A Workspace picked in a blank child's Hero opens that Workspace's blank Session as the main Session and moves the draft to it, as the main Conversation does.
Dragging a root Session row from the Session list shows a drop target while another Session is on screen. While the right Sidebar is open, one target covers each docked pane, leaving the panes' divider and the chat area visible, and a drop opens the Session in that pane. While it is collapsed, one target covers the area the Sidebar would open in, never left of the navigation column or narrow-window drawer that the row left, or that whole area right of the column when the Sidebar cannot fit. Each target's card has an 8px inset on every side, and targets stack above the drawer's mask. Dropping there opens the dragged Session as `dsh-resource://subagentchat/session/<id>`, an address without a query, in the on-screen Session's Sidebar, or reveals the tab that already shows it. Its Conversation accepts follow-up prompts like the main Conversation, and the tab is saved with that Session's browser-local Sidebar layout. The tab title is the Session's display title.
Dragging a root Session row from the Session list shows a drop target while another Session is on screen. While the right Sidebar is open, one target covers each docked pane, leaving the panes' divider and the chat area visible, and a drop opens the Session in that pane. While it is collapsed, one target covers the area the Sidebar would open in, never left of the navigation column or narrow-window drawer that the row left, or that whole area right of the column when the Sidebar cannot fit. Each target draws only its card, 8px in from every side, so the Sidebar's left border and the divider between panes stay visible; with several panes, only the target under the pointer shows its card. Targets stack above the drawer's mask. Dropping there opens the dragged Session as `dsh-resource://subagentchat/session/<id>`, an address without a query, in the on-screen Session's Sidebar, or reveals the tab that already shows it. Its Conversation accepts follow-up prompts like the main Conversation, and the tab is saved with that Session's browser-local Sidebar layout. The tab title is the Session's display title.
The section's title control (`conversation.session.panel.section.actions`, key `subagents`) shows direct-member progress: completed, in progress, not running, and external counts in that order, with zero counts omitted and the separator matching the input task list. External tasks never count as running or completed. The section lists running subagents first, the most recently started first, and then the others, the most recently updated first. It shows five rows and then the Session panel's fold control, “Show {count} more”, which shows the rest and then reads “Show less”; the list folds only when that holds back two rows or more, the choice holds for the Session, also after the panel is hidden and shown again, and an expanded branch's own rows all show. The section hides with its title while the Session has no subagents and no failed catalog read. While direct subagents run and the panel does not show, a blue dot on the panel toggle (`conversation.session.panel.indicator`) says so and names their number for assistive technology; external tasks do not count. The Session panel scrolls the section; the tree has no nested scrolling. The breadcrumb switcher menu is 360px wide with 6px outer padding, constrained to fit the layout viewport, and only the menu scrolls. In WebKit-compatible browsers, its native 5px scrollbar sits in the right 6px inset with inset track ends and a stable gutter, preserving content width when scrolling becomes necessary. Other browsers retain their standard native scrollbar.
+1 -1
View File
@@ -29,7 +29,7 @@ kind: "package-reference"
本包注册 `dsh-resource://subagentchat/session/<child>?parent=<parent>&mode=<mode>` 资源与 builtin Sidebar tab 类型。资源直接根据地址保留 child 的 `SessionReference`,不刷新 parent 目录,并在 tab 记录关闭时释放 reference。tab 通过 `sidebar.chat.conversation` 渲染共享 `conversation.content` Factory,把局部 View 固定为 Chat,并省略主 Conversation 的 Header 与宽度控制。在空白 child 的 Hero 中选择工作区时,与主 Conversation 一样,把该工作区的空白 Session 打开为主 Session,并把草稿移过去。
从会话列表拖拽根 Session 行时,如果屏幕上正显示另一个 Session,会显示放置目标。右侧侧边栏打开时,每个分栏各由一个放置目标覆盖,分栏之间的分割线和聊天区域保持可见;在某个分栏上放下时,会在该分栏中打开该 Session。侧边栏收起时,一个放置目标覆盖侧边栏打开时所占的区域,且始终位于该行被拖出的导航栏或窄窗口抽屉的右侧;侧边栏放不下时,该放置目标覆盖该栏右侧的整个区域。每个放置目标的卡片四边均内缩 8px,放置目标显示在抽屉遮罩之上。在此放下后,会在屏幕上那个 Session 的 Sidebar 中把被拖拽的 Session 打开为 `dsh-resource://subagentchat/session/<id>`(不带查询参数的地址);如果已有 tab 显示该 Session,则改为显示该 tab。其 Conversation 与主 Conversation 一样接受后续提示词,该 tab 随屏幕上那个 Session 的浏览器本地 Sidebar 布局保存。tab 标题为该 Session 的显示标题。
从会话列表拖拽根 Session 行时,如果屏幕上正显示另一个 Session,会显示放置目标。右侧侧边栏打开时,每个分栏各由一个放置目标覆盖,分栏之间的分割线和聊天区域保持可见;在某个分栏上放下时,会在该分栏中打开该 Session。侧边栏收起时,一个放置目标覆盖侧边栏打开时所占的区域,且始终位于该行被拖出的导航栏或窄窗口抽屉的右侧;侧边栏放不下时,该放置目标覆盖该栏右侧的整个区域。每个放置目标只绘制其卡片,卡片四边各内缩 8px,因此侧边栏的左边框和分栏之间的分割线保持可见;有多个分栏时,只有指针下方的放置目标显示其卡片。放置目标显示在抽屉遮罩之上。在此放下后,会在屏幕上那个 Session 的 Sidebar 中把被拖拽的 Session 打开为 `dsh-resource://subagentchat/session/<id>`(不带查询参数的地址);如果已有 tab 显示该 Session,则改为显示该 tab。其 Conversation 与主 Conversation 一样接受后续提示词,该 tab 随屏幕上那个 Session 的浏览器本地 Sidebar 布局保存。tab 标题为该 Session 的显示标题。
分栏的标题控件(`conversation.session.panel.section.actions`,键为 `subagents`)显示直接成员进度:依次为已完成、进行中、未运行和外部任务数量;省略零值,分隔符与输入区任务列表一致。外部任务不计入运行中或已完成数量。分栏把运行中的子智能体排在最前,最近开始的在前,然后是其余的,最近更新的在前。它只显示五行,然后是会话面板的收起控件「显示其余 {count} 个」,点击后显示其余的行并变为「收起」;只有能收起两行及以上时列表才收起,这个选择在 Session 内保持,隐藏后再次显示面板也不变;展开某个分支后,该分支自己的行全部显示。会话没有子智能体且目录读取未失败时,分栏连同标题一起隐藏。直接子智能体运行中且面板未显示时,面板开关上的蓝点(`conversation.session.panel.indicator`)会提示这一状态,并向辅助技术说明数量;外部任务不计入。会话面板负责分栏滚动,目录树不单独滚动。面包屑切换器菜单宽度为 360px,外层内边距为 6px,并受布局视口可用宽度约束,仅菜单本身滚动。在兼容 WebKit 的浏览器中,其原生 5px 滚动条位于右侧 6px 内边距内,轨道两端内缩,并保留稳定的滚动条空间,使内容在需要滚动时保持原有宽度。其他浏览器保留标准原生滚动条。
@@ -1,10 +1,11 @@
/* One drop target covers each docked pane of the open right Sidebar, leaving
the Sidebar's divider and the chat area visible, or the area a collapsed
Sidebar would open in (rectangles set inline). Each draws the dock kit's
drop hint with an 8px inset on every side: a blurred ground under a dashed
card that takes the accent while the pointer is over it. Targets stack
above the narrow-window drawer (71) and its mask (70), below menus and
toasts. */
/* One drop target covers each docked pane of the open right Sidebar, or the
area a collapsed Sidebar would open in (rectangles set inline). The target
itself paints nothing, so the pane's own left border and the divider between
panes stay visible; its card, 8px in from every side, carries the dock kit's
drop hint: a blurred ground under a dashed frame that takes the accent while
the pointer is over it. With several targets, only the one under the pointer
shows its card. Targets stack above the narrow-window drawer (71) and its
mask (70), below menus and toasts. */
.zone {
position: fixed;
z-index: 72;
@@ -12,9 +13,6 @@
display: flex;
padding: 8px;
pointer-events: auto;
background: color-mix(in srgb, var(--dsw-alias-bg-base) 72%, transparent);
backdrop-filter: blur(6px);
animation: zoneIn 140ms ease-out;
}
.card {
@@ -30,12 +28,21 @@
color: var(--dsw-alias-label-tertiary);
border: 1.5px dashed var(--dsw-alias-border-l2);
border-radius: var(--dsw-radius-lg);
background: color-mix(in srgb, var(--dsw-alias-bg-base) 72%, transparent);
backdrop-filter: blur(6px);
transition: color 120ms ease-out, background-color 120ms ease-out, border-color 120ms ease-out;
animation: zoneIn 140ms ease-out;
}
.zone[data-quiet]:not([data-active]) .card {
visibility: hidden;
}
.zone[data-active] .card {
color: var(--dsw-alias-label-secondary);
background: color-mix(in srgb, var(--dsw-alias-brand-primary-new-colorprimary-new-color) 8%, transparent);
background:
linear-gradient(color-mix(in srgb, var(--dsw-alias-brand-primary-new-colorprimary-new-color) 8%, transparent)),
color-mix(in srgb, var(--dsw-alias-bg-base) 72%, transparent);
border-color: var(--dsw-alias-brand-primary-new-colorprimary-new-color);
}
@@ -63,6 +70,5 @@
}
@media (prefers-reduced-motion: reduce) {
.zone { animation: none; }
.card { transition: none; }
.card { transition: none; animation: none; }
}
@@ -55,7 +55,7 @@ export function SessionDropZone({ useSessionDrag, openAside, t }: SessionDropZon
return createPortal(
<>
{targets.map(target => (
<DropTarget key={`${sessionId}:${target.paneId ?? ''}`} target={target} label={t('open.sidebar')}
<DropTarget key={`${sessionId}:${target.paneId ?? ''}`} target={target} quiet={targets.length > 1} label={t('open.sidebar')}
onDrop={() => { openAside(sessionId, target.paneId) }} />
))}
</>,
@@ -63,8 +63,10 @@ export function SessionDropZone({ useSessionDrag, openAside, t }: SessionDropZon
)
}
function DropTarget({ target, label, onDrop }: {
function DropTarget({ target, quiet, label, onDrop }: {
readonly target: SessionDropTarget
/** Show the card only while the pointer is over this target, because another target shares the drag. */
readonly quiet: boolean
readonly label: string
readonly onDrop: () => void
}) {
@@ -83,6 +85,7 @@ function DropTarget({ target, label, onDrop }: {
style={{ left: target.left, top: target.top, width: target.width, height: target.height }}
data-session-drop-zone={target.paneId ?? ''}
data-active={over || undefined}
data-quiet={quiet || undefined}
onDragEnter={accept}
onDragOver={accept}
onDragLeave={(event) => {
@@ -207,6 +207,9 @@ describe('Session drop zone', () => {
view.set(MAIN)
const panes = document.querySelectorAll<HTMLElement>('[data-session-drop-zone]')
expect([...panes].map(element => element.dataset.sessionDropZone)).toEqual(['p1', 'p2'])
// With several panes, each target keeps its card hidden until the pointer is over it.
expect([...panes].every(element => element.hasAttribute('data-quiet'))).toBe(true)
expect(zone.hasAttribute('data-quiet')).toBe(false)
fire(panes[1]!, 'drop')
expect(view.openAside).toHaveBeenLastCalledWith(MAIN, 'p2')