Skip to content

feat(user-guide): 随包使用教程与首次新手引导 - #252

Merged
freedomkk-qfeng merged 9 commits into
ECNU:mainfrom
wf0229:pr/user-guide-tour
Nov 16, 2026
Merged

freedomkk-qfeng merged 9 commits into
ECNU:mainfrom
wf0229:pr/user-guide-tour

Conversation

@wf0229

@wf0229 wf0229 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

feat(user-guide): 随包使用教程与首次新手引导

背景

#233 在「应用」菜单加了「使用教程」入口,但只在宿主提供 /eduwork-user-guide/ 路由时显示,公版目前没有提供这个路由的插件。本 PR 补上这个插件,并加入首次启动的新手引导。

改动

新增 dsh-plugins/user-guide(@eduwork/dsh-user-guide,条目 id eduwork-user-guide),加入 config/distributions/generic.json 与 config/assembly.eduwork.json,测试接入 validate-local-web。

  • 使用教程:在 /eduwork-user-guide/ 只读提供 guide/ 下的静态页(公版教程,内容取自 docs/USER_GUIDE.md,无截图)。页面不运行脚本、不加载网络资源;路径限定在 guide/ 内,拒绝 ..、隐藏文件与未知类型,带 nosniff 和 default-src 'none' CSP。在应用内面板打开,跟随应用深浅色。
  • 新手引导:首次进入工作台时播放一次,共 8 步:欢迎、新会话、工作区、输入框、权限与模型、技能与插件、文件栏、使用教程。触发条件是设置已加载、输入框已出现,并且没有其他模态窗口,因此会等 brand-settings-native 写入 ui-onboarding 的上游欢迎说明关闭后再开始。看完或跳过都会写入 volatile 的 tourSeen,在教程面板里可以重新播放。目标按无障碍标签和按钮文字查找,找不到目标时卡片居中显示,引导不会卡住。
  • 发行版可配置:productName(面板标题与文案中的 {product})、autoStart、steps(按顺序替换内置步骤;沿用内置 id 时只覆盖给出的字段,新步骤用 CSS selector 指定目标)。
  • 账户菜单:只有发行版提供 accountMenuEntries 服务时才注册入口,公版不依赖它。

测试

  • node --test dsh-plugins/user-guide/test/*.test.mjs:18 项通过,覆盖路径穿越、响应头、tour.json、卡片定位、步骤覆盖、首次播放的各项条件(未加载、已看过、关闭自动播放、无输入框、有模态窗口)、Esc 与卸载。

  • tests/eduwork-assembly-policy、distribution-config-patches、configuration-documentation、eduwork-source-audit、user-guide-menu 均通过。

  • audit-eduwork-distribution --edition generic --verify-receipt:errors: [];source-receipt.json 已刷新,createdAt 未变。

  • 在本分支装配的 macOS 测试包上走过一遍:新手引导在首次进入工作台时播放,各步挖亮位置正确;「应用 → 使用教程」能打开教程面板。

🤖 Generated with Claude Code

wf0229 and others added 7 commits October 27, 2026 22:56
新增 dsh-plugins/user-guide(@eduwork/dsh-user-guide),在 /eduwork-user-guide/ 提供离线教程,ECNU#233 的「应用 → 使用教程」菜单随之出现。首次进入工作台(输入框已出现、没有其他模态窗口)时播放一次 8 步引导,看完或跳过记入 volatile 的 tourSeen。产品名、是否自动播放与步骤可由发行版配置覆盖。账户菜单入口仅在发行版提供 accountMenuEntries 时注册。

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@freedomkk-qfeng
freedomkk-qfeng merged commit a4029b8 into ECNU:main Nov 16, 2026
9 checks passed
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.

2 participants