From d478780e435f042dfa7599c813ac3a550641c537 Mon Sep 17 00:00:00 2001 From: Menghuan1918 Date: Sat, 15 Aug 2026 01:18:58 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20README=20=E8=AF=AD=E6=B0=94=E4=B8=93?= =?UTF-8?q?=E4=B8=9A=E5=8C=96=E5=B9=B6=E6=94=BE=E5=A4=A7=E6=9C=80=E8=BF=91?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=88=AA=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Hero 特性标签新增 插件接入(Plugin integration),以 code 标签承载插件注册接入能力 - 移除口语化表达(吃自己的狗粮 / 把自己当用户),改用中性措辞 - 「我们的态度」改为「核心理念」,表述更正式 - 最近更新截图放大(320 → 480) - 同步英文 README --- README.md | 12 ++++++------ README_EN.md | 14 ++++++-------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 0fa7778..6c297e6 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,9 @@
一个服务化的侧边栏框架,一套开箱即用的完整工作台

- 文件管理 编辑预览 内嵌浏览器 真实终端 Git 面板 后台任务

+ 文件管理 编辑预览 内嵌浏览器 真实终端 Git 面板 后台任务 插件接入

右侧栏 + 底部面板双工作台,并把 ctx.betterSidebar 服务开放给所有插件——
- 通过 registerTab / registerFileViewer 注册新页面与文件预览器,
+ 通过 registerTab / registerFileViewer 注册新的侧边栏页面与文件预览器。
@@ -30,7 +30,7 @@ - **⚡ 按需加载**:启动只拉 ~325KB 核心,终端 / 编辑器等重依赖用到才按需拉取([设计文档](docs/plans/2026-08-12-lazy-chunks-design.md)) - **🌏 多语言**:界面文案跟随 DSH 语言(zh / en)实时切换 -> 🔌 **我们的态度**:把插件做成服务、把自己当用户——内置的 7 tab + 6 viewer 与外部插件走同一套 `ctx.betterSidebar` API,不自留特权;可被生态替代的就交给生态。详见下方「🔌 服务化」一节与 [外部插件接入指南](./docs/external-plugin-guide.md)。 +> 🔌 **核心理念**:服务优先——内置的 7 tab + 6 viewer 与第三方插件通过同一套 `ctx.betterSidebar` API 注册,能力完全对等;官方不再内置、可由生态提供的功能,交由生态插件实现。接入文档见下方「🔌 服务化」与 [外部插件接入指南](./docs/external-plugin-guide.md)。 ## 🆕 最近更新 @@ -38,8 +38,8 @@ | 功能 | 说明 | 截图 | |---|---|---| -| 🔌 服务化基座 | 完整类型导出 + `version`/`features` 能力探测、状态订阅(`getSnapshot`/`subscribeState`)、tab 角标、`onOpen`/`onActivate`/`onClose` 生命周期回调、`updateTab`/`activateTab`/`openFile`、定向打开、`meta` 跨刷新持久化、插件自有设置(`pluginToggles`/`render`) | 服务化基座截图 | -| ➕ 添加插件 | 设置页「推荐插件目录」+ 一键复制安装命令;内置 Office 预览迁至推荐插件 | 添加插件截图 | +| 🔌 服务化基座 | 完整类型导出 + `version`/`features` 能力探测、状态订阅(`getSnapshot`/`subscribeState`)、tab 角标、`onOpen`/`onActivate`/`onClose` 生命周期回调、`updateTab`/`activateTab`/`openFile`、定向打开、`meta` 跨刷新持久化、插件自有设置(`pluginToggles`/`render`) | 服务化基座截图 | +| ➕ 添加插件 | 设置页「推荐插件目录」+ 一键复制安装命令;内置 Office 预览迁至推荐插件 | 添加插件截图 | | 🖱️ 标签页滚轮 | 标签页栏支持鼠标滚轮横向滚动 | | | 🐛 修复 | 远程访问 403(信任栅栏改用 `trustedHosts`)、侧边栏崩溃 [#31](https://github.com/omdsh-dev/DSH-better-sidebar/issues/31)、Windows 下 HTML 预览盘符路径 | | @@ -206,7 +206,7 @@ dsh registry enable dsh-external/dsh-better-sidebar ## 🔌 服务化:注册 tab 与文件预览器 -从 v0.4.0 起暴露 `ctx.betterSidebar` 服务,其他插件可注册侧边栏页面与文件预览器(内置 7 tab + 6 viewer 也走同一服务,吃自己的狗粮): +从 v0.4.0 起暴露 `ctx.betterSidebar` 服务,其他插件可注册侧边栏页面与文件预览器(内置 7 tab + 6 viewer 亦通过同一服务注册): ```ts import type {} from 'dsh-better-sidebar' // 触发 ctx.betterSidebar 类型合并 diff --git a/README_EN.md b/README_EN.md index b42bb89..6512dde 100644 --- a/README_EN.md +++ b/README_EN.md @@ -3,11 +3,9 @@
A service-oriented sidebar framework, and a complete workbench out of the box

