Skip to content

Commit 3a67747

Browse files
committed
feat(web): add repo browsing without requiring a search first
1 parent 355509b commit 3a67747

File tree

4 files changed

+31
-1
lines changed

4 files changed

+31
-1
lines changed

packages/web/src/app/(app)/browse/layoutClient.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ import { FileSearchCommandDialog } from "./components/fileSearchCommandDialog";
1111
import { SearchBar } from "../components/searchBar";
1212
import escapeStringRegexp from "escape-string-regexp";
1313
import { Session } from "next-auth";
14+
import Link from "next/link";
15+
import { Button } from "@/components/ui/button";
16+
import { BookMarkedIcon } from "lucide-react";
1417

1518
interface LayoutProps {
1619
children: React.ReactNode;
@@ -29,6 +32,14 @@ export function LayoutClient({
2932
<div className="flex flex-col h-screen">
3033
<TopBar
3134
session={session}
35+
actions={
36+
<Button variant="outline" size="sm" asChild>
37+
<Link href="/repos" className="gap-1.5">
38+
<BookMarkedIcon className="h-3.5 w-3.5" />
39+
Repositories
40+
</Link>
41+
</Button>
42+
}
3243
>
3344
<SearchBar
3445
size="sm"

packages/web/src/app/(app)/components/navigationMenu/navigationItems.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ export const NavigationItems = ({
2626
if (href === '/') {
2727
return pathname === '/';
2828
}
29+
if (href === '/repos') {
30+
return pathname.startsWith('/repos') || pathname.startsWith('/browse');
31+
}
2932
return pathname.startsWith(href);
3033
};
3134

packages/web/src/app/(app)/repos/page.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ export default async function ReposPage(props: ReposPageProps) {
5555
<>
5656
<div className="mb-6">
5757
<h1 className="text-3xl font-semibold">Repositories</h1>
58-
<p className="text-muted-foreground mt-2">View and manage your code repositories and their indexing status.</p>
58+
<p className="text-muted-foreground mt-2">
59+
View and manage your code repositories and their indexing status. Select a repository name to open it in the file explorer.
60+
</p>
5961
</div>
6062
<ReposTable
6163
data={repos.map((repo) => ({

packages/web/src/app/(app)/search/components/searchLandingPage.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { RepositoryCarousel } from "../../components/repositoryCarousel"
44
import { Separator } from "@/components/ui/separator"
55
import { SyntaxReferenceGuideHint } from "../../components/syntaxReferenceGuideHint"
66
import Link from "next/link"
7+
import { Button } from "@/components/ui/button"
8+
import { FolderTreeIcon } from "lucide-react"
79
import { SearchBar } from "../../components/searchBar"
810
import { SearchModeSelector } from "../../components/searchModeSelector"
911
import { getRepos, getReposStats } from "@/actions"
@@ -56,6 +58,18 @@ export const SearchLandingPage = async ({
5658
</div>
5759
</div>
5860

61+
<div className="mt-5 flex flex-col items-center gap-1">
62+
<Button variant="outline" asChild>
63+
<Link href="/repos" className="gap-2">
64+
<FolderTreeIcon className="h-4 w-4" />
65+
Browse repositories
66+
</Link>
67+
</Button>
68+
<span className="text-xs text-muted-foreground text-center max-w-sm">
69+
Open the file explorer and pick a repo without running a search first.
70+
</span>
71+
</div>
72+
5973
<div className="mt-8">
6074
<RepositoryCarousel
6175
numberOfReposWithIndex={repoStats.numberOfReposWithIndex}

0 commit comments

Comments
 (0)