Skip to content

Commit d29d3fc

Browse files
authored
Added hover tooltip for long repo names in filter panel (#338)
* handle long repo names better in the UI * changelog * clean up hover UI * cleanup unused logic * simplify * remove unused import * changelog update
1 parent 0f3cdb7 commit d29d3fc

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
- Added seperate page for signup. [#311](https://github.com/sourcebot-dev/sourcebot/pull/331)
1212
- Fix repo images in authed instance case and add manifest json. [#332](https://github.com/sourcebot-dev/sourcebot/pull/332)
1313
- Added encryption logic for license keys. [#335](https://github.com/sourcebot-dev/sourcebot/pull/335)
14+
- Added hover tooltip for long repo names in filter panel. [#338](https://github.com/sourcebot-dev/sourcebot/pull/338)
1415
- Added repo shard validation on startup. [#339](https://github.com/sourcebot-dev/sourcebot/pull/339)
1516
- Added support for a file explorer when browsing files. [#336](https://github.com/sourcebot-dev/sourcebot/pull/336)
1617

packages/web/src/app/[domain]/search/components/filterPanel/entry.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use client';
22

3+
import { Tooltip, TooltipTrigger, TooltipContent } from "@/components/ui/tooltip";
34
import { QuestionMarkCircledIcon } from "@radix-ui/react-icons";
45
import clsx from "clsx";
56

@@ -44,13 +45,22 @@ export const Entry = ({
4445
)}
4546
onClick={() => onClicked()}
4647
>
47-
<div className="flex flex-row items-center gap-1 overflow-hidden">
48+
<div className="flex flex-row items-center gap-1 overflow-hidden min-w-0">
4849
{Icon ? Icon : (
4950
<QuestionMarkCircledIcon className="w-4 h-4 flex-shrink-0" />
5051
)}
51-
<p className="overflow-hidden text-ellipsis whitespace-nowrap">{displayName}</p>
52+
<div className="overflow-hidden flex-1 min-w-0">
53+
<Tooltip>
54+
<TooltipTrigger asChild>
55+
<p className="overflow-hidden text-ellipsis whitespace-nowrap truncate-start">{displayName}</p>
56+
</TooltipTrigger>
57+
<TooltipContent side="right" className="max-w-sm">
58+
<p className="font-mono text-sm break-all whitespace-pre-wrap">{displayName}</p>
59+
</TooltipContent>
60+
</Tooltip>
61+
</div>
5262
</div>
53-
<div className="px-2 py-0.5 bg-accent text-sm rounded-md">
63+
<div className="px-2 py-0.5 bg-accent text-sm rounded-md flex-shrink-0">
5464
{countText}
5565
</div>
5666
</div>

0 commit comments

Comments
 (0)