Kaynağa Gözat

refactor(client): rename document preview package

imccyu 1 ay önce
ebeveyn
işleme
dcfd8c299d
100 değiştirilmiş dosya ile 65 ekleme ve 65 silme
  1. 1 1
      apps/web/tests/document-preview.e2e.ts
  2. 1 1
      docs/config-catalog.md
  3. 1 1
      docs/config-catalog.zh.md
  4. 2 2
      docs/module-graph.md
  5. 2 2
      docs/module-graph.zh.md
  6. 5 5
      docs/subsystems/sidebar-right.md
  7. 5 5
      docs/subsystems/sidebar-right.zh.md
  8. 1 1
      packages/api/workspace-files/README.md
  9. 1 1
      packages/api/workspace-files/README.zh.md
  10. 2 2
      packages/bundle/web-app/cordis.patch.yml
  11. 1 1
      packages/bundle/web-app/package.json
  12. 1 1
      packages/client/ui-chat/package.json
  13. 1 1
      packages/client/ui-chat/src/client/apply.ts
  14. 1 1
      packages/client/ui-chat/tsconfig.json
  15. 1 1
      packages/client/ui-sidebar-documentpreview/README.i18n.yaml
  16. 3 3
      packages/client/ui-sidebar-documentpreview/README.md
  17. 3 3
      packages/client/ui-sidebar-documentpreview/README.zh.md
  18. 2 2
      packages/client/ui-sidebar-documentpreview/package.json
  19. 0 0
      packages/client/ui-sidebar-documentpreview/src/client/LoadingIndicator.module.css
  20. 0 0
      packages/client/ui-sidebar-documentpreview/src/client/LoadingIndicator.tsx
  21. 0 0
      packages/client/ui-sidebar-documentpreview/src/client/TextPreview.module.css
  22. 1 1
      packages/client/ui-sidebar-documentpreview/src/client/TextPreview.tsx
  23. 0 0
      packages/client/ui-sidebar-documentpreview/src/client/code/CodeBody.module.css
  24. 1 1
      packages/client/ui-sidebar-documentpreview/src/client/code/CodeBody.tsx
  25. 1 1
      packages/client/ui-sidebar-documentpreview/src/client/code/index.ts
  26. 0 0
      packages/client/ui-sidebar-documentpreview/src/client/code/languages.ts
  27. 0 0
      packages/client/ui-sidebar-documentpreview/src/client/code/locales.ts
  28. 1 1
      packages/client/ui-sidebar-documentpreview/src/client/definition.ts
  29. 0 0
      packages/client/ui-sidebar-documentpreview/src/client/document/contract.ts
  30. 0 0
      packages/client/ui-sidebar-documentpreview/src/client/document/registry.ts
  31. 0 0
      packages/client/ui-sidebar-documentpreview/src/client/face.ts
  32. 1 1
      packages/client/ui-sidebar-documentpreview/src/client/failure-line.ts
  33. 0 0
      packages/client/ui-sidebar-documentpreview/src/client/html/HtmlBody.module.css
  34. 0 0
      packages/client/ui-sidebar-documentpreview/src/client/html/HtmlBody.tsx
  35. 0 0
      packages/client/ui-sidebar-documentpreview/src/client/html/bootstrap.ts
  36. 0 0
      packages/client/ui-sidebar-documentpreview/src/client/html/bytes.ts
  37. 1 1
      packages/client/ui-sidebar-documentpreview/src/client/html/index.ts
  38. 0 0
      packages/client/ui-sidebar-documentpreview/src/client/html/locales.ts
  39. 0 0
      packages/client/ui-sidebar-documentpreview/src/client/html/pack.ts
  40. 0 0
      packages/client/ui-sidebar-documentpreview/src/client/html/read-relative.ts
  41. 0 0
      packages/client/ui-sidebar-documentpreview/src/client/icons.tsx
  42. 6 6
      packages/client/ui-sidebar-documentpreview/src/client/index.ts
  43. 3 3
      packages/client/ui-sidebar-documentpreview/src/client/locales.ts
  44. 0 0
      packages/client/ui-sidebar-documentpreview/src/client/markdown/MarkdownBody.module.css
  45. 0 0
      packages/client/ui-sidebar-documentpreview/src/client/markdown/MarkdownBody.tsx
  46. 1 1
      packages/client/ui-sidebar-documentpreview/src/client/markdown/index.ts
  47. 0 0
      packages/client/ui-sidebar-documentpreview/src/client/markdown/locales.ts
  48. 0 0
      packages/client/ui-sidebar-documentpreview/src/client/pdf/PdfBody.module.css
  49. 0 0
      packages/client/ui-sidebar-documentpreview/src/client/pdf/PdfBody.tsx
  50. 0 0
      packages/client/ui-sidebar-documentpreview/src/client/pdf/asset-imports.d.ts
  51. 0 0
      packages/client/ui-sidebar-documentpreview/src/client/pdf/assets.ts
  52. 0 0
      packages/client/ui-sidebar-documentpreview/src/client/pdf/document.ts
  53. 0 0
      packages/client/ui-sidebar-documentpreview/src/client/pdf/errors.ts
  54. 1 1
      packages/client/ui-sidebar-documentpreview/src/client/pdf/index.ts
  55. 0 0
      packages/client/ui-sidebar-documentpreview/src/client/pdf/locales.ts
  56. 0 0
      packages/client/ui-sidebar-documentpreview/src/client/pdf/runtime.ts
  57. 0 0
      packages/client/ui-sidebar-documentpreview/src/client/pdf/store.ts
  58. 1 1
      packages/client/ui-sidebar-documentpreview/src/client/rpc.ts
  59. 0 0
      packages/client/ui-sidebar-documentpreview/src/client/store.ts
  60. 0 0
      packages/client/ui-sidebar-documentpreview/src/client/text/TextBody.tsx
  61. 2 2
      packages/client/ui-sidebar-documentpreview/src/client/text/index.ts
  62. 0 0
      packages/client/ui-sidebar-documentpreview/src/client/text/lines.ts
  63. 0 0
      packages/client/ui-sidebar-documentpreview/src/css-modules.d.ts
  64. 0 0
      packages/client/ui-sidebar-documentpreview/src/index.ts
  65. 4 4
      packages/client/ui-sidebar-documentpreview/tests/apply.client.spec.ts
  66. 0 0
      packages/client/ui-sidebar-documentpreview/tests/code-body.client.spec.tsx
  67. 0 0
      packages/client/ui-sidebar-documentpreview/tests/code-languages.client.spec.ts
  68. 1 1
      packages/client/ui-sidebar-documentpreview/tests/code-registration.client.spec.tsx
  69. 0 0
      packages/client/ui-sidebar-documentpreview/tests/definition.client.spec.ts
  70. 0 0
      packages/client/ui-sidebar-documentpreview/tests/document-registry.client.spec.ts
  71. 0 0
      packages/client/ui-sidebar-documentpreview/tests/document-seat.client.spec.tsx
  72. 0 0
      packages/client/ui-sidebar-documentpreview/tests/document-toolbar.client.spec.tsx
  73. 0 0
      packages/client/ui-sidebar-documentpreview/tests/face.client.spec.ts
  74. 2 2
      packages/client/ui-sidebar-documentpreview/tests/failure-line.client.spec.ts
  75. 0 0
      packages/client/ui-sidebar-documentpreview/tests/fixtures.client.ts
  76. 0 0
      packages/client/ui-sidebar-documentpreview/tests/html-apply.client.spec.ts
  77. 0 0
      packages/client/ui-sidebar-documentpreview/tests/html-body.client.spec.tsx
  78. 0 0
      packages/client/ui-sidebar-documentpreview/tests/html-bootstrap.client.spec.ts
  79. 0 0
      packages/client/ui-sidebar-documentpreview/tests/html-pack.client.spec.ts
  80. 0 0
      packages/client/ui-sidebar-documentpreview/tests/html-read-relative.client.spec.ts
  81. 0 0
      packages/client/ui-sidebar-documentpreview/tests/lines.client.spec.ts
  82. 0 0
      packages/client/ui-sidebar-documentpreview/tests/markdown-body.client.spec.tsx
  83. 0 0
      packages/client/ui-sidebar-documentpreview/tests/markdown-registration.client.spec.tsx
  84. 0 0
      packages/client/ui-sidebar-documentpreview/tests/pdf-assets.client.spec.ts
  85. 0 0
      packages/client/ui-sidebar-documentpreview/tests/pdf-body.client.spec.tsx
  86. 0 0
      packages/client/ui-sidebar-documentpreview/tests/pdf-document.client.spec.ts
  87. 0 0
      packages/client/ui-sidebar-documentpreview/tests/pdf-fixture.ts
  88. 0 0
      packages/client/ui-sidebar-documentpreview/tests/pdf-registration.client.spec.ts
  89. 0 0
      packages/client/ui-sidebar-documentpreview/tests/pdf-runtime.client.spec.ts
  90. 0 0
      packages/client/ui-sidebar-documentpreview/tests/pdf-smoke.client.spec.ts
  91. 0 0
      packages/client/ui-sidebar-documentpreview/tests/pdf-store.client.spec.ts
  92. 0 0
      packages/client/ui-sidebar-documentpreview/tests/pdf-worker.fixture.mjs
  93. 0 0
      packages/client/ui-sidebar-documentpreview/tests/rpc.client.spec.ts
  94. 0 0
      packages/client/ui-sidebar-documentpreview/tests/store.client.spec.ts
  95. 0 0
      packages/client/ui-sidebar-documentpreview/tests/text-preview.client.spec.tsx
  96. 0 0
      packages/client/ui-sidebar-documentpreview/tsconfig.json
  97. 1 1
      packages/client/ui-sidebar-documentpreview/tsdown.config.ts
  98. 1 1
      packages/client/ui-sidebar-right/README.md
  99. 1 1
      packages/client/ui-sidebar-right/README.zh.md
  100. 1 1
      packages/client/ui-sidebar-right/src/client/index.ts

+ 1 - 1
apps/web/tests/document-preview.e2e.ts

@@ -6,7 +6,7 @@ import { fileURLToPath } from 'node:url'
 import type { Browser, Locator, Page } from 'playwright'
 import { chromium } from 'playwright'
 import { afterAll, beforeAll, describe, expect, it, onTestFailed, vi } from 'vitest'
