Skip to content

Commit bbd6352

Browse files
committed
Improve readability of fetchCommits and DiffDialog JSX
1 parent 8b89215 commit bbd6352

File tree

2 files changed

+20
-16
lines changed

2 files changed

+20
-16
lines changed

src/git/git-logic.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,9 @@ export async function fetchCommits(
157157
const sectionsToProcess = hasMore ? sections.slice(0, limit) : sections;
158158

159159
const commits: Commit[] = sectionsToProcess.map((section) => {
160-
const [hash, shortHash, message, author, date, parentsStr] =
161-
section.trim().split("\x1f");
160+
const [hash, shortHash, message, author, date, parentsStr] = section
161+
.trim()
162+
.split("\x1f");
162163
const parents = (parentsStr || "")
163164
.split(" ")
164165
.map((p) => p.trim())

webview-ui/src/components/DiffDialog.tsx

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -300,14 +300,15 @@ export function DiffDialog({
300300
{filePath}
301301
</span>
302302
<span
303-
className={`text-[9px] font-bold uppercase px-2 py-0.5 rounded ${isNew
304-
? "bg-emerald-500/20 text-emerald-400"
305-
: isDeleted
306-
? "bg-rose-500/20 text-rose-400"
307-
: isRename
308-
? "bg-amber-500/20 text-amber-400"
309-
: "bg-blue-500/10 text-blue-400"
310-
}`}
303+
className={`text-[9px] font-bold uppercase px-2 py-0.5 rounded ${
304+
isNew
305+
? "bg-emerald-500/20 text-emerald-400"
306+
: isDeleted
307+
? "bg-rose-500/20 text-rose-400"
308+
: isRename
309+
? "bg-amber-500/20 text-amber-400"
310+
: "bg-blue-500/10 text-blue-400"
311+
}`}
311312
>
312313
{fileTypeLabel}
313314
</span>
@@ -668,10 +669,11 @@ export function DiffDialog({
668669
className={`
669670
flex items-center gap-1 px-2 py-0.5 rounded text-[10px] font-mono whitespace-nowrap
670671
border transition-all cursor-pointer shrink-0
671-
${selectedFiles.has(file)
672-
? "bg-primary/10 border-primary/30 text-primary"
673-
: "bg-muted/30 border-border/50 text-muted-foreground hover:border-border"
674-
}
672+
${
673+
selectedFiles.has(file)
674+
? "bg-primary/10 border-primary/30 text-primary"
675+
: "bg-muted/30 border-border/50 text-muted-foreground hover:border-border"
676+
}
675677
`}
676678
>
677679
{selectedFiles.has(file) ? (
@@ -729,8 +731,9 @@ export function DiffDialog({
729731
}
730732
>
731733
<RotateCcw
732-
className={`h-3 w-3 ${isCurrentExecuting ? "animate-spin" : ""
733-
}`}
734+
className={`h-3 w-3 ${
735+
isCurrentExecuting ? "animate-spin" : ""
736+
}`}
734737
/>
735738
Fix
736739
</Button>

0 commit comments

Comments
 (0)