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
2026-08-14 22:30:34 +08:00
parent 1b0b382edc
commit cbc28473a0
40 changed files with 942 additions and 1128 deletions
+205
View File
@@ -198,6 +198,38 @@
text-overflow: ellipsis;
}
/* The "add plugin" card: same grid cell / chrome as the inventory cards
(it shares .card), but a DASHED border — the repo's first dashed surface;
the hover accent follows the existing drag-drop dashed outlines
(sidebar.module.css .dropCenter / .tabBarDrop). */
.addCard {
align-items: flex-start;
padding: 12px;
border-style: dashed;
border-color: var(--dsw-alias-border-l2);
text-align: left;
}
.addCard:hover {
background: var(--dsw-alias-interactive-bg-hover);
border-color: var(--dsw-alias-interactive-bg-hover-accent);
color: var(--dsw-alias-label-primary);
}
.addCard:hover .cardTitle {
color: var(--dsw-alias-label-primary);
}
.addCard:hover .cardIconChip {
border-color: color-mix(in srgb, var(--dsw-alias-button-primary-fill) 35%, transparent);
color: var(--dsw-alias-button-primary-fill);
}
.addCard:focus-visible {
outline: 2px solid var(--dsw-alias-border-l4);
outline-offset: 2px;
}
.cardOn .cardDesc {
color: var(--dsw-alias-label-secondary);
}
@@ -412,6 +444,179 @@
color: var(--dsw-alias-state-error-primary);
}
/* ── "Add plugin" modal ──────────────────────────────────────────────── */
/* A wide dialog like the settings popup (doubled class keeps the width
rule above the primitive's .dialog regardless of stylesheet order). */
.pluginModal.pluginModal {
width: min(560px, 100%);
}
.pluginList {
display: flex;
flex-direction: column;
gap: 12px;
width: 100%;
}
/* The GitHub topic entry: a full-width secondary BUTTON (not a link — it
opens a real new browser tab via window.open, bypassing the sidebar
link takeover). */
.pluginTopicBtn {
width: 100%;
appearance: none;
border: 1px solid var(--dsw-alias-border-l2);
border-radius: 8px;
padding: 6px 12px;
font: inherit;
font-size: 12px;
line-height: 18px;
color: var(--dsw-alias-label-secondary);
background: var(--dsw-alias-bg-layer-1);
cursor: pointer;
}
.pluginTopicBtn:hover {
background: var(--dsw-alias-interactive-bg-hover);
border-color: var(--dsw-alias-interactive-bg-hover-accent);
color: var(--dsw-alias-label-primary);
}
.pluginTopicBtn:focus-visible {
outline: 2px solid var(--dsw-alias-border-l4);
outline-offset: 1px;
}
.pluginEmpty {
padding: 20px 2px;
font-size: 12px;
line-height: 18px;
color: var(--dsw-alias-label-tertiary);
}
.pluginEntries {
display: flex;
flex-direction: column;
gap: 10px;
}
/* One catalog entry: name + install button on the head row, description,
then the install command in a mono block (the exact script that gets
pre-typed into the terminal — review it here before installing). */
.pluginEntry {
display: flex;
flex-direction: column;
gap: 4px;
padding: 12px;
border: 1px solid var(--dsw-alias-border-l2);
border-radius: 12px;
background: var(--dsw-alias-bg-layer-1);
}
.pluginEntryHead {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
}
.pluginEntryActions {
display: inline-flex;
align-items: center;
gap: 6px;
flex: none;
}
/* The per-entry "jump" button: opens the plugin repo in a REAL new browser
tab (window.open — a button, so the sidebar link takeover cannot reroute
it). Secondary style, quieter than the Install button. */
.pluginJumpBtn {
flex: none;
appearance: none;
border: 1px solid var(--dsw-alias-border-l2);
border-radius: 8px;
padding: 3px 12px;
font: inherit;
font-size: 12px;
line-height: 1.5;
cursor: pointer;
background: transparent;
color: var(--dsw-alias-label-secondary);
}
.pluginJumpBtn:hover {
background: var(--dsw-alias-interactive-bg-hover);
border-color: var(--dsw-alias-interactive-bg-hover-accent);
color: var(--dsw-alias-label-primary);
}
.pluginJumpBtn:focus-visible {
outline: 2px solid var(--dsw-alias-border-l4);
outline-offset: 1px;
}
.pluginName {
min-width: 0;
font-size: 13px;
line-height: 20px;
font-weight: 600;
color: var(--dsw-alias-label-primary);
text-decoration: none;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.pluginName:hover {
text-decoration: underline;
color: var(--dsw-alias-button-primary-fill);
}
.pluginDesc {
font-size: 12px;
line-height: 18px;
color: var(--dsw-alias-label-secondary);
}
.pluginInstall {
display: block;
padding: 6px 10px;
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
font-size: 11px;
line-height: 16px;
color: var(--dsw-alias-label-secondary);
background: var(--dsw-alias-bg-layer-2);
border: 1px solid var(--dsw-alias-border-l1);
border-radius: 8px;
overflow-x: auto;
white-space: nowrap;
}
/* The per-entry copy button: copies the install script to the
clipboard (the settings primary-button recipe, smaller than .done). */
.pluginCopyBtn {
flex: none;
appearance: none;
border: 1px solid transparent;
border-radius: 8px;
padding: 3px 12px;
font: inherit;
font-size: 12px;
line-height: 1.5;
cursor: pointer;
background: var(--dsw-alias-label-primary);
color: var(--dsw-alias-bg-layer-3);
}
.pluginCopyBtn:hover {
background: var(--dsw-alias-button-primary-hover);
}
.pluginCopyBtn:focus-visible {
outline: 2px solid var(--dsw-alias-brand-primary);
outline-offset: 1px;
}
@media (prefers-reduced-motion: reduce) {
.card,
.switchTrack,