refactor: desktop modal to toast#110
Merged
Merged
Conversation
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.
变更要点
当前加群引导弹窗(Modal)在功能上已经足够完善,视觉与文案清晰,能有效传递社群信息。但在桌面端实际使用中,每次打开页面都会强制弹出,且用户只能通过点击“关闭”或“确定”来消除,这带来了几个体验痛点:
我们的核心目标是 “提醒加群”,而非“强制关注”。因此,本次改动在不削弱提醒效果的前提下,将交互方式从“强制打断”调整为“尊重用户节奏”,尤其针对桌面端场景优化。
WelcomeModal → WelcomeNotice
将
WelcomeModal.vue重构为WelcomeNotice.vue,组件内部通过 UA 实时判断设备类型,自动渲染移动端全屏弹窗或桌面端右下角通知条。.vitepress/theme/components/WelcomeNotice.vue.vitepress/theme/components/HomeExitDetector.vue— 配合单组件接口简化.vitepress/theme/components/WelcomeModal.vue.github\workflows\ci.yml添加手动运行按钮行为变化
open()时实时检测,自动适配布局测试步骤
准备工作
每次测试前清理缓存:
然后回到首页,再点击任意非首页链接触发通知。
1. 桌面端
pnpm dev启动开发服务器/sessionStorage.clear()2. 移动端(切换标识符测试)
sessionStorage.clear()→ 离开首页3. 回归
pnpm build通过 https://github.com/igugyj/cuit-guide/actions/runs/29349448504UI变化
桌面端
折叠态
展开态
移动端
保持不变