sprint 卡 · 记下需求
docs/sprints/password_visibility.md
sprint 就绪
Task 已开
检查通过
结果完成
你: 加一个「显示密码」按钮。登录 API 和键盘行为都别变,把相关测试补上。
agent: 我会用一个绑定 sprint 的 Task 把这件事做完,验证过再在本地落地。
docs/sprints/password_visibility.md
# Password Visibility [plan-ref: login/password-visibility/root]
- [ ] Add the accessible control and focused tests. [ref: login/password-visibility/implement]
agent: sprint 条目写好了。我开它的 Task,进到隔离的工作区。
$ ait task start --from docs/sprints/password_visibility.md#login/password-visibility/implement --intent "Add accessible password visibility control"
task: RWT-0042
change: RWT-0042/C-01
next: cd .ait-worktree-links/rwt-0042
$ cd .ait-worktree-links/rwt-0042
working tree: RWT-0042/C-01
agent: 我只在 Task 工作区里动登录表单和它对应的测试。
src/LoginForm.tsx
+ <button type="button" aria-pressed={visible}>
+ {visible ? "Hide password" : "Show password"}
+ </button>
tests/LoginForm.test.tsx
+ toggles password visibility with keyboard and pointer input
$ npm test -- LoginForm
3 tests passed
agent: 针对性的检查过了。落地之前,我先把这个确切修订记下来。
$ ait snapshot create --message "Add accessible password visibility control"
Snapshot: SNP-7E21A4C8
agent: 验证过的 Snapshot 好了。我把 Task 落到本地的目标 Line 上。
$ ait task land RWT-0042/C-01 --local
Status: landed
Target: main (local)
Task: completed
Sprint item: completed
Worktree: cleaned
agent: 好了。密码开关和对应测试已经在本地落地,Task 和那条 sprint 条目都结掉了。
结果: 改动完成 → Task 关闭 → sprint 条目关闭 → 工作区清掉
你: 上次改登录表单之后,密码显隐用键盘就按不动了。确认一下是回归,修掉它,别动登录提交。
agent: 我先复现你说的现象,追出是哪个 Snapshot 造成的,再决定怎么修。
$ npm test -- LoginForm
1 failed: activates password visibility with Space
agent: 针对性的测试确实挂在键盘这条路径上。我这就去看改动的那一行。
$ ait blame src/LoginForm.tsx --line 84
resolved snapshot: SNP-5C91D2B4
path: src/LoginForm.tsx
84 SNP-5C91D2B4 · Refactor login form actions
agent: 回归确认在 SNP-5C91D2B4。我把这次修复和它的回归测试绑到一条确切的 sprint 条目上。
docs/sprints/password_keyboard_regression.md
# Password Keyboard Regression [plan-ref: login/password-keyboard-regression/root]
- [ ] Restore native keyboard activation and lock it with a regression test. [ref: login/password-keyboard-regression/repair]
$ ait task start --from docs/sprints/password_keyboard_regression.md#login/password-keyboard-regression/repair --intent "Restore password-control keyboard activation"
task: RWT-0043
change: RWT-0043/C-01
next: cd .ait-worktree-links/rwt-0043
$ cd .ait-worktree-links/rwt-0043
working tree: RWT-0043/C-01
agent: 我把原生 button 语义改回来,那个挂掉的键盘用例就留着当回归测试。
src/LoginForm.tsx
- <span role="button" onClick={toggleVisibility}>
+ <button type="button" onClick={toggleVisibility}>
tests/LoginForm.test.tsx
+ activates password visibility with Space
$ npm test -- LoginForm
4 tests passed
agent: 原本挂掉的现在过了,登录行为也没动。我把修好的修订记下来。
$ ait snapshot create --message "Restore password-control keyboard activation"
Snapshot: SNP-9B42C1E6
agent: 这次回归修复验证过了。我把 Task 落到本地的目标 Line 上。
$ ait task land RWT-0043/C-01 --local
Status: landed
Target: main (local)
Task: completed
Sprint item: completed
Worktree: cleaned
agent: 确认了,也修好了。键盘触发有回归测试盖着,修复已经在本地落地。
结果: 回归修复完成 → Task 关闭 → sprint 条目关闭 → 工作区清掉