Skip to content

feat(client): 仓库地志侧栏入口改旗标门控,默认关时不再常驻(#598) - #631

Open
modusensus wants to merge 1 commit into
mainfrom
fix/598-choro-entry-gate
Open

modusensus wants to merge 1 commit into
mainfrom
fix/598-choro-entry-gate

Conversation

@modusensus

Copy link
Copy Markdown
Member

背景

#598:chorographyEnabled 默认 false,关着时 /choro/* 一律 409、面板页渲染「未启用」空态——但侧栏那一格无条件注册(P11 取舍),于是从没用过仓库地志的用户侧栏也永久多一个图标,点进去只有一句「未启用」,想让它消失只能改插件代码。issue 正文排除了前端藏掉的两条路(glyph 返回 null = 空按钮;宿主没有隐藏面板项的 UI),结论是只能由插件不注册。

评论区 §四的处置拍板:座位闸 + 提示文案说准一起做(即本 PR);独立开关(issue 建议②)是已排期的 D2 形态,不在本 PR。

改动

成对规则拆成两半:

  • main(key "dsh-mneme-wiki")无条件保留,原地不动——feat(panel): 记忆库搬进宿主原生面板位(sidebar.panellist + main),老宿主保留回落 #562 那堵墙:布局里存着 activePanelId="dsh-mneme-wiki" 时少注册 main,宿主 selectPanel 直接抛 "main panel … is not registered";
  • 侧栏 glyph 的登记挪进座位闸,与 M.O.(v0.9.0)/日记(v0.13)两条既有闸同一形态:读一次 /features、fail-closed(读不到就不注册,不猜)、开关改动重启生效。glyph 延迟注册走 diary 右栏页签同一条 inject → register 路径(宿主每次渲染枚举 entriesOfSlot,晚到的登记下一帧出现)。

提示文案说准(#598 的另一半):两语言 memory.features.chorographyEnabled.hint 的「关着时它们全部不存在」补上侧栏入口——这句话此前与实现不符(侧栏那格就在),闸落了之后它才算真。

kb 座位刻意不动:契约 §3.6 选的是「入口常驻 + 空态自解释」(注释里自己写着是 #607 的另一种写法)——两种形态并存是评论区 §四的拍板;文件内注释把这条分歧写明,免得下次有人照着一边改另一边。

清理扫帚少一把:panellist 回调的 disposer 不再调 disposeWikiGlyph()——glyph 的生命周期随座位闸归 cordis 上下文,与本回调的成对座位不同源(注释写明)。

验证

  • test/client.test.js:座位闸断言重写(main 无条件 / glyph 在闸内 / flag fail-closed / features 失败不注册);panellist 结构测试更新——无条件 glyph 只剩记忆 + kb 两对、main 仍三份(wiki main 无条件是断言不是疏漏);清理扫帚断言同步;
  • 全量 node --test test/*.test.js:3154 用例 / 3153 通过 / 0 失败 / 1 跳过;check-sync 118 一致(本 PR 只动 lib/client.js 手写面,无 src 对应物)。

Closes #598。

chorographyEnabled 默认 false,但侧栏座位无条件注册(P11 取舍):从没用过
地志的用户侧栏永久多一个图标、点进去只有「未启用」空态。按 #598 评论区
§四的拍板落座位闸:

- 成对规则拆成两半:main(key "dsh-mneme-wiki")无条件保留——#562 的墙
  (布局存着 activePanelId 时少注册直接抛 "main panel … is not
  registered");侧栏 glyph 挪进座位闸,与 M.O.(v0.9.0)/日记(v0.13)
  同一形态:读一次 /features、fail-closed(读不到不注册)、开关重启生效。
  glyph 延迟注册走 diary 右栏页签同一条 inject→register 路径。
- 两语言 hint 的「关着时它们全部不存在」补上侧栏入口——这句此前与实现
  不符,正是 #598 的另一半。
- kb 座位刻意不动:契约 §3.6 选的是「入口常驻 + 空态自解释」(#607 的
  另一种写法),两种形态并存是拍板;独立开关(issue 建议②)是已排期的
  D2 形态,不在本 PR。
- panellist 清理扫帚少一把:wiki glyph 的生命周期随座位闸归 cordis 上下文。

test: client.test.js 座位闸断言重写 + panellist 结构测试更新(无条件
glyph 只剩记忆 + kb 两对,main 仍三份)。全量 3154 用例 / 3153 通过 /
0 失败 / 1 跳过;check-sync 118 一致。
Copilot AI lite review requested due to automatic review settings November 9, 2026 21:32
@coderabbitai

coderabbitai Bot commented Nov 9, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 39 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 514d238 and 6106f38.

Files selected for processing: 3

  • dsh-mneme/CHANGELOG.md
  • dsh-mneme/lib/client.js
  • dsh-mneme/test/client.test.js
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@codecov

codecov Bot commented Nov 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] chorographyEnabled 关着时,侧栏「仓库地志」入口不该常驻(并建议给入口一个独立开关)

2 participants