Skip to content

Commit ab4f21e

Browse files
committed
Refactor response history item display logic to correctly show instructions, status indicators, and manual entry labels
1 parent f8e215c commit ab4f21e

2 files changed

Lines changed: 31 additions & 4 deletions

File tree

‎packages/ui/src/components/editor/panel/Responses/Responses.module.scss‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,23 @@
4444
}
4545
}
4646

47-
&__instruction {
47+
&__instructions {
4848
text-align: left;
4949
font-size: var(--font-size-12px);
5050
white-space: nowrap;
5151
overflow: hidden;
5252
text-overflow: ellipsis;
53+
54+
&__new-indicator {
55+
transform: translateY(2px);
56+
margin-left: -2px;
57+
font-size: 12px !important;
58+
}
59+
60+
&__manual-entry {
61+
font-style: italic;
62+
padding-right: 1px;
63+
}
5364
}
5465

5566
&__right {

‎packages/ui/src/components/editor/panel/Responses/Responses.tsx‎

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,25 @@ export const Responses: React.FC<Props> = (props) => {
4848
props.on_selected_history_item_change(item.created_at)
4949
}}
5050
>
51-
<span className={styles['responses__item__instruction']}>
52-
{item.raw_instructions || 'Response without instructions'}
53-
</span>
51+
<div className={styles.responses__item__instructions}>
52+
{item.lines_added === undefined &&
53+
item.lines_removed === undefined && (
54+
<span
55+
className={`codicon codicon-circle-filled ${styles['responses__item__instructions__new-indicator']}`}
56+
/>
57+
)}
58+
{item.raw_instructions ? (
59+
<span>{item.raw_instructions}</span>
60+
) : (
61+
<span
62+
className={
63+
styles['responses__item__instructions__manual-entry']
64+
}
65+
>
66+
Added manually
67+
</span>
68+
)}
69+
</div>
5470
<div className={styles['responses__item__right']}>
5571
{item.lines_added !== undefined &&
5672
item.lines_removed !== undefined && (

0 commit comments

Comments
 (0)