adds nice git interface

This commit is contained in:
2026-10-30 13:21:45 +01:00
parent b9c03a7637
commit caec81e762
107 changed files with 6466 additions and 3992 deletions
-6
View File
@@ -4,7 +4,6 @@ public enum Metrics {
// MARK: Rows and bars
public static let explorerRow: CGFloat = 24
public static let sourceControlRow: CGFloat = 26
public static let statusBar: CGFloat = 28
public static let contextMenuItem: CGFloat = 30
/// The one top-bar height: Explorer head, Diff bar.
@@ -18,8 +17,6 @@ public enum Metrics {
public static let launcherRow: CGFloat = 38
public static let launcherNewRow: CGFloat = 46
public static let searchQueryBar: CGFloat = 54
public static let commitBox: CGFloat = 52
public static let pushButton: CGFloat = 34
// MARK: Radii
@@ -40,7 +37,6 @@ public enum Metrics {
// MARK: Columns
public static let sourceControlWidth: CGFloat = 236
public static let explorerWidth: CGFloat = 288
public static let agentWidth: CGFloat = 480
public static let minEditorWidth: CGFloat = 280
@@ -80,8 +76,6 @@ public enum Metrics {
// MARK: Overlays
public static let overlayInset: CGFloat = 34
/// The widest an `.inset` overlay grows; past it the card stays centred.
public static let insetOverlayMaxWidth: CGFloat = 1200
public static let contextMenuWidth: CGFloat = 320
public static let passOnWidth: CGFloat = 460
public static let launcherWidth: CGFloat = 520
+38 -5
View File
@@ -49,8 +49,6 @@ public enum Palette {
public static let amberKeycapBorder = Color(hex: 0xE8913A, alpha: 0.35)
/// Text on an amber fill: always ink, never white.
public static let ink = Color(hex: 0x171C22)
/// The Commit button's label, a warmer ink than `ink`.
public static let commitInk = Color(hex: 0x201608)
/// Keycap border on an amber fill.
public static let inkKeycapBorder = Color(hex: 0x171C22, alpha: 0.25)
@@ -121,9 +119,44 @@ public enum Palette {
public static let menuIconModify = Color(hex: 0xF0B476)
public static let menuIconRename = Color(hex: 0xBAC0C0)
/// Git status letters: staged rows in teal, unstaged in amber-soft.
public static let stagedLetter = Color(hex: 0x8FBFB4)
public static let unstagedLetter = Color(hex: 0xF0B476)
// MARK: Git view
/// Secondary meta between text-3 and text-4: the sync label, the author, directories, hints.
public static let textMuted = Color(hex: 0x828D9A)
/// A file row under the pointer.
public static let gitRowHover = Color(hex: 0x1F2834)
/// The idle Commit button under the pointer: `raised` one step darker.
public static let commitIdleHover = Color(hex: 0x202834)
/// Status colours: modified, new, deleted; staged is `amber`.
public static let gitModified = Color(hex: 0xF0B476)
public static let gitNew = Color(hex: 0x8FBFB4)
public static let gitDeleted = Color(hex: 0xC3A6CE)
/// Section header fills.
public static let gitStagedTint = Color(hex: 0xE8913A, alpha: 0.08)
public static let gitModifiedTint = Color(hex: 0xF0B476, alpha: 0.06)
public static let gitNewTint = Color(hex: 0x8FBFB4, alpha: 0.06)
public static let gitDeletedTint = Color(hex: 0xC3A6CE, alpha: 0.06)
/// The current branch row.
public static let gitCurrentBranch = Color(hex: 0xE8913A, alpha: 0.08)
/// Inline diff: line fills, the differing middle of a paired line, and the side with no line.
public static let inlineRemovedFill = Color(hex: 0xE8913A, alpha: 0.12)
public static let inlineAddedFill = Color(hex: 0x8FBFB4, alpha: 0.12)
public static let inlineRemovedHighlight = Color(hex: 0xE8913A, alpha: 0.38)
public static let inlineAddedHighlight = Color(hex: 0x8FBFB4, alpha: 0.36)
public static let inlineFiller = Color(hex: 0x232C39, alpha: 0.35)
/// The colour of a console line.
public static func console(_ kind: GitLineKind) -> Color {
switch kind {
case .command: text1
case .output: text3
case .error: amber
case .hint: textMuted
case .staged, .success: gitNew
case .unstaged: gitModified
}
}
}
extension Color {
+19 -1
View File
@@ -77,7 +77,7 @@ public enum Typography {
public static let terminal = TypeRole(.monoRegular, 12, lineHeight: 20.4)
public static let row = TypeRole(.sansRegular, 13)
public static let rowSelected = TypeRole(.sansMedium, 13)
public static let sourceControlRow = TypeRole(.sansRegular, 12)
public static let rowSmall = TypeRole(.sansRegular, 12)
public static let body = TypeRole(.sansRegular, 14, lineHeight: 23.8)
public static let tooltip = TypeRole(.sansRegular, 12, lineHeight: 18)
public static let button = TypeRole(.sansMedium, 12)
@@ -88,10 +88,28 @@ public enum Typography {
public static let toolbarLabel = TypeRole(.sansRegular, 12)
public static let menuItem = TypeRole(.sansRegular, 13)
public static let menuItemHighlighted = TypeRole(.sansMedium, 13)
/// The main item of a menu, such as "Open in editor".
public static let menuItemEmphasized = TypeRole(.sansSemiBold, 13)
public static let note = TypeRole(.monoRegular, 14, lineHeight: 23.8)
public static let markdownH2 = TypeRole(.monoBold, 24, lineHeight: 26.4, trackingEm: -0.03)
public static let markdownH3 = TypeRole(.monoBold, 17, lineHeight: 20.4)
public static let markdownQuote = TypeRole(.sansItalic, 15)
// MARK: Git view
/// `[ git ]` and the section labels: 11px mono 700, uppercase.
public static let gitLabel = TypeRole(.monoBold, 11, trackingEm: 0.14, uppercase: true)
/// The ↓2 / ↑1 counts, the ⌘G hint and the section count badge.
public static let gitCount = TypeRole(.monoSemiBold, 11)
public static let commitMessage = TypeRole(.monoRegular, 14, lineHeight: 22.4)
public static let gitCommitButton = TypeRole(.sansSemiBold, 13)
public static let gitStatusLetter = TypeRole(.monoBold, 11)
public static let gitPath = TypeRole(.monoRegular, 13)
public static let gitStats = TypeRole(.monoMedium, 12)
public static let inlineDiff = TypeRole(.monoRegular, 13, lineHeight: 22)
public static let gitEmpty = TypeRole(.sansRegular, 13, lineHeight: 20.8)
public static let console = TypeRole(.monoRegular, 12, lineHeight: 19.2)
public static let branchCurrent = TypeRole(.monoSemiBold, 12)
}
extension View {