>
& FilesInjected
& PropsLocale<'sidebarFiles'>
@@ -135,7 +136,7 @@ function Level({ path, tree }: { path: string; tree: TreeContext }): ReactNode {
/** The file tree's body: the workspace root and whatever the reader has opened under it. */
export function FilesBody({
- useTabInfo, sessionId, useSessions, useStore, actions, start, refresh, setAutoRefresh, toggle, t,
+ useTabInfo, sessionId, useSessions, useStore, actions, start, refresh, setAutoRefresh, toggle, t, renderSlot,
}: FilesBodyProps): ReactNode {
const { tab } = useTabInfo()
useEffect(() => tab.actions.bindCommands({ refresh: () => { refresh(tab.id) } }), [tab.actions, tab.id, refresh])
@@ -210,6 +211,7 @@ export function FilesBody({
+ {renderSlot('sidebar.right.tab.files.actions', {})}
ctx.slots.inject('sidebar.right.pane.tab', () => ctx.slots.register(
- { name: 'sidebar.right.pane.tab', key: FILES_ID, locale: NS, store, inject },
+ {
+ name: 'sidebar.right.pane.tab', key: FILES_ID, locale: NS, store, inject,
+ children: { 'sidebar.right.tab.files.actions': { kind: 'list', scope: 'session' } },
+ },
FilesBody,
)), 'ui-sidebar-files: files tab body')
ctx.effect(() => ctx.slots.inject('sidebar.right.pane.tab.title', () => ctx.slots.register(
diff --git a/packages/client/ui-sidebar-files/tests/mount.client.tsx b/packages/client/ui-sidebar-files/tests/mount.client.tsx
index 78597ba17b..5646e773fb 100644
--- a/packages/client/ui-sidebar-files/tests/mount.client.tsx
+++ b/packages/client/ui-sidebar-files/tests/mount.client.tsx
@@ -87,6 +87,7 @@ function harness(cwd: string | null, refreshShortcut?: ReturnType null,
sessionId: SESSION,
useSessions: (sel: (s: SessionListState) => S) => sel(sessions),
useStore: hookOf(instance),
diff --git a/packages/extensions/cordis-client-runner/src/client/slot-catalog.ts b/packages/extensions/cordis-client-runner/src/client/slot-catalog.ts
index 9b84cb4413..606b206f3f 100644
--- a/packages/extensions/cordis-client-runner/src/client/slot-catalog.ts
+++ b/packages/extensions/cordis-client-runner/src/client/slot-catalog.ts
@@ -3453,6 +3453,62 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [
example: 'return {\n inject: [\'slots\'],\n apply(ctx) {\n ctx.slots.inject(\'sidebar.right.tab.document.unpreviewable\', () => ctx.slots.register(\n { name: \'sidebar.right.tab.document.unpreviewable\', id: \'my-entry\', order: 100, label: \'My entry\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}',
source: 'packages/client/ui-sidebar-documentpreview/src/client/document/contract.ts:78',
},
+ {
+ key: 'sidebar.right.tab.files.actions',
+ kind: 'list',
+ scope: 'session',
+ summary: 'Workspace directory actions after the file tree\'s reload control.',
+ doc: 'Workspace directory actions after the file tree\'s reload control.',
+ registerOptions: [
+ {
+ name: 'id',
+ requirement: 'required',
+ type: 'string',
+ doc: 'Your cell key. Use an id of your own: a fresh id is added beside the shipped entries, while reusing a shipped id puts you in THAT cell and replaces it. Owners that filter by id address you by it.',
+ },
+ {
+ name: 'order',
+ requirement: 'optional',
+ type: 'number',
+ doc: 'Position among the entries, ascending (default 0).',
+ },
+ {
+ name: 'label',
+ requirement: 'optional',
+ type: 'string | (() => string)',
+ doc: 'Display text where the owner projects one (nav rows, tabs). A thunk is re-read on every projection, so localized text follows the active locale without re-registering.',
+ },
+ ],
+ ownerProps: [],
+ ownerPropsReferences: [],
+ standardProps: [
+ 'useResource: UseResource',
+ 'useWorkspaces: SnapshotSelectorHook',
+ 'usePanelInfo: UsePanelInfo',
+ 'useSessions: UseSessions',
+ 'useSessionStatus: UseSessionStatus',
+ 'useSessionRetainInfo: UseSessionRetainInfo',
+ 'useWorkspaces: SnapshotSelectorHook',
+ 'useChat: UseChat',
+ 'useConversation: UseConversation',
+ 'useInput: SnapshotSelectorHook',
+ 'inputActions: InputActions',
+ 'useSession: SessionSnapshotSelector',
+ 'sessionId: SessionId',
+ 'useProjection: UseProjection',
+ 'useTrajectory: UseTrajectory',
+ ],
+ keyDomain: '',
+ hookContext: '',
+ slotInject: '',
+ declaredBy: 'an entry in \'sidebar.right.pane.tab\' (client-ui-sidebar-files), so it exists while that entry is mounted',
+ occupants: [
+ 'client-ui-open-in-app OpenInAppAction id \'open-in-app\'',
+ ],
+ replaceRisk: 'none',
+ example: 'return {\n inject: [\'slots\'],\n apply(ctx) {\n ctx.slots.inject(\'sidebar.right.tab.files.actions\', () => ctx.slots.register(\n { name: \'sidebar.right.tab.files.actions\', id: \'my-entry\', order: 100, label: \'My entry\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}',
+ source: 'packages/client/ui-sidebar-files/src/client/index.ts:34',
+ },
{
key: 'sidebar.right.tab.guide',
kind: 'chain',
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index f4d3188cbc..cf730271b8 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -4142,6 +4142,9 @@ importers:
'@deepseek-ai/dsh-client-ui-sidebar-documentpreview':
specifier: workspace:*
version: link:../ui-sidebar-documentpreview
+ '@deepseek-ai/dsh-client-ui-sidebar-files':
+ specifier: workspace:*
+ version: link:../ui-sidebar-files
'@deepseek-ai/dsh-client-ui-slots':
specifier: workspace:*
version: link:../ui-slots