Skip to content

fix: refine autostart prompt modal#1668

Closed
wuyehan wants to merge 2 commits into
mainfrom
fix/autostart-prompt-buttons
Closed

fix: refine autostart prompt modal#1668
wuyehan wants to merge 2 commits into
mainfrom
fix/autostart-prompt-buttons

Conversation

@wuyehan
Copy link
Copy Markdown
Contributor

@wuyehan wuyehan commented Jun 6, 2026

按要求关闭这个 PR,改用新的干净分支重新提交,避免和昨天已合并的自启动弹窗层级/背景修复混在同一个 PR 里。

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 6, 2026

Too much diff to scan? Review this PR in Change Stack to start with the highest-impact changes.

Review Change Stack

产品更新步骤喵

自启动提示的界面与交互经历了一次大刀阔斧的改造呢~按钮从稳重的次级风格升级为精致的链接样式,文案也统一调整成更简洁的表述喵。同时决策弹窗配备了全新的生命周期事件系统,还能聪明地在展示时隐藏聊天窗口,关闭后自动恢复~完全是贴心的小姐姐的既视感呢喵!

变更详情喵

自启动提示与决策弹窗流程

图层 / 文件 内容
自启动提示按钮样式与多语言文案更新
static/app-autostart-prompt.js, static/locales/*
"永不再提示"按钮从 secondary 改为 link 样式;弹窗的标题、提示和备注文案在 8 种语言中全部更新,产品名统一为 N.E.K.O. 格式,移除了"仅对当前用户"的条件说明~更清爽了呢喵!
决策弹窗生命周期事件与 UI 隐藏机制
static/common_dialogs.js
新增 emitDecisionPromptLifecycleEvent() 在弹窗打开/关闭时派发 neko:decision-prompt-opened/closed 事件;当皮肤为 autostart-retention 时会临时隐藏 React 聊天覆盖层,关闭后通过闭包恢复 UI 状态与页面 class~机制超级精妙呢喵!
决策弹窗按钮 variant 与样式重构
static/common_dialogs.js
按钮 variant 映射逻辑补充 link 变体支持;重构 .modal-dialog-autostart-retention 的 footer、按钮尺寸、圆角、过渡效果与交互状态;调整 header padding 与移动端按钮布局~样式细节满满呢喵!
测试环境增强与用例扩展
tests/unit/test_common_dialogs.py
完善 FakeClassList 的 className 同步、补齐 CustomEvent 模拟与 document.getElementById;新增 5 个测试用例验证样式隔离、overlay 隐藏恢复、生命周期事件、link 按钮渲染与作用域合同~测试覆盖也很充分喵!

序列图喵

sequenceDiagram
  participant App as 应用
  participant CommonDialog as common_dialogs.js
  participant ReactChat as React Chat Overlay
  participant EventListener as 事件监听器
  App->>CommonDialog: showDecisionPrompt(skin: 'autostart-retention')
  CommonDialog->>ReactChat: 检查并临时隐藏 react-chat-window-overlay
  CommonDialog->>CommonDialog: 移除 react-chat-window-open class
  CommonDialog->>EventListener: 派发 neko:decision-prompt-opened 事件
  Note over EventListener: 决策提示展示中
  App->>CommonDialog: 用户点击按钮 → 关闭弹窗
  CommonDialog->>EventListener: 派发 neko:decision-prompt-closed 事件
  CommonDialog->>ReactChat: 恢复 hidden 状态与页面 class
  CommonDialog->>App: 返回用户选择结果
Loading

审查工作量预估喵

🎯 3 (中等复杂度) | ⏱️ ~25 分钟

代码变更涉及样式重构、事件系统逻辑与多语言同步,但改动模式相对清晰且有完整的测试覆盖呢~需要仔细审视决策弹窗的事件派发时机、UI 隐藏恢复的边界条件与样式作用域的隔离性呢喵!

可能相关的 PR 喵

  • Project-N-E-K-O/N.E.K.O#1656: 对同一块 static/common_dialogs.js 的 autostart-retention 决策弹窗做了完全相同的改动(移除 backdrop-filter、新增生命周期事件、隐藏 react-chat-window-overlay、补充 link variant 样式),代码级改动高度重合呢~
  • Project-N-E-K-O/N.E.K.O#1405: 同样在 static/app-autostart-prompt.js 里改动了"永不再提示"按钮,一个调整样式与文案(link variant、note 移除),另一个修改显示条件与决策逻辑呢喵~

💫 小小窗口焕新颜喵~
生命周期事件齐齐响喵~
聊天覆盖做隐藏喵~
link 按钮闪闪亮喵~
八国文案齐整整喵~✨

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed PR标题'fix: refine autostart prompt modal'准确概括了主要改动——优化自启动提示弹窗的样式、布局和文案,与changeset内容高度相关。
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

@wuyehan wuyehan closed this Jun 6, 2026
@wuyehan wuyehan reopened this Jun 6, 2026
@wuyehan wuyehan closed this Jun 6, 2026
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.

1 participant