Skip to content

Commit a774dbc

Browse files
committed
Update floating bar onboarding Mac lineup
1 parent 5dd2d6e commit a774dbc

File tree

5 files changed

+59
-61
lines changed

5 files changed

+59
-61
lines changed

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ Key rules:
118118
- Dev bundle ID: `com.omi.desktop-dev`. Prod: `com.omi.computer-macos`.
119119
- App flows & exploration skill: See `desktop/e2e/SKILL.md` for navigation architecture, interaction patterns, and reference flows.
120120
- Full command reference: `agent-swift --help` or `agent-swift schema`.
121+
- When asked to build or rebuild the desktop app for testing, don't stop at a successful compile: launch the dev app, interact with it programmatically to confirm it actually runs, and report any environment blocker if full interaction is impossible.
121122

122123
## Formatting
123124

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ agent-swift screenshot /tmp/after-change.png # capture app window
174174
- Works with any macOS app (SwiftUI, AppKit, Electron) — no Marionette or app-side setup.
175175
- Bundle ID for dev: `com.omi.desktop-dev`. For prod: `com.omi.computer-macos`.
176176
- **App flows & exploration skill**: See `desktop/e2e/SKILL.md` for navigation architecture, screen map, interaction patterns (click vs press), and known flows. Read this when developing features or exploring the app.
177+
- When asked to build or rebuild the desktop app for testing, don't stop at a successful compile: launch the dev app, interact with it programmatically to confirm it actually runs, and report any environment blocker if full interaction is impossible.
177178

178179
## Formatting
179180
<!-- Maintainers: @Thinh (Jan 19) -->

desktop/Desktop/Sources/Chat/ACPBridge.swift

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -827,9 +827,17 @@ actor ACPBridge {
827827

828828
// 3. Check relative to current working directory
829829
let cwdPath = FileManager.default.currentDirectoryPath
830-
let cwdScript = (cwdPath as NSString).appendingPathComponent("acp-bridge/dist/index.js")
831-
if FileManager.default.fileExists(atPath: cwdScript) {
832-
return cwdScript
830+
let cwdCandidates = [
831+
"acp-bridge/dist/index.js",
832+
"desktop/acp-bridge/dist/index.js",
833+
"../desktop/acp-bridge/dist/index.js",
834+
]
835+
for relativePath in cwdCandidates {
836+
let candidate = (cwdPath as NSString).appendingPathComponent(relativePath)
837+
let resolved = (candidate as NSString).standardizingPath
838+
if FileManager.default.fileExists(atPath: resolved) {
839+
return resolved
840+
}
833841
}
834842

835843
return nil

desktop/Desktop/Sources/OnboardingFloatingBarDemoView.swift

Lines changed: 46 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,12 @@ struct OnboardingFloatingBarDemoView: View {
1111

1212
@State private var barActivated = false
1313
@State private var showContinue = false
14-
@State private var pulseAnimation = false
15-
@State private var keyMonitor: Any?
1614

1715
var body: some View {
1816
VStack(spacing: 0) {
1917
// Header
2018
HStack {
21-
Text("Ask omi anything")
19+
Text("Ask omi which Mac fits you")
2220
.font(.system(size: 18, weight: .semibold))
2321
.foregroundColor(OmiColors.textPrimary)
2422

@@ -40,38 +38,21 @@ struct OnboardingFloatingBarDemoView: View {
4038
Spacer()
4139

4240
// Content
43-
VStack(spacing: 28) {
44-
// Icon with glow
45-
ZStack {
46-
Circle()
47-
.fill(OmiColors.purplePrimary.opacity(0.12))
48-
.frame(width: 96, height: 96)
49-
.blur(radius: 18)
50-
.scaleEffect(pulseAnimation ? 1.15 : 1.0)
51-
.animation(.easeInOut(duration: 2).repeatForever(autoreverses: true), value: pulseAnimation)
52-
53-
Image(systemName: "rectangle.and.text.magnifyingglass")
54-
.font(.system(size: 40))
55-
.foregroundStyle(
56-
LinearGradient(
57-
colors: [OmiColors.purplePrimary, OmiColors.purpleSecondary],
58-
startPoint: .topLeading,
59-
endPoint: .bottomTrailing
60-
)
61-
)
62-
}
63-
.onAppear { pulseAnimation = true }
41+
VStack(spacing: 24) {
42+
MacLineupPreview()
43+
.frame(maxWidth: 980)
6444

65-
VStack(spacing: 10) {
45+
VStack(spacing: 12) {
6646
Text("The Floating Bar")
6747
.font(.system(size: 24, weight: .bold))
6848
.foregroundColor(OmiColors.textPrimary)
6949

70-
Text("Ask anything and it responds using\neverything it knows about you.")
50+
Text("Try asking: Which computer suits me best?")
7151
.font(.system(size: 14))
7252
.foregroundColor(OmiColors.textSecondary)
7353
.multilineTextAlignment(.center)
7454
.lineSpacing(4)
55+
.frame(maxWidth: 560)
7556
}
7657

7758
if !barActivated {
@@ -100,6 +81,7 @@ struct OnboardingFloatingBarDemoView: View {
10081
.transition(.opacity)
10182
}
10283
}
84+
.padding(.top, 88)
10385
.padding(.horizontal, 40)
10486

10587
Spacer()
@@ -125,24 +107,28 @@ struct OnboardingFloatingBarDemoView: View {
125107
.onAppear {
126108
// Set up the real floating bar (creates the window if needed)
127109
FloatingControlBarManager.shared.setup(appState: appState, chatProvider: chatProvider)
128-
// Unregister global shortcuts so we handle Cmd+Enter ourselves
129-
GlobalShortcutManager.shared.unregisterShortcuts()
130-
installKeyMonitor()
110+
// Use the same global shortcut flow as the normal app so onboarding
111+
// behaves like production when the user presses Cmd+Enter.
112+
GlobalShortcutManager.shared.registerShortcuts()
131113
}
132114
.onDisappear {
133-
removeKeyMonitor()
134115
// Close the AI conversation panel on the floating bar so the next step starts clean
135116
if FloatingControlBarManager.shared.barState?.showingAIConversation == true {
136117
FloatingControlBarManager.shared.toggleAIInput()
137118
}
138-
// Re-register global shortcuts for subsequent steps and normal use
139-
GlobalShortcutManager.shared.registerShortcuts()
140119
}
141120
.onChange(of: barActivated) { _, activated in
142121
if activated {
143122
Task { await waitForResponse() }
144123
}
145124
}
125+
.onReceive(Timer.publish(every: 0.25, on: .main, in: .common).autoconnect()) { _ in
126+
guard !barActivated,
127+
FloatingControlBarManager.shared.barState?.showingAIConversation == true else { return }
128+
withAnimation(.spring(response: 0.4, dampingFraction: 0.8)) {
129+
barActivated = true
130+
}
131+
}
146132
}
147133

148134
// MARK: - Response Observer
@@ -169,32 +155,6 @@ struct OnboardingFloatingBarDemoView: View {
169155
}
170156
}
171157

172-
// MARK: - Key Monitor
173-
174-
private func installKeyMonitor() {
175-
keyMonitor = NSEvent.addLocalMonitorForEvents(matching: .keyDown) { event in
176-
let mods = event.modifierFlags.intersection(.deviceIndependentFlagsMask)
177-
if mods == .command && event.keyCode == 36 { // 36 = Return
178-
if !barActivated {
179-
// Activate the real floating bar's AI input
180-
FloatingControlBarManager.shared.openAIInput()
181-
withAnimation(.spring(response: 0.4, dampingFraction: 0.8)) {
182-
barActivated = true
183-
}
184-
return nil
185-
}
186-
}
187-
return event
188-
}
189-
}
190-
191-
private func removeKeyMonitor() {
192-
if let monitor = keyMonitor {
193-
NSEvent.removeMonitor(monitor)
194-
keyMonitor = nil
195-
}
196-
}
197-
198158
// MARK: - Key Cap
199159

200160
private func keyCap(_ key: String) -> some View {
@@ -214,3 +174,31 @@ struct OnboardingFloatingBarDemoView: View {
214174
)
215175
}
216176
}
177+
178+
private struct MacLineupPreview: View {
179+
private static let lineupImage: NSImage? = {
180+
guard let url = Bundle.resourceBundle.url(forResource: "onboarding_mac_lineup", withExtension: "png") else { return nil }
181+
return NSImage(contentsOf: url)
182+
}()
183+
184+
var body: some View {
185+
Group {
186+
if let nsImage = Self.lineupImage {
187+
Image(nsImage: nsImage)
188+
.resizable()
189+
.interpolation(.high)
190+
.scaledToFit()
191+
.clipShape(RoundedRectangle(cornerRadius: 24, style: .continuous))
192+
} else {
193+
RoundedRectangle(cornerRadius: 24)
194+
.fill(Color.white.opacity(0.06))
195+
.frame(height: 280)
196+
.overlay(
197+
Text("Mac lineup image unavailable")
198+
.font(.system(size: 14, weight: .medium))
199+
.foregroundColor(OmiColors.textTertiary)
200+
)
201+
}
202+
}
203+
}
204+
}
265 KB
Loading

0 commit comments

Comments
 (0)