@sparkelf/dsh-plus 0.2.9-alpha.56 → 0.2.9-alpha.58

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
@@ -331,6 +331,21 @@
331
331
  ]
332
332
  }
333
333
  },
334
+ {
335
+ "dsh": ">=0.2.2-alpha.2",
336
+ "file": "./patches/input-trigger-source-label.patch",
337
+ "id": "input-trigger-source-label",
338
+ "retireWhen": "官方 composer 的 @ 菜单显示来源分组名后退役",
339
+ "target": {
340
+ "kind": "dsh-source",
341
+ "packages": [
342
+ "@deepseek-ai/dsh-client-ui-conversation"
343
+ ],
344
+ "paths": [
345
+ "packages/client/ui-conversation/"
346
+ ]
347
+ }
348
+ },
334
349
  {
335
350
  "dsh": ">=0.2.2-alpha.2",
336
351
  "file": "./patches/legacy-code-preset.patch",
@@ -719,7 +734,7 @@
719
734
  "@sparkelf/dsh-dataops-account": "0.2.0",
720
735
  "@sparkelf/dsh-dataops-managed": "0.3.39",
721
736
  "@sparkelf/dsh-genui": "0.15.0-sparkelf.3",
722
- "@sparkelf/dsh-group-chat": "0.5.4",
737
+ "@sparkelf/dsh-group-chat": "0.5.6",
723
738
  "@sparkelf/dsh-kb-citation": "0.1.3",
724
739
  "@sparkelf/dsh-knowledge-base": "0.1.32",
725
740
  "@sparkelf/dsh-mineru": "0.1.4",
@@ -790,5 +805,5 @@
790
805
  },
791
806
  "type": "module",
792
807
  "types": "lib/types/index.d.ts",
793
- "version": "0.2.9-alpha.56"
808
+ "version": "0.2.9-alpha.58"
794
809
  }
@@ -0,0 +1,63 @@
1
+ diff --git a/packages/client/ui-input-trigger/src/client/MenuView.tsx b/packages/client/ui-input-trigger/src/client/MenuView.tsx
2
+ index da6dccdbad..42a7726014 100644
3
+ --- a/packages/client/ui-input-trigger/src/client/MenuView.tsx
4
+ +++ b/packages/client/ui-input-trigger/src/client/MenuView.tsx
5
+ @@ -143,7 +143,7 @@ export function MenuView({ menu, headers, onPick, onCrumb, onHover, onDismiss, t
6
+ shows its raw name — hence the cast past the typed key union. */}
7
+ {group.showGroupTitle === false || group.items.some(item => item.section !== undefined)
8
+ ? null
9
+ - : <div className={css.groupTitle} role="presentation" data-source={group.source}>{t(group.source as MenuKey)}</div>}
10
+ + : <div className={css.groupTitle} role="presentation" data-source={group.source}>{group.label ?? t(group.source as MenuKey)}</div>}
11
+ {group.status === 'pending' && group.items.length === 0
12
+ ? (
13
+ <div role="status" aria-label={t('loading')} data-source={group.source}>
14
+ diff --git a/packages/client/ui-input-trigger/src/core/contract.ts b/packages/client/ui-input-trigger/src/core/contract.ts
15
+ index eab79f1066..856555ca0d 100644
16
+ --- a/packages/client/ui-input-trigger/src/core/contract.ts
17
+ +++ b/packages/client/ui-input-trigger/src/core/contract.ts
18
+ @@ -37,6 +37,8 @@ export interface MenuState {
19
+ readonly generation: number
20
+ readonly groups: readonly {
21
+ readonly source: string
22
+ + /** Display title for the group row; absent renders the source id, as it always has. */
23
+ + readonly label?: string
24
+ /** False when candidate section rows own all visible group labeling. */
25
+ readonly showGroupTitle?: boolean
26
+ readonly status: 'pending' | 'ready'
27
+ diff --git a/packages/client/ui-input-trigger/src/core/menu.ts b/packages/client/ui-input-trigger/src/core/menu.ts
28
+ index 85787266a5..b3e8476132 100644
29
+ --- a/packages/client/ui-input-trigger/src/core/menu.ts
30
+ +++ b/packages/client/ui-input-trigger/src/core/menu.ts
31
+ @@ -29,12 +29,13 @@ export const MENU_CLOSED: MenuState = { open: false, hit: null, generation: 0, g
32
+ */
33
+ export function seedGroups(
34
+ state: MenuState,
35
+ - sources: readonly Pick<InputTriggerSource, 'name' | 'showGroupTitle'>[],
36
+ + sources: readonly Pick<InputTriggerSource, 'name' | 'label' | 'showGroupTitle'>[],
37
+ ): MenuState {
38
+ return {
39
+ ...state,
40
+ groups: sources.map(source => ({
41
+ source: source.name,
42
+ + ...(source.label === undefined ? {} : { label: source.label }),
43
+ ...(source.showGroupTitle === false ? { showGroupTitle: false } : {}),
44
+ status: 'pending',
45
+ items: [],
46
+ diff --git a/packages/client/ui-input-trigger/src/types.ts b/packages/client/ui-input-trigger/src/types.ts
47
+ index cd3f6bc54c..4b370b5127 100644
48
+ --- a/packages/client/ui-input-trigger/src/types.ts
49
+ +++ b/packages/client/ui-input-trigger/src/types.ts
50
+ @@ -161,6 +161,13 @@ export interface InputTriggerSource {
51
+ readonly trigger: TriggerChar
52
+ /** Menu group label; unique per trigger — duplicate registration throws. */
53
+ readonly name: string
54
+ + /**
55
+ + * Menu group display title. The raw `name` is shown when absent, which is why an unregistered
56
+ + * source renders its own id; a plugin whose name is a package path sets this to the words a
57
+ + * reader expects. It never appears in a pick, a reference, or a stored mention -- identity stays
58
+ + * `name`.
59
+ + */
60
+ + readonly label?: string
61
+ /** Menu group display order (lower = higher in the list; default 0). */
62
+ readonly order?: number
63
+ /** Whether the menu renders the source-title row; defaults to true. */