Skip to content

Commit e298776

Browse files
macOS Tahoe Toolbar (#2122)
### Description Updates the toolbar for macOS Tahoe. All changes in this PR should not affect existing functionality or design. ### Related Issues * closes #2116 * #2117 ### Checklist - [x] Navigator extends to the top of the toolbar. - [x] Task start/stop buttons in group. - [x] Toolbar no longer compact (taller) - [x] Extra padding on branch picker. - [x] Activity viewer no longer has a background color. - [x] Schema select hover is rounded. - [x] Task select hover is rounded. - [x] Activity viewer padding. - [x] Task status padding too short. - [x] Task status animation slightly wrong. - [x] Notifications and activity viewer are combined in one glass item. - [x] Notification item keeps space when hidden. - [x] I read and understood the [contributing guide](https://github.com/CodeEditApp/CodeEdit/blob/main/CONTRIBUTING.md) as well as the [code of conduct](https://github.com/CodeEditApp/CodeEdit/blob/main/CODE_OF_CONDUCT.md) - [x] The issues this PR addresses are related to each other - [x] My changes generate no new warnings - [x] My code builds and runs on my machine - [x] My changes are all related to the related issue above - [x] I documented my code ### Screenshots All toolbar sta <img width="1414" height="96" alt="Screenshot 2025-08-29 at 4 33 01 PM" src="https://github.com/user-attachments/assets/2cf369e7-4ab2-4f15-bc82-aa70954791fd" /> <img width="1399" height="81" alt="Screenshot 2025-08-29 at 4 32 57 PM" src="https://github.com/user-attachments/assets/fc0415ca-cfcc-40e3-a796-e3122841ab34" /> <img width="1382" height="70" alt="Screenshot 2025-08-29 at 4 32 44 PM" src="https://github.com/user-attachments/assets/91a3bbb9-672f-4e4f-80b8-da9230248fa0" /> <img width="1392" height="77" alt="Screenshot 2025-08-29 at 4 32 36 PM" src="https://github.com/user-attachments/assets/68dfc816-2cf3-4975-a59d-51cb0482d6cf" /> tes: <details><summary>Compression</summary> <p> https://github.com/user-attachments/assets/d8803ac1-a6e9-4648-a4e4-4c834d3c0f27 </p> </details> <details><summary>Toolbar in action</summary> <p> https://github.com/user-attachments/assets/b00e2f3e-7c15-4be2-b77a-6cc4440b004e </p> </details> <details><summary>Popovers</summary> <p> https://github.com/user-attachments/assets/fe7b12be-8c09-4be3-9ca6-b0f292bddfd0 </p> </details> <details><summary>Task notification viewer</summary> <p> https://github.com/user-attachments/assets/042d43ca-a60c-4188-a6e0-75fc1a43f13e </p> </details.
1 parent 5c2d8ec commit e298776

29 files changed

+701
-261
lines changed

CodeEdit.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CodeEdit.xcodeproj/xcshareddata/xcschemes/CodeEdit.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1640"
3+
LastUpgradeVersion = "2600"
44
version = "1.7">
55
<BuildAction
66
parallelizeBuildables = "YES"

CodeEdit.xcodeproj/xcshareddata/xcschemes/OpenWithCodeEdit.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1620"
3+
LastUpgradeVersion = "2600"
44
wasCreatedForAppExtension = "YES"
55
version = "2.0">
66
<BuildAction

CodeEdit/CodeEditApp.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ struct CodeEditApp: App {
3737
OpenFileOrFolderButton(dismissWindow: dismissWindow)
3838
},
3939
onDrop: { url, dismissWindow in
40-
Task { CodeEditDocumentController.shared.openDocument(at: url, onCompletion: { dismissWindow() }) }
40+
Task {
41+
await CodeEditDocumentController.shared.openDocument(at: url, onCompletion: { dismissWindow() })
42+
}
4143
}
4244
)
4345

