Close WeChat QR flow when binding is confirmed

This commit is contained in:
2026-09-20 10:36:29 +08:00
parent e04787763b
commit c953126284
5 changed files with 160 additions and 14 deletions

View File

@@ -0,0 +1,53 @@
# Task: Complete WeChat binding interaction after QR scan
## Identity
- Task ID: 20260920-wechat-qr-completion-29ea4d7c
- Mode: Feature
- Branch: codex/20260920-wechat-qr-completion-29ea4d7c-wechat-qr-completion
- Worktree: D:\Datas\OthersProjects\.codex-worktrees\makelore\20260920-wechat-qr-completion-29ea4d7c
- Base commit: e04787763b68574798c07ee2ff14f86607d4642a
- Owner: codex
- Status: Ready for Integration
## Scope
- Make WeChat QR binding complete visibly in ChannelAccounts: confirmed binding removes the QR/verification controls, refreshes the account, and guides the next step.
- Cover supported bind start, status polling, and verification responses with focused UI regressions and the existing Electron fixture.
## Intent And Constraints
- User reports the QR remains after successfully binding WeChat. Only a confirmed bind session should close it; an existing connected account must still be able to reconnect.
- Preserve Main-owned Host contracts, operation recovery, scan identity, route selection and explicit enabling. No automatic routing or enabling.
- Concurrent Task Gate and Planning Gate passed. Isolated from e047877 so the previous authorized sharing removal remains included; no merge, deployment, or cleanup in scope.
## Outcome
- Reproduced the exact symptom with a confirmed Host bind-status response: QR image remained visible. The existing handler stored confirmed state and stopped polling without closing the QR UI.
- Start, verification, and poll responses now share the confirmed transition: clear QR/session UI and verification input, stop polling, and show an account-scoped green connection confirmation.
- The confirmation guides unassigned accounts to select/save a target and enable the channel; routed paused accounts to enable; active accounts back to WeChat. These remain explicit user actions.
- Pending verification is described as submitted and awaiting confirmation. Reconnecting an already connected account keeps its new QR until that session confirms; account switching clears completion feedback.
- Confirmed polling refresh failures are caught and displayed instead of escaping as unhandled rejections.
- Updated README and existing Electron channel fixture; reviewed source diff and actual desktop screenshot. No debug instrumentation or temporary harness added.
## Verification
- Red reproduction: pnpm exec vitest run tests/unit/channel-accounts-page.test.tsx -t 'closes the QR' --maxWorkers=1 failed because the confirmed QR image remained. This small deterministic reproduction directly identified the missing terminal UI transition; multi-hypothesis instrumentation was unnecessary.
- Pinned pnpm 10.33.4 frozen dependency install: passed; lockfile unchanged.
- Focused unit suite (channel-accounts-page, cloud-channel-panel, cloud-channel-conversations): 24 tests passed. Includes poll/start/verification confirmation, pending verification, account switching, reconnect display, stopped polling, and no automatic routing/enabling.
- pnpm run typecheck and scoped ESLint (changed UI/unit/E2E files): passed.
- pnpm run build:vite: passed.
- Electron cloud-agent-channels.spec.ts: 1 passed. Verified QR and verification controls automatically disappear, target/enable guidance progresses, and existing channel routing/conversations/file saving remain functional.
- Visually inspected test-results/cloud-agent-channels-own-W-43513-ry-in-the-desktop-workspace/wechat-binding-completed.png.
- git diff --check and task-aware check_doc_drift.py: passed. Unit/Electron Host fixtures verify desktop state transitions; actual production WeChat login is not performed.
## Follow-ups
- Commit is based on previous sharing removal e047877. Neither change has been merged or deployed by this task. Shipping the updated client is required for the user to see this interaction.
## Promotion Candidates
- Targets: .project-docs/10-decisions/ADR-2026-09-11-personal-cloud-agents.md (User-Owned WeChat Accounts) and .project-docs/30-worklog/current-state.md.
- Proposal: confirmed binding closes transient QR/verification UI and shows account-scoped completion and next-step guidance; submitting verification alone does not indicate success.
- Evidence: direct failing reproduction, passing 24-test focused suite and Electron scenario, inspected screenshot.
- Future impact: preserve visible completion when extending binding/reconnect flows. No semantic conflict with accepted scan identity or route rules; human confirmation already supplied by this interaction request.