+ {question.header} + {question.question} +
++ {t('chat.questionReview.answerLabel')} + {review.skipped || + !question.answer || + question.answer.length === 0 + ? t('chat.questionReview.skipped') + : question.answer.join('、')} +
+{t(`chat.images.contextNotice.${message.imageContextNotice}`)} diff --git a/src/renderer/src/i18n/locales/en-US/app.ts b/src/renderer/src/i18n/locales/en-US/app.ts index 8384a031..170db42e 100644 --- a/src/renderer/src/i18n/locales/en-US/app.ts +++ b/src/renderer/src/i18n/locales/en-US/app.ts @@ -403,6 +403,11 @@ export const app = { cancelled: 'Cancelled' } }, + questionReview: { + title: 'Questions and answers', + answerLabel: 'Your answer:', + skipped: 'Skipped' + }, approval: { waiting: 'Awaiting approval: {{tool}}', deny: 'Deny', diff --git a/src/renderer/src/i18n/locales/zh-CN/app.ts b/src/renderer/src/i18n/locales/zh-CN/app.ts index dce86666..98ef1cd1 100644 --- a/src/renderer/src/i18n/locales/zh-CN/app.ts +++ b/src/renderer/src/i18n/locales/zh-CN/app.ts @@ -384,6 +384,11 @@ export const app = { cancelled: '已取消' } }, + questionReview: { + title: '问题与回答', + answerLabel: '你的回答:', + skipped: '已跳过' + }, approval: { waiting: '等待审批:{{tool}}', deny: '拒绝', diff --git a/src/renderer/src/styles.css b/src/renderer/src/styles.css index 4e7c2326..0b205d16 100644 --- a/src/renderer/src/styles.css +++ b/src/renderer/src/styles.css @@ -6651,6 +6651,64 @@ button > svg { font-size: var(--font-caption); } +.agent-question-review { + min-width: 0; + overflow-wrap: anywhere; + white-space: pre-wrap; + display: flex; + padding: var(--space-4); + border: 1px solid var(--border-subtle); + border-radius: var(--radius-card); + margin-top: var(--space-3); + background: var(--surface-raised); + color: var(--text-primary); + flex-direction: column; + gap: var(--space-3); +} + +.agent-question-review > header { + display: flex; + align-items: center; + color: var(--text-muted); + gap: var(--space-2); +} + +.agent-question-review__item { + display: flex; + padding: var(--space-3); + border: 1px solid var(--border-subtle); + border-radius: var(--radius-control); + flex-direction: column; + gap: var(--space-1); +} + +.agent-question-review__question { + margin: 0; + color: var(--text-primary); + font-size: var(--font-body); + line-height: 1.5; +} + +.agent-question-review__question span { + display: block; + color: var(--text-muted); + font-size: var(--font-caption); + font-weight: 650; +} + +.agent-question-review__answer { + margin: 0; + color: var(--text-secondary); + font-size: var(--font-body); +} + +.agent-question-review__answer span { + margin-right: var(--space-1); + color: var(--text-muted); + font-size: var(--font-caption); + font-weight: 650; +} + .composer-wrap { width: 100%; max-width: 100%; diff --git a/src/shared/assistant-contracts.ts b/src/shared/assistant-contracts.ts index bfb8b425..79e21ec2 100644 --- a/src/shared/assistant-contracts.ts +++ b/src/shared/assistant-contracts.ts @@ -309,6 +309,38 @@ export type ConversationContextCompressionMarker = z.infer< typeof conversationContextCompressionMarkerSchema > +export const conversationAnsweredQuestionSchema = z + .object({ + questionId: z.string().min(1), + skipped: z.boolean().optional(), + questions: z + .array( + z + .object({ + header: z.string(), + question: z.string(), + options: z + .array( + z + .object({ + label: z.string(), + description: z.string() + }) + .strict() + ), + multiple: z.boolean(), + custom: z.boolean(), + answer: z.array(z.string()).optional() + }) + .strict() + ) + }) + .strict() + +export type ConversationAnsweredQuestion = z.infer< + typeof conversationAnsweredQuestionSchema +> + export const conversationMessageSchema = z .object({ id: assistantIdSchema, @@ -397,7 +429,8 @@ export const conversationMessageSchema = z attachments: z .array(conversationAttachmentSchema) .max(8) - .optional() + .optional(), + answeredQuestions: z.array(conversationAnsweredQuestionSchema).optional() }) .strict()