Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Commit b05bd5b

Browse files
authored
fix(svelte): Open correct file from preview panel line number (#63309)
Fixes srch-553 This commit changes the "selectline" handler to open the correct file when the file view is embedded. ## Test plan Manual testing. Open reference panel, click on reference to open preview panel, click on line number in review panel.
1 parent e24226a commit b05bd5b

File tree

1 file changed

+3
-2
lines changed
  • client/web-sveltekit/src/routes/[...repo=reporev]/(validrev)/(code)/-/blob/[...path]

1 file changed

+3
-2
lines changed

client/web-sveltekit/src/routes/[...repo=reporev]/(validrev)/(code)/-/blob/[...path]/FileView.svelte

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,10 @@
272272
selectedLines={selectedPosition?.line ? selectedPosition : null}
273273
on:selectline={({ detail: range }) => {
274274
goto(
275-
SourcegraphURL.from($page.url.searchParams)
275+
SourcegraphURL.from(embedded ? `${repoURL}/-/blob/${filePath}` : $page.url.searchParams)
276276
.setLineRange(range ? { line: range.line, endLine: range.endLine } : null)
277-
.deleteSearchParameter('popover').search
277+
.deleteSearchParameter('popover')
278+
.toString()
278279
)
279280
}}
280281
{codeIntelAPI}

0 commit comments

Comments
 (0)