Skip to content

Commit 0f8bb1e

Browse files
committed
feat: use topo-order for git history and highlight current branch UI
1 parent 858d653 commit 0f8bb1e

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

wimygit-tauri/src-tauri/src/git/parsers/history.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ pub async fn get_history(
122122
let format_str = format!("{}%H||%h||%an||%at||%s||%D||%P", COMMIT_MARKER);
123123
let mut args = vec![
124124
"log".to_string(),
125+
"--topo-order".to_string(),
125126
format!("--pretty=format:{}", format_str),
126127
format!("-{}", count),
127128
format!("--skip={}", skip),

wimygit-tauri/src/components/tabs/HistoryTab.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -477,9 +477,9 @@ export function HistoryTab({ repoPath, filePath, refreshKey, onRefresh, onFileSe
477477

478478
return (
479479
<span key={i} className={`inline-flex items-center shrink-0 leading-4 overflow-hidden rounded ${outerCls}`}>
480-
<span className={`text-[10px] px-1 leading-4 inline-flex items-center gap-0.5 ${nameBg}`}>
480+
<span className={`${isCurrent ? "text-[13px] px-[5px] leading-5" : "text-[10px] px-1 leading-4"} inline-flex items-center gap-0.5 ${nameBg}`}>
481481
{(r.kind === "head" || r.kind === "branch" || r.kind === "remote") && (
482-
<svg width="10" height="10" viewBox="0 0 16 16" fill="currentColor" className="shrink-0">
482+
<svg width={isCurrent ? 13 : 10} height={isCurrent ? 13 : 10} viewBox="0 0 16 16" fill="currentColor" className="shrink-0">
483483
<path d="M11.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5zm-2.25.75a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25zM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5zM3.5 3.25a.75.75 0 1 1 1.5 0 .75.75 0 0 1-1.5 0z" />
484484
</svg>
485485
)}
@@ -491,7 +491,7 @@ export function HistoryTab({ repoPath, filePath, refreshKey, onRefresh, onFileSe
491491
{r.label}
492492
</span>
493493
{isCurrent && (
494-
<span className="text-[10px] px-1 leading-4 bg-green-600 text-white">HEAD</span>
494+
<span className="text-[13px] px-[5px] leading-5 bg-green-600 text-white">HEAD</span>
495495
)}
496496
{isLocalOnly && (
497497
<span className="text-[10px] px-1 leading-4 bg-orange-500 text-white">local only</span>

0 commit comments

Comments
 (0)