Repository navigation
feat(client): 仓库地志侧栏入口改旗标门控,默认关时不再常驻(#598) - #631
modusensus wants to merge 1 commit into
Conversation
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 一致。
|
Warning Review limit reachedYou'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. View limit details
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. |
There was a problem hiding this comment.
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 Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
背景
#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";/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-sync118 一致(本 PR 只动lib/client.js手写面,无 src 对应物)。Closes #598。