6.4 KiB
6.4 KiB
32. iOS App — Dashboard and Service Screens (DarkWatch, VoicePrint, SpamShield, etc.)
meta: id: shieldai-unified-restructure-32 feature: shieldai-unified-restructure priority: P1 depends_on: [shieldai-unified-restructure-28, shieldai-unified-restructure-29, shieldai-unified-restructure-30, shieldai-unified-restructure-31] tags: [ios, swiftui, dashboard, services, mobile]
objective:
- Build the main dashboard and all service-specific screens for the iOS app. These should mirror the web app's functionality while using native iOS UI patterns (lists, forms, sheets, charts).
deliverables:
iOS/ShieldAI/Views/Dashboard/DashboardView.swift— Main dashboard:- Scrollable vertical stack of widgets
- Threat score gauge (circular progress ring)
- Recent alerts list (top 5)
- Service summary cards (DarkWatch, VoicePrint, SpamShield, HomeTitle, RemoveBrokers)
- Quick action buttons
- Pull-to-refresh
iOS/ShieldAI/Views/Dashboard/AlertDetailView.swift— Alert detail:- Full alert information
- Correlated alerts section
- "Mark as resolved" and "False positive" actions
iOS/ShieldAI/Views/Services/DarkWatchView.swift— DarkWatch screen:- Watchlist items list with add/remove
- Exposures list with severity badges
- Exposure detail with source info and recommendations
- "Run scan" button
iOS/ShieldAI/Views/Services/VoicePrintView.swift— VoicePrint screen:- Voice enrollments list with play/delete
- "Enroll voice" button → opens recording sheet
- Analysis history list
- Analysis detail with confidence and verdict
iOS/ShieldAI/Views/Services/SpamShieldView.swift— SpamShield screen:- Blocked calls/SMS statistics
- Custom rules list with add/edit/delete
- Number check input with result
- "Report spam" button
iOS/ShieldAI/Views/Services/HomeTitleView.swift— HomeTitle screen:- Watched properties list with add/remove
- Property detail with snapshots and changes
- Map view showing property location (MapKit)
- "Run scan" button
iOS/ShieldAI/Views/Services/RemoveBrokersView.swift— RemoveBrokers screen:- Broker registry list with search/filter
- Removal requests list with status
- Request detail with progress timeline
- "Start removal" button
iOS/ShieldAI/Views/Settings/SettingsView.swift— Settings:- Account info, subscription details
- Notification preferences toggle
- Theme selection (light/dark/system)
- Biometric auth toggle
- Family group management
- Logout button
steps:
- Create view directories:
Dashboard/,Services/,Settings/. - DashboardView:
ScrollViewwithVStack- Threat score:
Canvasor customViewwith circular progress ring - Alerts:
ForEachoveralertsarray, each asShieldCardrow - Service cards: horizontal scroll or grid of compact cards
- Quick actions:
HStackof icon buttons .refreshablemodifier for pull-to-refresh
- AlertDetailView:
ScrollViewwith sections- Severity badge at top
- Description and metadata
- Correlated alerts in a nested list
- Action buttons at bottom
- DarkWatchView:
Listwith sections: Watchlist, Exposures- Watchlist items: swipe-to-delete, tap to edit
- Add button → sheet with form
- Exposures: tap to open detail
- VoicePrintView:
- Enrollments section with audio playback (AVFoundation)
- "Enroll" button →
RecordingViewsheet with waveform visualization - Analysis list with verdict color coding
- SpamShieldView:
- Stats cards at top
- Rules list with toggle for active/inactive
- Number check:
ShieldTextField+ check button → result card
- HomeTitleView:
- Properties list with address and status
- Add property: address search with geocoding
- Property detail:
Mapview, snapshot history, changes list
- RemoveBrokersView:
- Broker list with category filters
- Request list with status badges and progress bars
- Start removal: sheet with broker selection and personal info form
- SettingsView:
Formwith sections: Account, Preferences, Family, Danger Zone- Use native
Toggle,Picker,NavigationLink - Subscription info with upgrade button
- Wire all views to API client (task 31):
- Use
@StateObjectview models that call TRPCBridge - Show
ShieldSkeletonwhile loading - Show
ShieldEmptyStatewhen lists are empty - Handle errors with
ShieldToastor inline messages
- Use
steps:
- Unit: Each view model fetches data correctly from mocked API
- Unit: DashboardView displays correct widget count
- Visual: All screens use theme tokens and adapt to dark mode
- E2E: Navigate through all service screens and verify data loads
- E2E: Perform CRUD operations (add watchlist item, delete enrollment, create rule)
acceptance_criteria:
- Dashboard displays threat score, alerts, service summaries, and quick actions
- All 5 service screens (DarkWatch, VoicePrint, SpamShield, HomeTitle, RemoveBrokers) load and display data
- Each service screen supports core CRUD operations
- Alert detail shows full information and correlation group
- Settings screen allows managing account, preferences, and family
- Pull-to-refresh updates dashboard data
- All screens show loading skeletons and empty states appropriately
- Navigation between screens works smoothly with native iOS transitions
validation:
- Launch app, login, and verify dashboard renders with real data
- Tap each service tab and verify screen loads
- Add a watchlist item in DarkWatch and verify it appears in list
- Delete a voice enrollment and verify it disappears
- Create a spam rule and verify it applies
- Toggle settings and verify preferences persist
- Run unit tests via Xcode Cmd+U
notes:
- Use native iOS patterns:
Listfor scrollable data,Formfor settings,Sheetfor modals,.contextMenufor actions. - For the threat score gauge, consider using a SwiftUI charting library like
SwiftUI Charts(iOS 16+) or a customCanvasdrawing. - The map in HomeTitle should use
Map(iOS 17+) orMKMapViewwrapped inUIViewRepresentablefor older versions. - Voice recording requires microphone permission. Add
NSMicrophoneUsageDescriptionto Info.plist. - Keep view models separate from views for testability. View models should own the
@Publishedstate and API calls. - Consider using
Taskand.taskmodifier for async data loading instead ofonAppearto handle cancellation correctly.