fix(web): scope Composer drafts to Sessions - #480
Conversation
28bee59 to
180892f
Compare
tt-a1i
left a comment
There was a problem hiding this comment.
Reviewed at exact head 180892f.
Standards
[P1] Draft ownership prefers selectedPath whenever it is non-null, but setWorkspace() enables a workspace draft without clearing the previous Session path. Switching from Session A to a new draft in workspace B therefore keeps A’s scope and unsent text visible in B, where it can be submitted to the wrong repository. Draft mode must prefer new:${selectedWorkspace} or the store must atomically clear selectedPath; add an active-A → workspace-B regression.
Spec
[P1] Manual new-Session creation loses an unsent workspace draft. Transfer is allowed only when pendingSubmission exists; if the user types a workspace draft and clicks New Session before submitting, the path changes and the normal scope-change effect clears the draft. Add explicit transfer semantics and a manual-creation test.
[P2] A second Enter while admission is pending replaces pendingSubmission.current before the store rejects the duplicate. When the original send succeeds, its identity no longer matches and the already-sent text remains available for accidental resend. Guard the UI send path while pending or preserve the original pending identity, with a rapid double-Enter test.
Focused tests and bundle parity pass, but the requested real-browser delayed-network path is not covered.
180892f to
e6f6a55
Compare
|
Addressed the review findings in
Validation after rebasing onto
The full test command remains non-clean on this Windows runner because unrelated background-terminal process-control tests fail and do not exit cleanly; the preceding suite reported 1,359 passed and 9 skipped. |
tt-a1i
left a comment
There was a problem hiding this comment.
Reviewed 815f6ba after current-main integration. Standards: no remaining actionable blocker identified. Spec: Draft ownership now checks Session/workspace identity, manual creation preserves its draft, and pending submission identity prevents stale clearing. The old findings are fixed. No P0/P1 found. This supersedes findings against older implementations where stated; merge remains conditional on current required CI and branch protection.
# Conflicts: # web/dist/app.js
tt-a1i
left a comment
There was a problem hiding this comment.
最新 main 集成修复已完成,重新生成 Web 产物。双线复审保留既有侧栏焦点行为和本 PR 功能。 bun run check 已通过;完整测试已执行或正在串行验证,本机部分测试存在资源竞争超时,最终状态以最新 CI 为准。未发现 P0/P1。此账户推送了修复,仍需另一位维护者满足最后一次推送后的独立批准。
# Conflicts: # tests/web/app-render.spec.ts # web/dist/app.js # web/ui/src/features/composer/Composer.tsx
Problem
Web Composer drafts can cross Session/workspace boundaries, manual New Session creation can discard an unsent workspace draft, and rapid Enter presses can replace the identity of a pending prompt admission. These failures can show or resend text in the wrong context. Fixes #457.
Value
Drafts stay scoped to the selected workspace and Session, unsent text survives manual New Session creation, and a pending admission cannot be replaced by a duplicate UI send. Failed sends remain editable.
Approach
new:${selectedWorkspace}scope.Validation
bunx vitest run tests/web/app-render.spec.ts— 22 passed.bun run check— passed.bun run test:web:e2e— 11 passed, including real Chromium with a delayed/api/promptresponse and rapid double-Enter input.git diff --check— passed.bun run test— this Windows runner reported unrelated background-terminal process-control failures and did not exit cleanly; the preceding suite reported 1,359 passed and 9 skipped before that suite.Impact