@sparkelf/dsh-plus 0.2.9-alpha.58 → 0.2.9-alpha.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -732,7 +732,7 @@
|
|
|
732
732
|
"@sparkelf/dsh-client-ui-skill-center": "0.2.2-alpha.2.5",
|
|
733
733
|
"@sparkelf/dsh-credential-manager": "0.1.3",
|
|
734
734
|
"@sparkelf/dsh-dataops-account": "0.2.0",
|
|
735
|
-
"@sparkelf/dsh-dataops-managed": "0.3.
|
|
735
|
+
"@sparkelf/dsh-dataops-managed": "0.3.40",
|
|
736
736
|
"@sparkelf/dsh-genui": "0.15.0-sparkelf.3",
|
|
737
737
|
"@sparkelf/dsh-group-chat": "0.5.6",
|
|
738
738
|
"@sparkelf/dsh-kb-citation": "0.1.3",
|
|
@@ -747,7 +747,7 @@
|
|
|
747
747
|
"@sparkelf/dsh-query-result-analysis": "0.1.4",
|
|
748
748
|
"@sparkelf/dsh-sql-workbench": "0.6.0",
|
|
749
749
|
"@sparkelf/dsh-ssh-manager": "0.7.5",
|
|
750
|
-
"@sparkelf/dsh-task-bus": "0.1.
|
|
750
|
+
"@sparkelf/dsh-task-bus": "0.1.9",
|
|
751
751
|
"@sparkelf/dsh-workbench-vault": "0.1.2",
|
|
752
752
|
"dsh-better-sidebar": "npm:@sparkelf/dsh-better-sidebar@0.29.0-sparkelf.18",
|
|
753
753
|
"dsh-right-bg-anim": "1.1.0",
|
|
@@ -756,10 +756,10 @@
|
|
|
756
756
|
}
|
|
757
757
|
},
|
|
758
758
|
"runtime": {
|
|
759
|
-
"version": "0.2.2-
|
|
759
|
+
"version": "0.2.2-rc.1"
|
|
760
760
|
},
|
|
761
761
|
"sourceBase": {
|
|
762
|
-
"revision": "
|
|
762
|
+
"revision": "66491b05e3f05ad35bcdd4f6cd7ed26041d9e3db"
|
|
763
763
|
},
|
|
764
764
|
"thirdPartyPatches": []
|
|
765
765
|
},
|
|
@@ -805,5 +805,5 @@
|
|
|
805
805
|
},
|
|
806
806
|
"type": "module",
|
|
807
807
|
"types": "lib/types/index.d.ts",
|
|
808
|
-
"version": "0.2.9-alpha.
|
|
808
|
+
"version": "0.2.9-alpha.60"
|
|
809
809
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
diff --git a/apps/web/tests/access-confirmation.e2e.ts b/apps/web/tests/access-confirmation.e2e.ts
|
|
2
|
-
index
|
|
2
|
+
index f97978d3..edab518b 100644
|
|
3
3
|
--- a/apps/web/tests/access-confirmation.e2e.ts
|
|
4
4
|
+++ b/apps/web/tests/access-confirmation.e2e.ts
|
|
5
5
|
@@ -151,6 +151,12 @@ describe('web e2e: experimental Auto and Full access confirmation', () => {
|
|
@@ -16,10 +16,10 @@ index f97978d346..edab518be0 100644
|
|
|
16
16
|
const dialog = page.getByRole('dialog', { name: '确认启用完全权限?' })
|
|
17
17
|
await dialog.waitFor({ timeout: 10_000 })
|
|
18
18
|
diff --git a/apps/web/tests/default-model.e2e.ts b/apps/web/tests/default-model.e2e.ts
|
|
19
|
-
index
|
|
19
|
+
index 03a22e3c..d9cd04b8 100644
|
|
20
20
|
--- a/apps/web/tests/default-model.e2e.ts
|
|
21
21
|
+++ b/apps/web/tests/default-model.e2e.ts
|
|
22
|
-
@@ -
|
|
22
|
+
@@ -481,6 +481,13 @@ describe('web e2e: the composer model switch is the default for later sessions',
|
|
23
23
|
await trigger.waitFor({ timeout: 15_000 })
|
|
24
24
|
expect(await trigger.evaluate(element => getComputedStyle(element).fontWeight)).toBe('400')
|
|
25
25
|
await trigger.click()
|
|
@@ -34,10 +34,10 @@ index 9625333287..c71f8c02de 100644
|
|
|
34
34
|
const composerBounds = await page.locator('[data-composer-card]').first().boundingBox()
|
|
35
35
|
expect(modelMenuBounds!.width).toBeLessThan(composerBounds!.width)
|
|
36
36
|
diff --git a/packages/client/ui-layout/README.md b/packages/client/ui-layout/README.md
|
|
37
|
-
index
|
|
37
|
+
index 8a204762..b91e932d 100644
|
|
38
38
|
--- a/packages/client/ui-layout/README.md
|
|
39
39
|
+++ b/packages/client/ui-layout/README.md
|
|
40
|
-
@@ -
|
|
40
|
+
@@ -62,7 +62,7 @@ The root registration supplies folded-landscape posture through an injected obse
|
|
41
41
|
|
|
42
42
|
`selectPanel(id)` checks the live `main` registry before changing selection; an absent key throws and leaves the current panel intact. `beginNavigation()` returns an abort signal for an asynchronous UI navigation. A later call, a valid panel selection (including repeated selection), or layout disposal aborts that signal without cancelling underlying Session creation. Consumers check the signal before committing navigation or moving drafts.
|
|
43
43
|
|
|
@@ -47,291 +47,86 @@ index 43c61b89d1..8fa5117005 100644
|
|
|
47
47
|
</details>
|
|
48
48
|
|
|
49
49
|
diff --git a/packages/client/ui-layout/src/client/AppFrame.tsx b/packages/client/ui-layout/src/client/AppFrame.tsx
|
|
50
|
-
index
|
|
50
|
+
index 23e71c9c..50e1d3a9 100644
|
|
51
51
|
--- a/packages/client/ui-layout/src/client/AppFrame.tsx
|
|
52
52
|
+++ b/packages/client/ui-layout/src/client/AppFrame.tsx
|
|
53
|
-
@@ -
|
|
53
|
+
@@ -39,7 +39,7 @@ export type AppFrameProps =
|
|
54
54
|
|
|
55
55
|
/** Center column grid item (session-body building block). */
|
|
56
|
-
function CenterColumn(props: { children?: ReactNode }) {
|
|
57
|
-
- return <div className={css.centerCol}>{props.children}</div>
|
|
58
|
-
+ return <div className={css.centerCol} data-dsh-center-col>{props.children}</div>
|
|
56
|
+
function CenterColumn(props: { children?: ReactNode; inert: boolean }) {
|
|
57
|
+
- return <div className={css.centerCol} {...{ inert: props.inert ? '' : undefined }}>{props.children}</div>
|
|
58
|
+
+ return <div className={css.centerCol} data-dsh-center-col {...{ inert: props.inert ? '' : undefined }}>{props.children}</div>
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
/** Subscribe to the main key without subscribing the column frame to each panel id. */
|
|
62
|
-
diff --git a/packages/client/ui-model-selection/src/client/ModelSelect.module.css b/packages/client/ui-model-selection/src/client/ModelSelect.module.css
|
|
63
|
-
index c36809acaa..21fb6c73b8 100644
|
|
64
|
-
--- a/packages/client/ui-model-selection/src/client/ModelSelect.module.css
|
|
65
|
-
+++ b/packages/client/ui-model-selection/src/client/ModelSelect.module.css
|
|
66
|
-
@@ -97,7 +97,9 @@
|
|
67
|
-
display: flex;
|
|
68
|
-
flex-direction: column;
|
|
69
|
-
/* Let the visible pane's rows set the card width, but keep pathological ids
|
|
70
|
-
- and narrow screens inside a bounded card where ellipsis remains. */
|
|
71
|
-
+ and narrow screens inside a bounded card where ellipsis remains. The card's
|
|
72
|
-
+ own pad is part of that bound, as it is on the Menu primitive's surface. */
|
|
73
|
-
+ box-sizing: border-box;
|
|
74
|
-
width: max-content;
|
|
75
|
-
min-width: min(240px, calc(100vw - 32px));
|
|
76
|
-
max-width: min(420px, calc(100vw - 32px));
|
|
77
62
|
diff --git a/packages/client/ui-model-selection/src/client/ModelSelect.tsx b/packages/client/ui-model-selection/src/client/ModelSelect.tsx
|
|
78
|
-
index
|
|
63
|
+
index ecc984ca..ab32c21e 100644
|
|
79
64
|
--- a/packages/client/ui-model-selection/src/client/ModelSelect.tsx
|
|
80
65
|
+++ b/packages/client/ui-model-selection/src/client/ModelSelect.tsx
|
|
81
|
-
@@ -
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
+
|
|
86
|
-
+
|
|
87
|
-
+
|
|
88
|
-
+
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
if (lh > 0) y = Math.min(Math.max(y, MARGIN), window.innerHeight - lh - MARGIN)
|
|
100
|
-
- setMenuPos({ left: x, top: y })
|
|
101
|
-
+ // A bounded card takes the owner's width: the same 12px inset on both
|
|
102
|
-
+ // sides, never wider than the room between them.
|
|
103
|
-
+ const bounds = boundary === undefined
|
|
104
|
-
+ ? {}
|
|
105
|
-
+ : { minWidth: Math.min(264, availableWidth), maxWidth: availableWidth }
|
|
106
|
-
+ setMenuPos({ left: x, top: y, ...bounds })
|
|
107
|
-
}
|
|
108
|
-
place()
|
|
109
|
-
window.addEventListener('scroll', place, true)
|
|
110
|
-
diff --git a/packages/client/ui-model-selection/tests/model-select.client.spec.tsx b/packages/client/ui-model-selection/tests/model-select.client.spec.tsx
|
|
111
|
-
index dbb5b247db..584e1f0366 100644
|
|
112
|
-
--- a/packages/client/ui-model-selection/tests/model-select.client.spec.tsx
|
|
113
|
-
+++ b/packages/client/ui-model-selection/tests/model-select.client.spec.tsx
|
|
114
|
-
@@ -454,14 +454,19 @@ describe('ModelSelect reasoning effort', () => {
|
|
115
|
-
Object.defineProperty(HTMLElement.prototype, 'offsetWidth', { configurable: true, get: () => 200 })
|
|
116
|
-
Object.defineProperty(HTMLElement.prototype, 'offsetHeight', { configurable: true, get: () => 300 })
|
|
117
|
-
try {
|
|
118
|
-
- const { container } = render(<ModelSelect renderSlot={renderLabel}
|
|
119
|
-
+ const { container } = render(<div data-dsh-center-col><ModelSelect renderSlot={renderLabel}
|
|
120
|
-
locked={false}
|
|
121
|
-
available
|
|
122
|
-
directory={createSnapshotStore(state())}
|
|
123
|
-
load={vi.fn()} resolveText={resolveText}
|
|
124
|
-
select={vi.fn().mockResolvedValue({ ok: true, value: undefined })}
|
|
125
|
-
t={t}
|
|
126
|
-
- />)
|
|
127
|
-
+ /></div>)
|
|
128
|
-
+ // The composer card's own rect is a zero rect in jsdom; the column's is not.
|
|
129
|
-
+ Object.defineProperty(container.firstElementChild, 'getBoundingClientRect', {
|
|
130
|
-
+ configurable: true,
|
|
131
|
-
+ value: () => ({ left: 280, right: 520, top: 0, bottom: 700, width: 240, height: 700, x: 280, y: 0, toJSON: () => ({}) }),
|
|
132
|
-
+ })
|
|
133
|
-
const trigger = screen.getByRole('button', { name: /选择模型/ })
|
|
134
|
-
fireEvent.click(trigger)
|
|
135
|
-
const menu = screen.getByRole('menu')
|
|
136
|
-
@@ -469,8 +474,9 @@ describe('ModelSelect reasoning effort', () => {
|
|
137
|
-
expect(container.contains(menu)).toBe(false)
|
|
138
|
-
expect(menu.parentElement).toBe(document.body)
|
|
139
|
-
// jsdom anchor rects are all zero, so the measured 200x300 card clamps
|
|
140
|
-
- // to the 12px viewport margin on both axes.
|
|
141
|
-
- expect(menu.style.left).toBe('12px')
|
|
142
|
-
+ // to the centre column's 12px inset horizontally and the viewport's on
|
|
143
|
-
+ // the vertical axis.
|
|
144
|
-
+ expect(menu.style.left).toBe('292px')
|
|
145
|
-
expect(menu.style.top).toBe('12px')
|
|
146
|
-
// Interactions inside the trigger subtree or the portaled card stay open.
|
|
147
|
-
expect(fireEvent.mouseDown(menu)).toBe(true)
|
|
148
|
-
diff --git a/packages/client/ui-permission-presets/src/client/PermissionSelect.tsx b/packages/client/ui-permission-presets/src/client/PermissionSelect.tsx
|
|
149
|
-
index 0281c41a24..f44f20a8fc 100644
|
|
150
|
-
--- a/packages/client/ui-permission-presets/src/client/PermissionSelect.tsx
|
|
151
|
-
+++ b/packages/client/ui-permission-presets/src/client/PermissionSelect.tsx
|
|
152
|
-
@@ -1,4 +1,4 @@
|
|
153
|
-
-import { useEffect, useState } from 'react'
|
|
154
|
-
+import { useEffect, useRef, useState } from 'react'
|
|
155
|
-
import type { ReactNode } from 'react'
|
|
156
|
-
import clsx from 'clsx'
|
|
157
|
-
import {
|
|
158
|
-
@@ -81,6 +81,8 @@ export function PermissionSelect({
|
|
159
|
-
const catalog = usePermissionCatalog(state => state.value)
|
|
160
|
-
const [pick, setPick] = useState<string | null>(null)
|
|
161
|
-
const [open, setOpen] = useState(false)
|
|
162
|
-
+ /** The center column this trigger sits in; the portaled menu clamps to it. */
|
|
163
|
-
+ const boundaryRef = useRef<HTMLElement | null>(null)
|
|
164
|
-
const [confirmation, setConfirmation] = useState<string | null>(null)
|
|
165
|
-
const [acknowledged, setAcknowledged] = useState(false)
|
|
166
|
-
|
|
167
|
-
@@ -171,8 +173,12 @@ export function PermissionSelect({
|
|
168
|
-
onClose={() => { setOpen(false) }}
|
|
169
|
-
side="top"
|
|
170
|
-
portal
|
|
171
|
-
+ boundaryRef={boundaryRef}
|
|
172
|
-
anchor={
|
|
173
|
-
<button
|
|
174
|
-
+ ref={(node) => {
|
|
175
|
-
+ boundaryRef.current = node?.closest<HTMLElement>('[data-dsh-center-col]') ?? null
|
|
176
|
-
+ }}
|
|
177
|
-
type="button"
|
|
178
|
-
className={css.trigger}
|
|
179
|
-
aria-label={t('mode', { name: currentLabel })}
|
|
180
|
-
diff --git a/packages/client/ui-primitives/README.md b/packages/client/ui-primitives/README.md
|
|
181
|
-
index d95d802886..bb1d53df18 100644
|
|
182
|
-
--- a/packages/client/ui-primitives/README.md
|
|
183
|
-
+++ b/packages/client/ui-primitives/README.md
|
|
184
|
-
@@ -49,7 +49,7 @@ Check this table before writing a control in a feature package. A plugin cannot
|
|
185
|
-
| `Input` | Single-line text entry for search boxes and inline forms. Its ref targets the native input for focus and is cleared on unmount. |
|
|
186
|
-
| `InlineEditor` | Autofocused multi-line inline editor for short drafts such as queued messages and goals. It grows with its text and its width up to six lines, then scrolls; Enter saves, Shift+Enter breaks the line, Enter during IME composition does nothing, and Escape cancels. The caller supplies the localized `label` and rebinds the scrollbar on an elevated surface. |
|
|
187
|
-
| `ZoomControls`, `DOCUMENT_ZOOM` | Floating document zoom controls with localized labels, fixed presets, and visibility/activity callbacks. An omitted `fit` hides the fitting row. The toolbar carries `data-document-zoom-controls`, plus `data-document-zoom-visible` while visible. An owner `className` overrides `bottom` and `max-width` regardless of stylesheet order; `inset-inline-start` and `transform` center the toolbar and move it on enter and exit, `opacity` fades it, and all three stay with the primitive. Renderers share the published scale limits. |
|
|
188
|
-
-| `Menu`, `MenuItemButton` | Dropdown of `items` data rows, separators, and group labels, with nested submenus; `children` adds component rows, each a `MenuItemButton` (`separatorBefore` starts a new group), in the same list. `MenuItemButton.current` exposes the current page or view through `aria-current` without changing selection or appearance. Every row shares the styling, the keyboard walk, and the focus return; closing stays the owner's state change for both kinds. While open, ↑/↓ (with Home and End) walk the list, Tab settles the focused row, and Escape or Shift+Tab close back to the anchor; selecting a row also returns the keyboard to the anchor unless the owner moved it itself. Only a keyboard on the anchor or inside the list is intercepted, and `autoFocus` decides solely whether opening focuses the first row. |
|
|
189
|
-
+| `Menu`, `MenuItemButton` | Dropdown of `items` data rows, separators, and group labels, with nested submenus; `children` adds component rows, each a `MenuItemButton` (`separatorBefore` starts a new group), in the same list. `MenuItemButton.current` exposes the current page or view through `aria-current` without changing selection or appearance. Every row shares the styling, the keyboard walk, and the focus return; closing stays the owner's state change for both kinds. While open, ↑/↓ (with Home and End) walk the list, Tab settles the focused row, and Escape or Shift+Tab close back to the anchor; selecting a row also returns the keyboard to the anchor unless the owner moved it itself. Only a keyboard on the anchor or inside the list is intercepted, and `autoFocus` decides solely whether opening focuses the first row. A portaled list may intersect viewport clamping with an owner boundary. |
|
|
190
|
-
| `MenuGroup`, `observeStickyMenuGroups` | Localized, accessible groups for custom menus and listboxes, with shared sticky-heading styling and native intersection/size observation; the caller owns the observer's lifetime. |
|
|
191
|
-
| `Pill` | Selectable capsule button for view switchers and filters; takes `active` and `onClick`. |
|
|
192
|
-
| `SegmentedTabs` | Controlled equal-width tabs with a sliding indicator and Left/Right, Home, and End navigation. The caller supplies labels, tab/panel ids, and panel content. Default `size="md"` is 42px tall with a 4px inset; `size="sm"` is 34px tall with a 2px inset. |
|
|
193
|
-
diff --git a/packages/client/ui-primitives/README.zh.md b/packages/client/ui-primitives/README.zh.md
|
|
194
|
-
index 115e1defe5..9972ffe785 100644
|
|
195
|
-
--- a/packages/client/ui-primitives/README.zh.md
|
|
196
|
-
+++ b/packages/client/ui-primitives/README.zh.md
|
|
197
|
-
@@ -25,7 +25,7 @@ kind: "package-library"
|
|
198
|
-
<a id="use-this-package"></a>
|
|
199
|
-
## 使用本包
|
|
200
|
-
|
|
201
|
-
-`Toast` 在浅色和深色模式下均使用主题的系统提示背景与文字颜色。`Menu` 数据条目与 `MenuItemButton` 组件条目接收功能 owner 提供的有效快捷键,并在末端以无背景的浅灰色文字对齐显示,子菜单也采用同一呈现。主指针为粗指针(`pointer: coarse`)且未使用[键盘导航](#input-modality)时,菜单隐藏这些提示。键盘导航会显示提示,直到下一次指针按下;快捷键绑定始终生效。`ShortcutKeys` 默认以无方块的按键文字显示菜单和行内提示。`tooltip` 变体在深色气泡上使用稍浅的键帽,以加号连接的组合则共用一个填充色块。`Tooltip.shortcutKeys` 将键帽与可选的本地化操作文本垂直居中排列,标签为空时只显示按键。可选的 `className` 供调用方设置交互状态样式。`Modal` 使用框架共享的浮层起点,视口边距至少为 24px。其遮罩不绘制 Windows 顶栏区域,覆盖整个视口的模态层仍阻挡背景点击。`Modal` 与设置外壳通过 `useModalLayer` 共用顶层 Esc 和 Tab 处理,关闭时恢复先前焦点。`closeTopModal(document)` 请求前台弹窗当前的关闭操作;上层菜单或未注册的对话框会阻止关闭其后方弹窗。组件通过 `isBehindModal` 避免将焦点移到嵌套弹窗后方。菜单先消费自己的 Esc,再由模态层处理关闭。 `observeComposition` 为局部弹层和录键处理提供相同的 composition-end 与旧版 IME 保护;调用方随交互生命周期释放其 document 监听。
|
|
202
|
-
+`Toast` 在浅色和深色模式下均使用主题的系统提示背景与文字颜色。`Menu` 数据条目与 `MenuItemButton` 组件条目接收功能 owner 提供的有效快捷键,并在末端以无背景的浅灰色文字对齐显示,子菜单也采用同一呈现。主指针为粗指针(`pointer: coarse`)且未使用[键盘导航](#input-modality)时,菜单隐藏这些提示。键盘导航会显示提示,直到下一次指针按下;快捷键绑定始终生效。`ShortcutKeys` 默认以无方块的按键文字显示菜单和行内提示。`tooltip` 变体在深色气泡上使用稍浅的键帽,以加号连接的组合则共用一个填充色块。`Tooltip.shortcutKeys` 将键帽与可选的本地化操作文本垂直居中排列,标签为空时只显示按键。可选的 `className` 供调用方设置交互状态样式。`Modal` 使用框架共享的浮层起点,视口边距至少为 24px。其遮罩不绘制 Windows 顶栏区域,覆盖整个视口的模态层仍阻挡背景点击。`Modal` 与设置外壳通过 `useModalLayer` 共用顶层 Esc 和 Tab 处理,关闭时恢复先前焦点。`closeTopModal(document)` 请求前台弹窗当前的关闭操作;上层菜单或未注册的对话框会阻止关闭其后方弹窗。组件通过 `isBehindModal` 避免将焦点移到嵌套弹窗后方。菜单先消费自己的 Esc,再由模态层处理关闭。 portal 模式的列表可把视口钳制与 owner boundary 取交集。 `observeComposition` 为局部弹层和录键处理提供相同的 composition-end 与旧版 IME 保护;调用方随交互生命周期释放其 document 监听。
|
|
203
|
-
|
|
204
|
-
`isMobileDevice()` 识别 iOS 和 Android 手机及平板,供自动聚焦和收起键盘使用。它识别 UA 中的 `Android`、`iPhone`、`iPad` 或 `iPod`,以及报告 `MacIntel` 且触摸点数大于一的 iPad。其他设备(包括 Windows 触屏电脑)返回 false,不受窗口宽度影响。函数缓存首次判断结果,供页面内的所有调用方共享;组件重新挂载会复用该结果,重新加载页面时会再次读取浏览器环境。识别出的移动设备需要用户主动聚焦文本输入框。隐藏移动平台信息的浏览器模式或自定义 UA 可能导致识别失败;未识别的 UA 返回 false。仅凭桌面 UA 无法区分 Android 平板与 Linux 电脑。
|
|
205
|
-
|
|
206
|
-
diff --git a/packages/client/ui-primitives/src/Menu.tsx b/packages/client/ui-primitives/src/Menu.tsx
|
|
207
|
-
index 68b3a5766e..e25866591a 100644
|
|
208
|
-
--- a/packages/client/ui-primitives/src/Menu.tsx
|
|
209
|
-
+++ b/packages/client/ui-primitives/src/Menu.tsx
|
|
210
|
-
@@ -1,5 +1,5 @@
|
|
211
|
-
import { useEffect, useLayoutEffect, useRef, useState } from 'react'
|
|
212
|
-
-import type { CSSProperties, ReactNode, SyntheticEvent } from 'react'
|
|
213
|
-
+import type { CSSProperties, ReactNode, RefObject, SyntheticEvent } from 'react'
|
|
214
|
-
import { createPortal } from 'react-dom'
|
|
215
|
-
import clsx from 'clsx'
|
|
216
|
-
import { IconCheckOutlineRegular } from './icons/index.tsx'
|
|
217
|
-
@@ -154,6 +154,10 @@ const MEASURE_STYLE: CSSProperties = { visibility: 'hidden', left: 0, top: 0 }
|
|
218
|
-
* wrapper there races the host's layout effects). Called on open, each animation
|
|
219
|
-
* frame, and scroll/resize; return null to skip placement for that frame.
|
|
220
|
-
* @param props.minWidthFromAnchor - in portal mode, keep the menu at least as wide as its anchor, bounded by viewport margins.
|
|
221
|
-
+ * @param props.boundaryRef - portal mode only: intersect horizontal placement
|
|
222
|
-
+ * with this owner element's rect as well as the viewport, so a menu owned by a
|
|
223
|
-
+ * column stays inside that column when a sidebar or panel leaves a narrow
|
|
224
|
-
+ * center.
|
|
225
|
-
* @param props.footer - rows pinned below the scrolling items area, separated
|
|
226
|
-
* by a hairline; they stay visible while the items above scroll.
|
|
227
|
-
* @param props.children - component rows rendered after `items` in the same
|
|
228
|
-
@@ -170,7 +174,7 @@ const MEASURE_STYLE: CSSProperties = { visibility: 'hidden', left: 0, top: 0 }
|
|
229
|
-
* document.body outside the owner's DOM subtree.
|
|
230
|
-
* @returns anchor wrapper with the conditional list.
|
|
231
|
-
*/
|
|
232
|
-
-export function Menu({ open, anchor, items = [], children, selectedId, selectedIds, onSelect, onClose, align = 'start', side = 'bottom', portal = false, closeOnPointerLeave = false, dense = false, compact = false, autoFocus = false, selection = 'check', getAnchorRect, minWidthFromAnchor = false, footer, className, listClassName }: {
|
|
233
|
-
+export function Menu({ open, anchor, items = [], children, selectedId, selectedIds, onSelect, onClose, align = 'start', side = 'bottom', portal = false, closeOnPointerLeave = false, dense = false, compact = false, autoFocus = false, selection = 'check', getAnchorRect, minWidthFromAnchor = false, boundaryRef, footer, className, listClassName }: {
|
|
234
|
-
open: boolean
|
|
235
|
-
autoFocus?: boolean
|
|
236
|
-
anchor: ReactNode
|
|
237
|
-
@@ -190,6 +194,7 @@ export function Menu({ open, anchor, items = [], children, selectedId, selectedI
|
|
238
|
-
selection?: 'check' | 'fill'
|
|
239
|
-
getAnchorRect?: () => DOMRect | null
|
|
66
|
+
@@ -98,6 +98,10 @@ export function ModelSelect(
|
|
67
|
+
gap: 8,
|
|
68
|
+
margin: 12,
|
|
69
|
+
layoutKey: pane,
|
|
70
|
+
+ // The composer's center column, when this trigger sits in one, is narrower than the viewport;
|
|
71
|
+
+ // without it the card could spill under the neighbouring panes.
|
|
72
|
+
+ boundary: () => triggerRef.current?.closest<HTMLElement>('[data-dsh-center-col]')
|
|
73
|
+
+ ?.getBoundingClientRect() ?? null,
|
|
74
|
+
})
|
|
75
|
+
const itemRefs = useRef<(HTMLButtonElement | null)[]>([])
|
|
76
|
+
const id = useId()
|
|
77
|
+
diff --git a/packages/client/ui-primitives/src/useAnchoredPosition.ts b/packages/client/ui-primitives/src/useAnchoredPosition.ts
|
|
78
|
+
index 61a891e5..617bb643 100644
|
|
79
|
+
--- a/packages/client/ui-primitives/src/useAnchoredPosition.ts
|
|
80
|
+
+++ b/packages/client/ui-primitives/src/useAnchoredPosition.ts
|
|
81
|
+
@@ -26,6 +26,15 @@ export interface AnchoredPositionOptions {
|
|
82
|
+
layoutKey?: string | number
|
|
83
|
+
/** Minimum panel width follows the anchor, bounded by the visible viewport. */
|
|
240
84
|
minWidthFromAnchor?: boolean
|
|
241
|
-
+
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
+
|
|
250
|
-
|
|
251
|
-
+ const boundary = boundaryRef?.current?.getBoundingClientRect()
|
|
252
|
-
+ const minX = Math.max(MARGIN, (boundary?.left ?? 0) + MARGIN)
|
|
253
|
-
+ const maxX = Math.min(vw - MARGIN, (boundary?.right ?? vw) - MARGIN)
|
|
254
|
-
+ const availableWidth = Math.max(0, maxX - minX)
|
|
255
|
-
const listEl = listRef.current
|
|
256
|
-
if (listEl !== null) {
|
|
257
|
-
const minimum = minWidthFromAnchor ? `${Math.min(r.width, Math.max(0, vw - MARGIN * 2))}px` : ''
|
|
258
|
-
if (listEl.style.minWidth !== minimum) listEl.style.minWidth = minimum
|
|
259
|
-
}
|
|
260
|
-
const lw = listEl?.offsetWidth ?? 0
|
|
261
|
-
+ const placedWidth = boundary === undefined ? lw : Math.min(lw, availableWidth)
|
|
262
|
-
const lh = listEl?.offsetHeight ?? 0
|
|
85
|
+
+ /**
|
|
86
|
+
+ * Region the panel must stay inside, in viewport coordinates.
|
|
87
|
+
+ *
|
|
88
|
+
+ * A panel portaled to the body is constrained by the visible viewport by default, which is
|
|
89
|
+
+ * wider than the column an anchored control may live in (the composer's center column, for
|
|
90
|
+
+ * one). Supplying the region narrows both the size limits and the horizontal clamp, so the
|
|
91
|
+
+ * panel cannot spill outside the column it belongs to. Absent keeps the viewport behaviour.
|
|
92
|
+
+ */
|
|
93
|
+
+ boundary?: () => DOMRect | null
|
|
94
|
+
}
|
|
263
95
|
|
|
264
|
-
|
|
265
|
-
@@ -
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
-
|
|
270
|
-
+
|
|
271
|
-
|
|
96
|
+
/**
|
|
97
|
+
@@ -37,7 +46,7 @@ export interface AnchoredPositionOptions {
|
|
98
|
+
*/
|
|
99
|
+
export function useAnchoredPosition(options: AnchoredPositionOptions): CSSProperties | null {
|
|
100
|
+
const { open, anchorRef, panelRef, side = 'bottom', align = 'start', gap, margin,
|
|
101
|
+
- getAnchorRect, layoutKey, minWidthFromAnchor = false, frameClearance = true } = options
|
|
102
|
+
+ getAnchorRect, layoutKey, minWidthFromAnchor = false, frameClearance = true, boundary } = options
|
|
103
|
+
const [position, setPosition] = useState<CSSProperties | null>(null)
|
|
104
|
+
useLayoutEffect(() => {
|
|
105
|
+
if (!open) {
|
|
106
|
+
@@ -66,7 +75,9 @@ export function useAnchoredPosition(options: AnchoredPositionOptions): CSSProper
|
|
107
|
+
const width = viewport?.width ?? (anchor.ownerDocument.documentElement.clientWidth || win.innerWidth)
|
|
108
|
+
const height = viewport?.height ?? (anchor.ownerDocument.documentElement.clientHeight || win.innerHeight)
|
|
109
|
+
const topMargin = frameClearance ? overlayTopMargin(margin, rect, gap) : margin
|
|
110
|
+
- const maxWidth = Math.max(0, width - margin * 2)
|
|
111
|
+
+ const region = boundary?.() ?? null
|
|
112
|
+
+ const maxWidth = Math.max(0, Math.min(width - margin * 2,
|
|
113
|
+
+ region === null ? Number.POSITIVE_INFINITY : region.width - margin * 2))
|
|
114
|
+
panel.style.setProperty('--dsh-anchored-max-width', `${maxWidth}px`)
|
|
115
|
+
panel.style.setProperty('--dsh-anchored-max-height', `${Math.max(0, height - topMargin - margin)}px`)
|
|
116
|
+
if (minWidthFromAnchor) panel.style.minWidth = `${Math.min(rect.width, maxWidth)}px`
|
|
117
|
+
@@ -76,8 +87,14 @@ export function useAnchoredPosition(options: AnchoredPositionOptions): CSSProper
|
|
118
|
+
const offsetY = visualOrigin ? y : 0
|
|
119
|
+
const left = offsetX + (side === 'right' ? rect.right + gap : align === 'end' ? rect.right - panelWidth : rect.left)
|
|
120
|
+
const top = offsetY + (side === 'right' ? rect.top : side === 'top' ? rect.top - gap - panelHeight : rect.bottom + gap)
|
|
121
|
+
+ // The region narrows the horizontal clamp the same way it narrows the size limit:
|
|
122
|
+
+ // an anchored panel inside a column must not slide under its neighbours.
|
|
123
|
+
+ const minLeft = region === null ? x + margin : Math.max(x + margin, region.left + margin)
|
|
124
|
+
+ const maxLeft = region === null
|
|
125
|
+
+ ? x + width - margin - panelWidth
|
|
126
|
+
+ : Math.min(x + width - margin - panelWidth, region.right - margin - panelWidth)
|
|
127
|
+
next = {
|
|
128
|
+
- left: Math.max(x + margin, Math.min(left, x + width - margin - panelWidth)),
|
|
129
|
+
+ left: Math.max(minLeft, Math.min(left, maxLeft)),
|
|
130
|
+
top: Math.max(y + topMargin, Math.min(top, y + height - margin - panelHeight)),
|
|
131
|
+
}
|
|
272
132
|
}
|
|
273
|
-
|
|
274
|
-
- if (lw > 0) x = Math.min(Math.max(x, MARGIN), vw - lw - MARGIN)
|
|
275
|
-
+ if (lw > 0) x = Math.min(Math.max(x, minX), maxX - placedWidth)
|
|
276
|
-
if (lh > 0) y = Math.min(Math.max(y, overlayTopMargin(MARGIN, r, GAP)), vh - lh - MARGIN)
|
|
277
|
-
|
|
278
|
-
- setFixedPos(current => current?.left === x && current.top === y ? current : { left: x, top: y })
|
|
279
|
-
+ // A bounded card takes the owner's width: the same 12px inset on both
|
|
280
|
-
+ // sides, never wider than the room between them.
|
|
281
|
-
+ const bounds = boundary === undefined
|
|
282
|
-
+ ? {}
|
|
283
|
-
+ : { minWidth: Math.min(218, availableWidth), maxWidth: availableWidth }
|
|
284
|
-
+ setFixedPos(current => current?.left === x && current.top === y
|
|
285
|
-
+ && current.minWidth === bounds.minWidth && current.maxWidth === bounds.maxWidth
|
|
286
|
-
+ ? current
|
|
287
|
-
+ : { left: x, top: y, ...bounds })
|
|
288
|
-
}
|
|
289
|
-
// First run measures the hidden pre-render (same commit as `open`), so
|
|
290
|
-
// end/top alignment and clamping use real dimensions before anything
|
|
291
|
-
@@ -305,7 +325,7 @@ export function Menu({ open, anchor, items = [], children, selectedId, selectedI
|
|
292
|
-
window.removeEventListener('scroll', place, true)
|
|
293
|
-
window.removeEventListener('resize', place)
|
|
294
|
-
}
|
|
295
|
-
- }, [open, portal, align, side, getAnchorRect, minWidthFromAnchor])
|
|
296
|
-
+ }, [open, portal, align, side, getAnchorRect, minWidthFromAnchor, boundaryRef])
|
|
297
|
-
|
|
298
|
-
// Opening remembers where the keyboard was, so closing can hand it back to
|
|
299
|
-
// that control — an anchor wrapping several (a split button) cannot be asked
|
|
300
|
-
diff --git a/packages/client/ui-primitives/tests/atoms.client.spec.tsx b/packages/client/ui-primitives/tests/atoms.client.spec.tsx
|
|
301
|
-
index 8b198e4365..592c56641d 100644
|
|
302
|
-
--- a/packages/client/ui-primitives/tests/atoms.client.spec.tsx
|
|
303
|
-
+++ b/packages/client/ui-primitives/tests/atoms.client.spec.tsx
|
|
304
|
-
@@ -596,6 +596,33 @@ describe('Menu', () => {
|
|
305
|
-
expect(menu.style.top).toBe('132px')
|
|
306
|
-
})
|
|
307
|
-
|
|
308
|
-
+ it('portal mode intersects viewport clamping with an owner boundary', () => {
|
|
309
|
-
+ const offsetWidth = Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'offsetWidth')!
|
|
310
|
-
+ Object.defineProperty(HTMLElement.prototype, 'offsetWidth', { configurable: true, get: () => 300 })
|
|
311
|
-
+ const anchor = { left: 480, right: 500, top: 100, bottom: 128, width: 20, height: 28, x: 480, y: 100, toJSON: () => ({}) } as DOMRect
|
|
312
|
-
+ const boundary = { left: 280, right: 520, top: 0, bottom: 700, width: 240, height: 700, x: 280, y: 0, toJSON: () => ({}) } as DOMRect
|
|
313
|
-
+ try {
|
|
314
|
-
+ render(<Menu
|
|
315
|
-
+ portal
|
|
316
|
-
+ open
|
|
317
|
-
+ align="end"
|
|
318
|
-
+ getAnchorRect={() => anchor}
|
|
319
|
-
+ boundaryRef={{ current: { getBoundingClientRect: () => boundary } as HTMLElement }}
|
|
320
|
-
+ anchor={null}
|
|
321
|
-
+ items={items}
|
|
322
|
-
+ onSelect={() => {}}
|
|
323
|
-
+ onClose={() => {}}
|
|
324
|
-
+ />)
|
|
325
|
-
+ const menu = screen.getByRole('menu')
|
|
326
|
-
+ // The owner is 240px wide, so the 12px insets leave 216px for a 300px card.
|
|
327
|
-
+ expect(menu.style.left).toBe('292px')
|
|
328
|
-
+ expect(menu.style.minWidth).toBe('216px')
|
|
329
|
-
+ expect(menu.style.maxWidth).toBe('216px')
|
|
330
|
-
+ } finally {
|
|
331
|
-
+ Object.defineProperty(HTMLElement.prototype, 'offsetWidth', offsetWidth)
|
|
332
|
-
+ }
|
|
333
|
-
+ })
|
|
334
|
-
+
|
|
335
|
-
it('portal mode skips the frame when getAnchorRect returns null (no menu until a rect exists)', () => {
|
|
336
|
-
render(
|
|
337
|
-
<Menu
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
diff --git a/packages/client/ui-trajectory/src/client/TrajectoryToolbar.module.css b/packages/client/ui-trajectory/src/client/TrajectoryToolbar.module.css
|
|
2
|
-
index
|
|
2
|
+
index ca346565..98f68705 100644
|
|
3
3
|
--- a/packages/client/ui-trajectory/src/client/TrajectoryToolbar.module.css
|
|
4
4
|
+++ b/packages/client/ui-trajectory/src/client/TrajectoryToolbar.module.css
|
|
5
|
-
@@ -
|
|
5
|
+
@@ -178,13 +178,19 @@
|
|
6
6
|
font: 14px/14px var(--ds-font-family-code);
|
|
7
7
|
}
|
|
8
8
|
|
|
@@ -24,7 +24,7 @@ index 2bbc35663a..b2dde8dd3b 100644
|
|
|
24
24
|
gap: 4px;
|
|
25
25
|
border: 0.5px solid var(--dsw-alias-border-l4);
|
|
26
26
|
diff --git a/packages/client/ui-trajectory/src/client/TrajectoryToolbar.tsx b/packages/client/ui-trajectory/src/client/TrajectoryToolbar.tsx
|
|
27
|
-
index
|
|
27
|
+
index 98303805..3a1ad957 100644
|
|
28
28
|
--- a/packages/client/ui-trajectory/src/client/TrajectoryToolbar.tsx
|
|
29
29
|
+++ b/packages/client/ui-trajectory/src/client/TrajectoryToolbar.tsx
|
|
30
30
|
@@ -1,5 +1,6 @@
|
|
@@ -34,7 +34,7 @@ index c3861f03a9..a63ac8823b 100644
|
|
|
34
34
|
import type { TranslateNS } from '@deepseek-ai/dsh-client-ui-slots'
|
|
35
35
|
import { IconSearchOutlineRegular } from '@deepseek-ai/dsh-client-ui-primitives'
|
|
36
36
|
import type { NS } from './locales.ts'
|
|
37
|
-
@@ -
|
|
37
|
+
@@ -30,6 +31,8 @@ export interface TrajectoryToolbarProps {
|
|
38
38
|
searchQuery: string
|
|
39
39
|
/** Update the live ledger search query. */
|
|
40
40
|
onSearchQueryChange: (query: string) => void
|
|
@@ -43,16 +43,16 @@ index c3861f03a9..a63ac8823b 100644
|
|
|
43
43
|
/** Translate a toolbar dictionary key. */
|
|
44
44
|
t: TranslateNS<typeof NS>
|
|
45
45
|
}
|
|
46
|
-
@@ -
|
|
47
|
-
|
|
46
|
+
@@ -52,6 +55,7 @@ export function TrajectoryToolbar({
|
|
47
|
+
onToggleAllSubCalls,
|
|
48
48
|
searchQuery,
|
|
49
49
|
onSearchQueryChange,
|
|
50
50
|
+ utilities,
|
|
51
51
|
t,
|
|
52
52
|
}: TrajectoryToolbarProps) {
|
|
53
53
|
return (
|
|
54
|
-
@@ -
|
|
55
|
-
{t('toolbar.
|
|
54
|
+
@@ -130,7 +134,8 @@ export function TrajectoryToolbar({
|
|
55
|
+
{t('toolbar.subCalls')}
|
|
56
56
|
</button>
|
|
57
57
|
</div>
|
|
58
58
|
- <div className={css.search}>
|
|
@@ -62,7 +62,7 @@ index c3861f03a9..a63ac8823b 100644
|
|
|
62
62
|
<input
|
|
63
63
|
type="search"
|
|
64
64
|
diff --git a/packages/client/ui-trajectory/src/client/TrajectoryView.tsx b/packages/client/ui-trajectory/src/client/TrajectoryView.tsx
|
|
65
|
-
index
|
|
65
|
+
index 3c70561d..e0095772 100644
|
|
66
66
|
--- a/packages/client/ui-trajectory/src/client/TrajectoryView.tsx
|
|
67
67
|
+++ b/packages/client/ui-trajectory/src/client/TrajectoryView.tsx
|
|
68
68
|
@@ -135,7 +135,9 @@ export function TrajectoryView({
|
|
@@ -76,8 +76,8 @@ index 6835939198..47db0ef561 100644
|
|
|
76
76
|
& InjectFace<TrajectoryViewInjected>
|
|
77
77
|
& PropsLocale<'trajectory'>) {
|
|
78
78
|
const [collapsedTurns, setCollapsedTurns] = useState<ReadonlySet<number>>(EMPTY_TURN_IDS)
|
|
79
|
-
@@ -
|
|
80
|
-
|
|
79
|
+
@@ -562,6 +564,7 @@ export function TrajectoryView({
|
|
80
|
+
onToggleAllSubCalls={toggleAllSubCalls}
|
|
81
81
|
searchQuery={searchQuery}
|
|
82
82
|
onSearchQueryChange={setSearchQuery}
|
|
83
83
|
+ utilities={renderSlot('conversation.trajectory.toolbar.utilities', {})}
|
|
@@ -85,7 +85,7 @@ index 6835939198..47db0ef561 100644
|
|
|
85
85
|
/>
|
|
86
86
|
<TrajectoryTimeline
|
|
87
87
|
diff --git a/packages/client/ui-trajectory/src/client/index.ts b/packages/client/ui-trajectory/src/client/index.ts
|
|
88
|
-
index
|
|
88
|
+
index 28bf045a..6e44cb96 100644
|
|
89
89
|
--- a/packages/client/ui-trajectory/src/client/index.ts
|
|
90
90
|
+++ b/packages/client/ui-trajectory/src/client/index.ts
|
|
91
91
|
@@ -38,6 +38,13 @@ export type {
|
|
@@ -115,10 +115,10 @@ index 28bf045ab4..6e44cb96f7 100644
|
|
|
115
115
|
const session = ctx.sessions.binding(sessionId)?.session
|
|
116
116
|
if (session === undefined) {
|
|
117
117
|
diff --git a/packages/client/ui-trajectory/tests/views.client.spec.tsx b/packages/client/ui-trajectory/tests/views.client.spec.tsx
|
|
118
|
-
index
|
|
118
|
+
index 9b61aaef..d5933bad 100644
|
|
119
119
|
--- a/packages/client/ui-trajectory/tests/views.client.spec.tsx
|
|
120
120
|
+++ b/packages/client/ui-trajectory/tests/views.client.spec.tsx
|
|
121
|
-
@@ -
|
|
121
|
+
@@ -251,6 +251,9 @@ function standaloneProps(
|
|
122
122
|
loadImage: () => Promise.reject(new Error('standalone views load no images')),
|
|
123
123
|
// The locale seat the outlet would inject for the declared namespace.
|
|
124
124
|
t: tZh,
|
|
@@ -129,7 +129,7 @@ index c233d3315a..93a0fb5f3f 100644
|
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
diff --git a/packages/session-query/session-log-export/package.json b/packages/session-query/session-log-export/package.json
|
|
132
|
-
index
|
|
132
|
+
index 376163ed..81d87972 100644
|
|
133
133
|
--- a/packages/session-query/session-log-export/package.json
|
|
134
134
|
+++ b/packages/session-query/session-log-export/package.json
|
|
135
135
|
@@ -49,8 +49,8 @@
|
|
@@ -167,7 +167,7 @@ index 083b0e2ba7..a63d999978 100644
|
|
|
167
167
|
"platform": "web"
|
|
168
168
|
}
|
|
169
169
|
diff --git a/packages/session-query/session-log-export/src/client/HeaderAction.module.css b/packages/session-query/session-log-export/src/client/HeaderAction.module.css
|
|
170
|
-
index
|
|
170
|
+
index 90ca1eed..aa22e45e 100644
|
|
171
171
|
--- a/packages/session-query/session-log-export/src/client/HeaderAction.module.css
|
|
172
172
|
+++ b/packages/session-query/session-log-export/src/client/HeaderAction.module.css
|
|
173
173
|
@@ -10,3 +10,46 @@
|
|
@@ -218,7 +218,7 @@ index 90ca1eedbc..aa22e45ead 100644
|
|
|
218
218
|
+ .trajectoryButton { display: inline-flex; }
|
|
219
219
|
+}
|
|
220
220
|
diff --git a/packages/session-query/session-log-export/src/client/HeaderAction.tsx b/packages/session-query/session-log-export/src/client/HeaderAction.tsx
|
|
221
|
-
index
|
|
221
|
+
index fcf0cfd8..74a8209f 100644
|
|
222
222
|
--- a/packages/session-query/session-log-export/src/client/HeaderAction.tsx
|
|
223
223
|
+++ b/packages/session-query/session-log-export/src/client/HeaderAction.tsx
|
|
224
224
|
@@ -1,12 +1,13 @@
|
|
@@ -290,7 +290,7 @@ index fcf0cfd862..74a8209ffa 100644
|
|
|
290
290
|
+ )
|
|
291
291
|
+}
|
|
292
292
|
diff --git a/packages/session-query/session-log-export/src/client/index.ts b/packages/session-query/session-log-export/src/client/index.ts
|
|
293
|
-
index
|
|
293
|
+
index 74808d17..f3acaa07 100644
|
|
294
294
|
--- a/packages/session-query/session-log-export/src/client/index.ts
|
|
295
295
|
+++ b/packages/session-query/session-log-export/src/client/index.ts
|
|
296
296
|
@@ -8,11 +8,16 @@ import type {} from '@deepseek-ai/dsh-client-ui-conversation/client'
|
|
@@ -339,7 +339,7 @@ index 74808d1751..f3acaa0746 100644
|
|
|
339
339
|
|
|
340
340
|
export type { SessionLogDownloadDialogInjected, SessionLogDownloadDialogProps } from './Dialog.tsx'
|
|
341
341
|
diff --git a/packages/session-query/session-log-export/tsconfig.client.json b/packages/session-query/session-log-export/tsconfig.client.json
|
|
342
|
-
index
|
|
342
|
+
index c78dbf68..5e4fd918 100644
|
|
343
343
|
--- a/packages/session-query/session-log-export/tsconfig.client.json
|
|
344
344
|
+++ b/packages/session-query/session-log-export/tsconfig.client.json
|
|
345
345
|
@@ -28,6 +28,7 @@
|
|
@@ -1,114 +1,5 @@
|
|
|
1
|
-
diff --git a/packages/client/ui-schedule/src/client/TaskManagerPage.module.css b/packages/client/ui-schedule/src/client/TaskManagerPage.module.css
|
|
2
|
-
index 7c4acf5a3d..ea9d29e2e3 100644
|
|
3
|
-
--- a/packages/client/ui-schedule/src/client/TaskManagerPage.module.css
|
|
4
|
-
+++ b/packages/client/ui-schedule/src/client/TaskManagerPage.module.css
|
|
5
|
-
@@ -149,6 +149,12 @@
|
|
6
|
-
neutral hairline, the 10px radius, and the mock's `--muted` leading icon. The
|
|
7
|
-
mock brightens the border on hover and takes the brand stroke on focus
|
|
8
|
-
rather than drawing a ring around the control. */
|
|
9
|
-
+/* The runtime extension tab keeps the page's centered column, so a contributor
|
|
10
|
-
+ body lines up with the search field and the task rows. */
|
|
11
|
-
+.plazaBody {
|
|
12
|
-
+ min-width: 0;
|
|
13
|
-
+}
|
|
14
|
-
+
|
|
15
|
-
.searchTools {
|
|
16
|
-
--task-search-height: 36px;
|
|
17
|
-
display: flex;
|
|
18
|
-
diff --git a/packages/client/ui-schedule/src/client/TaskManagerPage.tsx b/packages/client/ui-schedule/src/client/TaskManagerPage.tsx
|
|
19
|
-
index 3c330c9f26..f7e7b78312 100644
|
|
20
|
-
--- a/packages/client/ui-schedule/src/client/TaskManagerPage.tsx
|
|
21
|
-
+++ b/packages/client/ui-schedule/src/client/TaskManagerPage.tsx
|
|
22
|
-
@@ -5,7 +5,7 @@ import {
|
|
23
|
-
Button, IconClockOutlineRegular, IconCloseOutlineRegular, IconEllipsisOutlineRegular, IconPlusOutlineRegular,
|
|
24
|
-
IconSearchOutlineRegular, IconTrashOutlineRegular, Input, Menu, Modal, Tooltip,
|
|
25
|
-
} from '@deepseek-ai/dsh-client-ui-primitives'
|
|
26
|
-
-import type { HostObservable, InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'
|
|
27
|
-
+import type { HostObservable, InjectFace, PropsLocale, PropsRenderSlots, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'
|
|
28
|
-
import type {} from '@deepseek-ai/dsh-client-ui-layout/client'
|
|
29
|
-
import type { ScheduleCatalogEntry, ScheduleId } from '@deepseek-ai/dsh-schedule/client'
|
|
30
|
-
import type { CatalogSnapshot } from './catalog-source.ts'
|
|
31
|
-
@@ -36,14 +36,26 @@ export interface TaskManagerInjected extends TaskDetailInjected {
|
|
32
|
-
* @returns resolution after the outcome is reported.
|
|
33
|
-
*/
|
|
34
|
-
readonly onClearEnded: () => Promise<void>
|
|
35
|
-
+ /**
|
|
36
|
-
+ * Whether a plugin currently contributes the page's runtime extension tab.
|
|
37
|
-
+ *
|
|
38
|
-
+ * The page reads this while rendering, so a contributor that registers after
|
|
39
|
-
+ * the page mounted still makes its tab appear on the next render; with no
|
|
40
|
-
+ * contributor the page keeps exactly its three status tabs.
|
|
41
|
-
+ * @returns true when the `schedule.manager.tabs` seat has an occupant.
|
|
42
|
-
+ */
|
|
43
|
-
+ readonly plazaAvailable?: () => boolean
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/** Root-scoped task catalog props derived from the framework and injected actions. */
|
|
47
|
-
export type TaskManagerPageProps = PropsRuntime<'main'>
|
|
48
|
-
& InjectFace<TaskManagerInjected>
|
|
49
|
-
& PropsLocale<'schedule.manager'>
|
|
50
|
-
+ // Narrowed to the one seat this page declares; optional so a unit test can
|
|
51
|
-
+ // render the page without a slot host, as every other page-level test does.
|
|
52
|
-
+ & Partial<PropsRenderSlots<'schedule.manager.tabs'>>
|
|
53
|
-
|
|
54
|
-
-type StatusFilter = 'all' | ScheduleCatalogEntry['status']
|
|
55
|
-
+type StatusFilter = 'all' | ScheduleCatalogEntry['status'] | 'plaza'
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Render retained tasks with authoritative deletion and timing-only edits.
|
|
59
|
-
@@ -51,7 +63,7 @@ type StatusFilter = 'all' | ScheduleCatalogEntry['status']
|
|
60
|
-
* @returns the searchable task list beside the selected task's detail.
|
|
61
|
-
*/
|
|
62
|
-
export function TaskManagerPage(props: TaskManagerPageProps) {
|
|
63
|
-
- const { useCatalog, onNewTask, onClearEnded, onRetry, t } = props
|
|
64
|
-
+ const { useCatalog, onNewTask, onClearEnded, onRetry, plazaAvailable, renderSlot, t } = props
|
|
65
|
-
const catalog = useCatalog(snapshot => snapshot)
|
|
66
|
-
const { records, status } = catalog
|
|
67
|
-
const [search, setSearch] = useState('')
|
|
68
|
-
@@ -85,7 +97,7 @@ export function TaskManagerPage(props: TaskManagerPageProps) {
|
|
69
|
-
const rows = useMemo(() => {
|
|
70
|
-
const query = search.trim().toLowerCase()
|
|
71
|
-
return records.filter(record => (
|
|
72
|
-
- (statusFilter === 'all' || record.status === statusFilter)
|
|
73
|
-
+ (statusFilter === 'all' || (statusFilter !== 'plaza' && record.status === statusFilter))
|
|
74
|
-
&& (record.prompt.toLowerCase().includes(query)
|
|
75
|
-
|| record.sessionId.toLowerCase().includes(query)
|
|
76
|
-
|| taskName(record).toLowerCase().includes(query))
|
|
77
|
-
@@ -202,8 +214,24 @@ export function TaskManagerPage(props: TaskManagerPageProps) {
|
|
78
|
-
{t(value === 'all' ? 'statusFilter.all' : `status.${value}`)}
|
|
79
|
-
</button>
|
|
80
|
-
))}
|
|
81
|
-
+ {plazaAvailable?.() === true && (
|
|
82
|
-
+ <button
|
|
83
|
-
+ type="button"
|
|
84
|
-
+ className={clsx(css.filterTab, statusFilter === 'plaza' && css.filterTabActive)}
|
|
85
|
-
+ aria-pressed={statusFilter === 'plaza'}
|
|
86
|
-
+ data-testid="task-manager-plaza-tab"
|
|
87
|
-
+ onClick={() => { setStatusFilter('plaza') }}
|
|
88
|
-
+ >
|
|
89
|
-
+ {t('statusFilter.plaza')}
|
|
90
|
-
+ </button>
|
|
91
|
-
+ )}
|
|
92
|
-
</div>
|
|
93
|
-
</div>
|
|
94
|
-
+ {statusFilter === 'plaza' ? (
|
|
95
|
-
+ <div className={css.plazaBody} data-testid="task-manager-plaza-body">
|
|
96
|
-
+ {renderSlot?.('schedule.manager.tabs', {})}
|
|
97
|
-
+ </div>
|
|
98
|
-
+ ) : (<>
|
|
99
|
-
<div className={css.searchTools}>
|
|
100
|
-
<div className={css.searchField}>
|
|
101
|
-
<Input
|
|
102
|
-
@@ -299,6 +327,7 @@ export function TaskManagerPage(props: TaskManagerPageProps) {
|
|
103
|
-
})}
|
|
104
|
-
</ul>
|
|
105
|
-
</div>
|
|
106
|
-
+ </>)}
|
|
107
|
-
</div>
|
|
108
|
-
</div>
|
|
109
|
-
</div>
|
|
110
1
|
diff --git a/packages/client/ui-schedule/src/client/index.ts b/packages/client/ui-schedule/src/client/index.ts
|
|
111
|
-
index
|
|
2
|
+
index 5df35309..8ae6791e 100644
|
|
112
3
|
--- a/packages/client/ui-schedule/src/client/index.ts
|
|
113
4
|
+++ b/packages/client/ui-schedule/src/client/index.ts
|
|
114
5
|
@@ -73,6 +73,21 @@ declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
@@ -119,10 +10,10 @@ index 7dcbc32ee3..cd072150e7 100644
|
|
|
119
10
|
+ /**
|
|
120
11
|
+ * One extension body contributed at runtime to the automation-task page.
|
|
121
12
|
+ *
|
|
122
|
-
+ * The page renders the single occupant as an additional status tab and
|
|
123
|
-
+ *
|
|
124
|
-
+ *
|
|
125
|
-
+ *
|
|
13
|
+
+ * The page renders the single occupant as an additional status tab and supplies no owner
|
|
14
|
+
+ * props: a contributor owns its own data and needs no identity from the page. The seat
|
|
15
|
+
+ * belongs to no Session, so opening the page never mounts a contributor against an arbitrary
|
|
16
|
+
+ * conversation.
|
|
126
17
|
+ */
|
|
127
18
|
+ 'schedule.manager.tabs': {
|
|
128
19
|
+ kind: 'single'
|
|
@@ -132,86 +23,86 @@ index 7dcbc32ee3..cd072150e7 100644
|
|
|
132
23
|
+ }
|
|
133
24
|
}
|
|
134
25
|
|
|
135
|
-
/** Required services for catalogs, ambient Session marks, the right Sidebar, Remote queries,
|
|
136
|
-
@@ -
|
|
137
|
-
name: 'main',
|
|
26
|
+
/** Required services for catalogs, ambient Session marks, the right Sidebar, Remote queries, linked-Session navigation, and access. */
|
|
27
|
+
@@ -220,8 +235,13 @@ export function apply(ctx: ClientContext): void {
|
|
138
28
|
key: PANEL_ID,
|
|
139
29
|
locale: MANAGER_NS,
|
|
140
|
-
|
|
141
|
-
+ //
|
|
142
|
-
+ // a tab body without this package
|
|
30
|
+
store: createEditorStore(),
|
|
31
|
+
+ // The automation page is the one first-level page that accepts a runtime extension tab.
|
|
32
|
+
+ // Declaring the seat here is what lets a plugin contribute a tab body without this package
|
|
33
|
+
+ // importing that plugin.
|
|
143
34
|
+ children: { 'schedule.manager.tabs': { kind: 'single', scope: 'root' } },
|
|
144
35
|
inject: (): TaskManagerInjected => ({
|
|
145
36
|
...detail,
|
|
146
37
|
+ plazaAvailable: () => ctx.slots.entriesOfSlot('schedule.manager.tabs').length > 0,
|
|
147
|
-
|
|
148
|
-
onNewTask: () => { ctx.uiWorkspace.startSession() },
|
|
38
|
+
onNewTask: () => { ctx.uiWorkspace.startSession(undefined, { prompt: t('host.createPrompt'), whenDraftExists: 'append' }) },
|
|
149
39
|
onClearEnded: async () => {
|
|
40
|
+
const outcome = await clearEnded()
|
|
150
41
|
diff --git a/packages/client/ui-schedule/src/client/task-manager-locales.ts b/packages/client/ui-schedule/src/client/task-manager-locales.ts
|
|
151
|
-
index
|
|
42
|
+
index 13ef7c90..b6b3a90e 100644
|
|
152
43
|
--- a/packages/client/ui-schedule/src/client/task-manager-locales.ts
|
|
153
44
|
+++ b/packages/client/ui-schedule/src/client/task-manager-locales.ts
|
|
154
|
-
@@ -
|
|
45
|
+
@@ -65,6 +65,7 @@ export const en = {
|
|
155
46
|
'empty.action': 'New automation task',
|
|
156
47
|
'statusFilter.label': 'Task status',
|
|
157
48
|
'statusFilter.all': 'All',
|
|
158
49
|
+ 'statusFilter.plaza': 'Workflow plaza',
|
|
159
50
|
'status.active': 'Enabled',
|
|
160
|
-
'status.inactive': 'Inactive',
|
|
161
51
|
'detail.label': 'Task details',
|
|
162
|
-
|
|
52
|
+
'detail.close': 'Close details',
|
|
53
|
+
@@ -231,6 +232,7 @@ export const zh: Record<TaskManagerKey, string> = {
|
|
163
54
|
'empty.action': '新建自动化任务',
|
|
164
55
|
'statusFilter.label': '任务状态',
|
|
165
56
|
'statusFilter.all': '全部',
|
|
166
57
|
+ 'statusFilter.plaza': '工作流广场',
|
|
167
58
|
'status.active': '已开启',
|
|
168
|
-
'status.inactive': '已结束',
|
|
169
59
|
'detail.label': '任务详情',
|
|
170
|
-
|
|
60
|
+
'detail.close': '关闭详情',
|
|
61
|
+
@@ -392,6 +394,7 @@ export const ja = {
|
|
171
62
|
'empty.action': '新規自動化タスク',
|
|
172
63
|
'statusFilter.label': 'タスクの状態',
|
|
173
64
|
'statusFilter.all': 'すべて',
|
|
174
65
|
+ 'statusFilter.plaza': 'ワークフロープラザ',
|
|
175
66
|
'status.active': '有効',
|
|
176
|
-
'status.inactive': '無効',
|
|
177
67
|
'detail.label': 'タスクの詳細',
|
|
178
|
-
|
|
68
|
+
'detail.close': '詳細を閉じる',
|
|
69
|
+
@@ -507,6 +510,7 @@ export const es = {
|
|
179
70
|
'empty.action': 'Nueva tarea de automatización',
|
|
180
71
|
'statusFilter.label': 'Estado de la tarea',
|
|
181
72
|
'statusFilter.all': 'Todos',
|
|
182
73
|
+ 'statusFilter.plaza': 'Plaza de flujos',
|
|
183
74
|
'status.active': 'Habilitado',
|
|
184
|
-
'status.inactive': 'Inactivo',
|
|
185
75
|
'detail.label': 'Detalles de la tarea',
|
|
186
|
-
|
|
76
|
+
'detail.close': 'Cerrar detalles',
|
|
77
|
+
@@ -668,6 +672,7 @@ export const fr = {
|
|
187
78
|
'empty.action': "Nouvelle tâche d'automatisation",
|
|
188
79
|
'statusFilter.label': 'Statut de la tâche',
|
|
189
80
|
'statusFilter.all': 'Tout',
|
|
190
81
|
+ 'statusFilter.plaza': 'Place des workflows',
|
|
191
82
|
'status.active': 'Activé',
|
|
192
|
-
'status.inactive': 'Inactif',
|
|
193
83
|
'detail.label': 'Détails de la tâche',
|
|
194
|
-
|
|
84
|
+
'detail.close': 'Fermer les détails',
|
|
85
|
+
@@ -829,6 +834,7 @@ export const de = {
|
|
195
86
|
'empty.action': 'Neue Automatisierungsaufgabe',
|
|
196
87
|
'statusFilter.label': 'Aufgabenstatus',
|
|
197
88
|
'statusFilter.all': 'Alle',
|
|
198
89
|
+ 'statusFilter.plaza': 'Workflow-Plaza',
|
|
199
90
|
'status.active': 'Aktiviert',
|
|
200
|
-
'status.inactive': 'Inaktiv',
|
|
201
91
|
'detail.label': 'Aufgabendetails',
|
|
202
|
-
|
|
92
|
+
'detail.close': 'Details schließen',
|
|
93
|
+
@@ -990,6 +996,7 @@ export const ru = {
|
|
203
94
|
'empty.action': 'Новая задача автоматизации',
|
|
204
95
|
'statusFilter.label': 'Статус задачи',
|
|
205
96
|
'statusFilter.all': 'Все',
|
|
206
97
|
+ 'statusFilter.plaza': 'Витрина сценариев',
|
|
207
98
|
'status.active': 'Включено',
|
|
208
|
-
'status.inactive': 'Неактивный',
|
|
209
99
|
'detail.label': 'Подробности задачи',
|
|
210
|
-
|
|
100
|
+
'detail.close': 'Закрыть детали',
|
|
101
|
+
@@ -1151,6 +1158,7 @@ export const pt = {
|
|
211
102
|
'empty.action': 'Nova tarefa de automação',
|
|
212
103
|
'statusFilter.label': 'Status da tarefa',
|
|
213
104
|
'statusFilter.all': 'Todos',
|
|
214
105
|
+ 'statusFilter.plaza': 'Praça de fluxos',
|
|
215
106
|
'status.active': 'Habilitado',
|
|
216
|
-
'status.inactive': 'Inativo',
|
|
217
107
|
'detail.label': 'Detalhes da tarefa',
|
|
108
|
+
'detail.close': 'Fechar detalhes',
|