-import { pdfFixture } from '../../../packages/client/ui-sidebar-textpreview/tests/pdf-fixture.ts'
+import { pdfFixture } from '../../../packages/client/ui-sidebar-documentpreview/tests/pdf-fixture.ts'
 import { assertFixtureInventory, compareOrRefreshGolden, launchWebScaffold, watchConsole, webSnapshotMode, type WebScaffold } from './scaffold.ts'
 import { connectFreshWorkspace, newEnglishPage, saveFailureShot } from './support.ts'
 

+ 1 - 1
docs/config-catalog.md

@@ -3483,7 +3483,7 @@ These load from a `cordis.yml` entry with no `config:` block; they declare no co
 - `@deepseek-ai/dsh-client-ui-sidebar` ([`packages/client/ui-sidebar/src/index.ts`](../packages/client/ui-sidebar/src/index.ts))
 - `@deepseek-ai/dsh-client-ui-sidebar-files` ([`packages/client/ui-sidebar-files/src/index.ts`](../packages/client/ui-sidebar-files/src/index.ts))
 - `@deepseek-ai/dsh-client-ui-sidebar-right` ([`packages/client/ui-sidebar-right/src/index.ts`](../packages/client/ui-sidebar-right/src/index.ts))
-- `@deepseek-ai/dsh-client-ui-sidebar-textpreview` ([`packages/client/ui-sidebar-textpreview/src/index.ts`](../packages/client/ui-sidebar-textpreview/src/index.ts))
+- `@deepseek-ai/dsh-client-ui-sidebar-documentpreview` ([`packages/client/ui-sidebar-documentpreview/src/index.ts`](../packages/client/ui-sidebar-documentpreview/src/index.ts))
 - `@deepseek-ai/dsh-client-ui-skill` ([`packages/client/ui-skill/src/index.ts`](../packages/client/ui-skill/src/index.ts))
 - `@deepseek-ai/dsh-client-ui-subagent` ([`packages/client/ui-subagent/src/index.ts`](../packages/client/ui-subagent/src/index.ts))
 - `@deepseek-ai/dsh-client-ui-theme` ([`packages/client/ui-theme/src/index.ts`](../packages/client/ui-theme/src/index.ts))

+ 1 - 1
docs/config-catalog.zh.md

