Skip to content

Commit 6f4b16a

Browse files
committed
Fix workspace path formatting in ResponsePreview by conditionally appending slash and remove redundant workspace name prepending in on_go_to_file handler
1 parent 51ae1fa commit 6f4b16a

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export const ResponsePreview: FC<Props> = (props) => {
174174

175175
<span>
176176
{props.has_multiple_workspaces && file.workspace_name
177-
? `${file.workspace_name}/`
177+
? `${file.workspace_name}${dir_path ? '/' : ''}`
178178
: ''}
179179
{dir_path}
180180
</span>

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -462,9 +462,7 @@ export const Panel = () => {
462462
on_go_to_file={(file) => {
463463
post_message(vscode, {
464464
command: 'GO_TO_FILE',
465-
file_path: file.workspace_name
466-
? `${file.workspace_name}/${file.file_path}`
467-
: file.file_path
465+
file_path: file.file_path
468466
})
469467
}}
470468
on_toggle_file={(file) => {

0 commit comments

Comments
 (0)