From 13388790fc0e005cb1888c4625414701a0ff1337 Mon Sep 17 00:00:00 2001 From: Caleb Wodi Date: Sat, 14 Feb 2026 18:26:44 +0100 Subject: [PATCH] feat: add flexible input showcase and tabbed install section --- apps/web/app/page.tsx | 2 + apps/web/components/input-formats.tsx | 51 ++++++++++ apps/web/components/install.tsx | 138 ++++++++++++++++++++++++++ 3 files changed, 191 insertions(+) create mode 100644 apps/web/components/input-formats.tsx create mode 100644 apps/web/components/install.tsx diff --git a/apps/web/app/page.tsx b/apps/web/app/page.tsx index 081e767..1e9414a 100644 --- a/apps/web/app/page.tsx +++ b/apps/web/app/page.tsx @@ -7,6 +7,8 @@ export default function Page() { + + ) } diff --git a/apps/web/components/input-formats.tsx b/apps/web/components/input-formats.tsx new file mode 100644 index 0000000..c52166b --- /dev/null +++ b/apps/web/components/input-formats.tsx @@ -0,0 +1,51 @@ +import { ArrowRight } from "lucide-react" + +const formats = [ + "https://github.com/owner/repo", + "github.com/owner/repo", + "owner/repo", + "https://github.com/owner/repo/issues/123", + "https://github.com/owner/repo?tab=readme", + "git@github.com:owner/repo.git", +] + +export function InputFormats() { + return ( +
+
+
+
+

+ Flexible Input +

+

+ Paste any GitHub link +

+

+ No need to reformat URLs. ExplainThisRepo accepts repositories the + way you actually copy them. All inputs are normalized internally to + owner/repo. +

+
+ +
+ {formats.map((format) => ( +
+ + {format} + + + + owner/repo + +
+ ))} +
+
+
+
+ ) +} diff --git a/apps/web/components/install.tsx b/apps/web/components/install.tsx new file mode 100644 index 0000000..4f821ec --- /dev/null +++ b/apps/web/components/install.tsx @@ -0,0 +1,138 @@ +"use client" + +import { useState } from "react" +import { Check, Copy } from "lucide-react" +import { cn } from "@/lib/utils" + +const tabs = [ + { + label: "pip", + commands: [ + { text: "pip install explainthisrepo", copyable: true }, + { text: "explainthisrepo owner/repo", copyable: true }, + ], + }, + { + label: "pipx", + commands: [ + { text: "pipx install explainthisrepo", copyable: true }, + { text: "explainthisrepo owner/repo", copyable: true }, + ], + }, + { + label: "npm", + commands: [ + { text: "npm install -g explainthisrepo", copyable: true }, + { text: "explainthisrepo owner/repo", copyable: true }, + ], + }, + { + label: "npx", + commands: [ + { text: "npx explainthisrepo owner/repo", copyable: true }, + ], + }, +] + +function CopyButton({ text }: { text: string }) { + const [copied, setCopied] = useState(false) + + const copy = async () => { + try { + await navigator.clipboard.writeText(text) + setCopied(true) + setTimeout(() => setCopied(false), 2000) + } catch { + // Clipboard API not available (non-HTTPS or unsupported browser) + } + } + + return ( + + ) +} + +export function Install() { + const [activeTab, setActiveTab] = useState(0) + + return ( +
+
+
+

+ Installation +

+

+ Get started in seconds +

+

+ Install via pip or npm and start explaining repos right away. + Requires Python 3.9+ or Node.js. +

+
+ +
+
+ {/* Tabs */} +
+ {tabs.map((tab, index) => ( + + ))} +
+ + {/* Commands */} +
+ {tabs[activeTab].commands.map((cmd) => ( +
+ + $ + {cmd.text} + + +
+ ))} +
+
+ + {/* API key note */} +
+

+ API Key Required:{" "} + ExplainThisRepo uses Gemini models for code analysis. Set your API + key with{" "} + + export GEMINI_API_KEY="your_key" + +

+
+
+
+
+ ) +}