feat(web): wire startup Workspace selection and sync docs

- Mount WorkspacesService.startInitialSelection in the runtime apply (the
  one-shot baseline follower shipped in 98633b5aa without a caller): a
  restored current session wins, an explicit clear stays cleared, a failed
  connect retries on the next baseline projection.
- Cover the policy in client-apply and the assembled workspace-flow
  snapshot; startup now lands in the recent Workspace's blank session, so
  the draft-carry scenario starts from the hero directly.
- Bring docs along: startup-selection paragraphs in the session-scope RFC
  note (both languages), bilingual README pairs for the four new client
  packages, doc-graph regeneration with client-declared events exempt from
  the dispatcher requirement (client dispatch sites are structurally
  invisible to the host-side ts.Program), and pairing re-records.
This commit is contained in:
imccyu
2026-07-27 06:24:09 +08:00
parent 22e4c05e69
commit cbe8735d7c
28 changed files with 372 additions and 96 deletions

View File

@@ -174,6 +174,26 @@ it('locks the composer in the New Session view state until a Workspace is chosen
`)
})
it('selects the recent Workspace and opens its blank Session on first load', async () => {
boot('?fixture')
const composer = await findHeroComposer()
const tree = screen.getByRole('tree', { name: 'Sessions' })
await waitFor(() => { expect(within(tree).getByText('4 sessions')).toBeDefined() }, { timeout: 10_000 })
expect({
chip: visibleText(workspaceChip()),
composerDisabled: composer.disabled,
blankRow: within(tree).getByText('New Session').textContent,
}).toMatchInlineSnapshot(`
{
"blankRow": "New Session",
"chip": "fixture",
"composerDisabled": false,
}
`)
})
it('creating a Workspace materializes and lists its selected blank Session', async () => {
boot('?fixture=empty')
@@ -297,8 +317,6 @@ it('a rejected first prompt keeps the session blank and the draft in the machine
it('switching Workspace before the first message carries the draft to the new blank session', async () => {
boot('?fixture')
await findLockedComposer()
await pickWorkspace('fixture')
const composer = await findHeroComposer()
setComposerText(composer, 'carry me')