neil-wang-global/dsh-footer-panels ↗★ 0

dsh-footer-panels

Promotes footer-overlay plugins (POMASA Studio, Pictor) to first-class sidebar panel entries, so they do not depend on their sidebar.footer.action buttons (which dsh-claude-style swallows into the account popover).

包名
dsh-footer-panels
兼容性
待验证
版本
1.0.0
许可证
MIT
最近更新
2026年11月7日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:neil-wang-global/dsh-footer-panels

核心机制:配置驱动

本插件的全部内容就是一张表。每个条目把一个底部按钮「提升」为一个面板:

{
  panelId: 'pomasa-studio',                 // 面板 key,全局唯一
  label: 'POMASA Studio',                   // 显示名
  order: 60,                                // 排序,越小越靠上
  launcher: '... .ps-footer-action',        // 该插件自己那个底部按钮的选择器
}
  • 想再接一个插件?加一行,不用改逻辑;
  • 想调顺序?改 order;
  • 想停用某个面板?删掉那一行。

这张表有默认值(就是本仓库附带的两个示例),也可以在 profile 的 bundle 配置里覆盖,不需要改动任何源码:

- id: footer-panels
  name: dsh-footer-panels
  config:
    panels:
      - panelId: my-plugin
        label: 我的插件
        order: 70
        launcher: '[data-slot="sidebar.footer.action"] .my-plugin-footer'

所以本插件本质上是一个通用机制 + 一份示例清单。POMASA Studio 和 Pictor 只是把这份清单填起来,证明它能用。

配置:添加你自己的面板

默认清单写在 client.js 的 DEFAULT_PANELS。有两种方式扩展。

方式 1:改默认清单(适合要提交回仓库)

在 DEFAULT_PANELS 追加一项:

const DEFAULT_PANELS = [
  // ...已有的两项
  {
    panelId: 'my-plugin',
    label: '我的插件',
    order: 62,
    launcher: '[data-slot="sidebar.footer.action"] .my-plugin-footer',
  },
]

方式 2:bundle 配置覆盖(不改源码)

在 ~/.dsh/profiles/web/cordis.patch.yml 里覆盖:

- id: footer-panels
  name: dsh-footer-panels
  config:
    panels:
      - panelId: my-plugin
        label: 我的插件
        order: 70
        launcher: '[data-slot="sidebar.footer.action"] .my-plugin-footer'

配置项按 panelId 与默认清单合并(覆盖同名字段),所以既可以只改某个示例的顺序,也可以纯新增。

怎么找到 launcher 选择器

  1. 打开 http://127.0.0.1:3080,按 F12 进入 devtools;
  2. 找到你想提升的那个底部按钮,看它的 class;
  3. 用「插槽容器 + 插件自己的 class」组合,例如:
document.querySelector('[data-slot="sidebar.footer.action"] .ps-footer-action')

返回 null 说明选择器不对或插件没挂载。必须指向插件自己的原始按钮,不要指向皮肤克隆出来的那份。

图标

ICONS 里按 panelId 注册图标,glyph() 会套上统一的 16px / 1.4 描边 / currentColor 外壳,只需传内部图形:

const ICONS = {
  'my-plugin': () => glyph([h('circle', { key: 'c', cx: 8, cy: 8, r: 5 })]),
}

没有注册图标的 panelId 会使用中性的默认面板图标(不会报错)。

方式 2:bundle 配置覆盖(不改源码)

在 ~/.dsh/profiles/web/cordis.patch.yml 里覆盖:

- id: footer-panels
  name: dsh-footer-panels
  config:
    panels:
      - panelId: my-plugin
        label: 我的插件
        order: 70
        launcher: '[data-slot="sidebar.footer.action"] .my-plugin-footer'

配置项按 panelId 与默认清单合并(覆盖同名字段),所以既可以只改某个示例的顺序,也可以纯新增。