feat(git): show current branch boundary in commit history (#682)
* feat(git): show current branch boundary in commit history * style(git): round commit cards around branch divider * style(git): refine branch divider visual boundary
This commit is contained in:
@@ -12,6 +12,8 @@ interface HistoryCommitRowProps {
|
||||
files: CommitFileEntry[];
|
||||
isLoadingFiles: boolean;
|
||||
onCopyHash: (hash: string) => void;
|
||||
roundTop?: boolean;
|
||||
roundBottom?: boolean;
|
||||
}
|
||||
|
||||
function formatCommitDate(date: string) {
|
||||
@@ -52,6 +54,8 @@ export const HistoryCommitRow: React.FC<HistoryCommitRowProps> = ({
|
||||
files,
|
||||
isLoadingFiles,
|
||||
onCopyHash,
|
||||
roundTop = false,
|
||||
roundBottom = false,
|
||||
}) => {
|
||||
return (
|
||||
<li>
|
||||
@@ -60,6 +64,8 @@ export const HistoryCommitRow: React.FC<HistoryCommitRowProps> = ({
|
||||
onClick={onToggle}
|
||||
className={cn(
|
||||
'w-full flex items-start gap-3 px-3 py-2 text-left transition-colors',
|
||||
roundTop && 'rounded-t-lg',
|
||||
roundBottom && !isExpanded && 'rounded-b-lg',
|
||||
isExpanded ? 'bg-sidebar/90' : 'hover:bg-sidebar/40'
|
||||
)}
|
||||
>
|
||||
@@ -107,7 +113,7 @@ export const HistoryCommitRow: React.FC<HistoryCommitRowProps> = ({
|
||||
</button>
|
||||
|
||||
{isExpanded && (
|
||||
<div className="px-3 pb-2 pl-8 border-t border-border/40">
|
||||
<div className={cn('px-3 pb-2 pl-8 border-t border-border/40', roundBottom && 'rounded-b-lg')}>
|
||||
{isLoadingFiles ? (
|
||||
<div className="flex items-center gap-2 py-2">
|
||||
<RiLoader4Line className="size-4 animate-spin text-muted-foreground" />
|
||||
|
||||
Reference in New Issue
Block a user