Skip to content

Commit 6b2e772

Browse files
committed
Refactor the Home component UI to correctly wrap response history and add a separator, and ensure checkpoint updates are sent to the panel after accepting a response preview
1 parent 82e4ca6 commit 6b2e772

3 files changed

Lines changed: 25 additions & 13 deletions

File tree

‎packages/vscode/src/commands/apply-chat-response-command/apply-chat-response-command.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ export const apply_chat_response_command = (
251251
CHECKPOINTS_STATE_KEY,
252252
checkpoints
253253
)
254+
await panel_provider.send_checkpoints()
254255
}
255256
}
256257

‎packages/vscode/src/views/panel/frontend/Home/Home.module.scss‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,19 @@
7777
display: flex;
7878
flex-direction: column;
7979
width: 100%;
80-
gap: var(--padding-12px);
80+
81+
&__responses {
82+
margin: 0 -12px;
83+
}
8184

8285
&__mode {
8386
display: flex;
8487
gap: var(--padding-8px);
8588
width: 100%;
89+
position: relative;
90+
background-color: var(--vscode-sideBar-background);
91+
border-radius: var(--border-radius-10px);
92+
8693
> button {
8794
flex: 1;
8895
}

‎packages/vscode/src/views/panel/frontend/Home/Home.tsx‎

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,22 @@ export const Home: React.FC<Props> = (props) => {
5757
<div className={styles.content}>
5858
<div className={styles.inner}>
5959
{props.response_history.length > 0 && (
60-
<UiResponses
61-
response_history={props.response_history}
62-
on_response_history_item_click={
63-
props.on_response_history_item_click
64-
}
65-
selected_history_item_created_at={
66-
props.selected_history_item_created_at
67-
}
68-
on_selected_history_item_change={
69-
props.on_selected_history_item_change
70-
}
71-
/>
60+
<div className={styles.inner__responses}>
61+
<UiResponses
62+
response_history={props.response_history}
63+
on_response_history_item_click={
64+
props.on_response_history_item_click
65+
}
66+
selected_history_item_created_at={
67+
props.selected_history_item_created_at
68+
}
69+
on_selected_history_item_change={
70+
props.on_selected_history_item_change
71+
}
72+
/>{' '}
73+
</div>
7274
)}
75+
7376
<div className={styles.inner__mode}>
7477
<ModeButton
7578
pre="Initialize"
@@ -82,6 +85,7 @@ export const Home: React.FC<Props> = (props) => {
8285
on_click={props.on_api_calls_click}
8386
/>
8487
</div>
88+
<Separator height={12} />
8589
<div className={styles.inner__timeline}>
8690
<Timeline
8791
items={props.checkpoints.map((c) => ({

0 commit comments

Comments
 (0)