+ {/* Header — also the floating window's drag handle. The control cluster
+ opts out of pointerdown so pressing a button never starts a drag. */}
@@ -469,73 +582,103 @@ export function AskQuestionCard({
{title ?? t("title")}
- {resolvedSubtitle && (
+ {resolvedSubtitle && !collapsed && (
{resolvedSubtitle}
)}
{isMulti && (
-
+
{`${answeredCount}/${questions.length}`}
)}
+ {!readOnly && (
+ e.stopPropagation()}
+ >
+
+
+
+ )}
- {isMulti ? (
-
-
- {questions.map((q, i) => {
- const done = isAnswered(state[q.id])
- return (
-
- {done ? (
-
- ) : (
-
- {i + 1}
-
- )}
- {q.header}
-
- )
- })}
-
- {questions.map((q) => (
-
- {questionHeading(q)}
- {renderOptions(q)}
-
- ))}
-
- ) : (
-
- {questions.map((q) => (
-
- {questionHeading(q)}
- {renderOptions(q)}
-
- ))}
-
- )}
+ {!collapsed &&
+ (isMulti ? (
+
+
+ {questions.map((q, i) => {
+ const done = isAnswered(state[q.id])
+ return (
+
+ {done ? (
+
+ ) : (
+
+ {i + 1}
+
+ )}
+ {q.header}
+
+ )
+ })}
+
+ {questions.map((q) => (
+
+ {questionHeading(q)}
+ {renderOptions(q)}
+
+ ))}
+
+ ) : (
+
+ {questions.map((q) => (
+
+ {questionHeading(q)}
+ {renderOptions(q)}
+
+ ))}
+
+ ))}
- {/* Footer — dropped in the read-only/answered view */}
- {!readOnly && (
+ {/* Footer — dropped in the read-only/answered view and while collapsed */}
+ {!readOnly && !collapsed && (
)
+
+ // Floating mode escapes any transformed ancestor via the body portal — a
+ // fixed child of a transformed container would position against that
+ // ancestor instead of the viewport.
+ if (floating && typeof document !== "undefined") {
+ return createPortal(card, document.body)
+ }
+ return card
}
diff --git a/src/i18n/messages/ar.json b/src/i18n/messages/ar.json
index e30777fc22..2727c26d59 100644
--- a/src/i18n/messages/ar.json
+++ b/src/i18n/messages/ar.json
@@ -3451,7 +3451,11 @@
"skip": "تخطّي",
"next": "التالي",
"submit": "إرسال",
- "submitError": "تعذّر الإرسال. حاول مرة أخرى."
+ "submitError": "تعذّر الإرسال. حاول مرة أخرى.",
+ "collapse": "طيّ",
+ "expand": "توسيع",
+ "float": "نافذة عائمة",
+ "dock": "العودة إلى اللوحة"
},
"planApproval": {
"title": "لدى الوكيل خطة — راجعها",
diff --git a/src/i18n/messages/de.json b/src/i18n/messages/de.json
index 0c0178e4a8..bc814285f8 100644
--- a/src/i18n/messages/de.json
+++ b/src/i18n/messages/de.json
@@ -3451,7 +3451,11 @@
"skip": "Überspringen",
"next": "Weiter",
"submit": "Senden",
- "submitError": "Senden fehlgeschlagen. Bitte versuche es erneut."
+ "submitError": "Senden fehlgeschlagen. Bitte versuche es erneut.",
+ "collapse": "Einklappen",
+ "expand": "Ausklappen",
+ "float": "Abtrennen",
+ "dock": "Andocken"
},
"planApproval": {
"title": "Der Agent hat einen Plan – bitte prüfen",
diff --git a/src/i18n/messages/en.json b/src/i18n/messages/en.json
index 1afa5ba65d..7558f8f6a6 100644
--- a/src/i18n/messages/en.json
+++ b/src/i18n/messages/en.json
@@ -3451,7 +3451,11 @@
"skip": "Skip",
"next": "Next",
"submit": "Submit",
- "submitError": "Couldn't submit. Please try again."
+ "submitError": "Couldn't submit. Please try again.",
+ "collapse": "Collapse",
+ "expand": "Expand",
+ "float": "Pop out",
+ "dock": "Back to panel"
},
"planApproval": {
"title": "The agent has a plan — review it",
diff --git a/src/i18n/messages/es.json b/src/i18n/messages/es.json
index 17faed1050..f07de31c08 100644
--- a/src/i18n/messages/es.json
+++ b/src/i18n/messages/es.json
@@ -3451,7 +3451,11 @@
"skip": "Omitir",
"next": "Siguiente",
"submit": "Enviar",
- "submitError": "No se pudo enviar. Inténtalo de nuevo."
+ "submitError": "No se pudo enviar. Inténtalo de nuevo.",
+ "collapse": "Plegar",
+ "expand": "Desplegar",
+ "float": "Ventana flotante",
+ "dock": "Volver al panel"
},
"planApproval": {
"title": "El agente tiene un plan: revísalo",
diff --git a/src/i18n/messages/fr.json b/src/i18n/messages/fr.json
index fd18122dec..f2d275349a 100644
--- a/src/i18n/messages/fr.json
+++ b/src/i18n/messages/fr.json
@@ -3451,7 +3451,11 @@
"skip": "Ignorer",
"next": "Suivant",
"submit": "Envoyer",
- "submitError": "Échec de l'envoi. Veuillez réessayer."
+ "submitError": "Échec de l'envoi. Veuillez réessayer.",
+ "collapse": "Replier",
+ "expand": "Déplier",
+ "float": "Détacher",
+ "dock": "Réintégrer le panneau"
},
"planApproval": {
"title": "L'agent a un plan — à vérifier",
diff --git a/src/i18n/messages/ja.json b/src/i18n/messages/ja.json
index 6d2222b05e..77537c29c5 100644
--- a/src/i18n/messages/ja.json
+++ b/src/i18n/messages/ja.json
@@ -3451,7 +3451,11 @@
"skip": "スキップ",
"next": "次へ",
"submit": "送信",
- "submitError": "送信できませんでした。もう一度お試しください。"
+ "submitError": "送信できませんでした。もう一度お試しください。",
+ "collapse": "折りたたむ",
+ "expand": "展開",
+ "float": "ポップアウト",
+ "dock": "パネルに戻す"
},
"planApproval": {
"title": "エージェントが計画を提示しました — 確認してください",
diff --git a/src/i18n/messages/ko.json b/src/i18n/messages/ko.json
index 847a5a904e..a466d798fd 100644
--- a/src/i18n/messages/ko.json
+++ b/src/i18n/messages/ko.json
@@ -3451,7 +3451,11 @@
"skip": "건너뛰기",
"next": "다음",
"submit": "제출",
- "submitError": "제출하지 못했습니다. 다시 시도해 주세요."
+ "submitError": "제출하지 못했습니다. 다시 시도해 주세요.",
+ "collapse": "접기",
+ "expand": "펼치기",
+ "float": "분리 창",
+ "dock": "패널로 돌아가기"
},
"planApproval": {
"title": "에이전트가 계획을 제시했습니다 — 검토하세요",
diff --git a/src/i18n/messages/pt.json b/src/i18n/messages/pt.json
index ab8205a606..a0c3f9fece 100644
--- a/src/i18n/messages/pt.json
+++ b/src/i18n/messages/pt.json
@@ -3451,7 +3451,11 @@
"skip": "Pular",
"next": "Próxima",
"submit": "Enviar",
- "submitError": "Falha ao enviar. Tente novamente."
+ "submitError": "Falha ao enviar. Tente novamente.",
+ "collapse": "Recolher",
+ "expand": "Expandir",
+ "float": "Destacar",
+ "dock": "Voltar ao painel"
},
"planApproval": {
"title": "O agente tem um plano — revise",
diff --git a/src/i18n/messages/zh-CN.json b/src/i18n/messages/zh-CN.json
index 402b191571..10ccf4800b 100644
--- a/src/i18n/messages/zh-CN.json
+++ b/src/i18n/messages/zh-CN.json
@@ -3451,7 +3451,11 @@
"skip": "跳过",
"next": "下一题",
"submit": "提交",
- "submitError": "提交失败,请重试。"
+ "submitError": "提交失败,请重试。",
+ "collapse": "折叠",
+ "expand": "展开",
+ "float": "浮窗",
+ "dock": "停回面板"
},
"planApproval": {
"title": "智能体已给出计划——请审阅",
diff --git a/src/i18n/messages/zh-TW.json b/src/i18n/messages/zh-TW.json
index a097a4ffe4..3677146e06 100644
--- a/src/i18n/messages/zh-TW.json
+++ b/src/i18n/messages/zh-TW.json
@@ -3451,7 +3451,11 @@
"skip": "略過",
"next": "下一題",
"submit": "提交",
- "submitError": "提交失敗,請重試。"
+ "submitError": "提交失敗,請重試。",
+ "collapse": "摺疊",
+ "expand": "展開",
+ "float": "浮動視窗",
+ "dock": "停靠回面板"
},
"planApproval": {
"title": "智慧代理已提出計畫——請審閱",