@@ -3485,7 +3485,7 @@ export interface Config {
 - `@deepseek-ai/dsh-client-ui-sidebar`([`packages/client/ui-sidebar/src/index.ts`](../packages/client/ui-sidebar/src/index.ts))
 - `@deepseek-ai/dsh-client-ui-sidebar-files`([`packages/client/ui-sidebar-files/src/index.ts`](../packages/client/ui-sidebar-files/src/index.ts))
 - `@deepseek-ai/dsh-client-ui-sidebar-right`([`packages/client/ui-sidebar-right/src/index.ts`](../packages/client/ui-sidebar-right/src/index.ts))
-- `@deepseek-ai/dsh-client-ui-sidebar-textpreview`([`packages/client/ui-sidebar-textpreview/src/index.ts`](../packages/client/ui-sidebar-textpreview/src/index.ts))
+- `@deepseek-ai/dsh-client-ui-sidebar-documentpreview`([`packages/client/ui-sidebar-documentpreview/src/index.ts`](../packages/client/ui-sidebar-documentpreview/src/index.ts))
 - `@deepseek-ai/dsh-client-ui-skill`([`packages/client/ui-skill/src/index.ts`](../packages/client/ui-skill/src/index.ts))
 - `@deepseek-ai/dsh-client-ui-subagent`([`packages/client/ui-subagent/src/index.ts`](../packages/client/ui-subagent/src/index.ts))
 - `@deepseek-ai/dsh-client-ui-theme`([`packages/client/ui-theme/src/index.ts`](../packages/client/ui-theme/src/index.ts))

+ 2 - 2
docs/module-graph.md

@@ -175,7 +175,7 @@ flowchart TD
     pkg_client_ui_sidebar["client-ui-sidebar"]
     pkg_client_ui_sidebar_files["client-ui-sidebar-files"]
     pkg_client_ui_sidebar_right["client-ui-sidebar-right"]
-    pkg_client_ui_sidebar_textpreview["client-ui-sidebar-textpreview"]
+    pkg_client_ui_sidebar_textpreview["client-ui-sidebar-documentpreview"]
     pkg_client_ui_skill["client-ui-skill"]
     pkg_client_ui_slots["client-ui-slots"]
     pkg_client_ui_subagent["client-ui-subagent"]
@@ -1241,7 +1241,7 @@ flowchart TD
 | [`client-ui-sidebar`](../packages/client/ui-sidebar) | `client` | — |
 | [`client-ui-sidebar-files`](../packages/client/ui-sidebar-files) | `client` | — |
 | [`client-ui-sidebar-right`](../packages/client/ui-sidebar-right) | `client` | — |
-| [`client-ui-sidebar-textpreview`](../packages/client/ui-sidebar-textpreview) | `client` | — |
+| [`client-ui-sidebar-documentpreview`](../packages/client/ui-sidebar-documentpreview) | `client` | — |
 | [`client-ui-skill`](../packages/client/ui-skill) | `client` | — |
 | [`client-ui-slots`](../packages/client/ui-slots) | `client` | — |
 | [`client-ui-subagent`](../packages/client/ui-subagent) | `client` | — |

+ 2 - 2
docs/module-graph.zh.md

@@ -177,7 +177,7 @@ flowchart TD
     pkg_client_ui_sidebar["client-ui-sidebar"]
     pkg_client_ui_sidebar_files["client-ui-sidebar-files"]
     pkg_client_ui_sidebar_right["client-ui-sidebar-right"]
-    pkg_client_ui_sidebar_textpreview["client-ui-sidebar-textpreview"]
+    pkg_client_ui_sidebar_textpreview["client-ui-sidebar-documentpreview"]
     pkg_client_ui_skill["client-ui-skill"]
     pkg_client_ui_slots["client-ui-slots"]
     pkg_client_ui_subagent["client-ui-subagent"]
@@ -1243,7 +1243,7 @@ flowchart TD
 | [`client-ui-sidebar`](../packages/client/ui-sidebar) | `client` | — |
 | [`client-ui-sidebar-files`](../packages/client/ui-sidebar-files) | `client` | — |
 | [`client-ui-sidebar-right`](../packages/client/ui-sidebar-right) | `client` | — |
-| [`client-ui-sidebar-textpreview`](../packages/client/ui-sidebar-textpreview) | `client` | — |
+| [`client-ui-sidebar-documentpreview`](../packages/client/ui-sidebar-documentpreview) | `client` | — |
 | [`client-ui-skill`](../packages/client/ui-skill) | `client` | — |
 | [`client-ui-slots`](../packages/client/ui-slots) | `client` | — |
 | [`client-ui-subagent`](../packages/client/ui-subagent) | `client` | — |

+ 5 - 5
docs/subsystems/sidebar-right.md

@@ -19,7 +19,7 @@ A tab type is two registrations that share the definition's `id`: a static defin
 | [`client/resources`](../../packages/client/resources/README.md) | `ctx.resources`, `useResource`, the protocol → value roster `ResourceProtocolMap` |
 | [`api/workspace-files`](../../packages/api/workspace-files/README.md) | Host `ctx.workspaceFiles`, the `workspaceFiles` Remote namespace, and the Client `file` resource provider |
 | [`util/workspace-path`](../../packages/util/workspace-path/README.md) | The file address grammar: `fileAddressFor`, `parseFileAddress` |
-| [`client/ui-sidebar-textpreview`](../../packages/client/ui-sidebar-textpreview/README.md), [`client/ui-sidebar-files`](../../packages/client/ui-sidebar-files/README.md) | The shipped `text` and `files` types |
+| [`client/ui-sidebar-documentpreview`](../../packages/client/ui-sidebar-documentpreview/README.md), [`client/ui-sidebar-files`](../../packages/client/ui-sidebar-files/README.md) | The shipped `text` and `files` types |
 
 ## Addresses
 
@@ -106,11 +106,11 @@ A body, title and guide replacement receive the framework-injected `useTabInfo()
 
 ## Document renderers
 
-The `text` tab is the shared Document Preview owner. Its [root registration](../../packages/client/ui-sidebar-textpreview/src/client/index.ts) declares `sidebar.right.tab.document` and provides `ctx.documentPreviews`. A renderer registers `DocumentPreviewDefinition` metadata in its own effect, then waits through `ctx.slots.inject('sidebar.right.tab.document', ...)` and registers its component with `key: definition.id` and its locale namespace. Changing the renderer does not change the tab or resource address; the [extension decision](../../.agents/notes/implemented/architecture/2026-09-08-document-preview-operations.md) separates preview policy from resource ownership.
+The `text` tab is the shared Document Preview owner. Its [root registration](../../packages/client/ui-sidebar-documentpreview/src/client/index.ts) declares `sidebar.right.tab.document` and provides `ctx.documentPreviews`. A renderer registers `DocumentPreviewDefinition` metadata in its own effect, then waits through `ctx.slots.inject('sidebar.right.tab.document', ...)` and registers its component with `key: definition.id` and its locale namespace. Changing the renderer does not change the tab or resource address; the [extension decision](../../.agents/notes/implemented/architecture/2026-09-08-document-preview-operations.md) separates preview policy from resource ownership.
 
-The [registry](../../packages/client/ui-sidebar-textpreview/src/client/document/registry.ts) records unique `id`, `extensions`, localized `title()`, `loading`, optional `priority`, and optional `wrap`. Case-insensitive suffix matching ranks `extension` (the default) before `builtin`, then longer suffixes before shorter ones, then registration order. Unlike tab-kind replacement, the registry keeps all implementations available; the toolbar lists matching alternatives and remembers the selection per tab. Unknown extensions use plain text. `loading` is `text-pages` or `bytes-complete`; `wrap` advertises support for the shared source-wrap control.
+The [registry](../../packages/client/ui-sidebar-documentpreview/src/client/document/registry.ts) records unique `id`, `extensions`, localized `title()`, `loading`, optional `priority`, and optional `wrap`. Case-insensitive suffix matching ranks `extension` (the default) before `builtin`, then longer suffixes before shorter ones, then registration order. Unlike tab-kind replacement, the registry keeps all implementations available; the toolbar lists matching alternatives and remembers the selection per tab. Unknown extensions use plain text. `loading` is `text-pages` or `bytes-complete`; `wrap` advertises support for the shared source-wrap control.
 
-[`DocumentPreviewProps`](../../packages/client/ui-sidebar-textpreview/src/client/document/contract.ts) derives from `PropsRuntime<'sidebar.right.tab.document'>`. The owner supplies the original `resourceAddress`, `content`, and current `wrap`: text content is `{ kind: 'text', text, pages: [{ offset, text, lines }], eof }`, with cumulative `text`; complete bytes are `{ kind: 'bytes', data }`, with `Uint8Array<ArrayBuffer>` data. These transient buffers are borrowed read-only and must not enter durable layout or Session JSON. PDF copies the bytes before Worker transfer, preserving the owner's buffer. The child receives the same framework-bound `useTabInfo` and the global metadata-only `useResource`. The parent reads through ordinary inject callbacks to `remote.workspaceFiles.read`/`readAll` and owns page appends, per-tab refresh, and loading status. HTML's own inject callback uses `readRelated`; Host code resolves paths. Markdown and code retain one incremental renderer across appends and settle at EOF; HTML and PDF receive complete bytes.
+[`DocumentPreviewProps`](../../packages/client/ui-sidebar-documentpreview/src/client/document/contract.ts) derives from `PropsRuntime<'sidebar.right.tab.document'>`. The owner supplies the original `resourceAddress`, `content`, and current `wrap`: text content is `{ kind: 'text', text, pages: [{ offset, text, lines }], eof }`, with cumulative `text`; complete bytes are `{ kind: 'bytes', data }`, with `Uint8Array<ArrayBuffer>` data. These transient buffers are borrowed read-only and must not enter durable layout or Session JSON. PDF copies the bytes before Worker transfer, preserving the owner's buffer. The child receives the same framework-bound `useTabInfo` and the global metadata-only `useResource`. The parent reads through ordinary inject callbacks to `remote.workspaceFiles.read`/`readAll` and owns page appends, per-tab refresh, and loading status. HTML's own inject callback uses `readRelated`; Host code resolves paths. Markdown and code retain one incremental renderer across appends and settle at EOF; HTML and PDF receive complete bytes.
 
 Preview records its loaded version and the version observed when a read starts. Refresh rereads only that tab, without changing shared metadata or another tab's content. Reads are non-transactional; versions are opaque equality tokens, not ordered timestamps ([resource observation and Preview RPC](../../.agents/notes/implemented/architecture/2026-09-08-document-preview-operations.md)).
 
@@ -131,7 +131,7 @@ The Host `ctx.workspaceFiles` service and the generated `workspaceFiles` Remote
 ## Shipped types
 
 - **`guide`** — `builtin`, opened as `openTab('guide')`. A centred title, one line, and one entry box per `guide` entry the registered types contributed, in `order`; picking a box opens the contributing type as a page in the guide tab's place. A pane holds at most one guide tab, every new pane is seeded with one, and the strip's add control appears only while its pane has none ([guide](../../packages/client/ui-sidebar-right/README.md#the-guide)).
-- **`text`** — `fallback`, `dsh-resource://file/**`, claiming Session addresses only. Document Preview observes metadata through `useResource<'file'>`, loads content through Remote callbacks, and owns renderer selection, the toolbar, per-tab refresh, scroll, and source navigation; unknown extensions render as plain text ([README](../../packages/client/ui-sidebar-textpreview/README.md)).
+- **`text`** — `fallback`, `dsh-resource://file/**`, claiming Session addresses only. Document Preview observes metadata through `useResource<'file'>`, loads content through Remote callbacks, and owns renderer selection, the toolbar, per-tab refresh, scroll, and source navigation; unknown extensions render as plain text ([README](../../packages/client/ui-sidebar-documentpreview/README.md)).
 - **`files`** — `builtin`, opened as `openTab('files')`. The workspace directory tree, listed lazily through `list`, opening a file with `tab.actions.openResource(fileAddressFor(sessionId, root, path))` into its own pane ([README](../../packages/client/ui-sidebar-files/README.md)).
 
 <a id="not-built"></a>

+ 5 - 5
docs/subsystems/sidebar-right.zh.md

@@ -19,7 +19,7 @@
 | [`client/resources`](../../packages/client/resources/README.zh.md) | `ctx.resources`、`useResource`、协议 → 值类型的花名册 `ResourceProtocolMap` |
 | [`api/workspace-files`](../../packages/api/workspace-files/README.zh.md) | Host `ctx.workspaceFiles`、`workspaceFiles` Remote 命名空间与 Client `file` 资源提供者 |
 | [`util/workspace-path`](../../packages/util/workspace-path/README.zh.md) | 文件地址语法:`fileAddressFor`、`parseFileAddress` |
-| [`client/ui-sidebar-textpreview`](../../packages/client/ui-sidebar-textpreview/README.zh.md)、[`client/ui-sidebar-files`](../../packages/client/ui-sidebar-files/README.zh.md) | 内置的 `text` 与 `files` 类型 |
+| [`client/ui-sidebar-documentpreview`](../../packages/client/ui-sidebar-documentpreview/README.zh.md)、[`client/ui-sidebar-files`](../../packages/client/ui-sidebar-files/README.zh.md) | 内置的 `text` 与 `files` 类型 |
 
 ## 地址
 
@@ -106,11 +106,11 @@ Sidebar 声明四个扩展 slot;其文档 tab 另行声明下表中的 keyed 
 
 ## 文档渲染器
 
-`text` tab 是共享的 Document Preview 所有者。其[根注册](../../packages/client/ui-sidebar-textpreview/src/client/index.ts)声明 `sidebar.right.tab.document` 并提供 `ctx.documentPreviews`。渲染器在自己的 effect 中注册 `DocumentPreviewDefinition` 元数据,再通过 `ctx.slots.inject('sidebar.right.tab.document', ...)` 等待 slot,以 `key: definition.id` 和自己的 locale 命名空间注册组件。切换渲染器不改变 tab 或资源地址;[扩展决议](../../.agents/notes/implemented/architecture/2026-09-08-document-preview-operations.zh.md)将预览策略与资源归属分开。
+`text` tab 是共享的 Document Preview 所有者。其[根注册](../../packages/client/ui-sidebar-documentpreview/src/client/index.ts)声明 `sidebar.right.tab.document` 并提供 `ctx.documentPreviews`。渲染器在自己的 effect 中注册 `DocumentPreviewDefinition` 元数据,再通过 `ctx.slots.inject('sidebar.right.tab.document', ...)` 等待 slot,以 `key: definition.id` 和自己的 locale 命名空间注册组件。切换渲染器不改变 tab 或资源地址;[扩展决议](../../.agents/notes/implemented/architecture/2026-09-08-document-preview-operations.zh.md)将预览策略与资源归属分开。
 
-[注册表](../../packages/client/ui-sidebar-textpreview/src/client/document/registry.ts)记录唯一的 `id`、`extensions`、本地化 `title()`、`loading`,以及可选的 `priority` 和 `wrap`。后缀匹配不区分大小写,先排 `extension`(缺省值)、再排 `builtin`,随后比较后缀长度(长者优先)与注册顺序。与 tab kind 替换不同,注册表保留所有实现;工具栏列出匹配的候选,按 tab 记住选择。未知扩展名使用纯文本。`loading` 为 `text-pages` 或 `bytes-complete`;`wrap` 声明是否支持共享的源码换行控件。
+[注册表](../../packages/client/ui-sidebar-documentpreview/src/client/document/registry.ts)记录唯一的 `id`、`extensions`、本地化 `title()`、`loading`,以及可选的 `priority` 和 `wrap`。后缀匹配不区分大小写,先排 `extension`(缺省值)、再排 `builtin`,随后比较后缀长度(长者优先)与注册顺序。与 tab kind 替换不同,注册表保留所有实现;工具栏列出匹配的候选,按 tab 记住选择。未知扩展名使用纯文本。`loading` 为 `text-pages` 或 `bytes-complete`;`wrap` 声明是否支持共享的源码换行控件。
 
-[`DocumentPreviewProps`](../../packages/client/ui-sidebar-textpreview/src/client/document/contract.ts) 派生自 `PropsRuntime<'sidebar.right.tab.document'>`。owner 提供原始 `resourceAddress`、`content` 与当前 `wrap`:文本内容为 `{ kind: 'text', text, pages: [{ offset, text, lines }], eof }`,其中 `text` 为累积文本;完整字节为 `{ kind: 'bytes', data }`,其中 `data` 为 `Uint8Array<ArrayBuffer>`。这些瞬时缓冲区按只读方式借用,不得进入持久布局或 Session JSON。PDF 在转移到 Worker 前复制字节,以保留 owner 的缓冲区。子组件收到同一个框架绑定的 `useTabInfo`,以及全局共享、仅提供元数据的 `useResource`。父组件通过普通 inject 回调调用 `remote.workspaceFiles.read`/`readAll`,拥有追加分页、逐 tab 刷新与加载状态。HTML 自己的 inject 回调使用 `readRelated`;路径由 Host 代码解析。Markdown 和代码在追加期间保留同一个增量渲染器,到 EOF 完成最终解析;HTML 和 PDF 接收完整字节。
+[`DocumentPreviewProps`](../../packages/client/ui-sidebar-documentpreview/src/client/document/contract.ts) 派生自 `PropsRuntime<'sidebar.right.tab.document'>`。owner 提供原始 `resourceAddress`、`content` 与当前 `wrap`:文本内容为 `{ kind: 'text', text, pages: [{ offset, text, lines }], eof }`,其中 `text` 为累积文本;完整字节为 `{ kind: 'bytes', data }`,其中 `data` 为 `Uint8Array<ArrayBuffer>`。这些瞬时缓冲区按只读方式借用,不得进入持久布局或 Session JSON。PDF 在转移到 Worker 前复制字节,以保留 owner 的缓冲区。子组件收到同一个框架绑定的 `useTabInfo`,以及全局共享、仅提供元数据的 `useResource`。父组件通过普通 inject 回调调用 `remote.workspaceFiles.read`/`readAll`,拥有追加分页、逐 tab 刷新与加载状态。HTML 自己的 inject 回调使用 `readRelated`;路径由 Host 代码解析。Markdown 和代码在追加期间保留同一个增量渲染器,到 EOF 完成最终解析;HTML 和 PDF 接收完整字节。
 
 Preview 记录已载入版本和读取开始时的观察版本。刷新只重读当前 tab,不改变共享元数据或其他 tab 的内容。读取不具备事务性;版本是不透明的相等性令牌,不是可排序的时间戳([资源观察与 Preview RPC](../../.agents/notes/implemented/architecture/2026-09-08-document-preview-operations.zh.md))。
 
@@ -131,7 +131,7 @@ Host 的 `ctx.workspaceFiles` 服务与生成的 `workspaceFiles` Remote 命名
 ## 内置类型
 
 - **`guide`**——`builtin`,以 `openTab('guide')` 打开。居中标题、一行说明,以及已注册类型贡献的每个 `guide` 入口一框、按 `order` 排列;点一框即在引导 tab 的位置把贡献它的类型作为页面打开。每个 pane 最多一个引导 tab,每个新 pane 都种入一个,tab 条的新增控件只在本 pane 没有引导时出现([引导](../../packages/client/ui-sidebar-right/README.zh.md#the-guide))。
-- **`text`**——`fallback`,`dsh-resource://file/**`,只认领 Session 地址。Document Preview 通过 `useResource<'file'>` 观察元数据,经 Remote 回调加载内容,并拥有渲染器选择、工具栏、逐 tab 刷新、滚动与源码定位;未知扩展名按纯文本渲染([README](../../packages/client/ui-sidebar-textpreview/README.zh.md))。
+- **`text`**——`fallback`,`dsh-resource://file/**`,只认领 Session 地址。Document Preview 通过 `useResource<'file'>` 观察元数据,经 Remote 回调加载内容,并拥有渲染器选择、工具栏、逐 tab 刷新、滚动与源码定位;未知扩展名按纯文本渲染([README](../../packages/client/ui-sidebar-documentpreview/README.zh.md))。
 - **`files`**——`builtin`,以 `openTab('files')` 打开。工作区目录树,经 `list` 懒加载,用 `tab.actions.openResource(fileAddressFor(sessionId, root, path))` 在自己所在 pane 打开文件([README](../../packages/client/ui-sidebar-files/README.zh.md))。
 
 <a id="not-built"></a>

+ 1 - 1
packages/api/workspace-files/README.md

@@ -119,7 +119,7 @@ Typert generates the Host and Client Remote artifacts exposed by `./typert` and
 - [Remote assembly](../../api/remotes/README.md) — how Client packages reach the `workspaceFiles` namespace.
 - [Client resources](../../client/resources/README.md) — the resource model, `useResource`, pins, and provider lifetime.
 - [Workspace path helpers](../../util/workspace-path/README.md) — `fileAddressFor` and `parseFileAddress`, the `dsh-resource://file/…` address grammar both ends share.
-- [Sidebar text preview](../../client/ui-sidebar-textpreview/README.md) — the tab type that follows a file through the `file` provider and reads its pages.
+- [Sidebar text preview](../../client/ui-sidebar-documentpreview/README.md) — the tab type that follows a file through the `file` provider and reads its pages.
 
 -----
 

+ 1 - 1
packages/api/workspace-files/README.zh.md

@@ -119,7 +119,7 @@ Typert 生成 `./typert` 与 `./remote` 暴露的 Host 与 Client Remote 产物
 - [Remote 装配](../../api/remotes/README.zh.md)——Client 包如何触达 `workspaceFiles` 命名空间。
 - [Client 资源](../../client/resources/README.zh.md)——资源模型、`useResource`、pin 与提供者生命周期。
 - [工作区路径辅助](../../util/workspace-path/README.zh.md)——`fileAddressFor` 与 `parseFileAddress`,两端共享的 `dsh-resource://file/…` 地址语法。
-- [Sidebar 文本预览](../../client/ui-sidebar-textpreview/README.zh.md)——经 `file` 提供者跟随文件并读取其页的 tab 类型。
+- [Sidebar 文本预览](../../client/ui-sidebar-documentpreview/README.zh.md)——经 `file` 提供者跟随文件并读取其页的 tab 类型。
 
 -----
 

+ 2 - 2
packages/bundle/web-app/cordis.patch.yml

@@ -227,8 +227,8 @@
 
     # The right Sidebar's first outside tab type: workspace text files, read
     # through the bounded workspaceFiles endpoint.
-    - id: ui-sidebar-textpreview
-      name: '@deepseek-ai/dsh-client-ui-sidebar-textpreview'
+    - id: ui-sidebar-documentpreview
+      name: '@deepseek-ai/dsh-client-ui-sidebar-documentpreview'
 
     # The right Sidebar's workspace file tree tab type.
     - id: ui-sidebar-files

+ 1 - 1
packages/bundle/web-app/package.json

@@ -84,7 +84,7 @@
     "@deepseek-ai/dsh-client-ui-sidebar": "workspace:^",
     "@deepseek-ai/dsh-client-ui-sidebar-files": "workspace:^",
     "@deepseek-ai/dsh-client-ui-sidebar-right": "workspace:^",
-    "@deepseek-ai/dsh-client-ui-sidebar-textpreview": "workspace:^",
+    "@deepseek-ai/dsh-client-ui-sidebar-documentpreview": "workspace:^",
     "@deepseek-ai/dsh-client-ui-skill": "workspace:^",
     "@deepseek-ai/dsh-client-ui-subagent": "workspace:^",
     "@deepseek-ai/dsh-client-ui-theme": "workspace:^",

+ 1 - 1
packages/client/ui-chat/package.json

@@ -68,7 +68,7 @@
     "@deepseek-ai/dsh-client-ui-session": "workspace:^",
     "@deepseek-ai/dsh-client-ui-settings": "workspace:^",
     "@deepseek-ai/dsh-client-ui-sidebar-right": "workspace:^",
-    "@deepseek-ai/dsh-client-ui-sidebar-textpreview": "workspace:^",
+    "@deepseek-ai/dsh-client-ui-sidebar-documentpreview": "workspace:^",
     "@deepseek-ai/dsh-client-ui-slots": "workspace:^",
     "@deepseek-ai/dsh-client-ui-workspace": "workspace:^",
     "@deepseek-ai/dsh-commands": "workspace:^",

+ 1 - 1
packages/client/ui-chat/src/client/apply.ts

@@ -7,7 +7,7 @@ import type { ObservableSnapshot } from '@deepseek-ai/dsh-client-store'
 import type { SessionId } from '@deepseek-ai/dsh-session/types'
 import type {} from '@deepseek-ai/dsh-client-ui-sidebar-right/client'
 // The `file` entry of `SidebarRightResourceParamsMap`, which types `{ params: { line } }` below.
-import type {} from '@deepseek-ai/dsh-client-ui-sidebar-textpreview/client'
+import type {} from '@deepseek-ai/dsh-client-ui-sidebar-documentpreview/client'
 import { fileAddressFor } from '@deepseek-ai/dsh-util-workspace-path'
 // Type-only service and declaration merges used by the apply world.
 import type {} from '@deepseek-ai/dsh-client-locale/client'

+ 1 - 1
packages/client/ui-chat/tsconfig.json

@@ -99,7 +99,7 @@
       "path": "../ui-workspace"
     },
     {
-      "path": "../ui-sidebar-textpreview"
+      "path": "../ui-sidebar-documentpreview"
     }
   ]
 }

