Skip to content

Commit 90a832b

Browse files
committed
Enhance file path extraction robustness in the clipboard parser and ensure the response preview defaults to selecting the first file
1 parent 10f2462 commit 90a832b

6 files changed

Lines changed: 9 additions & 12 deletions

File tree

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,6 @@
7676

7777
&--selected {
7878
background-color: var(--vscode-list-inactiveSelectionBackground);
79-
80-
&:hover {
81-
background-color: var(--vscode-list-inactiveSelectionBackground);
82-
}
8379
}
8480

8581
&__left {

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ type Props = {
2525
}
2626

2727
export const ResponsePreview: FC<Props> = (props) => {
28-
const [last_clicked_file_index, set_last_clicked_file_index] = useState(0)
28+
const [last_clicked_file_index, set_last_clicked_file_index] = useState(
29+
props.items.findIndex((i) => i.type == 'file')
30+
)
2931
const [expanded_text_items, set_expanded_text_items] = useState<Set<number>>(
3032
new Set()
3133
)

‎packages/vscode/src/commands/apply-chat-response-command/utils/clipboard-parser/parsers/multiple-files-parser.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,10 @@ export const parse_multiple_files = (params: {
180180
if (match && match[1]) {
181181
const potential_path = match[1]
182182
if (
183-
potential_path.includes('/') ||
184-
potential_path.includes('\\') ||
185-
potential_path.includes('.')
183+
(potential_path.includes('/') ||
184+
potential_path.includes('\\') ||
185+
potential_path.includes('.')) &&
186+
!potential_path.includes(' ')
186187
) {
187188
extracted_filename = potential_path
188189
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Bottom.
1+
Bottom `test test`.

‎packages/vscode/src/commands/apply-chat-response-command/utils/clipboard-parser/test-cases/text-between/text-between.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ console.log('some inline code');
1515
console.log('ipsum');
1616
```
1717

18-
Bottom.
18+
Bottom `test test`.

‎packages/vscode/src/views/panel/frontend/Main/MainView/MainView.tsx‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,6 @@ export const MainView: React.FC<Props> = (props) => {
302302
/>
303303
</>
304304
)}
305-
306-
<UiSeparator height={10} />
307305
</Scrollable>
308306
</>
309307
)

0 commit comments

Comments
 (0)