Skip to content

Commit 748c372

Browse files
mcintyre94claude
andcommitted
Restyle Quick Actions sheet to match DevTools drawer design
Replace TabView with segmented Picker in principal toolbar position, and remove opaque systemBackground to let sheet material show through. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 9898dad commit 748c372

File tree

3 files changed

+29
-22
lines changed

3 files changed

+29
-22
lines changed

Wisp/Views/QuickActions/BashQuickView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ struct BashQuickView: View {
138138
}
139139
}
140140
}
141-
.background(Color(.systemBackground))
141+
.background(.clear)
142142
}
143143
}
144144

Wisp/Views/QuickActions/QuickActionsView.swift

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,44 @@
11
import SwiftUI
22

3+
private enum QuickActionsTab {
4+
case chat, bash
5+
}
6+
37
struct QuickActionsView: View {
48
@Environment(SpritesAPIClient.self) private var apiClient
59
@Environment(\.dismiss) private var dismiss
610
let viewModel: QuickActionsViewModel
711
var insertCallback: ((String) -> Void)? = nil
812
var startChatCallback: ((String) -> Void)? = nil
913

10-
@State private var selectedTab = 0
14+
@State private var selectedTab: QuickActionsTab = .chat
1115

1216
var body: some View {
1317
NavigationStack {
14-
tabs
15-
.navigationTitle(selectedTab == 0 ? "Quick Chat" : "Bash")
16-
.navigationBarTitleDisplayMode(.inline)
17-
.toolbar {
18-
ToolbarItem(placement: .cancellationAction) {
19-
Button(action: handleDone) {
20-
Image(systemName: "xmark")
21-
}
18+
Group {
19+
switch selectedTab {
20+
case .chat:
21+
QuickChatView(viewModel: viewModel.quickChatViewModel)
22+
case .bash:
23+
bashTab
24+
}
25+
}
26+
.navigationBarTitleDisplayMode(.inline)
27+
.toolbar {
28+
ToolbarItem(placement: .principal) {
29+
Picker("Tab", selection: $selectedTab) {
30+
Text("Quick Chat").tag(QuickActionsTab.chat)
31+
Text("Bash").tag(QuickActionsTab.bash)
2232
}
33+
.pickerStyle(.segmented)
34+
.frame(width: 200)
2335
}
24-
}
25-
}
26-
27-
private var tabs: some View {
28-
TabView(selection: $selectedTab) {
29-
QuickChatView(viewModel: viewModel.quickChatViewModel)
30-
.tabItem { Label("Quick Chat", systemImage: "bubble.left") }
31-
.tag(0)
32-
bashTab
33-
.tabItem { Label("Bash", systemImage: "terminal") }
34-
.tag(1)
36+
ToolbarItem(placement: .cancellationAction) {
37+
Button(action: handleDone) {
38+
Image(systemName: "xmark")
39+
}
40+
}
41+
}
3542
}
3643
}
3744

Wisp/Views/QuickActions/QuickChatView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ struct QuickChatView: View {
8787
.padding(.vertical, 8)
8888
.padding(.bottom, isRunningOnMac ? 12 : 0)
8989
}
90-
.background(Color(.systemBackground))
90+
.background(.clear)
9191
}
9292
}
9393

0 commit comments

Comments
 (0)