Files
fusion/packages/dashboard/app/components/ChatQuestionResponse.css
gsxdsm a4537167ab FN-6501: render chat question response controls
Render structured assistant question prompts directly in chat surfaces.

- Add parser and formatter support for question tool calls.
- Add reusable question response UI for select, multi-select, text, and confirm prompts.
- Wire regular chat and quick chat to show live and answered question states.
- Cover parsing and chat response behavior with dashboard tests and localized labels.

Files changed:
 .changeset/fn-6501-chat-question-response.md       |   5 +
 docs/dashboard-guide.md                            |   2 +
 .../app/components/ChatQuestionResponse.css        | 194 ++++++++++++++++
 .../app/components/ChatQuestionResponse.tsx        | 247 +++++++++++++++++++++
 packages/dashboard/app/components/ChatView.tsx     |  85 ++++++-
 packages/dashboard/app/components/QuickChatFAB.tsx |  84 ++++++-
 .../__tests__/ChatQuestionResponse.test.tsx        |  52 +++++
 .../app/components/__tests__/ChatView.test.tsx     |  51 +++++
 .../app/components/__tests__/QuickChatFAB.test.tsx |  64 ++++++
 .../utils/__tests__/parseQuestionToolCall.test.ts  |  82 +++++++
 .../dashboard/app/utils/parseQuestionToolCall.ts   | 240 ++++++++++++++++++++
 packages/i18n/locales/en/app.json                  |  10 +
 12 files changed, 1105 insertions(+), 11 deletions(-)

Fusion-Task-Id: FN-6501
Fusion-Task-Lineage: 1fd4a3aa-b2d7-4157-a196-852fdeda680d
2026-06-16 20:13:13 -07:00

195 lines
4.2 KiB
CSS

.chat-question-response {
display: flex;
flex-direction: column;
gap: var(--space-md);
margin-block: var(--space-sm);
padding: var(--space-md);
border: thin solid color-mix(in srgb, var(--accent) 28%, var(--border));
border-radius: var(--radius-lg);
background: color-mix(in srgb, var(--accent) 6%, var(--bg-secondary));
color: var(--text);
}
.chat-question-response--compact {
gap: var(--space-sm);
padding: var(--space-sm);
border-radius: var(--radius-md);
}
.chat-question-response__header,
.chat-question-response__actions {
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-sm);
}
.chat-question-response__eyebrow,
.chat-question-response__answered-label,
.chat-question-response__submitted-label {
font-size: 0.75rem;
font-weight: 600;
letter-spacing: 0.08em;
text-transform: uppercase;
color: var(--text-muted);
}
.chat-question-response__answered-label {
color: var(--color-success);
}
.chat-question-response__questions {
display: flex;
flex-direction: column;
gap: var(--space-md);
}
.chat-question-response__question {
display: flex;
flex-direction: column;
gap: var(--space-xs);
}
.chat-question-response__question-header {
margin: 0;
font-size: 0.875rem;
font-weight: 600;
color: var(--text-muted);
}
.chat-question-response__question-text {
margin: 0;
font-size: 1rem;
line-height: 1.3;
color: var(--text);
}
.chat-question-response--compact .chat-question-response__question-text {
font-size: 0.875rem;
}
.chat-question-response__description,
.chat-question-response__hint {
margin: 0;
font-size: 0.875rem;
line-height: 1.45;
color: var(--text-muted);
}
.chat-question-response__options,
.chat-question-response__confirm-group {
display: flex;
flex-direction: column;
gap: var(--space-xs);
margin-block-start: var(--space-xs);
}
.chat-question-response__confirm-group {
flex-direction: row;
flex-wrap: wrap;
}
.chat-question-response__option {
display: flex;
align-items: flex-start;
gap: var(--space-sm);
padding: var(--space-sm);
border: thin solid var(--border);
border-radius: var(--radius-md);
background: var(--card);
cursor: pointer;
transition: border-color var(--transition-fast), background-color var(--transition-fast), color var(--transition-fast);
}
.chat-question-response__option:hover,
.chat-question-response__option--selected,
.chat-question-response__confirm--selected {
border-color: var(--accent);
background: color-mix(in srgb, var(--accent) 12%, var(--card));
}
.chat-question-response__option input {
margin: calc(var(--space-xs) / 2) 0 0;
accent-color: var(--accent);
}
.chat-question-response__option-content {
display: flex;
flex-direction: column;
gap: calc(var(--space-xs) / 2);
min-width: 0;
}
.chat-question-response__option-label {
font-size: 0.875rem;
font-weight: 600;
color: var(--text);
}
.chat-question-response__option-description {
font-size: 0.875rem;
line-height: 1.45;
color: var(--text-muted);
}
.chat-question-response__textarea {
width: 100%;
min-height: calc(var(--space-xl) * 3);
margin-block-start: var(--space-xs);
resize: vertical;
line-height: 1.45;
}
.chat-question-response__submit {
flex: 0 0 auto;
}
.chat-question-response__submitted {
display: flex;
flex-direction: column;
gap: var(--space-xs);
padding: var(--space-sm);
border: thin solid var(--border);
border-radius: var(--radius-md);
background: var(--card);
}
.chat-question-response__submitted pre {
margin: 0;
white-space: pre-wrap;
font-family: var(--font-mono);
font-size: 0.875rem;
line-height: 1.45;
color: var(--text);
}
.chat-question-response--compact .chat-question-response__actions {
align-items: stretch;
flex-direction: column;
}
.chat-question-response--compact .chat-question-response__submit {
width: 100%;
}
@media (max-width: 768px) {
.chat-question-response {
padding: var(--space-sm);
border-radius: var(--radius-md);
}
.chat-question-response__header,
.chat-question-response__actions {
align-items: stretch;
flex-direction: column;
}
.chat-question-response__confirm-group {
flex-direction: column;
}
.chat-question-response__submit {
width: 100%;
}
}