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

This commit is contained in:
drew-u410 2025-06-07 15:27:29 -04:00 committed by GitHub
parent d5dc26cb1f
commit eb6d58d6d3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 11 deletions

View file

@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [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 ## [4.2.0] - 2025-06-09
### Added ### Added

View file

@ -223,22 +223,27 @@ export const PathHeader = ({
return ( return (
<div className="flex flex-row gap-2 items-center w-full overflow-hidden"> <div className="flex flex-row gap-2 items-center w-full overflow-hidden">
{info?.icon ? ( {info?.icon ? (
<Image <a href={info.repoLink} target="_blank" rel="noopener noreferrer">
src={info.icon} <Image
alt={info.codeHostName} src={info.icon}
className={`w-4 h-4 ${info.iconClassName}`} alt={info.codeHostName}
/> className={`w-4 h-4 ${info.iconClassName}`}
): ( />
</a>
) : (
<LaptopIcon className="w-4 h-4" /> <LaptopIcon className="w-4 h-4" />
)} )}
<Link <div
className={clsx("font-medium", { className="font-medium cursor-pointer hover:underline"
"cursor-pointer hover:underline": info?.repoLink, onClick={() => navigateToPath({
repoName: repo.name,
path: '',
pathType: 'tree',
revisionName: branchDisplayName,
})} })}
href={info?.repoLink ?? ""}
> >
{info?.displayName} {info?.displayName}
</Link> </div>
{branchDisplayName && ( {branchDisplayName && (
<p <p
className="text-xs font-semibold text-gray-500 dark:text-gray-400 mt-[3px] flex items-center gap-0.5" className="text-xs font-semibold text-gray-500 dark:text-gray-400 mt-[3px] flex items-center gap-0.5"