Skip to content

Commit 4a5ed49

Browse files
fix(web): preserve question option text and styling
1 parent c8ff613 commit 4a5ed49

3 files changed

Lines changed: 16 additions & 12 deletions

File tree

‎apps/web/src/components/chat/ComposerBanner.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ function Root({
163163
"[&>[data-composer-banner-row]:first-child>[data-slot=composer-banner-actions]>[data-slot=button]:last-child]:rounded-se-xl",
164164
"[&>[data-composer-banner-row]:first-child>[data-slot=composer-banner-actions]>:last-child>[data-slot=button]:last-of-type]:rounded-se-xl",
165165
"[&>:first-child>[data-composer-banner-row]:first-child>[data-slot=composer-banner-actions]>[data-slot=button]:last-child]:rounded-se-xl",
166+
"[&>:first-child>[data-composer-banner-row]:first-child>[data-slot=composer-banner-actions]>:last-child>[data-slot=button]:last-of-type]:rounded-se-xl",
166167
placement === "floating" && [
167168
"[&>[data-composer-banner-row]:only-child>[data-slot=composer-banner-actions]>[data-slot=button]:last-child]:rounded-ee-xl",
168169
"[&>[data-composer-banner-row]:only-child>[data-slot=composer-banner-actions]>:last-child>[data-slot=button]:last-of-type]:rounded-ee-xl",

‎apps/web/src/components/chat/ComposerPendingUserInputPanel.navigation.browser.test.tsx‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,15 +161,21 @@ it("still auto-advances once after the answer draft rerenders the same question"
161161
it.each([undefined, " done "])(
162162
"renders option Markdown and keeps the raw answer value (%s)",
163163
async (value) => {
164-
const option = { label: "**Done**", description: "Use `the browser`.", value };
164+
const option = {
165+
label: "**Return** Promise<void> from handler",
166+
description: "Use `the browser` with Array<string> input.",
167+
value,
168+
};
165169
await act(async () =>
166170
root.render(<Questions questions={[{ ...prompt.questions[0]!, options: [option] }]} />),
167171
);
168-
expect(container.innerText).toContain("Done");
169-
expect(container.innerText).toContain("Use the browser.");
172+
expect(container.innerText).toContain("Return Promise<void> from handler");
173+
expect(container.innerText).toContain("Use the browser with Array<string> input.");
170174
expect(container.innerText).not.toContain("**");
171175
expect(container.innerText).not.toContain("`");
172-
await act(async () => page.getByRole("button", { name: "Done", exact: true }).click());
176+
await act(async () =>
177+
page.getByRole("button", { name: "Return Promise<void> from handler", exact: true }).click(),
178+
);
173179
expect(JSON.parse(page.getByLabelText("Answers").element().textContent!)).toEqual({
174180
"question-0": { selectedOptionValues: [value ?? option.label], customAnswer: "" },
175181
});

‎apps/web/src/components/chat/ComposerPendingUserInputPanel.tsx‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -208,17 +208,12 @@ const ComposerPendingUserInputCard = memo(function ComposerPendingUserInputCard(
208208
{activeQuestion.header}
209209
</span>
210210
{isCollapsed ? (
211-
<span
212-
id={previewId}
213-
inert
214-
className="min-w-0 flex-1 text-secondary-label"
215-
data-pending-user-input-preview
216-
>
211+
<span id={previewId} inert className="min-w-0 flex-1" data-pending-user-input-preview>
217212
<ChatMarkdown
218213
text={activeQuestion.question}
219214
cwd={cwd}
220215
threadRef={threadRef}
221-
className="line-clamp-1 max-h-lh"
216+
className="line-clamp-1 max-h-lh text-xs/4 text-secondary-label"
222217
/>
223218
</span>
224219
) : null}
@@ -320,7 +315,8 @@ const ComposerPendingUserInputCard = memo(function ComposerPendingUserInputCard(
320315
text={option.label}
321316
cwd={cwd}
322317
threadRef={threadRef}
323-
className="text-sm font-medium"
318+
parseRawHtml={false}
319+
className="text-sm font-medium text-current"
324320
/>
325321
</div>
326322
{hasDescription ? (
@@ -329,6 +325,7 @@ const ComposerPendingUserInputCard = memo(function ComposerPendingUserInputCard(
329325
text={option.description}
330326
cwd={cwd}
331327
threadRef={threadRef}
328+
parseRawHtml={false}
332329
className="text-secondary-label text-2xs"
333330
/>
334331
</div>

0 commit comments

Comments
 (0)