Skip to content

Commit 496c13b

Browse files
authored
Merge pull request #2 from mherrera53/feat/terminal
Feat/Terminal
2 parents d904ede + 4e61a40 commit 496c13b

195 files changed

Lines changed: 18461 additions & 13117 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

GitMac.xcodeproj/project.pbxproj

Lines changed: 1997 additions & 746 deletions
Large diffs are not rendered by default.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
//
2+
// ActionButton.swift
3+
// GitMac
4+
//
5+
// Extracted from ContentView.swift
6+
//
7+
8+
import SwiftUI
9+
10+
// MARK: - Action Button
11+
struct ActionButton: View {
12+
let icon: String
13+
let title: String
14+
let action: () -> Void
15+
@State private var isHovered = false
16+
17+
var body: some View {
18+
Button(action: action) {
19+
HStack(spacing: 6) {
20+
Image(systemName: icon)
21+
.font(.system(size: 10))
22+
Text(title)
23+
.font(.system(size: 10))
24+
Spacer()
25+
}
26+
.foregroundColor(isHovered ? AppTheme.textPrimary : AppTheme.textMuted)
27+
.padding(.horizontal, 8)
28+
.padding(.vertical, 5)
29+
.background(isHovered ? AppTheme.hover : Color.clear)
30+
.cornerRadius(DesignTokens.CornerRadius.sm)
31+
}
32+
.buttonStyle(.plain)
33+
.onHover { isHovered = $0 }
34+
}
35+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
//
2+
// OperationProgressOverlay.swift
3+
// GitMac
4+
//
5+
// Extracted from ContentView.swift
6+
//
7+
8+
import SwiftUI
9+
10+
// MARK: - Operation Progress Overlay
11+
struct OperationProgressOverlay: View {
12+
let message: String
13+
14+
var body: some View {
15+
ZStack {
16+
AppTheme.background.opacity(0.4)
17+
.ignoresSafeArea()
18+
19+
VStack(spacing: 16) {
20+
ProgressView()
21+
.scaleEffect(1.5)
22+
.progressViewStyle(.circular)
23+
24+
Text(message)
25+
.font(.system(size: 13, weight: .medium))
26+
.foregroundColor(AppTheme.textPrimary)
27+
}
28+
.padding(32)
29+
.background(
30+
RoundedRectangle(cornerRadius: 12)
31+
.fill(AppTheme.backgroundSecondary)
32+
.shadow(color: .black.opacity(0.3), radius: 20, y: 10)
33+
)
34+
}
35+
}
36+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
//
2+
// SidebarSection.swift
3+
// GitMac
4+
//
5+
// Extracted from ContentView.swift
6+
//
7+
8+
import SwiftUI
9+
10+
// MARK: - Sidebar Section
11+
struct SidebarSection<Content: View>: View {
12+
let title: String
13+
let isExpanded: Bool
14+
let onToggle: () -> Void
15+
@ViewBuilder let content: Content
16+
17+
var body: some View {
18+
VStack(alignment: .leading, spacing: 0) {
19+
Button(action: onToggle) {
20+
HStack(spacing: 6) {
21+
Image(systemName: isExpanded ? "chevron.down" : "chevron.right")
22+
.font(.system(size: 9, weight: .bold))
23+
.foregroundColor(AppTheme.textMuted)
24+
.frame(width: 12)
25+
Text(title)
26+
.font(.system(size: 11, weight: .semibold))
27+
.foregroundColor(AppTheme.textMuted)
28+
Spacer()
29+
}
30+
.padding(.horizontal, 12)
31+
.padding(.vertical, 6)
32+
}
33+
.buttonStyle(.plain)
34+
35+
if isExpanded {
36+
content
37+
.padding(.leading, 8)
38+
}
39+
}
40+
}
41+
}
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
import SwiftUI
2+
3+
struct WelcomeView: View {
4+
let onOpen: () -> Void
5+
let onClone: () -> Void
6+
7+
var body: some View {
8+
VStack(spacing: DesignTokens.Spacing.xxl) {
9+
Spacer()
10+
11+
// App Icon
12+
Image(systemName: "arrow.triangle.branch")
13+
.font(.system(size: 80, weight: .light))
14+
.foregroundColor(AppTheme.accent)
15+
16+
// Welcome text
17+
VStack(spacing: DesignTokens.Spacing.sm) {
18+
Text("Welcome to GitMac")
19+
.font(.largeTitle)
20+
.fontWeight(.bold)
21+
.foregroundColor(AppTheme.textPrimary)
22+
23+
Text("A modern Git client for macOS")
24+
.font(.title3)
25+
.foregroundColor(AppTheme.textSecondary)
26+
}
27+
28+
// Action buttons
29+
HStack(spacing: DesignTokens.Spacing.lg) {
30+
WelcomeButton(
31+
title: "Open Repository",
32+
icon: "folder",
33+
action: onOpen
34+
)
35+
36+
WelcomeButton(
37+
title: "Clone Repository",
38+
icon: "arrow.down.circle",
39+
action: onClone
40+
)
41+
}
42+
43+
Spacer()
44+
45+
// Recent repositories
46+
RecentRepositoriesSection()
47+
}
48+
.frame(maxWidth: .infinity, maxHeight: .infinity)
49+
.background(AppTheme.background)
50+
}
51+
}
52+
53+
struct WelcomeButton: View {
54+
let title: String
55+
let icon: String
56+
let action: () -> Void
57+
58+
var body: some View {
59+
Button(action: action) {
60+
VStack(spacing: DesignTokens.Spacing.sm) {
61+
Image(systemName: icon)
62+
.font(.system(size: 32))
63+
.foregroundColor(AppTheme.accent)
64+
65+
Text(title)
66+
.font(.headline)
67+
.foregroundColor(AppTheme.textPrimary)
68+
}
69+
.frame(width: 160, height: 100)
70+
.background(AppTheme.backgroundSecondary)
71+
.cornerRadius(DesignTokens.CornerRadius.lg)
72+
}
73+
.buttonStyle(.plain)
74+
}
75+
}
76+
77+
struct RecentRepositoriesSection: View {
78+
@EnvironmentObject var recentReposManager: RecentRepositoriesManager
79+
@EnvironmentObject var appState: AppState
80+
81+
var body: some View {
82+
VStack(alignment: .leading, spacing: DesignTokens.Spacing.md) {
83+
Text("Recent Repositories")
84+
.font(.headline)
85+
.foregroundColor(AppTheme.textSecondary)
86+
87+
if recentReposManager.recentRepos.isEmpty {
88+
Text("No recent repositories")
89+
.font(.subheadline)
90+
.foregroundColor(AppTheme.textMuted)
91+
.padding(.vertical, DesignTokens.Spacing.lg)
92+
} else {
93+
ForEach(recentReposManager.recentRepos.prefix(5), id: \.path) { repo in
94+
RecentRepoRow(repo: repo)
95+
}
96+
}
97+
}
98+
.padding(DesignTokens.Spacing.lg)
99+
.frame(width: 400)
100+
}
101+
}
102+
103+
struct RecentRepoRow: View {
104+
let repo: RecentRepository
105+
@EnvironmentObject var appState: AppState
106+
@State private var isHovered = false
107+
108+
var body: some View {
109+
Button {
110+
Task {
111+
await appState.openRepository(at: repo.path)
112+
}
113+
} label: {
114+
HStack(spacing: DesignTokens.Spacing.md) {
115+
Image(systemName: "folder.fill")
116+
.font(.system(size: 20))
117+
.foregroundColor(AppTheme.accent)
118+
119+
VStack(alignment: .leading, spacing: 2) {
120+
Text(repo.name)
121+
.font(.system(size: 13, weight: .medium))
122+
.foregroundColor(AppTheme.textPrimary)
123+
.lineLimit(1)
124+
125+
Text(repo.path)
126+
.font(.caption)
127+
.foregroundColor(AppTheme.textMuted)
128+
.lineLimit(1)
129+
}
130+
131+
Spacer()
132+
133+
Text(repo.lastOpened, style: .relative)
134+
.font(.caption2)
135+
.foregroundColor(AppTheme.textMuted)
136+
}
137+
.padding(.horizontal, DesignTokens.Spacing.md)
138+
.padding(.vertical, DesignTokens.Spacing.sm)
139+
.background(isHovered ? AppTheme.hover : Color.clear)
140+
.cornerRadius(DesignTokens.CornerRadius.md)
141+
}
142+
.buttonStyle(.plain)
143+
.onHover { isHovered = $0 }
144+
}
145+
}

0 commit comments

Comments
 (0)