Skip to content

[search/browse] link repo name to file browser; link code image to external #340

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added
- Changed repository link in search to file tree + move external link to code host logo. [#340](https://github.com/sourcebot-dev/sourcebot/pull/340)

## [4.2.0] - 2025-06-09

### Added
Expand Down
27 changes: 16 additions & 11 deletions packages/web/src/app/[domain]/components/pathHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -223,22 +223,27 @@ export const PathHeader = ({
return (
<div className="flex flex-row gap-2 items-center w-full overflow-hidden">
{info?.icon ? (
<Image
src={info.icon}
alt={info.codeHostName}
className={`w-4 h-4 ${info.iconClassName}`}
/>
): (
<a href={info.repoLink} target="_blank" rel="noopener noreferrer">
<Image
src={info.icon}
alt={info.codeHostName}
className={`w-4 h-4 ${info.iconClassName}`}
/>
</a>
) : (
<LaptopIcon className="w-4 h-4" />
)}
<Link
className={clsx("font-medium", {
"cursor-pointer hover:underline": info?.repoLink,
<div
className="font-medium cursor-pointer hover:underline"
onClick={() => navigateToPath({
repoName: repo.name,
path: '',
pathType: 'tree',
revisionName: branchDisplayName,
})}
href={info?.repoLink ?? ""}
>
{info?.displayName}
</Link>
</div>
{branchDisplayName && (
<p
className="text-xs font-semibold text-gray-500 dark:text-gray-400 mt-[3px] flex items-center gap-0.5"
Expand Down