+ 1 - 1
packages/client/ui-sidebar-textpreview/README.i18n.yaml → packages/client/ui-sidebar-documentpreview/README.i18n.yaml

@@ -1,6 +1,6 @@
 # Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
 # side as of the last confirmed-consistent state. Both languages carry equal authority;
 # after editing either side, bring the other along and re-record with:
-#   pnpm run verify-translation-pairing --write packages/client/ui-sidebar-textpreview/README.md
+#   pnpm run verify-translation-pairing --write packages/client/ui-sidebar-documentpreview/README.md
 README.md: 671367221b4b336bfccb1052054b210f5a42c5ad
 README.zh.md: 990b4175332ba1c72f98f4060c315ec8912cec8b

+ 3 - 3
packages/client/ui-sidebar-textpreview/README.md → packages/client/ui-sidebar-documentpreview/README.md

@@ -3,7 +3,7 @@ description: "Document previews in the right Sidebar: shared file loading and co
 kind: "package-reference"
 ---
 
-# @deepseek-ai/dsh-client-ui-sidebar-textpreview
+# @deepseek-ai/dsh-client-ui-sidebar-documentpreview
 
 English | [中文](README.zh.md)
 
@@ -26,7 +26,7 @@ Preview workspace documents in the right Sidebar and choose among registered ren
 <a id="what-it-registers"></a>
 ## What it registers
 
