Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ export const SessionQuestionDock: Component<{ request: QuestionRequest; onSubmit
}

const focus = (i: number) => {
// Text-card: the textarea is the only focusable element; focusCustom
// handles it via the ref callback — skip option routing entirely.
if (text()) return
const next = clamp(i)
setStore("focus", next)
if (store.editing) return
Expand Down Expand Up @@ -431,6 +434,10 @@ export const SessionQuestionDock: Component<{ request: QuestionRequest; onSubmit
setTimeout(() => {
el.focus()
resizeInput(el)
// Sync the container measurement after the textarea has its final height
if (optionsRef) {
setStore("optionsHeight", (h) => Math.max(h, optionsRef!.scrollHeight))
}
}, 0)
}

Expand Down
30 changes: 30 additions & 0 deletions packages/session-ui/src/components/message-part.css
Original file line number Diff line number Diff line change
Expand Up @@ -1141,6 +1141,26 @@
}
}

/* Text-card (kind: "text") — the textarea is the ONLY affordance, so it
needs visible chrome (border + background) unlike the choice-card's
secondary custom-input which is borderless/transparent. */
[data-slot="question-text-form"] {
padding: 4px 8px;
}

[data-slot="question-text-form"] > [data-slot="question-custom-input"] {
border: 1px solid var(--v2-border-border-base);
border-radius: var(--radius-md);
padding: 8px 12px;
background: var(--v2-background-bg-layer-02);
min-height: 36px;

&:focus-visible {
border-color: var(--v2-border-border-focus);
outline: none;
}
}

[data-slot="question-footer"] {
display: flex;
align-items: center;
Expand Down Expand Up @@ -1589,6 +1609,16 @@ body:not([data-new-layout]) {
outline: 1px solid var(--border-interactive-base);
}
}

[data-slot="question-text-form"] > [data-slot="question-custom-input"] {
border-color: var(--border-weak-base);
background: var(--surface-weak);

&:focus-visible {
border-color: var(--border-interactive-base);
outline: none;
}
}
}

[data-component="question-answers"] {
Expand Down
Loading