Skip to content

Fix onboarding skip alert and empty name bypass#6072

Merged
beastoin merged 1 commit into
mainfrom
worktree-fix-onboarding-flaws
Mar 27, 2026
Merged

Fix onboarding skip alert and empty name bypass#6072
beastoin merged 1 commit into
mainfrom
worktree-fix-onboarding-flaws

Conversation

@beastoin
Copy link
Copy Markdown
Collaborator

Summary

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

…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>
@beastoin beastoin merged commit fae79e4 into main Mar 27, 2026
3 checks passed
@beastoin beastoin deleted the worktree-fix-onboarding-flaws branch March 27, 2026 01:48
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Mar 27, 2026

Greptile Summary

This PR makes two focused bug fixes to OnboardingChatView.swift found via chaos engineering on the desktop onboarding flow.\n\n- Alert z-ordering fix: The .alert(\"Are you sure?\", ...) modifier was previously attached to the Skip Button deep inside a nested HStack. It has been moved to the top-level VStack(spacing: 0) that forms the view's body. This is the correct SwiftUI pattern — attaching an alert to the root view ensures it is presented above all descendant views, including any ZStack-based overlays (like the brain graph referenced in the PR).\n\n- Whitespace-only send guard: guard !text.isEmpty else { return } is added in sendMessage() after let text = inputText.trimmingCharacters(in: .whitespacesAndNewlines). This is a sound defensive check. Worth noting that the existing canSend computed property (line 568) already requires !inputText.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty, so the new guard is redundant in the normal call paths (both .onSubmit and the send Button). However, it adds explicit protection if sendMessage() is ever called from a new code path that doesn't go through the canSend gate, and it makes the function's intent self-documenting.\n\nBoth changes are minimal, non-breaking, and correctly address the reported issues.

Confidence Score: 5/5

Safe 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

Filename Overview
desktop/Desktop/Sources/OnboardingChatView.swift Two targeted fixes: alert modifier moved from Skip button to top-level VStack to fix z-ordering with 3D brain graph; empty-text guard added to sendMessage() as defensive belt-and-suspenders against whitespace-only sends (already caught by existing canSend check).

Sequence Diagram

sequenceDiagram
    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
Loading

Reviews (1): Last reviewed commit: "Fix onboarding skip alert hidden behind ..." | Re-trigger Greptile

shaneholloman pushed a commit to shaneholloman/omi that referenced this pull request Mar 27, 2026
Glucksberg pushed a commit to Glucksberg/omi-local that referenced this pull request Apr 28, 2026
## 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)
Glucksberg pushed a commit to Glucksberg/omi-local that referenced this pull request Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Desktop onboarding: Empty name bypass skips entire chat step Desktop onboarding: Skip confirmation dialog hidden behind 3D brain graph

1 participant