Skip to content

Commit eb6d58d

Browse files
authored
[search/browse] link repo name to file browser; link code image to external (#340)
1 parent d5dc26c commit eb6d58d

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
- Changed repository link in search to file tree + move external link to code host logo. [#340](https://github.com/sourcebot-dev/sourcebot/pull/340)
12+
1013
## [4.2.0] - 2025-06-09
1114

1215
### Added

packages/web/src/app/[domain]/components/pathHeader.tsx

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -223,22 +223,27 @@ export const PathHeader = ({
223223
return (
224224
<div className="flex flex-row gap-2 items-center w-full overflow-hidden">
225225
{info?.icon ? (
226-
<Image
227-
src={info.icon}
228-
alt={info.codeHostName}
229-
className={`w-4 h-4 ${info.iconClassName}`}
230-
/>
231-
): (
226+
<a href={info.repoLink} target="_blank" rel="noopener noreferrer">
227+
<Image
228+
src={info.icon}
229+
alt={info.codeHostName}
230+
className={`w-4 h-4 ${info.iconClassName}`}
231+
/>
232+
</a>
233+
) : (
232234
<LaptopIcon className="w-4 h-4" />
233235
)}
234-
<Link
235-
className={clsx("font-medium", {
236-
"cursor-pointer hover:underline": info?.repoLink,
236+
<div
237+
className="font-medium cursor-pointer hover:underline"
238+
onClick={() => navigateToPath({
239+
repoName: repo.name,
240+
path: '',
241+
pathType: 'tree',
242+
revisionName: branchDisplayName,
237243
})}
238-
href={info?.repoLink ?? ""}
239244
>
240245
{info?.displayName}
241-
</Link>
246+
</div>
242247
{branchDisplayName && (
243248
<p
244249
className="text-xs font-semibold text-gray-500 dark:text-gray-400 mt-[3px] flex items-center gap-0.5"

0 commit comments

Comments
 (0)