fix: review-bot findings on the provider-hosted shell

- Keep ConversationSession mounted for blank sessions (chrome-less) so the
  draft-persistence mirror stays bound in the hero; hero typing reaches the
  chat store again.
- Restore the baselines-ready gate in AppFrame: empty boot snapshots no
  longer flash the New Workspace hero before either baseline lands.
- Commit ordinary sends through the machine (send-committed event +
  Shell.commitSend): undo can no longer resurrect already-sent content on
  the default-sink path.
- Give the production InputMachine a real wall clock so the typing-run
  merge window actually expires.
- Coalesce concurrent connectWorkspace creates per workspace: the summary
  has no cwd until the host frame lands, so a second New Session inside
  that window minted a duplicate hidden blank session.
This commit is contained in:
imccyu
2026-07-27 05:07:59 +08:00
parent 45ad06ece9
commit 10bb708eb7
9 changed files with 128 additions and 21 deletions

View File

@@ -162,12 +162,12 @@ describe('ConversationRoot resident composer', () => {
// Hero chrome present, view ring absent.
expect(b.view.getByText("Let's start building")).toBeTruthy()
expect(b.view.queryByTestId('view-chat')).toBeNull()
// The same machine-backed textarea is live in the hero. The chat-store
// mirror binds with ConversationSession (unmounted in hero), so the
// draft's truth here is the machine itself.
// The same machine-backed textarea is live in the hero, and the
// persistence mirror stays bound (ConversationSession mounts chrome-less
// for blank sessions): hero typing reaches the chat store.
const box = b.view.getByRole('textbox')
fireEvent.change(box, { target: { value: 'draft in hero' } })
expect((box as HTMLTextAreaElement).value).toBe('draft in hero')
expect(b.chat.store.getSnapshot().draft).toBe('draft in hero')
// Picker: open through the chip; a pick switches to the other
// workspace's blank session (draft carry is apply-layer wiring).
fireEvent.click(b.view.getByRole('button', { name: 'Choose workspace' }))