fix(agents): answer AskUserQuestion in the conversation (#5034)

The open AskUserQuestion card was pinned above the composer: with several options it covered the conversation (max 50vh, its own scroll), and in a short conversation it floated away from its messages. The card now renders in the conversation at the asking entry and scrolls with it; picking an option on a single-select question moves on to the next one. Permission forms and questions that outlive their turn still wait above the composer at the composer's width.

Closes #5033

Co-authored-by: panda-student <71381346+panda-student@users.noreply.github.com>
This commit is contained in:
SunZhiQiang
2026-11-22 00:06:25 +08:00
committed by GitHub
parent 85edcf0660
commit 4c19b7d5b0
7 changed files with 86 additions and 44 deletions
+14 -16
View File
@@ -47,10 +47,6 @@
.fitWidth .composerArea {
max-width: none;
}
.fitWidth .questionCard {
width: calc(100% - var(--space-3) * 2);
max-width: none;
}
/* Under the composer: where the task works on the left; changes, meters and terminal on the right. */
.statusBar {
@@ -1559,18 +1555,11 @@
text-overflow: ellipsis;
}
/* An open AskUserQuestion: every question with its options, answered at once above the composer. */
/* An open AskUserQuestion: every question with its options, answered at once in the conversation. */
.questionCard {
flex: none;
display: flex;
flex-direction: column;
gap: var(--space-3);
max-height: 50vh;
overflow-y: auto;
/* The composer's width, so the card sits exactly over the box it belongs to. */
width: 100%;
max-width: var(--session-content-width);
margin: 0 auto 8px;
padding: 12px;
border: 1px solid var(--border-strong);
border-radius: var(--radius-control);
@@ -1578,6 +1567,19 @@
font-size: var(--agent-fs-ui, var(--fs-ui));
container: question-card / inline-size;
}
/* A question that outlived its turn waits above the composer, at the composer's width. */
.questionCardPinned {
flex: none;
max-height: 50vh;
overflow-y: auto;
width: 100%;
max-width: var(--session-content-width);
margin: 0 auto 8px;
}
.fitWidth .questionCardPinned {
width: calc(100% - var(--space-3) * 2);
max-width: none;
}
.questionTabCheck {
flex: none;
color: var(--accent);
@@ -1588,10 +1590,6 @@
grid-template-columns: minmax(0, 1fr);
min-width: 0;
}
.questionPanelsPaged {
min-height: 0;
overflow-y: auto;
}
.questionPanel {
grid-area: 1 / 1;
min-width: 0;