feat: 设置页「添加插件」推荐目录 + 复制安装命令;移除内置 Office 预览

- 设置页侧边栏内容/文件预览两个网格末尾各增虚线卡片,弹出对应 kind 的插件弹窗
- 弹窗:GitHub topic 按钮(新标签页)+ 推荐插件目录(plugins-tabs.ts / plugins-viewers.ts)
- 每条目「跳转」(window.open 新标签页直达仓库)与「复制」(writeClipboard + 已复制反馈)
- 不做终端预填流:不关闭弹窗、不打开终端、无失败路径(install/installNotice/installError* 文案删除)
- 内置 Office 预览(docx/xlsx/pptx)整体移除,chunk 白名单 5→2(terminal/editor)
- 文案「内置插件」→「推荐插件」;AGENTS.md/README/设计文档同步
This commit is contained in:
Menghuan1918 committed 2026-08-14 22:30:34 +08:00
1 parent 1b0b382edc
commit cbc28473a0
40 files changed
+942 -1128

No files matched your search

-23
View File
@@ -10,7 +10,6 @@ import {
import { loadPrefs, type SidebarSettingsClient } from '../src/client/prefs.ts'
import { SIDEBAR_PREFS_DEFAULTS } from '../src/prefs-shared.ts'
import { extOf, languageKeyForExt } from '../src/client/lang.ts'
import { officeKindForExt } from '../src/client/office-types.ts'
import { isPdfExt } from '../src/client/pdf-types.ts'
import { isImageExt } from '../src/client/image-types.ts'
import { relativeTo } from '../src/client/paths.ts'
@@ -1088,28 +1087,6 @@ describe('editor language mapping', () => {
})
})
describe('office preview kind', () => {
it('routes docx/xlsx to their renderers', () => {
expect(officeKindForExt('.docx')).toBe('docx')
expect(officeKindForExt('.xlsx')).toBe('xlsx')
})
it('routes pptx to its renderer and legacy OLE formats to download-only', () => {
expect(officeKindForExt('.pptx')).toBe('pptx')
expect(officeKindForExt('.doc')).toBe('download-only')
expect(officeKindForExt('.xls')).toBe('download-only')
expect(officeKindForExt('.ppt')).toBe('download-only')
})
it('returns null for non-Office extensions and empty input', () => {
expect(officeKindForExt('.txt')).toBeNull()
expect(officeKindForExt('.md')).toBeNull()
expect(officeKindForExt('.png')).toBeNull()
expect(officeKindForExt('.pdf')).toBeNull()
expect(officeKindForExt('')).toBeNull()
})
})
describe('pdf preview kind', () => {
it('routes only .pdf to the browser-native preview', () => {
expect(isPdfExt('.pdf')).toBe(true)