- File management Edit & preview Embedded browser Real terminal Git panel Background tasks

+ File management Edit & preview Embedded browser Real terminal Git panel Background tasks Plugin integration

A dual workbench (right sidebar + bottom panel) that opens its ctx.betterSidebar service to every plugin —
- register new pages and file viewers via registerTab / registerFileViewer.
- The 7 built-in tabs + 6 viewers go through the same service as third-party plugins: we eat our own dog food.

- 🧩 Ecosystem plugins: tag your repo with the dsh-better-sidebar topic to join the ecosystem. + register new sidebar pages and file viewers via registerTab / registerFileViewer.
@@ -32,7 +30,7 @@ - **⚡ On-demand Loading**: only ~325KB core at startup; heavy deps (terminal / editor) load on demand ([design](docs/plans/2026-08-12-lazy-chunks-design.md)) - **🌏 i18n**: UI text follows DSH's language (zh / en) with live switching -> 🔌 **Our stance**: build a plugin like a service, and use it like a user. The 7 built-in tabs + 6 viewers hold no special privileges — they register through the same `ctx.betterSidebar` API as third-party plugins; whatever the ecosystem can do better, we hand off. See the "🔌 Service" section below and the [external plugin guide](./docs/external-plugin-guide.md). +> 🔌 **Core principle**: service-first — the 7 built-in tabs + 6 viewers register through the same `ctx.betterSidebar` API as third-party plugins, with fully equal capabilities; anything the ecosystem can provide better is delegated to ecosystem plugins. See the "🔌 Service" section below and the [external plugin guide](./docs/external-plugin-guide.md). ## 🆕 Recent Updates @@ -40,8 +38,8 @@ | Feature | Description | Screenshot | |---|---|---| -| 🔌 Service API base | Complete type exports + `version`/`features` capability detection, state subscription (`getSnapshot`/`subscribeState`), tab `badge`, `onOpen`/`onActivate`/`onClose` lifecycle callbacks, `updateTab`/`activateTab`/`openFile`, targeted open, `meta` persisted across reloads, plugin-owned settings (`pluginToggles`/`render`) | Service API base screenshot | -| ➕ Add Plugins | Recommended plugin catalog in settings + one-click copy install command; built-in Office preview moved to the recommended plugin | Add Plugins screenshot | +| 🔌 Service API base | Complete type exports + `version`/`features` capability detection, state subscription (`getSnapshot`/`subscribeState`), tab `badge`, `onOpen`/`onActivate`/`onClose` lifecycle callbacks, `updateTab`/`activateTab`/`openFile`, targeted open, `meta` persisted across reloads, plugin-owned settings (`pluginToggles`/`render`) | Service API base screenshot | +| ➕ Add Plugins | Recommended plugin catalog in settings + one-click copy install command; built-in Office preview moved to the recommended plugin | Add Plugins screenshot | | 🖱️ Tab-bar scroll | Mouse-wheel horizontal scrolling on the tab bar | | | 🐛 Fixes | Remote access 403 (trust fence now uses `trustedHosts`), sidebar crash [#31](https://github.com/omdsh-dev/DSH-better-sidebar/issues/31), Windows HTML-preview drive-path | | @@ -208,7 +206,7 @@ Update: `git pull && pnpm install && pnpm build` → `node scripts/package-regis ## 🔌 Service: register tabs & file viewers -Since v0.4.0 the plugin exposes the `ctx.betterSidebar` service — other plugins can register sidebar pages and file viewers (the 7 built-in tabs + 6 viewers go through the same service, eating our own dog food): +Since v0.4.0 the plugin exposes the `ctx.betterSidebar` service — other plugins can register sidebar pages and file viewers (the 7 built-in tabs + 6 viewers register through the same service): ```ts import type {} from 'dsh-better-sidebar' // triggers the ctx.betterSidebar type merge