-- **The type** — `ctx.sidebarRightTabs.register(...)` with id `@deepseek-ai/dsh-client-ui-sidebar-textpreview` (this implementation's identity in the tab system, and the key its body registers under), kind `text`, pattern `dsh-resource://file/**`, band `fallback`. `canOpen` accepts only Session addresses, whose paths may be relative or absolute; bare `absolute` addresses are not claimed. A type registered at the `extension` or `builtin` band for a narrower pattern (say `*.png`) takes those addresses; other supported files land here. The whole address is the content identity, so two files with one name in different directories, or one path under two sessions, are two tabs; the decoded basename is the tab title.
+- **The type** — `ctx.sidebarRightTabs.register(...)` with id `@deepseek-ai/dsh-client-ui-sidebar-documentpreview` (this implementation's identity in the tab system, and the key its body registers under), kind `text`, pattern `dsh-resource://file/**`, band `fallback`. `canOpen` accepts only Session addresses, whose paths may be relative or absolute; bare `absolute` addresses are not claimed. A type registered at the `extension` or `builtin` band for a narrower pattern (say `*.png`) takes those addresses; other supported files land here. The whole address is the content identity, so two files with one name in different directories, or one path under two sessions, are two tabs; the decoded basename is the tab title.
 - **The body** — the keyed `sidebar.right.pane.tab` seat under the type's id. Its fixed header shows the Host's absolute path when available, otherwise the requested path, and a dropdown for matching renderers plus plain text. A wrap toggle appears only when the selected renderer declares `wrap: true`; the per-tab preference starts on. Reload stays in this header, not the Sidebar's tab strip. The shared body below owns document scrolling.
 - **Shared loading and view state**, session-scoped and bucketed by tab id. The store holds accumulated pages or complete bytes, read and observed versions, loading/failure state, renderer choice, scroll offset, wrap, and the answered navigation revision. The ordinary inject face calls Remote readers and writes through declared store actions. Reloads and loading-mode changes retire older requests; the tab's abort signal forgets its state.
 
@@ -59,7 +59,7 @@ The body reads its record, navigation and lifetime through `useTabInfo().tab`. `
 
 HTML runs in a Blob iframe with exactly `sandbox="allow-scripts"`, without `allow-same-origin`; scripts cannot access the parent application's origin or file reader. The renderer loads directly declared relative `.js` classic scripts and `.css` stylesheets through its ordinary inject callback to `remote.workspaceFiles.readRelated`, under the configured limits. Host code resolves the related path; `rpc.ts` decodes the returned bytes. Inside the renderer, base64 is used only to embed the iframe bootstrap payload in script text. A `<base href>` leaves dependency resolution to the browser, as do HTTPS resources. Local module imports, CSS `url()`/`@import`, and dynamic `fetch` do not use Host file access. Read failures, invalid UTF-8, or exceeded limits fail the preview rather than publishing a partial asset package. Replacing or unmounting the document releases its Blob URL.
 
-Shared copy comes from `sidebarTextpreview`; each builtin renderer owns its localized labels.
+Shared copy comes from `sidebarDocumentPreview`; each builtin renderer owns its localized labels.
 
 Initial reads, additional pages, and HTML/PDF preparation share a loading indicator that respects reduced-motion preferences. Loaded pages stay visible while another page loads. Code previews show source line numbers by default without including them in copied text; plain text uses the same font size and line height as code.
 

+ 3 - 3
packages/client/ui-sidebar-textpreview/README.zh.md → packages/client/ui-sidebar-documentpreview/README.zh.md

@@ -3,7 +3,7 @@ description: "右侧 Sidebar 的文档预览:共享文件加载与控件,可
 kind: "package-reference"
 ---
 
-# @deepseek-ai/dsh-client-ui-sidebar-textpreview
+# @deepseek-ai/dsh-client-ui-sidebar-documentpreview
 
 [English](README.md) | 中文
 
@@ -26,7 +26,7 @@ kind: "package-reference"
 <a id="what-it-registers"></a>
 ## 注册了什么
 
-- **类型** —— `ctx.sidebarRightTabs.register(...)`,id 为 `@deepseek-ai/dsh-client-ui-sidebar-textpreview`(这个实现在 tab 系统里的唯一键,也是其体注册所用的 key),kind `text`,pattern `dsh-resource://file/**`,档位 `fallback`。`canOpen` 只接受 Session 地址,其中路径可为相对或绝对路径;不认领裸 `absolute` 地址。在 `extension` 或 `builtin` 档以更窄 pattern(比如 `*.png`)注册的类型接走那些地址;其他受支持文件落到这里。整个地址就是内容身份,所以不同目录下同名的两个文件、或同一路径在两个会话之下,是两个 tab;解码后的 basename 是 tab 标题。
+- **类型** —— `ctx.sidebarRightTabs.register(...)`,id 为 `@deepseek-ai/dsh-client-ui-sidebar-documentpreview`(这个实现在 tab 系统里的唯一键,也是其体注册所用的 key),kind `text`,pattern `dsh-resource://file/**`,档位 `fallback`。`canOpen` 只接受 Session 地址,其中路径可为相对或绝对路径;不认领裸 `absolute` 地址。在 `extension` 或 `builtin` 档以更窄 pattern(比如 `*.png`)注册的类型接走那些地址;其他受支持文件落到这里。整个地址就是内容身份,所以不同目录下同名的两个文件、或同一路径在两个会话之下,是两个 tab;解码后的 basename 是 tab 标题。
 - **正文** —— keyed slot `sidebar.right.pane.tab`,键为类型的 id。固定头部在可用时显示 Host 的绝对路径,否则显示请求路径,并提供匹配渲染器及纯文本的下拉选择。仅当所选渲染器声明 `wrap: true` 时显示换行开关;该偏好按 tab 保存,初始开启。重新载入仍在此头部,不放入 Sidebar 的 tab 条。下方的共享正文区域负责文档滚动。
 - **共享加载与视图状态**,会话作用域、按 tab id 分桶。store 持有累计页或完整字节、读取与观察版本、加载/失败状态、渲染器选择、滚动位置、换行和已响应的导航 revision。普通 inject face 调用 Remote 读取,并经声明的 store action 写入。重新载入和加载模式变化会淘汰旧请求;tab 的中止信号清理其状态。
 
@@ -59,7 +59,7 @@ tab 使用 `fileAddressFor` 构造的 Session 地址,携带相对或绝对路
 
 HTML 在 Blob iframe 中运行,沙箱属性严格为 `sandbox="allow-scripts"`,不含 `allow-same-origin`;脚本无法访问父应用的源或文件读取接口。渲染器在配置上限内,通过普通 inject 回调调用 `remote.workspaceFiles.readRelated`,加载直接声明的相对 `.js` 经典脚本和 `.css` 样式表。Host 代码解析关联路径,`rpc.ts` 解码返回的字节。在渲染器内部,base64 仅用于把 iframe 引导载荷嵌入脚本文本。`<base href>` 将依赖解析交给浏览器,HTTPS 资源也由浏览器处理。本地模块 import、CSS `url()`/`@import` 和动态 `fetch` 不使用 Host 文件访问。读取失败、无效 UTF-8 或超出上限都使预览失败,不发布部分资源包。替换或卸载文档会释放其 Blob URL。
 
-共享文案来自 `sidebarTextpreview`;各内置渲染器拥有自己的本地化标签。
+共享文案来自 `sidebarDocumentPreview`;各内置渲染器拥有自己的本地化标签。
 
 首次读取、追加页及 HTML/PDF 准备共用加载指示器,并遵循减少动态效果偏好。下一页加载期间保留已显示的内容。代码预览默认显示源码行号,但复制文本不包含行号;纯文本与代码使用相同字号和行高。
 

+ 2 - 2
packages/client/ui-sidebar-textpreview/package.json → packages/client/ui-sidebar-documentpreview/package.json

@@ -1,5 +1,5 @@
 {
-  "name": "@deepseek-ai/dsh-client-ui-sidebar-textpreview",
+  "name": "@deepseek-ai/dsh-client-ui-sidebar-documentpreview",
   "description": "Extensible document previews for Sidebar files: Markdown, highlighted code, PDF, HTML, and plain text",
   "version": "0.1.5-alpha.1",
   "publishConfig": {
@@ -8,7 +8,7 @@
   "repository": {
     "type": "git",
     "url": "git+https://github.com/deepseek-ai/deepseek-harness.git",
-    "directory": "packages/client/ui-sidebar-textpreview"
+    "directory": "packages/client/ui-sidebar-documentpreview"
   },
   "type": "module",
   "main": "lib/index.js",

+ 0 - 0
packages/client/ui-sidebar-textpreview/src/client/LoadingIndicator.module.css → packages/client/ui-sidebar-documentpreview/src/client/LoadingIndicator.module.css


+ 0 - 0
packages/client/ui-sidebar-textpreview/src/client/LoadingIndicator.tsx → packages/client/ui-sidebar-documentpreview/src/client/LoadingIndicator.tsx


+ 0 - 0
packages/client/ui-sidebar-textpreview/src/client/TextPreview.module.css → packages/client/ui-sidebar-documentpreview/src/client/TextPreview.module.css


+ 1 - 1
packages/client/ui-sidebar-textpreview/src/client/TextPreview.tsx → packages/client/ui-sidebar-documentpreview/src/client/TextPreview.tsx

@@ -43,7 +43,7 @@ export type TextPreviewProps =
   & PropsRenderSlots<'sidebar.right.tab.document'>
   & PropsStore<TextStore>
   & InjectFace<TextPreviewInjected>
-  & PropsLocale<'sidebarTextpreview'>
+  & PropsLocale<'sidebarDocumentPreview'>
 
 /**
  * The text type's body, registered under `sidebar.right.pane.tab` as `text`.

+ 0 - 0
packages/client/ui-sidebar-textpreview/src/client/code/CodeBody.module.css → packages/client/ui-sidebar-documentpreview/src/client/code/CodeBody.module.css


+ 1 - 1
packages/client/ui-sidebar-textpreview/src/client/code/CodeBody.tsx → packages/client/ui-sidebar-documentpreview/src/client/code/CodeBody.tsx

@@ -15,7 +15,7 @@ export type CodeBodyProps = DocumentPreviewProps & PropsLocale<'sidebarCodePrevi
 export function CodeBody({ resourceAddress, content, wrap, t }: CodeBodyProps): ReactNode {
   if (content.kind !== 'text') return null
   const file = parseFileAddress(resourceAddress)
-  if (file === undefined) throw new Error(`ui-sidebar-textpreview: not a file address "${resourceAddress}"`)
+  if (file === undefined) throw new Error(`ui-sidebar-documentpreview: not a file address "${resourceAddress}"`)
   const language = languageForPath(file.path)
   return (
     <div className={css.renderer} data-code-preview data-wrap={wrap}>

+ 1 - 1
packages/client/ui-sidebar-textpreview/src/client/code/index.ts → packages/client/ui-sidebar-documentpreview/src/client/code/index.ts

@@ -5,7 +5,7 @@ import { CodeBody } from './CodeBody.tsx'
 import { CODE_EXTENSIONS } from './languages.ts'
 import { en, zh } from './locales.ts'
 
-const ID = '@deepseek-ai/dsh-client-ui-sidebar-textpreview/code'
+const ID = '@deepseek-ai/dsh-client-ui-sidebar-documentpreview/code'
 const NS = 'sidebarCodePreview'
 
 /** @param ctx - owning plugin context. Register localized metadata and the matching keyed document body. */

+ 0 - 0
packages/client/ui-sidebar-textpreview/src/client/code/languages.ts → packages/client/ui-sidebar-documentpreview/src/client/code/languages.ts


+ 0 - 0
packages/client/ui-sidebar-textpreview/src/client/code/locales.ts → packages/client/ui-sidebar-documentpreview/src/client/code/locales.ts


+ 1 - 1
packages/client/ui-sidebar-textpreview/src/client/definition.ts → packages/client/ui-sidebar-documentpreview/src/client/definition.ts

@@ -15,7 +15,7 @@ import { parseFileAddress } from '@deepseek-ai/dsh-util-workspace-path'
 export const TEXTPREVIEW_KIND = 'text'
 
 /** This implementation's identity in the tab system: the key its body registers under. */
-export const TEXTPREVIEW_ID = '@deepseek-ai/dsh-client-ui-sidebar-textpreview'
+export const TEXTPREVIEW_ID = '@deepseek-ai/dsh-client-ui-sidebar-documentpreview'
 
 /**
  * The tab title for one `file:` address: its decoded basename.

+ 0 - 0
packages/client/ui-sidebar-textpreview/src/client/document/contract.ts → packages/client/ui-sidebar-documentpreview/src/client/document/contract.ts


+ 0 - 0
packages/client/ui-sidebar-textpreview/src/client/document/registry.ts → packages/client/ui-sidebar-documentpreview/src/client/document/registry.ts


+ 0 - 0
packages/client/ui-sidebar-textpreview/src/client/face.ts → packages/client/ui-sidebar-documentpreview/src/client/face.ts


+ 1 - 1
packages/client/ui-sidebar-textpreview/src/client/failure-line.ts → packages/client/ui-sidebar-documentpreview/src/client/failure-line.ts

@@ -21,7 +21,7 @@ function humanBytes(bytes: number): string {
  * @param failure - the settled Remote failure.
  * @returns the line to show in place of the file.
  */
-export function failureLine(t: TranslateNS<'sidebarTextpreview'>, failure: RemoteFailure): string {
+export function failureLine(t: TranslateNS<'sidebarDocumentPreview'>, failure: RemoteFailure): string {
   switch (failure.code) {
     case 'workspace-file/not-found': return t('error.notFound')
     case 'workspace-file/outside-workspace': return t('error.outsideWorkspace')

+ 0 - 0
packages/client/ui-sidebar-textpreview/src/client/html/HtmlBody.module.css → packages/client/ui-sidebar-documentpreview/src/client/html/HtmlBody.module.css


+ 0 - 0
packages/client/ui-sidebar-textpreview/src/client/html/HtmlBody.tsx → packages/client/ui-sidebar-documentpreview/src/client/html/HtmlBody.tsx


+ 0 - 0
packages/client/ui-sidebar-textpreview/src/client/html/bootstrap.ts → packages/client/ui-sidebar-documentpreview/src/client/html/bootstrap.ts


+ 0 - 0
packages/client/ui-sidebar-textpreview/src/client/html/bytes.ts → packages/client/ui-sidebar-documentpreview/src/client/html/bytes.ts


+ 1 - 1
packages/client/ui-sidebar-textpreview/src/client/html/index.ts → packages/client/ui-sidebar-documentpreview/src/client/html/index.ts

@@ -9,7 +9,7 @@ import { en, zh } from './locales.ts'
 import type { HtmlPackLimits } from './pack.ts'
 
 /** HTML implementation identity, shared by metadata and the keyed slot. */
-export const HTML_BODY_ID = '@deepseek-ai/dsh-client-ui-sidebar-textpreview/html'
+export const HTML_BODY_ID = '@deepseek-ai/dsh-client-ui-sidebar-documentpreview/html'
 
 /**
  * Describe the builtin HTML renderer's file types and loading mode.

+ 0 - 0
packages/client/ui-sidebar-textpreview/src/client/html/locales.ts → packages/client/ui-sidebar-documentpreview/src/client/html/locales.ts


+ 0 - 0
packages/client/ui-sidebar-textpreview/src/client/html/pack.ts → packages/client/ui-sidebar-documentpreview/src/client/html/pack.ts


+ 0 - 0
packages/client/ui-sidebar-textpreview/src/client/html/read-relative.ts → packages/client/ui-sidebar-documentpreview/src/client/html/read-relative.ts


+ 0 - 0
packages/client/ui-sidebar-textpreview/src/client/icons.tsx → packages/client/ui-sidebar-documentpreview/src/client/icons.tsx


+ 6 - 6
packages/client/ui-sidebar-textpreview/src/client/index.ts → packages/client/ui-sidebar-documentpreview/src/client/index.ts

@@ -38,7 +38,7 @@ import { apply as registerCode } from './code/index.ts'
 // Values stay package-private unless another package needs them; the plugin
 // surface is `apply`, `inject`, and the store factory another registration may
 // share, plus the types a consumer of the seat or the store names.
-export type { SidebarTextpreviewKey } from './locales.ts'
+export type { SidebarDocumentPreviewKey } from './locales.ts'
 export type { TextPreviewProps } from './TextPreview.tsx'
 export type { TextInjected } from './face.ts'
 export type { ReadWorkspaceFilePage, SessionFile, WorkspaceFilesReadRemote } from './rpc.ts'
@@ -54,7 +54,7 @@ declare module '@deepseek-ai/cordis' {
 }
 
 /** This package's copy namespace. */
-const NS = 'sidebarTextpreview'
+const NS = 'sidebarDocumentPreview'
 
 declare module '@deepseek-ai/dsh-client-ui-sidebar-right/client' {
   interface SidebarRightResourceParamsMap {
@@ -66,7 +66,7 @@ declare module '@deepseek-ai/dsh-client-ui-sidebar-right/client' {
 declare module '@deepseek-ai/dsh-client-ui-slots' {
   interface LocaleNamespaceMap {
     /** Text-preview progress, paging, change, control, and failure lines. */
-    sidebarTextpreview: import('./locales.ts').SidebarTextpreviewKey
+    sidebarDocumentPreview: import('./locales.ts').SidebarDocumentPreviewKey
   }
 }
 
@@ -102,8 +102,8 @@ export function apply(ctx: ClientContext, config: Config = Config({})): void {
   const previews = new DocumentPreviewRegistry()
   const disposePreviews = ctx.reflect.provide('documentPreviews', previews)
   ctx.effect(() => disposePreviews)
-  ctx.effect(() => ctx.sidebarRightTabs.register(textDefinition()), 'ui-sidebar-textpreview: text type')
-  ctx.effect(() => ctx.locale.register(NS, { zh, en }), 'ui-sidebar-textpreview: dictionaries')
+  ctx.effect(() => ctx.sidebarRightTabs.register(textDefinition()), 'ui-sidebar-documentpreview: text type')
+  ctx.effect(() => ctx.locale.register(NS, { zh, en }), 'ui-sidebar-documentpreview: dictionaries')
 
   const store = createTextStore()
   const face = textFace(
@@ -120,7 +120,7 @@ export function apply(ctx: ClientContext, config: Config = Config({})): void {
       inject: (sessionId, actions): TextPreviewInjected => ({ ...face(sessionId, actions), hooks: { documentPreviews: source } }),
     },
     TextPreview,
-  )), 'ui-sidebar-textpreview: text body')
+  )), 'ui-sidebar-documentpreview: text body')
   registerText(ctx)
   registerMarkdown(ctx)
   registerHtml(ctx, { maxAssetBytes: config.htmlMaxAssetBytes, maxTotalBytes: config.htmlMaxTotalBytes, maxAssets: config.htmlMaxAssets })

+ 3 - 3
packages/client/ui-sidebar-textpreview/src/client/locales.ts → packages/client/ui-sidebar-documentpreview/src/client/locales.ts

@@ -1,5 +1,5 @@
 /**
- * `sidebarTextpreview` namespace dictionaries.
+ * `sidebarDocumentPreview` namespace dictionaries.
  *
  * The failure lines are the point of this file: a preview that cannot show a
  * page has to say which of several different things went wrong, and each one
@@ -28,7 +28,7 @@ export const zh = {
 } satisfies Record<string, string>
 
 /** Text-preview dictionary key union. */
-export type SidebarTextpreviewKey = keyof typeof zh
+export type SidebarDocumentPreviewKey = keyof typeof zh
 
 /** English dictionary, checked against the Chinese key set. */
 export const en = {
@@ -49,4 +49,4 @@ export const en = {
   'error.notRegularFile': 'That is not a regular file, so it has no text to show.',
   'error.unavailable': 'Read failed: {message}',
   retry: 'Retry',
-} satisfies Record<SidebarTextpreviewKey, string>
+} satisfies Record<SidebarDocumentPreviewKey, string>

+ 0 - 0
packages/client/ui-sidebar-textpreview/src/client/markdown/MarkdownBody.module.css → packages/client/ui-sidebar-documentpreview/src/client/markdown/MarkdownBody.module.css


+ 0 - 0
packages/client/ui-sidebar-textpreview/src/client/markdown/MarkdownBody.tsx → packages/client/ui-sidebar-documentpreview/src/client/markdown/MarkdownBody.tsx


+ 1 - 1
packages/client/ui-sidebar-textpreview/src/client/markdown/index.ts → packages/client/ui-sidebar-documentpreview/src/client/markdown/index.ts

@@ -6,7 +6,7 @@ import { MarkdownBody } from './MarkdownBody.tsx'
 import { en, zh } from './locales.ts'
 
 /** Implementation identity shared by metadata and the document slot. */
-export const MARKDOWN_BODY_ID = '@deepseek-ai/dsh-client-ui-sidebar-textpreview/markdown'
+export const MARKDOWN_BODY_ID = '@deepseek-ai/dsh-client-ui-sidebar-documentpreview/markdown'
 
 /**
  * Describe the Markdown implementation without taking ownership of loading.

+ 0 - 0
packages/client/ui-sidebar-textpreview/src/client/markdown/locales.ts → packages/client/ui-sidebar-documentpreview/src/client/markdown/locales.ts


+ 0 - 0
packages/client/ui-sidebar-textpreview/src/client/pdf/PdfBody.module.css → packages/client/ui-sidebar-documentpreview/src/client/pdf/PdfBody.module.css


+ 0 - 0
packages/client/ui-sidebar-textpreview/src/client/pdf/PdfBody.tsx → packages/client/ui-sidebar-documentpreview/src/client/pdf/PdfBody.tsx


+ 0 - 0
packages/client/ui-sidebar-textpreview/src/client/pdf/asset-imports.d.ts → packages/client/ui-sidebar-documentpreview/src/client/pdf/asset-imports.d.ts


+ 0 - 0
packages/client/ui-sidebar-textpreview/src/client/pdf/assets.ts → packages/client/ui-sidebar-documentpreview/src/client/pdf/assets.ts


+ 0 - 0
packages/client/ui-sidebar-textpreview/src/client/pdf/document.ts → packages/client/ui-sidebar-documentpreview/src/client/pdf/document.ts


+ 0 - 0
packages/client/ui-sidebar-textpreview/src/client/pdf/errors.ts → packages/client/ui-sidebar-documentpreview/src/client/pdf/errors.ts


+ 1 - 1
packages/client/ui-sidebar-textpreview/src/client/pdf/index.ts → packages/client/ui-sidebar-documentpreview/src/client/pdf/index.ts

@@ -7,7 +7,7 @@ import { createPdfStore } from './store.ts'
 import { en, zh } from './locales.ts'
 
 /** PDF metadata and keyed body share this package-local implementation identity. */
-export const PDF_BODY_ID = '@deepseek-ai/dsh-client-ui-sidebar-textpreview/pdf'
+export const PDF_BODY_ID = '@deepseek-ai/dsh-client-ui-sidebar-documentpreview/pdf'
 
 /**
  * Describe the builtin PDF renderer independently from its keyed body slot.

+ 0 - 0
packages/client/ui-sidebar-textpreview/src/client/pdf/locales.ts → packages/client/ui-sidebar-documentpreview/src/client/pdf/locales.ts


+ 0 - 0
packages/client/ui-sidebar-textpreview/src/client/pdf/runtime.ts → packages/client/ui-sidebar-documentpreview/src/client/pdf/runtime.ts


+ 0 - 0
packages/client/ui-sidebar-textpreview/src/client/pdf/store.ts → packages/client/ui-sidebar-documentpreview/src/client/pdf/store.ts


+ 1 - 1
packages/client/ui-sidebar-textpreview/src/client/rpc.ts → packages/client/ui-sidebar-documentpreview/src/client/rpc.ts

@@ -66,7 +66,7 @@ export interface SessionFile {
  */
 export function hostFileOf(address: string): SessionFile {
   const parsed = parseFileAddress(address)
-  if (parsed?.scope !== 'session') throw new Error(`ui-sidebar-textpreview: not a session file address "${address}"`)
+  if (parsed?.scope !== 'session') throw new Error(`ui-sidebar-documentpreview: not a session file address "${address}"`)
   // The address is a string boundary: its id segment is the Session id it names.
   return { sessionId: parsed.sessionId as SessionId, path: parsed.path }
 }

+ 0 - 0
packages/client/ui-sidebar-textpreview/src/client/store.ts → packages/client/ui-sidebar-documentpreview/src/client/store.ts


+ 0 - 0
packages/client/ui-sidebar-textpreview/src/client/text/TextBody.tsx → packages/client/ui-sidebar-documentpreview/src/client/text/TextBody.tsx


+ 2 - 2
packages/client/ui-sidebar-textpreview/src/client/text/index.ts → packages/client/ui-sidebar-documentpreview/src/client/text/index.ts

@@ -5,7 +5,7 @@ import type { DocumentPreviewDefinition } from '../document/registry.ts'
 import { TextBody } from './TextBody.tsx'
 
 /** Stable plain-text implementation identity within this package. */
-export const PLAIN_BODY_ID = '@deepseek-ai/dsh-client-ui-sidebar-textpreview/text'
+export const PLAIN_BODY_ID = '@deepseek-ai/dsh-client-ui-sidebar-documentpreview/text'
 
 /**
  * Describe the plain-text fallback.
@@ -18,7 +18,7 @@ export function textBodyDefinition(title: () => string): DocumentPreviewDefiniti
 
 /** @param ctx - owning plugin context. Register the fallback metadata and keyed body. */
 export function apply(ctx: Context): void {
-  const t = ctx.locale.bind('sidebarTextpreview')
+  const t = ctx.locale.bind('sidebarDocumentPreview')
   ctx.effect(() => ctx.documentPreviews.register(textBodyDefinition(() => t('viewer.text'))))
   ctx.effect(() => ctx.slots.inject('sidebar.right.tab.document', () => ctx.slots.register(
     { name: 'sidebar.right.tab.document', key: PLAIN_BODY_ID }, TextBody,

+ 0 - 0
packages/client/ui-sidebar-textpreview/src/client/text/lines.ts → packages/client/ui-sidebar-documentpreview/src/client/text/lines.ts


+ 0 - 0
packages/client/ui-sidebar-textpreview/src/css-modules.d.ts → packages/client/ui-sidebar-documentpreview/src/css-modules.d.ts


+ 0 - 0
packages/client/ui-sidebar-textpreview/src/index.ts → packages/client/ui-sidebar-documentpreview/src/index.ts


+ 4 - 4
packages/client/ui-sidebar-textpreview/tests/apply.client.spec.ts → packages/client/ui-sidebar-documentpreview/tests/apply.client.spec.ts

@@ -74,7 +74,7 @@ async function boot() {
   return { tabs, registered, dictionaries, fiber, workspaceFiles }
 }
 
-describe('ui-sidebar-textpreview apply', () => {
+describe('ui-sidebar-documentpreview apply', () => {
   it('keeps the host Loader entry inert', () => {
     expect(hostApply).not.toThrow()
   })
@@ -83,16 +83,16 @@ describe('ui-sidebar-textpreview apply', () => {
     const { tabs, registered, dictionaries } = await boot()
     expect(tabs.get(TEXTPREVIEW_KIND)?.priority).toBe('fallback')
     expect(tabs.get(TEXTPREVIEW_KIND)?.id).toBe(TEXTPREVIEW_ID)
-    expect(dictionaries.get('sidebarTextpreview')).toEqual({ zh, en })
+    expect(dictionaries.get('sidebarDocumentPreview')).toEqual({ zh, en })
     // The seat key is the implementation's id, not the kind: an extension may
     // take the kind over, and the seat must still find this body.
     expect(registered.map(entry => [entry.name, entry.key, entry.locale, entry.component])).toEqual([
-      ['sidebar.right.pane.tab', TEXTPREVIEW_ID, 'sidebarTextpreview', TextPreview],
+      ['sidebar.right.pane.tab', TEXTPREVIEW_ID, 'sidebarDocumentPreview', TextPreview],
       ['sidebar.right.tab.document', PLAIN_BODY_ID, undefined, TextBody],
       ['sidebar.right.tab.document', MARKDOWN_BODY_ID, 'documentMarkdown', MarkdownBody],
       ['sidebar.right.tab.document', HTML_BODY_ID, 'documentHtml', HtmlBody],
       ['sidebar.right.tab.document', PDF_BODY_ID, 'sidebarPdf', PdfBody],
-      ['sidebar.right.tab.document', '@deepseek-ai/dsh-client-ui-sidebar-textpreview/code', 'sidebarCodePreview', CodeBody],
+      ['sidebar.right.tab.document', '@deepseek-ai/dsh-client-ui-sidebar-documentpreview/code', 'sidebarCodePreview', CodeBody],
     ])
     expect(registered[0]?.store).toBeDefined()
     expect(typeof registered[0]?.inject).toBe('function')

+ 0 - 0
packages/client/ui-sidebar-textpreview/tests/code-body.client.spec.tsx → packages/client/ui-sidebar-documentpreview/tests/code-body.client.spec.tsx


+ 0 - 0
packages/client/ui-sidebar-textpreview/tests/code-languages.client.spec.ts → packages/client/ui-sidebar-documentpreview/tests/code-languages.client.spec.ts


+ 1 - 1
packages/client/ui-sidebar-textpreview/tests/code-registration.client.spec.tsx → packages/client/ui-sidebar-documentpreview/tests/code-registration.client.spec.tsx

@@ -10,7 +10,7 @@ import { CODE_EXTENSIONS } from '../src/client/code/languages.ts'
 import { DocumentPreviewRegistry } from '../src/client/document/registry.ts'
 import { documentTabInfoFactory } from '../src/client/document/contract.ts'
 
-const ID = '@deepseek-ai/dsh-client-ui-sidebar-textpreview/code'
+const ID = '@deepseek-ai/dsh-client-ui-sidebar-documentpreview/code'
 const SLOT = 'sidebar.right.tab.document'
 const plugin = { inject: ['slots', 'locale', 'documentPreviews'], apply }
 let runtime: SlotTestRuntime | undefined

+ 0 - 0
packages/client/ui-sidebar-textpreview/tests/definition.client.spec.ts → packages/client/ui-sidebar-documentpreview/tests/definition.client.spec.ts


+ 0 - 0
packages/client/ui-sidebar-textpreview/tests/document-registry.client.spec.ts → packages/client/ui-sidebar-documentpreview/tests/document-registry.client.spec.ts


+ 0 - 0
packages/client/ui-sidebar-textpreview/tests/document-seat.client.spec.tsx → packages/client/ui-sidebar-documentpreview/tests/document-seat.client.spec.tsx


+ 0 - 0
packages/client/ui-sidebar-textpreview/tests/document-toolbar.client.spec.tsx → packages/client/ui-sidebar-documentpreview/tests/document-toolbar.client.spec.tsx


+ 0 - 0
packages/client/ui-sidebar-textpreview/tests/face.client.spec.ts → packages/client/ui-sidebar-documentpreview/tests/face.client.spec.ts


+ 2 - 2
packages/client/ui-sidebar-textpreview/tests/failure-line.client.spec.ts → packages/client/ui-sidebar-documentpreview/tests/failure-line.client.spec.ts

@@ -4,12 +4,12 @@
 import { describe, expect, it } from 'vitest'
 import type { RemoteFailure } from '@deepseek-ai/dsh-api-remotes/client'
 import type { TranslateNS } from '@deepseek-ai/dsh-client-ui-slots'
-// The namespace declaration `TranslateNS<'sidebarTextpreview'>` resolves against.
+// The namespace declaration `TranslateNS<'sidebarDocumentPreview'>` resolves against.
 import type {} from '../src/client/index.ts'
 import { failureLine } from '../src/client/failure-line.ts'
 
 /** Key-echoing translate that also shows its parameters, so a formatted value is visible. */
-const t: TranslateNS<'sidebarTextpreview'> = (key, params) =>
+const t: TranslateNS<'sidebarDocumentPreview'> = (key, params) =>
   params === undefined ? key : `${key}(${Object.entries(params).map(([k, v]) => `${k}=${String(v)}`).join(',')})`
 
 function failure(code: string, details: Record<string, unknown> = {}, message = 'boom'): RemoteFailure {

+ 0 - 0
packages/client/ui-sidebar-textpreview/tests/fixtures.client.ts → packages/client/ui-sidebar-documentpreview/tests/fixtures.client.ts


+ 0 - 0
packages/client/ui-sidebar-textpreview/tests/html-apply.client.spec.ts → packages/client/ui-sidebar-documentpreview/tests/html-apply.client.spec.ts


+ 0 - 0
packages/client/ui-sidebar-textpreview/tests/html-body.client.spec.tsx → packages/client/ui-sidebar-documentpreview/tests/html-body.client.spec.tsx


+ 0 - 0
packages/client/ui-sidebar-textpreview/tests/html-bootstrap.client.spec.ts → packages/client/ui-sidebar-documentpreview/tests/html-bootstrap.client.spec.ts


+ 0 - 0
packages/client/ui-sidebar-textpreview/tests/html-pack.client.spec.ts → packages/client/ui-sidebar-documentpreview/tests/html-pack.client.spec.ts


+ 0 - 0
packages/client/ui-sidebar-textpreview/tests/html-read-relative.client.spec.ts → packages/client/ui-sidebar-documentpreview/tests/html-read-relative.client.spec.ts


+ 0 - 0
packages/client/ui-sidebar-textpreview/tests/lines.client.spec.ts → packages/client/ui-sidebar-documentpreview/tests/lines.client.spec.ts


+ 0 - 0
packages/client/ui-sidebar-textpreview/tests/markdown-body.client.spec.tsx → packages/client/ui-sidebar-documentpreview/tests/markdown-body.client.spec.tsx


+ 0 - 0
packages/client/ui-sidebar-textpreview/tests/markdown-registration.client.spec.tsx → packages/client/ui-sidebar-documentpreview/tests/markdown-registration.client.spec.tsx


+ 0 - 0
packages/client/ui-sidebar-textpreview/tests/pdf-assets.client.spec.ts → packages/client/ui-sidebar-documentpreview/tests/pdf-assets.client.spec.ts


+ 0 - 0
packages/client/ui-sidebar-textpreview/tests/pdf-body.client.spec.tsx → packages/client/ui-sidebar-documentpreview/tests/pdf-body.client.spec.tsx


+ 0 - 0
packages/client/ui-sidebar-textpreview/tests/pdf-document.client.spec.ts → packages/client/ui-sidebar-documentpreview/tests/pdf-document.client.spec.ts


+ 0 - 0
packages/client/ui-sidebar-textpreview/tests/pdf-fixture.ts → packages/client/ui-sidebar-documentpreview/tests/pdf-fixture.ts


+ 0 - 0
packages/client/ui-sidebar-textpreview/tests/pdf-registration.client.spec.ts → packages/client/ui-sidebar-documentpreview/tests/pdf-registration.client.spec.ts


+ 0 - 0
packages/client/ui-sidebar-textpreview/tests/pdf-runtime.client.spec.ts → packages/client/ui-sidebar-documentpreview/tests/pdf-runtime.client.spec.ts


+ 0 - 0
packages/client/ui-sidebar-textpreview/tests/pdf-smoke.client.spec.ts → packages/client/ui-sidebar-documentpreview/tests/pdf-smoke.client.spec.ts


+ 0 - 0
packages/client/ui-sidebar-textpreview/tests/pdf-store.client.spec.ts → packages/client/ui-sidebar-documentpreview/tests/pdf-store.client.spec.ts


+ 0 - 0
packages/client/ui-sidebar-textpreview/tests/pdf-worker.fixture.mjs → packages/client/ui-sidebar-documentpreview/tests/pdf-worker.fixture.mjs


+ 0 - 0
packages/client/ui-sidebar-textpreview/tests/rpc.client.spec.ts → packages/client/ui-sidebar-documentpreview/tests/rpc.client.spec.ts


+ 0 - 0
packages/client/ui-sidebar-textpreview/tests/store.client.spec.ts → packages/client/ui-sidebar-documentpreview/tests/store.client.spec.ts


+ 0 - 0
packages/client/ui-sidebar-textpreview/tests/text-preview.client.spec.tsx → packages/client/ui-sidebar-documentpreview/tests/text-preview.client.spec.tsx


+ 0 - 0
packages/client/ui-sidebar-textpreview/tsconfig.json → packages/client/ui-sidebar-documentpreview/tsconfig.json


+ 1 - 1
packages/client/ui-sidebar-textpreview/tsdown.config.ts → packages/client/ui-sidebar-documentpreview/tsdown.config.ts

@@ -4,7 +4,7 @@ import { dirname, join } from 'node:path'
 import type { UserConfig } from 'tsdown'
 import { clientBundle } from '../tsdown.client.ts'
 
-const bundle = clientBundle('@deepseek-ai/dsh-client-ui-sidebar-textpreview', ['lib/types/index.js'])
+const bundle = clientBundle('@deepseek-ai/dsh-client-ui-sidebar-documentpreview', ['lib/types/index.js'])
 const require = createRequire(import.meta.url)
 const workerSpecifier = 'pdfjs-dist/build/pdf.worker.min.mjs?raw'
 const workerModule = '\0dsh-pdf-worker.mjs'

+ 1 - 1
packages/client/ui-sidebar-right/README.md

@@ -70,7 +70,7 @@ State is memory-only. A reload returns every session to the collapsed default; s
 <a id="extension-seats"></a>
 ## Extension seats
 
-A tab type registers in two stages, and the shipped guide type goes through exactly the same public path a type from another package does (`ui-sidebar-textpreview` is the live proof). Both stages sit inside the type's own `ctx.effect`, so the registration lives exactly as long as the plugin that made it.
+A tab type registers in two stages, and the shipped guide type goes through exactly the same public path a type from another package does (`ui-sidebar-documentpreview` is the live proof). Both stages sit inside the type's own `ctx.effect`, so the registration lives exactly as long as the plugin that made it.
 
 1. **The type** — `ctx.sidebarRightTabs.register({ id, kind, patterns?, priority?, canOpen?, title, guide? })`, a static declaration with no runtime hook, returning a disposer. `id` is this implementation's identity in the tab system, unique across every registration (a package name is the natural value; the shipped guide is `@deepseek-ai/dsh-client-ui-sidebar-right/guide`): a kind is not unique once an extension may take a builtin's over, so the implementation names itself, and a second registration of an `id` throws. A resource type names `patterns`, globs over `dsh-resource://` addresses: one containing `:` matches the whole address (`dsh-resource://file/**`); one without matches the URI's path at any depth, ignoring case (`*.md`), and an address that is not a URI matches no such pattern. A page type — the guide, a file tree — names none and is opened by kind. `canOpen(address)` vetoes a match. `title(address)` is the tab chip's text, captured when the tab opens. `guide` lists entry boxes for the guide page; picking one opens the contributing type as a page. A `kind` carries at most one `builtin` and one `extension` registration (the extension is in force; the builtin resumes when it leaves); any other collision on a kind throws. The `id` is also the key the type's body and title register under, so an extension and the builtin it takes over hold distinct cells and the seat renders the one in force.
 2. **The body** — `ctx.slots.register({ name: 'sidebar.right.pane.tab', key: definition.id }, Body)` reads `{ sidebar, panel, tab }` through the framework-injected `useTabInfo()`. `sidebar` supplies expansion and fullscreen information; `panel.id` identifies its pane; `tab` contains the record fields, `visible`, `navigation`, `signal`, and `actions`. These are not parallel owner props; the type's own store still uses `useStore`/`actions`. Optional title registrations and guide replacements share this hook; an absent title registration uses the text captured at open time.

+ 1 - 1
packages/client/ui-sidebar-right/README.zh.md

@@ -70,7 +70,7 @@ kind: "package-reference"
 <a id="extension-seats"></a>
 ## 扩展席位
 
-tab 类型分两阶段注册,随包发布的引导类型走的正是别的包的类型走的同一条公开路径(`ui-sidebar-textpreview` 是活的证明)。两个阶段都在类型自己的 `ctx.effect` 里,因此注册与创建它的插件同生共死。
+tab 类型分两阶段注册,随包发布的引导类型走的正是别的包的类型走的同一条公开路径(`ui-sidebar-documentpreview` 是活的证明)。两个阶段都在类型自己的 `ctx.effect` 里,因此注册与创建它的插件同生共死。
 
 1. **类型**——`ctx.sidebarRightTabs.register({ id, kind, patterns?, priority?, canOpen?, title, guide? })`,一份没有运行时钩子的静态声明,返回 disposer。`id` 是这个实现在 tab 系统里的身份,在全部注册中唯一(包名是天然取值;随包引导页是 `@deepseek-ai/dsh-client-ui-sidebar-right/guide`):一旦 extension 可以接管 builtin 的 kind,kind 就不再唯一,所以实现要自己命名,同一 `id` 的第二次注册会 throw。资源类型给出 `patterns`,即作用于 `dsh-resource://` 地址的 glob:含 `:` 的匹配整个地址(`dsh-resource://file/**`);不含的匹配 URI 路径的任意深度且忽略大小写(`*.md`),不是 URI 的地址不匹配任何这类模式。页类型——引导页、文件树——不给出模式,按 kind 打开。`canOpen(address)` 否决一次命中。`title(address)` 是 tab chip 的文字,在 tab 打开时捕获。`guide` 列出引导页的入口框;选中一个即把贡献它的类型作为页打开。一个 `kind` 最多承载一份 `builtin` 与一份 `extension` 注册(extension 生效;它离开后 builtin 恢复);kind 上的其它任何撞名都 throw。`id` 同时也是该类型正文与标题注册时用的 key,因此 extension 与它接管的 builtin 各占一个格位,席位渲染生效的那个。
 2. **正文**——`ctx.slots.register({ name: 'sidebar.right.pane.tab', key: definition.id }, Body)` 通过框架注入的 `useTabInfo()` 读取 `{ sidebar, panel, tab }`。`sidebar` 提供开合与全屏信息,`panel.id` 命名所在格,`tab` 包含原记录字段、`visible`、`navigation`、`signal` 和 `actions`。这些字段不再作为平铺owner props传入;类型自己的store仍使用 `useStore`/`actions`。可选标题注册及引导替换共享该hook;未注册标题时使用打开时保存的文本。

+ 1 - 1
packages/client/ui-sidebar-right/src/client/index.ts

@@ -18,7 +18,7 @@
  * Tab types register in two stages: the type itself into `ctx.sidebarRightTabs`,
  * its body into the keyed `sidebar.right.pane.tab` seat under the same kind. The
  * guide registers through those stages unmodified, exactly as a type shipped
- * from another package does — `ui-sidebar-textpreview` is the live proof.
+ * from another package does — `ui-sidebar-documentpreview` is the live proof.
  */
 import type { Context as ClientContext } from '@deepseek-ai/cordis'
 import type {} from '@deepseek-ai/dsh-client-resources/client'

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor