diff --git a/packages/app/src/pages/session/composer/session-question-dock.tsx b/packages/app/src/pages/session/composer/session-question-dock.tsx
index 35690030c9..2df439cf84 100644
--- a/packages/app/src/pages/session/composer/session-question-dock.tsx
+++ b/packages/app/src/pages/session/composer/session-question-dock.tsx
@@ -4,6 +4,7 @@ import { useMutation } from "@tanstack/solid-query"
import { Button } from "@opencode-ai/ui/button"
import { DockPrompt } from "@opencode-ai/ui/dock-prompt"
import { Icon } from "@opencode-ai/ui/icon"
+import { IconButton } from "@opencode-ai/ui/icon-button"
import { showToast } from "@opencode-ai/ui/toast"
import type { QuestionAnswer, QuestionRequest } from "@opencode-ai/sdk/v2"
import { useLanguage } from "@/context/language"
@@ -73,6 +74,7 @@ export const SessionQuestionDock: Component<{ request: QuestionRequest; onSubmit
customOn: cached?.customOn ?? ([] as boolean[]),
editing: false,
focus: 0,
+ collapsed: false,
})
let root: HTMLDivElement | undefined
@@ -87,6 +89,7 @@ export const SessionQuestionDock: Component<{ request: QuestionRequest; onSubmit
const on = createMemo(() => store.customOn[store.tab] === true)
const multi = createMemo(() => question()?.multiple === true)
const count = createMemo(() => options().length + 1)
+ const num = createMemo(() => store.answers[store.tab]?.length ?? 0)
const summary = createMemo(() => {
const n = Math.min(store.tab + 1, total())
@@ -98,6 +101,8 @@ export const SessionQuestionDock: Component<{ request: QuestionRequest; onSubmit
const last = createMemo(() => store.tab >= total() - 1)
+ const fold = () => setStore("collapsed", (value) => !value)
+
const customUpdate = (value: string, selected: boolean = on()) => {
const prev = input().trim()
const next = value.trim()
@@ -426,9 +431,21 @@ export const SessionQuestionDock: Component<{ request: QuestionRequest; onSubmit
ref={(el) => (root = el)}
onKeyDown={nav}
header={
- <>
+
{
+ if (event.key !== "Enter" && event.key !== " ") return
+ event.preventDefault()
+ fold()
+ }}
+ >
{summary()}
-
+
{(_, i) => (
- >
+
+ {
+ event.preventDefault()
+ event.stopPropagation()
+ }}
+ onClick={(event) => {
+ event.stopPropagation()
+ fold()
+ }}
+ aria-label={store.collapsed ? language.t("session.todo.expand") : language.t("session.todo.collapse")}
+ />
+
+
}
footer={
<>
@@ -469,99 +511,137 @@ export const SessionQuestionDock: Component<{ request: QuestionRequest; onSubmit
>
}
>
-
{question()?.question}
-
{language.t("ui.question.singleHint")} }>
- {language.t("ui.question.multiHint")}
+ {
+ if (!store.collapsed) return
+ if (event.key !== "Enter" && event.key !== " ") return
+ event.preventDefault()
+ fold()
+ }}
+ >
+ {question()?.question}
+
+ 0}>
+
+ {num()} answer{num() === 1 ? "" : "s"} selected
+
-
-
- {(opt, i) => (
-
+
+ {language.t("ui.question.singleHint")}
}>
+
{language.t("ui.question.multiHint")}
+
+
+
+ {(opt, i) => (
+
- setStore("focus", options().length)}
+ onClick={customOpen}
+ >
+ {
+ e.preventDefault()
+ e.stopPropagation()
+ customToggle()
+ }}
+ >
+
+ }>
+
+
+
+
+
+ {customLabel()}
+ {input() || customPlaceholder()}
+
+
+ }
+ >
+
-
+ commitCustom()
+ }}
+ onInput={(e) => {
+ customUpdate(e.currentTarget.value)
+ resizeInput(e.currentTarget)
+ }}
+ />
+
+
+
+
)
diff --git a/packages/ui/src/components/message-part.css b/packages/ui/src/components/message-part.css
index d9893503fb..a5f93bcb8c 100644
--- a/packages/ui/src/components/message-part.css
+++ b/packages/ui/src/components/message-part.css
@@ -832,7 +832,7 @@
[data-slot="question-body"] {
display: flex;
flex-direction: column;
- gap: 16px;
+ gap: 0;
flex: 1;
min-height: 0;
padding: 8px 8px 0;
@@ -912,7 +912,7 @@
font-weight: var(--font-weight-medium);
line-height: var(--line-height-large);
color: var(--text-strong);
- padding: 0 10px;
+ padding: 16px 10px 0;
}
[data-slot="question-hint"] {
@@ -1055,8 +1055,26 @@
line-height: var(--line-height-large);
color: var(--text-base);
min-width: 0;
- overflow-wrap: anywhere;
- white-space: normal;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+
+ [data-slot="question-option"][data-custom="true"] {
+ [data-slot="option-description"] {
+ overflow: visible;
+ text-overflow: clip;
+ white-space: normal;
+ overflow-wrap: anywhere;
+ }
+
+ &[data-picked="true"] {
+ [data-slot="question-custom-input"]:focus-visible {
+ outline: none;
+ outline-offset: 0;
+ border-radius: 0;
+ }
+ }
}
[data-slot="question-custom"] {