fix(web): keep the Session drop target above the narrow-window drawer
Co-authored-by: liukx0205 <[email protected]> Co-authored-by: Yifffan <[email protected]>
This commit is contained in:
1 parent
01aff22399
commit
b4e81dcd05
6 files changed
+21
-12
No files matched your search
@@ -15,8 +15,8 @@
|
||||
en: d152484eb41ac6b4
|
||||
zh: 09388d293f9be9cb
|
||||
/deepseek-ai-dsh-client-ui-subagent/use-this-package:
|
||||
en: f14602d90bd2050c
|
||||
zh: 3e07260df8e52965
|
||||
en: a705c095de602744
|
||||
zh: 839030c37d0fd31a
|
||||
/deepseek-ai-dsh-client-ui-subagent/use-this-package/browsing-the-tree:
|
||||
en: da87d582146106c4
|
||||
zh: f640b3a3fcc11209
|
||||
|
||||
@@ -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 over the window's right 40%, at least 300px wide, while another Session is on screen. Dropping there opens the dragged Session as `dsh-resource://subagentchat/session/<id>`, an address without a query, in the on-screen Session's Sidebar column, 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 over the window's right 40%, at least 300px wide, while another Session is on screen. The target never covers the window's leftmost 280px, so an open narrow-window drawer stays reachable, and it stacks 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 column, 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.
|
||||
|
||||
|
||||
@@ -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,窗口右侧 40% 的区域(宽度至少 300px)会显示放置目标。在此放下后,会在屏幕上那个 Session 的 Sidebar 栏中把被拖拽的 Session 打开为 `dsh-resource://subagentchat/session/<id>`(不带查询参数的地址);如果已有 tab 显示该 Session,则改为显示该 tab。其 Conversation 与主 Conversation 一样接受后续提示词,该 tab 随屏幕上那个 Session 的浏览器本地 Sidebar 布局保存。tab 标题为该 Session 的显示标题。
|
||||
从会话列表拖拽根 Session 行时,如果屏幕上正显示另一个 Session,窗口右侧 40% 的区域(宽度至少 300px)会显示放置目标。放置目标不覆盖窗口最左侧 280px,因此窄窗口中已打开的抽屉仍可操作;放置目标显示在抽屉遮罩之上。在此放下后,会在屏幕上那个 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,15 +1,18 @@
|
||||
/* The drop target covers the right column's default 40% band, like the dock
|
||||
kit's edge band, and draws the dock kit's drop hint: a blurred ground under
|
||||
a dashed card that takes the accent while the pointer is over it. */
|
||||
a dashed card that takes the accent while the pointer is over it. It stacks
|
||||
above the narrow-window drawer (71) and its mask (70), below menus and
|
||||
toasts, and leaves the default 280px drawer width uncovered so the list
|
||||
stays reachable for reordering. */
|
||||
.zone {
|
||||
position: fixed;
|
||||
z-index: 72;
|
||||
top: var(--dsh-frame-top-clearance, 0px);
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
width: max(300px, 40vw);
|
||||
max-width: 100vw;
|
||||
width: min(max(300px, 40vw), calc(100vw - 280px));
|
||||
padding: 8px;
|
||||
pointer-events: auto;
|
||||
background: color-mix(in srgb, var(--dsw-alias-bg-base) 72%, transparent);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/** Drop target that opens a Session dragged from the Session list in the right Sidebar. */
|
||||
import { useState, type DragEvent } from 'react'
|
||||
import { createPortal } from 'react-dom'
|
||||
import { IconPanelLeftOutlineRegular } from '@deepseek-ai/dsh-client-ui-primitives'
|
||||
import type { HostObservable, InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'
|
||||
import type { SessionId } from '@deepseek-ai/dsh-session/types'
|
||||
@@ -46,7 +47,8 @@ function DropTarget({ label, onDrop }: { readonly label: string; readonly onDrop
|
||||
event.dataTransfer.dropEffect = 'copy'
|
||||
setOver(true)
|
||||
}
|
||||
return (
|
||||
// A body portal stacks above the narrow-window drawer mask, which covers the frame's overlay layer.
|
||||
return createPortal(
|
||||
<div
|
||||
className={css.zone}
|
||||
data-session-drop-zone=""
|
||||
@@ -67,6 +69,7 @@ function DropTarget({ label, onDrop }: { readonly label: string; readonly onDrop
|
||||
<IconPanelLeftOutlineRegular className={css.icon} aria-hidden="true" />
|
||||
<span className={css.label}>{label}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>,
|
||||
document.body,
|
||||
)
|
||||
}
|
||||
@@ -94,10 +94,13 @@ describe('Session drop zone', () => {
|
||||
|
||||
it('renders only during a Session drag and opens the dropped Session aside', () => {
|
||||
const view = mount(undefined)
|
||||
expect(view.container.innerHTML).toBe('')
|
||||
expect(document.querySelector('[data-session-drop-zone]')).toBeNull()
|
||||
view.set(OTHER)
|
||||
const label = screen.getByText('Open in sidebar')
|
||||
const zone = view.container.querySelector('[data-session-drop-zone]') as HTMLElement
|
||||
// The zone portals to the body so it stacks above the narrow-window drawer mask.
|
||||
const zone = document.querySelector<HTMLElement>('[data-session-drop-zone]')!
|
||||
expect(zone.parentElement).toBe(document.body)
|
||||
expect(view.container.innerHTML).toBe('')
|
||||
expect(zone.hasAttribute('data-active')).toBe(false)
|
||||
|
||||
const over = fire(zone, 'dragOver')
|
||||
@@ -122,6 +125,6 @@ describe('Session drop zone', () => {
|
||||
expect(zone.hasAttribute('data-active')).toBe(false)
|
||||
|
||||
view.set(undefined)
|
||||
expect(view.container.innerHTML).toBe('')
|
||||
expect(document.querySelector('[data-session-drop-zone]')).toBeNull()
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user