- Add centralized formatWidgetDate() helper that handles both yyyy-MM-dd and ISO8601 formats
- Update widget date display to show "Today", "in X days", or "X days ago"
- Fix isTaskOverdue() to parse ISO8601 dates from Go API
- Remove duplicate date formatting functions from widget views
- Switch API environment back to DEV
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add DateUtils.kt for shared Kotlin date formatting with formatDate,
formatDateMedium, formatDateTime, formatRelativeDate, and isOverdue
- Add DateUtils.swift for iOS with matching date formatting functions
- Enhance ContractorDetailScreen (Android) with quick action buttons
(call, email, website, directions), clickable contact rows, residence
association, statistics section, and metadata
- Enhance ContractorDetailView (iOS) with same features, refactored into
smaller @ViewBuilder functions to fix Swift compiler type-check timeout
- Fix empty string handling in iOS - check !isEmpty in addition to != nil
for optional fields like phone, email, website, address
- Update various task and document views to use centralized DateUtils
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Kotlin/KMM:
- Update Contractor model with optional residenceId and specialties array
- Rename averageRating to rating, update address field names
- Add ContractorMinimal model for task references
- Add residence picker and multi-select specialty chips to AddContractorDialog
- Fix ContractorsScreen and ContractorDetailScreen field references
iOS:
- Rewrite ContractorFormSheet with residence and specialty pickers
- Update ContractorDetailView with FlowLayout for specialties
- Add FlowLayout component for wrapping badge layouts
- Fix ContractorCard and CompleteTaskView field references
- Update ContractorFormState with residence/specialty selection
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add NotificationPreferencesScreen (Android) and NotificationPreferencesView (iOS)
- Add NotificationPreferencesViewModel for shared business logic
- Wire up notification preferences from ProfileScreen on both platforms
- Add subscription verification on app launch for iOS (StoreKit) and Android (Google Play Billing)
- Update SubscriptionApi to match Go backend endpoints (/subscription/purchase/)
- Update StoreKit Configuration with correct product IDs and pricing ($2.99/month, $27.99/year)
- Update Android placeholder prices to match App Store pricing
- Fix NotificationPreference model to match Go backend schema
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Kotlin Shared Layer:
- Add AppleSignInRequest and AppleSignInResponse models
- Add appleSignIn method to AuthApi and APILayer
- Add appleSignInState and appleSignIn() to AuthViewModel
iOS App:
- Create AppleSignInManager for AuthenticationServices integration
- Create AppleSignInViewModel to coordinate Apple auth flow
- Update LoginView with "Sign in with Apple" button
- Add Sign in with Apple entitlement
- Add accessibility identifier for UI testing
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Update google-services.json package name to com.example.casera
- Fix Xcode project paths from MyCrib/ to Casera/
- Update app display name and usage descriptions
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Rename Kotlin package from com.example.mycrib to com.example.casera
- Update Android app name, namespace, and application ID
- Update iOS bundle identifiers and project settings
- Rename iOS directories (MyCribTests -> CaseraTests, etc.)
- Update deep link schemes from mycrib:// to casera://
- Update app group identifiers
- Update subscription product IDs
- Update all UI strings and branding
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Change residence to residence_id with @SerialName annotation
- Change contractor to contractor_id with @SerialName annotation
- Update DocumentApi.kt to use correct field names in form data and JSON requests
- Fixes iOS document creation failing with "missing residence_id" error
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add CompletionHistorySheet for viewing task completion history (Android & iOS)
- Update TaskCard and DynamicTaskCard with completion history access
- Add getTaskCompletions API endpoint to TaskApi and APILayer
- Update models (CustomTask, Document, TaskCompletion, User) for Go API alignment
- Improve TaskKanbanView with completion history integration
- Update iOS TaskViewModel with completion history loading
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Update all Kotlin API models to match Go API response structures
- Fix Swift type aliases (TaskDetail→TaskResponse, Residence→ResidenceResponse, etc.)
- Update TaskCompletionCreateRequest to simplified Go API format (taskId, notes, actualCost, photoUrl)
- Fix optional handling for frequency, priority, category, status in task models
- Replace isPrimaryOwner with ownerId comparison against current user
- Update ResidenceUsersResponse to use owner.id instead of ownerId
- Fix non-optional String fields to use isEmpty checks instead of optional binding
- Add type aliases for backwards compatibility in Kotlin models
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Load subscription status and upgrade triggers during Android app
initialization in LookupsRepository.initialize(). Previously, only
iOS was loading this data via APILayer.initializeLookups().
Without subscription data, SubscriptionHelper couldn't enforce limits
because SubscriptionCache.currentSubscription was always null.
Changes:
- Add SubscriptionApi calls to load subscription status and upgrade
triggers in parallel with other lookup data
- Clear SubscriptionCache on logout in clear() method
- Add debug logging for subscription loading
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Changes:
- Make currentTier a computed property from StoreKit instead of stored value
- Initialize StoreKit at app launch and refresh on foreground for ready subscription status
- Fix empty state logic: show empty state when limit > 0, upgrade prompt when limit = 0
- Add subscription status display in Profile screen (iOS/Android)
- Add upgrade prompts to Residences and Tasks screens for free tier users
- Improve SubscriptionHelper with better tier checking logic
iOS:
- SubscriptionCache: currentTier now computed from StoreKit.purchasedProductIDs
- StoreKitManager: add refreshSubscriptionStatus() method
- AppDelegate: initialize StoreKit at launch and refresh on app active
- ContractorsListView: use shouldShowUpgradePrompt(currentCount:limitKey:)
- WarrantiesTabContent/DocumentsTabContent: same empty state fix
- ProfileTabView: display current tier and limitations status
- ResidencesListView/ResidenceDetailView: add upgrade prompts for free users
- AllTasksView: add upgrade prompt for free users
Android:
- ContractorsScreen/DocumentsScreen: fix empty state logic
- ProfileScreen: display subscription status and limits
- ResidencesScreen/ResidenceDetailScreen: add upgrade prompts
- UpgradeFeatureScreen: improve UI layout
Shared:
- APILayer: add getSubscriptionStatus() method
- SubscriptionHelper: add hasAccessToFeature() utility
- Remove duplicate subscription checking logic
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Fixed unresolved references by matching the standard API client pattern:
- Changed from apiCall helper to try-catch pattern
- Use ApiClient.httpClient instead of direct httpClient reference
- Use ApiClient.getBaseUrl() instead of ApiConfig.baseUrl
- Added proper HttpClient parameter with default value
- Added proper error handling with response status checks
- Fixed verifyIOSReceipt to include transactionId parameter
- Fixed Android verification request format (use map instead of data class)
Now matches the pattern used by other API classes (ResidenceApi, TaskApi, etc.)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Implemented Android subscription UI components:
- UpgradeFeatureScreen: Full-screen view for restricted features (contractors, documents)
* Shows feature icon, name, and description
* Displays "This feature is available with Pro" badge
* Opens UpgradePromptDialog on button click
- UpgradePromptDialog: Modal dialog with upgrade options
* Trigger-specific title and message from backend
* Feature preview list with Material icons
* "Upgrade to Pro" button with loading state
* "Compare Free vs Pro" button
* "Maybe Later" cancel option
- FeatureComparisonDialog: Full-screen comparison table
* Free vs Pro feature comparison
* Displays data from SubscriptionCache.featureBenefits
* Default features if no data loaded
* Upgrade button
- BillingManager: Google Play Billing Library placeholder
* Singleton manager for in-app purchases
* Product query placeholder
* Purchase flow placeholder
* Backend receipt verification placeholder
* Restore purchases placeholder
All components follow Material3 design system with theme-aware colors and spacing constants.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Client-Side Changes:
- Add WarrantyStatus data class to Document model for backend-calculated status
- Update WarrantyCard to display backend status (statusText, statusColor) with client fallback
- Fix document list refresh: call loadDocuments() after create/update operations
Testing:
- Add ComprehensiveDocumentWarrantyTests with 25+ XCUITest cases
- Test document creation, update, delete, image upload
- Test warranty-specific fields and property selection
- Test both general documents and warranties
- Includes helper methods for form interaction and cleanup
Other:
- Update ApiConfig and PushNotificationManager
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit adds persistent theme storage and comprehensive documentation for Android development.
Theme Persistence:
- Created ThemeStorage with platform-specific implementations (SharedPreferences/UserDefaults)
- Updated ThemeManager.initialize() to load saved theme on app start
- Integrated ThemeStorage initialization in MainActivity and MainViewController
- Theme selection now persists across app restarts
Documentation (CLAUDE.md):
- Added comprehensive Android Design System section
- Documented all 11 themes and theme management
- Provided color system guidelines (use MaterialTheme.colorScheme)
- Documented spacing system (AppSpacing/AppRadius constants)
- Added standard component usage examples (StandardCard, FormTextField, etc.)
- Included screen patterns (Scaffold, pull-to-refresh, lists)
- Provided button and dialog patterns
- Listed key design principles for Android development
Build Status:
- ✅ Android builds successfully
- ✅ iOS builds successfully
- ✅ Theme persistence works on both platforms
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit adds a comprehensive theming system to Android matching iOS, and fixes package declarations throughout the codebase to match directory structure.
Theme System Additions:
- Added 11 themes matching iOS: Default, Teal, Ocean, Forest, Sunset, Monochrome, Lavender, Crimson, Midnight, Desert, Mint
- Created ThemeColors.kt with exact iOS color values for light/dark modes
- Added ThemeManager.kt for dynamic theme switching
- Created Spacing.kt with standardized spacing constants (xs/sm/md/lg/xl)
- Added ThemePickerDialog.kt for theme selection UI
- Integrated theme switching in ProfileScreen.kt
- Updated App.kt to observe ThemeManager for reactive theming
Component Library:
- Added StandardCard.kt and CompactCard.kt for consistent card styling
- Added FormTextField.kt with error/helper text support
- Added FormSection.kt for grouping related form fields
- Added StandardEmptyState.kt for empty state UI
Package Migration:
- Fixed all package declarations to match directory structure (com.example.mycrib.*)
- Updated package declarations in commonMain, androidMain, and iosMain
- Fixed all import statements across entire codebase
- Ensures compilation on both Android and iOS platforms
iOS Theme Rename:
- Renamed "Default" theme to "Teal" in iOS
- Renamed "Bright" theme to "Default" in iOS to make vibrant colors the default
Build Status:
- ✅ Android builds successfully
- ✅ iOS builds successfully
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Remove pagination from all Django REST Framework endpoints
- Update Kotlin API clients to return direct lists instead of paginated responses
- Update iOS ViewModels to handle direct list responses
- Remove ContractorListResponse, DocumentListResponse, and PaginatedResponse models
- Fix contractor form specialty selector loading with improved DataCache access
- Fix contractor sheet presentation to use full screen (.presentationDetents([.large]))
- Improve UI test scrolling to handle lists of any size with smart end detection
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Updated contractor models and forms to make phone field optional. Added
accessibility identifiers for add buttons to enable UI testing.
Contractor changes:
- Kotlin: Made phone nullable in Contractor, ContractorCreateRequest,
ContractorSummary models
- Android: Updated AddContractorDialog validation to only require name
- Android: Removed asterisk from phone field label
- Android: Updated ContractorDetailScreen to handle nullable phone
- iOS: Updated ContractorFormSheet validation to only check name field
- iOS: Updated form footer text to show only name as required
- iOS: Updated ContractorDetailView to use optional binding for phone display
Accessibility improvements:
- iOS: Added accessibility identifier to contractor add button in
ContractorsListView
- iOS: Added accessibility identifier to task add button in
ResidenceDetailView
These identifiers enable reliable UI testing by allowing tests to access
buttons by their accessibility identifiers instead of searching by label.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Updated Kotlin models, Android UI, and iOS UI to make all address fields
optional for residences. Only the residence name is now required.
Changes:
- Kotlin: Made propertyType, streetAddress, city, stateProvince, postalCode,
country nullable in Residence, ResidenceSummary, ResidenceWithTasks models
- Kotlin: Updated navigation routes to handle nullable address fields
- Android: Updated ResidenceFormScreen and ResidenceDetailScreen to handle nulls
- iOS: Updated ResidenceFormView validation to only check name field
- iOS: Updated PropertyHeaderCard and ResidenceCard to use optional binding
for address field displays
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Fixed issue where adding or editing a residence didn't update the residence
list, requiring manual refresh to see changes.
iOS Changes:
- ResidencesListView: Added onResidenceCreated callback to AddResidenceView
sheet that triggers loadMyResidences(forceRefresh: true)
- AddResidenceView: Added onResidenceCreated callback parameter
- ResidenceFormView: Added onSuccess callback that fires before dismissing
in both create and update modes
Android Changes:
- ResidencesScreen: Added shouldRefresh parameter with LaunchedEffect that
watches for changes and reloads residences when flag is true
- App.kt (ResidencesRoute): Read "refresh" flag from saved state handle
- App.kt (AddResidenceRoute): Set "refresh" flag in previous back stack
entry before navigating back on residence created
- App.kt (EditResidenceRoute): Set "refresh" flag before navigating back
on residence updated
Both platforms now properly refresh the residence list when:
- A new residence is added
- An existing residence is edited
- User joins a residence with code (already working)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Model type updates:
- Change decimal cost fields from String to Double for better type safety
- actualCost: String? → Double? (TaskCompletion, TaskCompletionCreateRequest)
- estimatedCost: String? → Double? (CustomTask, TaskCreateRequest, TaskDetail)
- purchasePrice: String? → Double? (Residence, ResidenceCreateRequest)
TaskDetail model fixes:
- Add missing residenceName, createdBy, createdByUsername fields
- Add missing intervalDays field to match backend response
- Remove actualCost and notes fields (not in backend TaskDetailSerializer)
- Ensure 100% compatibility with Django API TaskDetailSerializer
UI input/output conversions:
- EditTaskScreen: Convert Double to String for display, String to Double for API
- AddTaskDialog: Convert String input to Double for API requests
- CompleteTaskDialog: Convert String input to Double for API requests
- App.kt: Handle type conversions in navigation route parameters
Display improvements:
- TaskCard: Update preview data to use numeric literals (150.00 vs "150.00")
- Cost display already handles Double correctly with string interpolation
Benefits:
- Type-safe numeric handling throughout the app
- Smaller JSON payloads (numbers vs quoted strings)
- Better performance with direct numeric deserialization
- Aligns with REST API best practices
- 100% backend compatibility verified
Testing:
- All models now match backend serializer field types exactly
- Build successful with no errors
- Ready for integration with optimized Django API
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Added comprehensive usage documentation for dynamic task summary components
and updated TaskApi to rely on backend's default threshold value.
**Changes:**
**New: TASK_SUMMARY_USAGE.md**
- Complete Android usage guide for TaskSummaryCard component
- Examples of basic usage, filtering categories, and customization
- Documents all available categories and their metadata
- Shows how to use dynamic task summary in different screens
**New: iosApp/TASK_SUMMARY_USAGE_IOS.md**
- Complete iOS usage guide for TaskSummaryCard SwiftUI component
- Examples for ResidenceDetailView, ResidenceCard, and HomeScreen
- Documents SF Symbol icon usage and color parsing
- Integration examples and troubleshooting tips
**New: TaskConstants.kt**
- Created client-side constants file (currently unused)
- Contains TASK_CURRENT_THRESHOLD_DAYS = 29
- Available for future use if client needs local threshold
**Updated: TaskApi.kt**
- Changed days parameter from `days: Int = 30` to `days: Int? = null`
- Now only sends days parameter to backend if explicitly provided
- Allows backend's default threshold (29 days) to be used
- Applied to both getTasks() and getTasksByResidence()
**Updated: ApiConfig.kt**
- Minor configuration update
**Benefits:**
✅ Comprehensive documentation for both platforms
✅ Apps now use backend's default threshold value
✅ Cleaner API calls without unnecessary parameters
✅ Client can still override threshold if needed
✅ Documentation includes troubleshooting and best practices
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Updated both iOS and Android to build residence task summary UI entirely
from API response data, with no hardcoded categories, icons, colors, or labels.
**Changes:**
**Backend Integration:**
- Updated TaskSummary model to use dynamic categories list instead of static fields
- Added TaskColumnCategory and TaskColumnIcon models for metadata
- Categories now include: name, displayName, icons (ios/android/web), color, count
**Android (ResidencesScreen.kt):**
- Removed hardcoded category extraction (overdue_tasks, current_tasks, in_progress_tasks)
- Now dynamically iterates over first 3 categories from API
- Added getIconForCategory() helper to map icon names to Material Icons
- Added parseHexColor() helper that works in commonMain (no Android-specific code)
- Uses category.displayName, category.icons.android, category.color from API
**iOS (ResidenceCard.swift):**
- Removed hardcoded category extraction and SF Symbol names
- Now dynamically iterates over first 3 categories using ForEach
- Uses category.displayName, category.icons.ios, category.color from API
- Leverages existing Color(hex:) extension for color parsing
**Component Organization:**
- Moved TaskSummaryCard.kt from commonMain to androidMain (uses Android-specific APIs)
- Created TaskSummaryCard.swift for iOS with dynamic category rendering
**Benefits:**
✅ Backend controls all category metadata (icons, colors, display names)
✅ Apps automatically reflect backend changes without redeployment
✅ No platform-specific hardcoded values
✅ Single source of truth in task/constants.py TASK_COLUMNS
**Files Changed:**
- Residence.kt: Added TaskColumnCategory, TaskColumnIcon models
- ResidencesScreen.kt: Dynamic category rendering with helpers
- ResidenceCard.swift: Dynamic category rendering with ForEach
- TaskSummaryCard.kt: Moved to androidMain
- TaskSummaryCard.swift: New iOS dynamic component
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Created ErrorMessageParser utility for both iOS (Swift) and Android (Kotlin)
- Parser detects JSON-formatted error messages and extracts user-friendly text
- Identifies when data objects (not errors) are returned and provides generic messages
- Updated all API error handling to pass raw error bodies instead of concatenating
- Applied ErrorMessageParser across all ViewModels and screens on both platforms
- Fixed ContractorApi and DocumentApi to not concatenate error bodies with messages
- Updated ApiResultHandler to automatically parse all error messages
- Error messages now show "Request failed. Please check your input and try again." instead of raw JSON
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Applied the new error handling utilities to ResidencesScreen and
ResidenceDetailScreen, replacing inline error displays with popup dialogs.
Changes:
- ResidencesScreen: Replaced inline error UI with ApiResultHandler
- Shows error dialog popup instead of error message in center of screen
- Maintains all functionality while improving UX
- ResidenceDetailScreen: Comprehensive error handling implementation
- Main residence loading uses ApiResultHandler with custom loading content
- Generate report operation uses HandleErrors() extension
- Delete residence operation uses HandleErrors() extension
- All operations now show retry/cancel dialogs on error
Benefits:
- Consistent error handling UX across screens
- Users can retry failed operations without navigating away
- Cleaner code with less boilerplate error handling
- Error dialogs are non-blocking and dismissible
These screens now demonstrate the pattern for implementing error handling
across the rest of the app using the error handling utilities.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Created reusable error handling components that can be used across all
screens in both Android and iOS apps to show retry/cancel dialogs when
network calls fail.
Android Components:
- ApiResultHandler: Composable that automatically handles ApiResult states
with loading indicators and error dialogs
- HandleErrors(): Extension function for ApiResult to show error dialogs
for operations that don't return display data
- Updated ResidencesScreen to import ApiResultHandler
iOS Components:
- ViewStateHandler: SwiftUI view that handles loading/error/success states
with automatic error alerts
- handleErrors(): View modifier for automatic error monitoring
- Both use the existing ErrorAlertModifier for consistent alerts
Documentation:
- Created ERROR_HANDLING.md with comprehensive usage guide
- Includes examples for data loading and create/update/delete operations
- Migration guide for updating existing screens
- Best practices and testing guidelines
These utilities make it easy to add consistent error handling with retry
functionality to any screen that makes network calls, improving the user
experience across the entire app.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Implemented user-friendly error handling for network call failures:
Android (Compose):
- Created reusable ErrorDialog component with retry and cancel buttons
- Updated TasksScreen to show error dialog popup instead of inline error
- Error dialog appears when network calls fail with option to retry
iOS (SwiftUI):
- Created ErrorAlertModifier and ErrorAlertInfo helpers
- Added .errorAlert() view modifier for consistent error handling
- Updated TaskFormView to show error alerts with retry/cancel options
- Error alerts appear when task creation or other network calls fail
Both platforms now provide a consistent user experience when network
errors occur, giving users the choice to retry the operation or cancel.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Added order_id field to TaskCategory, TaskPriority, and TaskStatus models
to support custom ordering of lookup values from the API.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
The completion_date should be provided by the client, not auto-generated
by the backend. Backend has been updated to accept this field.
This allows clients to specify when the task was actually completed,
which may be different from when the completion record is created.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
The completion_date field is automatically set by the backend (auto_now_add)
and should not be sent in the create request. Removed this field from
TaskCompletionCreateRequest to match the API expectations.
Backend TaskCompletion model sets completion_date automatically, so
clients should not provide it when creating a completion.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Updated CustomTask to use nested objects for category, frequency,
priority, and status instead of strings to match the API's actual
response format after recent serializer changes.
Changes:
- category: String → TaskCategory?
- Added frequency: TaskFrequency
- priority: String → TaskPriority
- status: String? → TaskStatus?
- Added next_scheduled_date field
- Added completion_count field
This fixes the JSON parsing error when creating/updating tasks via
the iOS and Android apps, which was caused by the API returning
nested objects like {"id": 21, "name": "Flooring"} but the model
expecting simple strings.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
iOS:
- Add archive task confirmation to TaskActionButtons.swift
- Add archive task confirmation to AllTasksView.swift
- Add cancel and archive task confirmations to ResidenceDetailView.swift
- Fix generatePropertyReport call to use new method signature
Android:
- Add cancel task confirmation to ResidenceDetailScreen.kt
- Add archive task confirmation to ResidenceDetailScreen.kt
All destructive task actions (cancel, archive/delete) now require user confirmation with clear warning messages before proceeding.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Remove AppColors struct, migrate to iOS system colors throughout
- Redesign ContractorFormSheet to use native SwiftUI Form components
- Add color-coded icons to contractor form sections
- Improve dark mode contrast for task cards
- Add background colors to document detail fields
- Fix text alignment issues in ContractorDetailView
- Make task completion lists expandable/collapsible by default
- Clear app badge on launch and when app becomes active
- Update button styling with proper gradients and shadows
- Improve form field focus states and accessibility
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Remove AppColors object, migrate to Material3 semantic colors throughout
- Add collapsible dropdown menu for task card actions
- Implement pull-to-refresh on Residences, Documents, and Contractors screens
- Add refresh button to All Tasks screen with forceRefresh support
- Fix nullable function reference error in TaskCard (make onEditClick nullable)
- Fix layout padding issues on All Tasks and Tasks screens
- Remove unused AppColors import from HomeScreen
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Refactored ContractorFormSheet to follow SwiftUI best practices
- Moved Field enum outside struct and renamed to ContractorFormField
- Extracted body into computed properties for better readability
- Replaced deprecated NavigationView with NavigationStack
- Fixed input field contrast in light mode by adding borders
- Fixed force cast in loadContractorSpecialties
- Refactored TaskFormView to eliminate screen flickering
- Moved Field enum outside struct and renamed to TaskFormField
- Fixed conditional view structure that caused flicker on load
- Used ZStack with overlay instead of if/else for loading state
- Changed to .task modifier for proper async initialization
- Made loadLookups properly async and fixed force casts
- Replaced deprecated NavigationView with NavigationStack
- Integrated PushNotificationManager with APILayer
- Updated registerDeviceWithBackend to use APILayer.shared.registerDevice()
- Updated updateNotificationPreferences to use APILayer
- Updated getNotificationPreferences to use APILayer
- Added proper error handling with try-catch pattern
- Added notification operations to APILayer
- Added NotificationApi instance
- Implemented registerDevice, unregisterDevice
- Implemented getNotificationPreferences, updateNotificationPreferences
- Implemented getNotificationHistory, markNotificationAsRead
- Implemented markAllNotificationsAsRead, getUnreadCount
- All methods follow consistent pattern with auth token handling
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Added StaticDataResponse model to combine all lookup data
- Added getStaticData() method to LookupsApi
- Updated LookupsRepository to fetch all lookups in single API call
- Added updateAllLookups() method to DataCache for batch updates
- Reduces network requests from 6 to 1 for initial data load
- Improves app startup performance with Redis-cached response
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Major architectural improvements:
- Created APILayer as single entry point for all network operations
- Integrated cache-first reads with automatic cache updates on mutations
- Migrated all shared Kotlin ViewModels to use APILayer instead of direct API calls
- Migrated iOS ViewModels to wrap shared Kotlin ViewModels with StateFlow observation
- Replaced LookupsManager with DataCache for centralized lookup data management
- Added password reset methods to AuthViewModel
- Added task completion and update methods to APILayer
- Added residence user management methods to APILayer
iOS specific changes:
- Updated LoginViewModel, RegisterViewModel, ProfileViewModel to use shared AuthViewModel
- Updated ContractorViewModel, DocumentViewModel to use shared ViewModels
- Updated ResidenceViewModel to use shared ViewModel and APILayer
- Updated TaskViewModel to wrap shared ViewModel with callback-based interface
- Migrated PasswordResetViewModel and VerifyEmailViewModel to shared AuthViewModel
- Migrated AllTasksView, CompleteTaskView, EditTaskView to use APILayer
- Migrated ManageUsersView, ResidenceDetailView to use APILayer
- Migrated JoinResidenceView to use async/await pattern with APILayer
- Removed LookupsManager.swift in favor of DataCache
- Fixed PushNotificationManager @MainActor issue
- Converted all direct API calls to use async/await with proper error handling
Benefits:
- Reduced code duplication between iOS and Android
- Consistent error handling across platforms
- Automatic cache management for better performance
- Centralized network layer for easier testing and maintenance
- Net reduction of ~700 lines of code through shared logic
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit adds a comprehensive caching system that loads all data
on app launch and keeps it in memory, eliminating redundant API calls
when navigating between screens.
Core Implementation:
- DataCache: Singleton holding all app data in StateFlow
- DataPrefetchManager: Loads all data in parallel on app launch
- Automatic cache updates on create/update/delete operations
Features:
- ✅ Instant screen loads from cached data
- ✅ Reduced API calls (no redundant requests)
- ✅ Better UX (no loading spinners on navigation)
- ✅ Offline support (data remains available)
- ✅ Consistent state across all screens
Cache Contents:
- Residences (all + my residences + summaries)
- Tasks (all tasks + tasks by residence)
- Documents (all + by residence)
- Contractors (all)
- Lookup data (categories, priorities, frequencies, statuses)
ViewModels Updated:
- ResidenceViewModel: Uses cache with forceRefresh option
- TaskViewModel: Uses cache with forceRefresh option
- Updates cache on successful create/update/delete
iOS Integration:
- Data prefetch on successful login
- Cache cleared on logout
- Background prefetch doesn't block authentication
Usage:
// Load from cache (instant)
viewModel.loadResidences()
// Force refresh from API
viewModel.loadResidences(forceRefresh: true)
Next Steps:
- Update DocumentViewModel and ContractorViewModel (same pattern)
- Add Android MainActivity integration
- Add pull-to-refresh support
See composeApp/src/commonMain/kotlin/com/example/mycrib/cache/README_CACHING.md
for complete documentation and implementation guide.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit adds extensive unit test coverage for the entire application,
including iOS ViewModels, design system, and shared Kotlin Multiplatform code.
iOS Unit Tests (49 tests):
- LoginViewModelTests: Authentication state and validation tests
- ResidenceViewModelTests: Residence loading and state management
- TaskViewModelTests: Task operations (cancel, archive, mark progress)
- DocumentViewModelTests: Document/warranty CRUD operations
- ContractorViewModelTests: Contractor management and favorites
- DesignSystemTests: Color system, typography, spacing, radius, shadows
Shared KMM Unit Tests (26 tests):
- AuthViewModelTest: Login, register, verify email state initialization
- TaskViewModelTest: Task state management verification
- DocumentViewModelTest: Document state initialization tests
- ResidenceViewModelTest: Residence state management tests
- ContractorViewModelTest: Contractor state initialization tests
Test Infrastructure:
- Reorganized test files from iosAppUITests to MyCribTests
- All shared KMM tests passing successfully (./gradlew test)
- Tests focus on state initialization and core functionality
- Ready for CI/CD integration
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit ensures both platforms properly support light and dark mode with automatic switching based on system settings.
## iOS Changes
- Updated DesignSystem.swift to use adaptive system colors
- Changed neutral colors to use UIKit system colors:
- background: systemGroupedBackground
- surface: secondarySystemGroupedBackground
- text colors: label, secondaryLabel, tertiaryLabel
- borders: separator, opaqueSeparator
- Colors now automatically adapt to light/dark mode
- Info.plist already configured to support both modes
## Android Changes
- Updated AndroidManifest.xml app theme
- Changed from Theme.Material.Light.NoActionBar to Theme.Material.NoActionBar
- Allows app to respect system dark mode settings
- Theme.kt already has complete light/dark color schemes
- MyCribTheme automatically switches based on system settings
## Testing
- iOS: Toggle Settings → Display & Brightness → Appearance
- Android: Toggle Settings → Display → Dark theme
- Both platforms automatically update colors
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit completes the DRY refactoring by implementing the missing document form functionality and enhancing user experience with better error messages.
## iOS Document Forms
- Implemented complete createDocument() method in DocumentViewModel:
- Support for all warranty-specific fields (itemName, modelNumber, serialNumber, provider, etc.)
- Multiple image uploads with JPEG compression
- Proper UIImage to KotlinByteArray conversion
- Async completion handlers
- Implemented updateDocument() method with full field support
- Completed DocumentFormView submitForm() implementation with proper API calls
- Fixed type conversion issues (Bool/KotlinBoolean, Int32/KotlinInt)
- Added proper error handling and user feedback
## iOS Login Error Handling
- Enhanced error messages to be user-friendly and concise
- Added specific messages for common HTTP error codes (400, 401, 403, 404, 500+)
- Implemented cleanErrorMessage() helper to remove technical jargon
- Added network-specific error handling (connection, timeout)
- Fixed MainActor isolation warnings with proper Task wrapping
## Code Quality
- Removed ~4,086 lines of duplicate code through form consolidation
- Added 429 lines of new shared form components
- Fixed Swift compiler performance issues
- Ensured both iOS and Android builds succeed
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Integrated Firebase Cloud Messaging (FCM) for Android
- Integrated Apple Push Notification Service (APNs) for iOS
- Created shared notification models and API client
- Added device registration and token management
- Added notification permission handling for Android
- Created PushNotificationManager for iOS with AppDelegate
- Added placeholder google-services.json (needs to be replaced with actual config)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Simplify image parameter passing in task completion ViewModels
- Pass ImageData objects directly instead of separate bytes and filenames
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add Swift ImageCompression helper to enforce 200KB limit on iOS
- Update iOS views to use compression for all image uploads
- Fix iOS EditDocumentView to show success only after all uploads complete
- Add AsyncImage thumbnails to Android EditDocumentScreen
- Fix Android success message visibility with delay before state reset
- Add proper error handling for failed image uploads
- Add resetUpdateState on error for consistency
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>