fix(web): address question draft review feedback

This commit is contained in:
Yichen Jiang
2026-08-26 14:53:37 +08:00
parent f95cbca9ce
commit 605e33a2f5
4 changed files with 9 additions and 3 deletions
+1 -1
View File
@@ -200,7 +200,7 @@ describe('web e2e: resident question composer round trip', () => {
// Session-scoped store to restore both option and free-text drafts.
const originalRow = page.locator('[role="treeitem"]')
.filter({ hasText: 'Use the ask_user_question tool' }).first()
await page.getByRole('button', { name: /^(?:New session|新.*会话)$/ }).last().click()
await page.getByRole('button', { name: 'New session', exact: true }).last().click()
await page.getByText('New Session', { exact: true }).waitFor({ timeout: 15_000 })
await expect.poll(() => composer.count(), { timeout: 10_000 }).toBe(0)
await originalRow.click()
@@ -168,7 +168,6 @@ function QuestionFlow({ pending, t, useStore, actions }: QuestionFlowProps) {
const cancelFlow = (): void => {
setBusy('cancel')
setError(null)
replaceProgress(index, drafts)
void pending.cancel()
.then(() => { actions.clear(pending.key) })
.catch((cause: unknown) => {
@@ -6,6 +6,7 @@ import { LocaleRuntime } from '@deepseek-ai/dsh-client-locale/client'
import type { SessionId } from '@deepseek-ai/dsh-session/types'
import { QuestionComposer } from '../src/client/QuestionComposer.tsx'
import { PendingQuestion } from '../src/client/contract/slots.ts'
import { createQuestionDraftStore } from '../src/client/draft-store.ts'
import { apply, inject } from '../src/client/index.ts'
const SESSION_ID = 'session-question' as SessionId
@@ -122,7 +123,10 @@ describe('apply', () => {
expect(entry.component).toBe(QuestionComposer)
expect(entry.inject).toBeUndefined()
expect(entry.locale).toBe('question')
expect(entry.store).toBeDefined()
const store = entry.store as ReturnType<typeof createQuestionDraftStore>
expect(store.create(SESSION_ID).getSnapshot()).toEqual({
progress: { index: 0, drafts: [] },
})
const pending = b.pending.getSnapshot()[0]!
const select = entry.select as (
owner: { pendingInteraction: PendingQuestion | undefined },
@@ -29,6 +29,9 @@
{
"path": "../locale"
},
{
"path": "../store"
},
{
"path": "../ui-conversation"
},