CodeEdit/Features/ActivityViewer/ActivityViewer.swift

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,41 @@ struct ActivityViewer: View {
3232
self.taskManager = taskManager
3333
}
3434
var body: some View {
35+
Group {
36+
if #available(macOS 26, *) {
37+
content
38+
.fixedSize(horizontal: false, vertical: false)
39+
.padding(5)
40+
// TaskNotificationView doesn't have it's own padding
41+
// Also this padding seems weird. However, we want the spinning circle to be padded with the same
42+
// amount from both the top and bottom, as well as the trailing edge. So despite it not being exactly
43+
// the same it *looks* correctly padded
44+
.padding(.trailing, 5)
45+
.clipShape(Capsule())
46+
.frame(minWidth: 200)
47+
} else {
48+
content
49+
.fixedSize(horizontal: false, vertical: false)
50+
.padding(.horizontal, 5)
51+
.padding(.vertical, 1.5)
52+
.frame(height: 22)
53+
.clipped()
54+
.background {
55+
if colorScheme == .dark {
56+
RoundedRectangle(cornerRadius: 5)
57+
.opacity(0.1)
58+
} else {
59+
RoundedRectangle(cornerRadius: 5)
60+
.opacity(0.1)
61+
}
62+
}
63+
}
64+
}
65+
.accessibilityElement(children: .contain)
66+
.accessibilityLabel("Activity Viewer")
67+
}
68+
69+
@ViewBuilder private var content: some View {
3570
HStack(spacing: 0) {
3671
SchemeDropDownView(
3772
workspaceSettingsManager: workspaceSettingsManager,
@@ -45,21 +80,5 @@ struct ActivityViewer: View {
4580
TaskNotificationView(taskNotificationHandler: taskNotificationHandler)
4681
.fixedSize()
4782
}
48-
.fixedSize(horizontal: false, vertical: false)
49-
.padding(.horizontal, 5)
50-
.padding(.vertical, 1.5)
51-
.frame(height: 22)
52-
.clipped()
53-
.background {
54-
if colorScheme == .dark {
55-
RoundedRectangle(cornerRadius: 5)
56-
.opacity(0.1)
57-
} else {
58-
RoundedRectangle(cornerRadius: 5)
59-
.opacity(0.1)
60-
}
61-
}
62-
.accessibilityElement(children: .contain)
63-
.accessibilityLabel("Activity Viewer")
6483
}
6584
}

CodeEdit/Features/ActivityViewer/Notifications/TaskNotificationView.swift

Lines changed: 54 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -17,48 +17,35 @@ struct TaskNotificationView: View {
1717

1818
var body: some View {
1919
ZStack {
20-
if let notification {
21-
HStack {
22-
Text(notification.title)
23-
.font(.subheadline)
24-
.transition(
25-
.asymmetric(insertion: .move(edge: .top), removal: .move(edge: .bottom))
26-
.combined(with: .opacity)
27-
)
28-
.id("NotificationTitle" + notification.title)
29-
30-
if notification.isLoading {
31-
CECircularProgressView(
32-
progress: notification.percentage,
33-
currentTaskCount: taskNotificationHandler.notifications.count
34-
)
35-
.padding(.horizontal, -1)
36-
.frame(height: 16)
37-
} else {
38-
if taskNotificationHandler.notifications.count > 1 {
39-
Text("\(taskNotificationHandler.notifications.count)")
40-
.font(.caption)
41-
.padding(5)
42-
.background(
43-
Circle()
44-
.foregroundStyle(.gray)
45-
.opacity(0.2)
46-
)
47-
.padding(-5)
48-
}
20+
HStack {
21+
if let notification {
22+
HStack {
23+
Text(notification.title)
24+
.font(.subheadline)
25+
.transition(
26+
.asymmetric(insertion: .move(edge: .top), removal: .move(edge: .bottom))
27+
.combined(with: .opacity)
28+
)
29+
.id("NotificationTitle" + notification.title)
4930
}
31+
.transition(.opacity.combined(with: .move(edge: .trailing)))
32+
33+
loaderView(notification: notification)
34+
.transition(.opacity)
35+
.id("Loader")
36+
} else {
37+
Text("")
38+
.id("Loader")
5039
}
51-
.transition(.opacity.combined(with: .move(edge: .trailing)))
52-
.opacity(activeState == .inactive ? 0.4 : 1.0)
53-
.padding(3)
54-
.padding(-3)
55-
.padding(.trailing, 3)
56-
.popover(isPresented: $isPresented, arrowEdge: .bottom) {
57-
TaskNotificationsDetailView(taskNotificationHandler: taskNotificationHandler)
58-
}
59-
.onTapGesture {
60-
self.isPresented.toggle()
61-
}
40+
}
41+
.opacity(activeState == .inactive ? 0.4 : 1.0)
42+
.padding(3)
43+
.padding(-3)
44+
.popover(isPresented: $isPresented, arrowEdge: .bottom) {
45+
TaskNotificationsDetailView(taskNotificationHandler: taskNotificationHandler)
46+
}
47+
.onTapGesture {
48+
self.isPresented.toggle()
6249
}
6350
}
6451
.animation(.easeInOut, value: notification)
@@ -69,6 +56,33 @@ struct TaskNotificationView: View {
6956
}
7057
}
7158

59+
@ViewBuilder
60+
private func loaderView(notification: TaskNotificationModel) -> some View {
61+
if notification.isLoading {
62+
CECircularProgressView(
63+
progress: notification.percentage,
64+
currentTaskCount: taskNotificationHandler.notifications.count
65+
)
66+
.if(.tahoe) {
67+
$0.padding(.leading, 1)
68+
} else: {
69+
$0.padding(.horizontal, -1)
70+
}
71+
.frame(height: 16)
72+
} else {
73+
if taskNotificationHandler.notifications.count > 1 {
74+
Text("\(taskNotificationHandler.notifications.count)")
75+
.font(.caption)
76+
.padding(5)
77+
.background(
78+
Circle()
79+
.foregroundStyle(.gray)
80+
.opacity(0.2)
81+
)
82+
.padding(-5)
83+
}
84+
}
85+
}
7286
}
7387

7488
#Preview {

CodeEdit/Features/ActivityViewer/Tasks/DropdownMenuItemStyleModifier.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,33 @@
77

88
import SwiftUI
99

10+
extension View {
11+
@ViewBuilder
12+
func dropdownItemStyle() -> some View {
13+
self.modifier(DropdownMenuItemStyleModifier())
14+
}
15+
}
16+
1017
struct DropdownMenuItemStyleModifier: ViewModifier {
1118
@State private var isHovering = false
1219

1320
func body(content: Content) -> some View {
1421
content
22+
.padding(.vertical, 4)
23+
.padding(.horizontal, 8)
1524
.background(
1625
isHovering
1726
? AnyView(EffectView(.selection, blendingMode: .withinWindow, emphasized: true))
1827
: AnyView(Color.clear)
1928
)
2029
.foregroundColor(isHovering ? Color(NSColor.white) : .primary)
30+
.if(.tahoe) {
31+
if #available(macOS 26, *) {
32+
$0.clipShape(ContainerRelativeShape())
33+
}
34+
} else: {
35+
$0.clipShape(RoundedRectangle(cornerRadius: 5))
36+
}
2137
.onHover(perform: { hovering in
2238
self.isHovering = hovering
2339
})

CodeEdit/Features/ActivityViewer/Tasks/OptionMenuItemView.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@ struct OptionMenuItemView: View {
1616
Text(label)
1717
Spacer()
1818
}
19-
.padding(.vertical, 4)
20-
.padding(.horizontal, 28)
21-
.modifier(DropdownMenuItemStyleModifier())
22-
.clipShape(RoundedRectangle(cornerRadius: 5))
19+
.padding(.horizontal, 20)
20+
.dropdownItemStyle()
2321
.onTapGesture {
2422
action()
2523
}

0 commit comments

Comments
 (0)