Fix onboarding skip alert and empty name bypass#6072
Conversation
…pass Move .alert() modifier from Skip button to top-level VStack so the confirmation dialog renders above the 3D brain graph ZStack (#6069). Add empty text guard in sendMessage() to prevent sending whitespace-only input which could bypass the name entry step (#6071). Closes #6069 Closes #6071 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Greptile SummaryThis PR makes two focused bug fixes to Confidence Score: 5/5Safe to merge — two small, targeted, non-breaking fixes with no side effects. Both changes are minimal and correct. The alert fix follows standard SwiftUI best practice. The whitespace guard is harmless and defensive. No logic regressions, no state management changes, no new dependencies introduced. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
actor User
participant TextField
participant sendMessage
participant canSend
participant ChatProvider
User->>TextField: Types whitespace only
Note over canSend: canSend = !trimmed.isEmpty && !isSending → false
User->>TextField: Presses Enter (.onSubmit)
TextField->>sendMessage: sendMessage()
sendMessage->>canSend: guard canSend
canSend-->>sendMessage: false → return early
User->>TextField: Types real text
Note over canSend: canSend = true
User->>TextField: Presses Enter (.onSubmit)
TextField->>sendMessage: sendMessage()
sendMessage->>canSend: guard canSend → passes
sendMessage->>sendMessage: trim + guard !text.isEmpty (new defensive check)
sendMessage->>ChatProvider: sendMessage(text)
User->>User: Clicks Skip button
Note over User: showSkipConfirmation = true
Note right of User: .alert now on top-level VStack
User->>User: Alert renders above all layers
Reviews (1): Last reviewed commit: "Fix onboarding skip alert hidden behind ..." | Re-trigger Greptile |
## Summary - Move `.alert()` modifier from Skip button to top-level VStack so the skip confirmation dialog renders above the 3D brain graph ZStack (fixes BasedHardware#6069) - Add empty text guard in `sendMessage()` to prevent whitespace-only input from bypassing the name entry step (fixes BasedHardware#6071) ## Context Found via chaos engineering on the desktop onboarding flow using agent-swift. The skip confirmation alert was invisible because SwiftUI rendered it behind the brain graph's ZStack. Empty/whitespace sends could bypass the chat name entry step. ## Test plan - [ ] Click "Skip" during onboarding — confirmation dialog should appear above all content - [ ] Press Enter/Cmd+Enter with empty input — nothing should be sent - [ ] Normal onboarding flow still works end-to-end 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Summary
.alert()modifier from Skip button to top-level VStack so the skip confirmation dialog renders above the 3D brain graph ZStack (fixes Desktop onboarding: Skip confirmation dialog hidden behind 3D brain graph #6069)sendMessage()to prevent whitespace-only input from bypassing the name entry step (fixes Desktop onboarding: Empty name bypass skips entire chat step #6071)Context
Found via chaos engineering on the desktop onboarding flow using agent-swift. The skip confirmation alert was invisible because SwiftUI rendered it behind the brain graph's ZStack. Empty/whitespace sends could bypass the chat name entry step.
Test plan
🤖 Generated with Claude Code