adds claude-generated commit messages and a recent commits panel to the git view - adds log tailing in the explorer, branch merging and a clean up button

This commit is contained in:
2026-11-04 10:07:52 +01:00
parent 600d4874d2
commit cc6651c08a
49 changed files with 1944 additions and 180 deletions
+36 -7
View File
@@ -25,18 +25,27 @@ struct GitView: View {
}
}
/// The console left, the branches right, 230pt tall.
/// The console left, the branches right, 230pt tall; a wide window adds the commit list after them.
private struct GitBottomStrip: View {
let model: WorkspaceModel
let store: SourceControlStore
var body: some View {
HStack(spacing: 0) {
GitConsolePanel(model: model, store: store)
.frame(maxWidth: .infinity)
Hairline(.vertical)
GitBranchesPanel(model: model, store: store)
.frame(maxWidth: .infinity)
GeometryReader { proxy in
let layout = GitStripLayout(width: proxy.size.width)
HStack(spacing: 0) {
GitConsolePanel(model: model, store: store)
.frame(width: layout.console)
Hairline(.vertical)
GitBranchesPanel(model: model, store: store)
.frame(width: layout.branches)
if let commits = layout.commits {
Hairline(.vertical)
GitCommitsPanel(store: store)
.frame(width: commits)
}
Spacer(minLength: 0)
}
}
.frame(height: GitMetrics.bottomStrip)
.background(Palette.panel)
@@ -44,6 +53,23 @@ private struct GitBottomStrip: View {
}
}
/// The widths of the bottom strip's panels for one strip width.
struct GitStripLayout: Equatable {
var console: CGFloat
var branches: CGFloat
/// Nil while the room left after the two capped panels is under `GitMetrics.commitsMinWidth`.
var commits: CGFloat?
init(width: CGFloat) {
let hairline = Metrics.hairline
let share = max(0, (width - hairline) / 2).rounded(.down)
console = min(GitMetrics.consoleMaxWidth, share)
branches = min(GitMetrics.branchesMaxWidth, share)
let left = width - console - branches - 2 * hairline
commits = left >= GitMetrics.commitsMinWidth ? left : nil
}
}
/// The Git view's fixed sizes, from the design handoff.
enum GitMetrics {
static let topBar: CGFloat = 44
@@ -68,6 +94,9 @@ enum GitMetrics {
static let diffGutter: CGFloat = 52
static let diffGap: CGFloat = 28
static let bottomStrip: CGFloat = 230
static let consoleMaxWidth: CGFloat = 820
static let branchesMaxWidth: CGFloat = 820
static let commitsMinWidth: CGFloat = 260
static let stripHeader: CGFloat = 32
static let branchRow: CGFloat = 28
}