Skip to content

fix(web): scope Composer drafts to Sessions - #480

Open
627150795 wants to merge 1 commit into
openpi-dev:mainfrom
627150795:codex/issue-457-composer-drafts
Open

fix(web): scope Composer drafts to Sessions#480
627150795 wants to merge 1 commit into
openpi-dev:mainfrom
627150795:codex/issue-457-composer-drafts

Conversation

@627150795

Copy link
Copy Markdown
Contributor

Problem

Web Composer drafts are local to the component instead of the selected Session. Switching Sessions can show the previous Session's draft, and a late successful send receipt clears newer text typed after the send. Fixes #457.

Value

Users no longer lose new input when a send settles late, and drafts from one Session cannot appear in another Session. Failed sends remain editable.

Approach

  • Pass the store's selected Session path into Composer as the draft scope.
  • Clear drafts when the Session or new-workspace scope changes.
  • Track draft revisions so a send only clears the exact unchanged draft it submitted.
  • Transfer a pending new-workspace draft to the created Session until its first send is accepted.
  • Add focused regressions for delayed and retyped sends, failed sends, Session changes, late receipts, and new-Session creation.

Validation

  • bunx vitest run tests/web/app-render.spec.ts — 17 passed.
  • bun run check — passed.
  • git diff --check — passed.
  • bun run test — run; two unrelated existing/environment-sensitive failures remain: the Windows Git process test reports -1 instead of 7, and the detached launch-card repaint test fails. The focused Web Composer suite passes.

Impact

  • User-visible behavior: drafts are Session-scoped and newer edits are preserved.
  • Model-visible context/tools: None.
  • Runtime/lifecycle: None.
  • Persisted config/data: None; drafts remain in memory and are not written to localStorage.
  • Compatibility/risk: limited to the Web Composer's local draft lifecycle.

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.

[Web UX][P2] 输入草稿缺少会话归属,迟到发送回执会清空新输入

1 participant