Skip to content

Commit 306a12b

Browse files
committed
fmt
1 parent 93165f7 commit 306a12b

File tree

5 files changed

+233
-153
lines changed

5 files changed

+233
-153
lines changed

src/browser/components/file-header.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ export const FileHeader = memo(function FileHeader({
5454
<div className="flex items-center justify-between">
5555
<div className="flex items-center gap-3 min-w-0 flex-1">
5656
<FileCode className="w-4 h-4 text-muted-foreground shrink-0" />
57-
<span className="font-mono text-sm font-medium truncate">{file.filename}</span>
57+
<span className="font-mono text-sm font-medium truncate">
58+
{file.filename}
59+
</span>
5860
{fileStatusBadge}
5961
<span className="text-xs text-muted-foreground shrink-0">
6062
<span className="text-green-500">+{file.additions}</span>{" "}

src/browser/components/home.tsx

Lines changed: 51 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -183,29 +183,42 @@ function buildSearchQueries(config: FilterConfig): string[] {
183183
if (modeFilter) parts.push(modeFilter);
184184
// Note: "all" mode on All Repos would be too broad, so we skip it
185185
// Also skip "authored-by" without a username
186-
if (filter.mode !== "all" && !(filter.mode === "authored-by" && !filter.authoredBy)) {
186+
if (
187+
filter.mode !== "all" &&
188+
!(filter.mode === "authored-by" && !filter.authoredBy)
189+
) {
187190
queries.push(parts.join(" "));
188191
}
189192
}
190193

191194
// Group specific repos by mode+authoredBy (for authored-by, different authors need separate queries)
192195
if (specificRepos.length > 0) {
193196
// Use a composite key: mode + authoredBy for authored-by mode
194-
const byModeKey = new Map<string, { mode: FilterMode; authoredBy?: string; repos: string[] }>();
197+
const byModeKey = new Map<
198+
string,
199+
{ mode: FilterMode; authoredBy?: string; repos: string[] }
200+
>();
195201
for (const repo of specificRepos) {
196-
const key = repo.mode === "authored-by" ? `${repo.mode}:${repo.authoredBy || ""}` : repo.mode;
202+
const key =
203+
repo.mode === "authored-by"
204+
? `${repo.mode}:${repo.authoredBy || ""}`
205+
: repo.mode;
197206
const existing = byModeKey.get(key);
198207
if (existing) {
199208
existing.repos.push(repo.name);
200209
} else {
201-
byModeKey.set(key, { mode: repo.mode, authoredBy: repo.authoredBy, repos: [repo.name] });
210+
byModeKey.set(key, {
211+
mode: repo.mode,
212+
authoredBy: repo.authoredBy,
213+
repos: [repo.name],
214+
});
202215
}
203216
}
204217

205218
for (const [, { mode, authoredBy, repos }] of byModeKey) {
206219
// Skip authored-by without a username
207220
if (mode === "authored-by" && !authoredBy) continue;
208-
221+
209222
const parts = ["is:pr", "archived:false"];
210223
if (stateFilter) parts.push(stateFilter);
211224
// Multiple repo: qualifiers act as OR
@@ -440,7 +453,9 @@ export function Home() {
440453
});
441454
// Track author input for "authored-by" mode
442455
const [authoredByInput, setAuthoredByInput] = useState<string>("");
443-
const [showAuthoredByInput, setShowAuthoredByInput] = useState<string | null>(null);
456+
const [showAuthoredByInput, setShowAuthoredByInput] = useState<string | null>(
457+
null
458+
);
444459
const [showAddRepo, setShowAddRepo] = useState(false);
445460
const [addRepoButtonRef, setAddRepoButtonRef] =
446461
useState<HTMLButtonElement | null>(null);
@@ -594,12 +609,18 @@ export function Home() {
594609
>
595610
{showAuthoredByInput === repo.name ? (
596611
<div className="p-3">
597-
<div className="text-xs font-medium mb-2">Enter GitHub username</div>
612+
<div className="text-xs font-medium mb-2">
613+
Enter GitHub username
614+
</div>
598615
<form
599616
onSubmit={(e) => {
600617
e.preventDefault();
601618
if (authoredByInput.trim()) {
602-
handleRepoModeChange(repo.name, "authored-by", authoredByInput.trim());
619+
handleRepoModeChange(
620+
repo.name,
621+
"authored-by",
622+
authoredByInput.trim()
623+
);
603624
setOpenRepoDropdown(null);
604625
setShowAuthoredByInput(null);
605626
setAuthoredByInput("");
@@ -608,11 +629,15 @@ export function Home() {
608629
>
609630
<div className="flex gap-2">
610631
<div className="relative flex-1">
611-
<span className="absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground text-xs">@</span>
632+
<span className="absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground text-xs">
633+
@
634+
</span>
612635
<input
613636
type="text"
614637
value={authoredByInput}
615-
onChange={(e) => setAuthoredByInput(e.target.value)}
638+
onChange={(e) =>
639+
setAuthoredByInput(e.target.value)
640+
}
616641
placeholder="username"
617642
className="w-full h-7 pl-6 pr-2 rounded-md border border-border bg-muted/50 text-xs placeholder:text-muted-foreground/60 focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent"
618643
autoFocus
@@ -659,11 +684,13 @@ export function Home() {
659684
<div className="flex-1 min-w-0">
660685
<div className="font-medium text-xs">
661686
{option.label}
662-
{option.value === "authored-by" && repo.mode === "authored-by" && repo.authoredBy && (
663-
<span className="text-muted-foreground font-normal ml-1">
664-
@{repo.authoredBy}
665-
</span>
666-
)}
687+
{option.value === "authored-by" &&
688+
repo.mode === "authored-by" &&
689+
repo.authoredBy && (
690+
<span className="text-muted-foreground font-normal ml-1">
691+
@{repo.authoredBy}
692+
</span>
693+
)}
667694
</div>
668695
<div className="text-[10px] text-muted-foreground">
669696
{option.description}
@@ -707,14 +734,17 @@ export function Home() {
707734
"text-emerald-400 hover:text-emerald-300",
708735
"hover:shadow-[0_0_20px_rgba(16,185,129,0.15)]",
709736
"hover:from-emerald-500/15 hover:via-green-500/15 hover:to-teal-500/15",
710-
showAddRepo && "border-emerald-500/50 shadow-[0_0_20px_rgba(16,185,129,0.2)] from-emerald-500/20 via-green-500/20 to-teal-500/20"
737+
showAddRepo &&
738+
"border-emerald-500/50 shadow-[0_0_20px_rgba(16,185,129,0.2)] from-emerald-500/20 via-green-500/20 to-teal-500/20"
711739
)}
712740
>
713-
<span className={cn(
714-
"flex items-center justify-center w-4 h-4 rounded-md transition-all duration-200",
715-
"bg-emerald-500/20 group-hover:bg-emerald-500/30 group-hover:scale-110",
716-
showAddRepo && "bg-emerald-500/30 rotate-45"
717-
)}>
741+
<span
742+
className={cn(
743+
"flex items-center justify-center w-4 h-4 rounded-md transition-all duration-200",
744+
"bg-emerald-500/20 group-hover:bg-emerald-500/30 group-hover:scale-110",
745+
showAddRepo && "bg-emerald-500/30 rotate-45"
746+
)}
747+
>
718748
<Plus className="w-3 h-3" />
719749
</span>
720750
<span>Add Repo</span>

0 commit comments

Comments
 (0)