Skip to content

Address Greptile review on onboarding feature showcase#461

Merged
FuJacob merged 1 commit into
mainfrom
fix/onboarding-showcase-greptile
May 31, 2026
Merged

Address Greptile review on onboarding feature showcase#461
FuJacob merged 1 commit into
mainfrom
fix/onboarding-showcase-greptile

Conversation

@FuJacob

@FuJacob FuJacob commented May 31, 2026

Copy link
Copy Markdown
Owner

Summary

Follow-up to #459 addressing the three Greptile findings on OnboardingFeatureShowcase:

  • The showcase is purely decorative, so it now sets .accessibilityHidden(true) to keep mid-animation text fragments out of VoiceOver.
  • GhostTextDemoCard now resets typedCount = 0 inside its closing fade-out animation, matching EmojiPickerDemoCard so the typed text fades instead of snapping blank between loops.
  • The emoji candidate ForEach now keys on the stable alias string instead of the array index (\.offset).

Validation

swiftlint lint --strict --quiet Cotabby/UI/Onboarding/OnboardingFeatureShowcase.swift
# exit 0

xcodebuild -project Cotabby.xcodeproj -scheme Cotabby -destination 'platform=macOS' build
# ** BUILD SUCCEEDED **

Linked issues

Refs #459.

Risk / rollout notes

Onboarding-only, decorative view. No behavior change to suggestions, settings, or any service.

Greptile Summary

This PR is a follow-up cleanup to #459, applying three targeted fixes to OnboardingFeatureShowcase.swift based on a prior review. All changes are isolated to a single decorative, onboarding-only file with no impact on the real suggestion pipeline, settings, or services.

  • Accessibility: .accessibilityHidden(true) is now applied to the top-level VStack in OnboardingFeatureShowcase, preventing mid-animation text fragments from being read by VoiceOver.
  • Ghost text reset fix: typedCount = 0 is moved inside the closing withAnimation block in GhostTextDemoCard, matching EmojiPickerDemoCard so the typed text fades out smoothly instead of snapping blank between loops.
  • Stable ForEach ID: The DemoEmojiPopup candidate list now uses id: \.element.alias (a stable string) instead of id: \.offset (an array index), avoiding potential SwiftUI identity churn.

Confidence Score: 5/5

Safe to merge — all three changes are correct, confined to a single decorative onboarding view, and have no effect on any real app functionality.

The three changes are straightforward and well-matched to the problems they solve. Moving typedCount = 0 into the animation block is consistent with how EmojiPickerDemoCard already handles its own reset. The ForEach key change from \.offset to \.element.alias is valid given the hardcoded, distinct alias values. The .accessibilityHidden(true) placement on the top-level VStack correctly covers both child cards. No logic errors, no regressions, no edge cases left unaddressed.

No files require special attention — the single changed file is a self-contained decorative view.

Important Files Changed

Filename Overview
Cotabby/UI/Onboarding/OnboardingFeatureShowcase.swift Three targeted fixes: accessibility hidden on the top-level view, typedCount reset moved into the fade-out animation block, and ForEach ID changed from offset to stable alias string. All changes are correct and consistent with sibling patterns in the file.

Sequence Diagram

sequenceDiagram
    participant Task as .task loop
    participant State as @State (typedCount / showGhost / accepted)
    participant View as SwiftUI View

    Note over Task,View: GhostTextDemoCard animation loop
    Task->>State: "typedCount = 0, showGhost = false, accepted = false (direct)"
    loop type each character
        Task->>State: "typedCount += 1"
        View-->>View: re-render typed text
    end
    Task->>State: "withAnimation { showGhost = true }"
    View-->>View: ghost text fades in
    Task->>State: "withAnimation { accepted = true }"
    View-->>View: ghost turns primary color
    Task->>State: "withAnimation { showGhost=false, accepted=false, typedCount=0 } NEW"
    View-->>View: typed text + ghost fade out smoothly
    Note right of State: Previously typedCount=0 was bare assignment at loop top
Loading

Reviews (1): Last reviewed commit: "Address Greptile review on onboarding sh..." | Re-trigger Greptile

- Hide the decorative showcase from VoiceOver via .accessibilityHidden(true)
- Reset typedCount inside the ghost card's fade-out so it doesn't snap blank
- Identify emoji candidate rows by stable alias instead of array index
@FuJacob FuJacob merged commit ebe7872 into main May 31, 2026
4 checks passed
@FuJacob FuJacob deleted the fix/onboarding-showcase-greptile branch May 31, 2026 02:29
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.

1 participant