Repository navigation
[PR] feat: unified announcement surface — built-in registry + single renderer (lane A, #5548 P1) - #5557
[PR] feat: unified announcement surface — built-in registry + single renderer (lane A, #5548 P1)#5557ranxianglei wants to merge 2 commits into
Conversation
…rer (lane A, #5548 P1) Part of #5548 (approved unified announcement panel design, phase 1 of 4). Converge the hand-copied panel banners (pck-default-off #5079, wm-fastpath-intro #5469) into one registry (src/notices.ts) with a shared record schema, kind-priority/tone/dismiss-mode pure functions, and one client render loop (textContent only, max 5 header banners + overflow list card). Overview payload now carries a unified notices array; new GET /__bili/notices endpoint. Dismissal store, endpoint and allowlist semantics preserved (allowlist widened to registered dynamic ids for lanes B/C). No config surface change.
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.7913-pr.5557.7e960a9This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr5557.tgz
npm install -g packageInstall instructions are refreshed on each push. |
Review fix for PR #5557: the unused-exports gate flagged 7 type-only declarations (NoticeKind/NoticeTone/NoticeDismiss/NoticeText/BuiltInContext/ BuiltinNotice/VisibleNoticesOptions) that are referenced only inside src/notices.ts. Per the gate's own guidance they get the leading 'export' dropped (INTERNAL_ONLY), not a waiver — no other module imports them today, and P2/P3 can re-export whichever types the dynamic lanes actually consume. Zero behavior change: type-level surface only. Verified locally: check-unused-exports.mjs clean, tsc --noEmit clean, targeted suites (notices-registry, web-notices-banner, issue5079-pck-default-off, wm-fastpath-intro-notice, web-i18n) 38/38 green.
🔶 需要决策 背景一句话:审核 #5557 时发现存在平行 PR #5554(早 24 分钟开出)——同一已批准设计阶段(#5548 P1 内置公告注册表 + 单一渲染器)的另一份实现,两者互斥,只能留一个。 待决问题:留 #5557 还是留 #5554?两者同文件集、同 overview payload 形状变更( 选项(各带代价):
查重结论:重复——与 #5554 同范围平行实现(机制对比见上;因差异是真实的有意设计分歧而非误判,置信度不足 100%,按政策不关闭任何一个,交叉链接评论已发在 #5554 下)。 #5557 本 PR 的独立审核结论(已完成,不依赖作者自述)八问
独立验证证据
CI 状态与已做修复
收工判定代码面通过审核:方向正确、实现与批准设计一致、回归面钉住、测试有牙。合并前提:① 你对平行 PR 的拍板(推荐 A);② 新 head 重跑全绿。 feat 类 PR 无论结果如何都走人工合并(§7.4 auto-merge 排除 feat)。 |
(ai: vllm-qwen/qwen3.8-27b) 📌 CI 重跑更新(新 head
|
1 similar comment
(ai: vllm-qwen/qwen3.8-27b) 📌 CI 重跑更新(新 head
|
🔶 需要决策 Finding: this PR is fully superseded by master — the conflict is not mechanically resolvable into a meaningful mergeable result. I rebased Evidence:
Because resolving means choosing which of two incompatible designs wins for an already-shipped feature — and the natural outcome (close as redundant) is owner-only — I stopped rather than force a resolution. I pushed nothing; I aborted the rebase, so the branch is left clean at its original head ( Options:
Default if undecided: A. 结构化八问(中文)
建议:A(关闭为已取代)。 |
[ework] CI fix verified green ✓ |
1 similar comment
[ework] CI fix verified green ✓ |
🔶 需要决策 重复触发 · 本轮无新变化。 Same unresolved blocker re-fired. I re-verified live this run — nothing changed since my previous 需要决策 (floor 11):
There is still no mechanical fix: the conflict is two mutually-exclusive implementations of Options (full evidence in floor 11):
No code changed, nothing pushed this run. 结构化八问(中文 · 本轮)
建议:A(关闭为已取代),可同时止住重复触发循环。 |
[ework] CI fix verified green ✓ |
🔶 需要决策 第三次重复触发 · 状态仍未变。 Live re-check this run:
There is still no mechanical fix: the conflict is two mutually-exclusive implementations of Your call — A (close #5557 as superseded) — is the only action that clears the block and stops these repeated no-op triggers. 结构化八问(中文 · 本轮,均无变化)
建议:A(关闭为已取代)。 |
[ework] CI fix verified green ✓ |
1 similar comment
[ework] CI fix verified green ✓ |
🔶 需要决策 第四次重复触发 · 状态仍未变,且 PR 越来越旧。 Live re-check:
No mechanical fix exists (superseded by master — evidence + A/B/C in floor 11). Nothing changed, nothing pushed this run. The lane now re-fires on every poll as a no-op; only your call — A (close #5557 as superseded) — clears the block and stops the loop. Until then I will keep each pass to a verify-and-report tick. 结构化八问(中文 · 本轮,均无变化)
建议:A(关闭为已取代)。 |
🔶 需要决策 第五次触发 · 状态无变化。 head 仍 唯一解法仍是 owner 关闭(A)。此后每次触发我只发一行核验简报,不再重复分析。 八问(本轮无变化,详见 floor 11):1 被取代的 dirty PR 再触发;2 已被 master 取代待拍板;3 仅本 PR,空跑浪费调度;4 仅活体核验,未改未 push;5 不涉及;6 不涉及;7 不涉及,待 A/B/C;8 不涉及。建议 A。 |
🔶 需要决策 第六次触发 · 活体核验,状态无变化。 head 仍 唯一解法仍是 owner 关闭(A)。 八问:本轮 1–8 全部无变化/不涉及(详见 floor 11)。建议 A。 |
[ework] CI fix verified green ✓ |
2 similar comments
[ework] CI fix verified green ✓ |
[ework] CI fix verified green ✓ |
(ai: vllm-qwen/qwen3.8-27b)
Part of #5548(已批准的统一公告面设计,四期中的第一期;P2/P3/P4 各自后续 PR,本 PR 不关闭该 issue)。
是什么
面板上现有两条通知(pck-default-off #5079、wm-fastpath-intro #5469)各自手写五处:后端字段、i18n 中英文、HTML 模板函数、渲染绑定、页面 div。加一条通知要复制五份文件改动,文案与行为散在两层。本期把内置通知收敛成一张注册表 + 一套渲染循环,为「内置 / 本地 JSON / 远程 raw」三来源统一渲染器打地基。
修法
src/notices.ts:公告记录 schema(id/kind/tone/title/desc/hint/cta/dismiss/priority/publishedAt,多语言文案对象或纯字符串)、内置声明表BUILTIN_NOTICES(两条既有横幅原样迁入,active 谓词与显示条件逐字保留)、kind→priority 默认表(incident 90 > upgrade-advisory 80 > warning 70 > deprecation 60 > suggestion 50 > new-feature 40 > other 30)、tone 派生规则(可被记录显式覆盖)、dismiss 三模式(persistent / instance / always)、稳定排序(priority 降序 → publishedAt 降序)。src/server/admin.ts:overview payload 的pckNotice/wmNotice两个专用字段合并为统一的notices数组;新增GET /__bili/notices独立端点(同一构建器)。src/web/client.ts:删除两个手抄的模板函数与两段渲染绑定,换成单一renderAnnouncementBanners()——createElement 树 + textContent 注入(外部数据零 innerHTML),头部最多 5 条横幅,超出进页面底部「公告列表」卡片;always 模式不渲染关闭按钮;cta 按钮仅在 label+url 同时存在时渲染。src/pck-notice.ts瘦身:只保留 dismiss 存储读写(路径、文件格式、POST 端点语义全部不变)+pckNoticeActive()(acp-status 与启动日志仍在用);id 常量改从 notices.ts 再导出;允许名单从写死两 id 扩为注册表(P2 本地 JSON 的 id 届时经registerDynamicNoticeIds自动纳入)。notices.dismiss_btn/dismissed/list_title(zh/en)。行为变更披露(旧 → 新 + 原因)
/__bili/overviewpayload:移除pckNotice: {id, active}与wmNotice: {id, active}两个对象,新增notices: [记录…]数组。原因:统一公告面的核心结构变更;同仓客户端已同步更新。该 payload 是 bili 自家面板 API,无已知第三方消费者;若有外部脚本解析旧字段需适配新数组。GET /__bili/notices(纯增量)。pck-notice-dismiss/wm-notice-dismiss→ 统一notice-dismiss(grep 确认无 CSS/测试依赖旧名)。pckoff.*/wmfast.*共 20 个键,增notices.*3 个动作词键;横幅正文从目录迁至src/notices.ts记录内(中英逐字核对过原文)。八问
pckNoticeActive(),签名未动;⑤ 无 fail-fast 变吞错、无阈值/时序/输出格式漂移(横幅 DOM 结构与 class 保持)。BILI_ANNOUNCEMENTS_URL属 P3,届时按 env-var discipline 补 CONFIGURATION.md 中英)。验收证据(P1 退出标准)
BUILTIN_NOTICES追加一条记录即可(~10 行),其余文件零改动——本期两条记录本身就是示范。tests/notices-registry.test.ts(7 例:表完整性/谓词矩阵/dismiss 三模式/priority 表/tone 派生/排序稳定性/允许名单+可见集 wire 形状)、tests/web-notices-banner.test.ts(8 例:真实 WEB_CLIENT vm 驱动——基础渲染/always 无按钮/cta 双向/5+2 溢出/空列表/locale 回退/XSS 惰性文本/dismiss POST+重取);回归守护tests/issue5079-pck-default-off.test.ts(9 例)、tests/wm-fastpath-intro-notice.test.ts(4 例)、tests/web-i18n.test.ts(11 例)全绿。typecheck + build 通过;全量回归交 CI。