Skip to content
Open
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
3 changes: 2 additions & 1 deletion frontend/src/components/Chat/ChatInputArea.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,8 @@ describe("ChatInputArea", () => {
expect(screen.getByTestId("converted-indicator")).toBeInTheDocument();

// Edit the converted value
const convertedInput = screen.getByTestId("converted-value-input");
const convertedInput = screen.getByRole("textbox", { name: /converted prompt/i });
expect(convertedInput).toHaveValue("aGVsbG8=");
await user.clear(convertedInput);
await user.type(convertedInput, "new");
expect(onConvertedValueChange).toHaveBeenCalled();
Expand Down
8 changes: 6 additions & 2 deletions frontend/src/components/Chat/ChatInputArea.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState, useEffect, useLayoutEffect, useRef, forwardRef, useImperativeHandle, KeyboardEvent, Ref } from 'react'
import { useState, useEffect, useLayoutEffect, useRef, useId, forwardRef, useImperativeHandle, KeyboardEvent, Ref } from 'react'
import {
Button,
Caption1,
Expand Down Expand Up @@ -241,6 +241,7 @@ interface TextInputRowsProps {

function TextInputRows({ input, convertedValue, convertedFileChip, disabled, textareaRef, convertedRef, onInput, onKeyDown, onConvertedValueChange, onClearConvertedFileChip, styles, textInputClassName }: TextInputRowsProps) {
const hasConversion = Boolean(convertedValue) || Boolean(convertedFileChip)
const convertedTextareaId = useId()
return (
<>
<div className={styles.textRow}>
Expand All @@ -261,8 +262,11 @@ function TextInputRows({ input, convertedValue, convertedFileChip, disabled, tex
</div>
{convertedValue && (
<div className={styles.convertedRow} data-testid="converted-indicator">
<span className={styles.convertedBadge}>Converted</span>
<label htmlFor={convertedTextareaId} className={styles.convertedBadge}>
Converted prompt
</label>
<textarea
id={convertedTextareaId}
ref={convertedRef}
className={styles.convertedTextarea}
value={convertedValue}
Expand Down