feat(onboarding): 强制走完新手引导,开发版本可跳过#245
Open
ocsin1 wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Hey - 我在这里给出了一些总体反馈:
- 在
OnboardingOverlay的onPopoverRender中,你给动态创建的按钮添加了点击监听器,但从未移除它;建议在合适的时机清理这个监听器(例如在销毁时,或者通过复用同一个按钮实例),以避免在弹出层重新渲染时产生潜在的内存泄漏或重复的事件处理。 - 在自动连接的 effect 中,你将
tourFinishedRef.current设为true,同时在该 effect 和onDestroyed中都调用了setOnboardingCompleted(true);建议将这一逻辑整合到单一的位置更新,这样可以让引导完成的副作用路径更加简单、易于理解。
给 AI 代理的提示
Please address the comments from this code review:
## Overall Comments
- In `OnboardingOverlay`'s `onPopoverRender`, you are attaching a click listener to a dynamically created button but never removing it; consider cleaning up the listener (e.g., on destroy or by reusing a single button instance) to avoid potential leaks or duplicate handlers if the popover is re-rendered.
- `tourFinishedRef.current` is set to `true` in the auto-connect effect and you also call `setOnboardingCompleted(true)` both there and in `onDestroyed`; consider consolidating this so onboarding completion is updated in a single place to keep the side-effect path simpler and easier to reason about.帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续的代码审查。
Original comment in English
Hey - I've left some high level feedback:
- In
OnboardingOverlay'sonPopoverRender, you are attaching a click listener to a dynamically created button but never removing it; consider cleaning up the listener (e.g., on destroy or by reusing a single button instance) to avoid potential leaks or duplicate handlers if the popover is re-rendered. tourFinishedRef.currentis set totruein the auto-connect effect and you also callsetOnboardingCompleted(true)both there and inonDestroyed; consider consolidating this so onboarding completion is updated in a single place to keep the side-effect path simpler and easier to reason about.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `OnboardingOverlay`'s `onPopoverRender`, you are attaching a click listener to a dynamically created button but never removing it; consider cleaning up the listener (e.g., on destroy or by reusing a single button instance) to avoid potential leaks or duplicate handlers if the popover is re-rendered.
- `tourFinishedRef.current` is set to `true` in the auto-connect effect and you also call `setOnboardingCompleted(true)` both there and in `onDestroyed`; consider consolidating this so onboarding completion is updated in a single place to keep the side-effect path simpler and easier to reason about.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
- 屏蔽 ESC、遮罩点击、× 按钮,引导必须走完最后一步才视为完成; 中途关闭软件不写入 completed,下次启动重新弹出 - 开发模式(import.meta.env.DEV 或 isDebugVersion)下在 popover 左侧注入「跳过(DEV)」按钮,非开发版完全不渲染 - 以及修复 WelcomeDialog 异步加载窗口期内教程抢先弹出后被公告盖住的 竞态(测 maaend 的 api 测出来的,加载超过 600 ms 容易触发):加载中渲染一个不可见的 z-50 占位,让 hasActiveModal 能 正确感知决策未完成
a1cce94 to
54fd39d
Compare
Contributor
There was a problem hiding this comment.
Hey - 我已经审查了你的更改,一切看起来都很棒!
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈持续改进评审质量。
Original comment in English
Hey - I've reviewed your changes and they look great!
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
正文:
屏蔽 ESC、遮罩点击、× 按钮,引导必须走完最后一步才视为完成; 中途关闭软件不写入 completed,下次启动重新弹出
开发模式(import.meta.env.DEV 或 isDebugVersion)下在 popover 左侧注入「跳过(DEV)」按钮,非开发版完全不渲染
以及修复 WelcomeDialog 异步加载窗口期内教程抢先弹出后被公告盖住的 竞态(测 maaend 的 api 测出来的,加载超过 600 ms 容易触发):加载中渲染一个不可见的 z-50 占位,让 hasActiveModal 能 正确感知决策未完成
效果演示 :
Demo.Video.mp4
Summary by Sourcery
在强制完成新手引导教程的同时,增加仅用于开发环境的跳过选项,并防止教程在欢迎对话框之前过早开始。
New Features:
driver.js气泡的类型定义,以支持自定义气泡渲染钩子和导航按钮。Bug Fixes:
Enhancements:
Original summary in English
Summary by Sourcery
Enforce completion of the onboarding tutorial while adding a development-only skip option and preventing the tutorial from racing ahead of the welcome dialog.
New Features:
Bug Fixes:
Enhancements:
Original summary in English
Summary by Sourcery
在强制完成新手引导教程的同时,增加仅用于开发环境的跳过选项,并防止教程在欢迎对话框之前过早开始。
New Features:
driver.js气泡的类型定义,以支持自定义气泡渲染钩子和导航按钮。Bug Fixes:
Enhancements:
Original summary in English
Summary by Sourcery
Enforce completion of the onboarding tutorial while adding a development-only skip option and preventing the tutorial from racing ahead of the welcome dialog.
New Features:
Bug Fixes:
Enhancements: