style: simplify git header controls

Show sync counters only when needed
Use an icon-only identity selector
This commit is contained in:
Bohdan Triapitsyn
2026-05-05 23:57:42 +03:00
parent 7b66bca2c5
commit 16c349417f
2 changed files with 6 additions and 4 deletions
@@ -270,7 +270,7 @@ export const GitHeader: React.FC<GitHeaderProps> = ({
onSelect={onSelectIdentity} onSelect={onSelectIdentity}
isApplying={isApplyingIdentity} isApplying={isApplyingIdentity}
iconOnly={false} iconOnly={true}
/> />
); );
@@ -55,9 +55,11 @@ export const SyncActions: React.FC<SyncActionsProps> = ({
const isPrimaryDisabled = disabled || syncAction !== null || isRemovingRemote || !trackingRemote || blocksRebaseSync; const isPrimaryDisabled = disabled || syncAction !== null || isRemovingRemote || !trackingRemote || blocksRebaseSync;
const isDropdownDisabled = disabled || syncAction !== null || isRemovingRemote || remotes.length === 0; const isDropdownDisabled = disabled || syncAction !== null || isRemovingRemote || remotes.length === 0;
const hasKnownSyncWork = aheadCount > 0 || behindCount > 0; const hasKnownSyncWork = aheadCount > 0 || behindCount > 0;
const primaryLabel = hasKnownSyncWork const primaryLabel = [
? t('gitView.sync.syncCounts', { ahead: aheadCount, behind: behindCount }) t('gitView.sync.sync'),
: t('gitView.sync.sync'); behindCount > 0 ? `↓${behindCount}` : null,
aheadCount > 0 ? `↑${aheadCount}` : null,
].filter(Boolean).join(' ');
const tooltipLabel = blocksRebaseSync const tooltipLabel = blocksRebaseSync
? t('gitView.sync.commitOrStashTooltip') ? t('gitView.sync.commitOrStashTooltip')
: trackingRemote : trackingRemote