dsh-foxy-memory 0.4.4 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -86,7 +86,7 @@ Foxy 面板的「记忆桥设置」可以修改这些值,保存到 `$DSH_HOME/
86
86
 
87
87
  ## 记忆浏览界面
88
88
 
89
- 安装并重启 DSH 后,左侧栏出现 **Foxy Memory**。页面提供:
89
+ 安装并重启 DSH 后,入口在 **Foxy → 记忆**。页面提供:
90
90
 
91
91
  - 记忆总数、待写入数、来源平台数和当前 provider;
92
92
  - 按平台(QQ / 微博 / B站 / DSH)、状态筛选;
package/lib/client.js CHANGED
@@ -304,6 +304,23 @@ window.__ModuleLoader__.load({
304
304
  const name = 'dsh-foxy-memory'
305
305
  const inject = ['slots']
306
306
 
307
+ function registerConsolePage() {
308
+ const root = window.__FOXY_CONSOLE__ || (window.__FOXY_CONSOLE__ = { pages: [], listeners: new Set() })
309
+ if (!Array.isArray(root.pages)) root.pages = []
310
+ if (!(root.listeners instanceof Set)) root.listeners = new Set()
311
+ const entry = { id: PANEL_ID, label: '记忆', order: 15, Component: Panel }
312
+ const index = root.pages.findIndex((page) => page.id === entry.id)
313
+ if (index >= 0) root.pages[index] = entry
314
+ else root.pages.push(entry)
315
+ for (const listener of root.listeners) {
316
+ try {
317
+ listener()
318
+ } catch {
319
+ // 单个面板的渲染错误不应影响其他标签页
320
+ }
321
+ }
322
+ }
323
+
307
324
  function apply(ctx) {
308
325
  const style = document.createElement('style')
309
326
  style.setAttribute('data-plugin-css', 'dsh-foxy-memory')
@@ -311,18 +328,13 @@ window.__ModuleLoader__.load({
311
328
  document.head.appendChild(style)
312
329
  ctx.effect(() => () => style.remove(), 'dsh-foxy-memory: style')
313
330
 
331
+ registerConsolePage()
314
332
  ctx.slots.inject('main', () =>
315
333
  ctx.slots.register(
316
334
  { name: 'main', key: PANEL_ID, inject: () => ({ workbench: true }) },
317
335
  () => h(Panel),
318
336
  ),
319
337
  )
320
- ctx.slots.inject('sidebar.panellist', () =>
321
- ctx.slots.register(
322
- { name: 'sidebar.panellist', id: PANEL_ID, order: 15, label: () => LABEL },
323
- MemoryIcon,
324
- ),
325
- )
326
338
  ctx.slots.inject('settings.section', () =>
327
339
  ctx.slots.register(
328
340
  { name: 'settings.section', id: 'foxy-memory', order: 33, label: LABEL },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-foxy-memory",
3
- "version": "0.4.4",
3
+ "version": "0.4.5",
4
4
  "description": "Memory subplugin for dsh-foxy: local JSONL archive plus optional cross-platform Foxy Memory API, recall and search.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",