Commit Graph

43 Commits

Author SHA1 Message Date
Trey t
1a4b5d07bf Refactor task completion image handling
- 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>
2025-11-11 21:45:12 -06:00
Trey t
22949d18a7 Add image compression and improve document edit UI
- 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>
2025-11-11 21:23:22 -06:00
Trey t
7740438ea6 Add image upload functionality to iOS EditDocumentView
Added the ability to add and remove images when editing documents on iOS:

Backend API (DocumentApi.kt):
- Added uploadDocumentImage() method to upload images to existing documents
- Sends multipart/form-data with document ID, image bytes, and optional caption

iOS EditDocumentView:
- Added PhotosPicker for selecting images from library
- Added camera button (placeholder for future implementation)
- Added display of new images with thumbnails
- Added ability to remove new images before saving
- Updated saveDocument() to upload new images after updating metadata
- Shows total image count (existing + new, max 10)

Android formatFileSize fix:
- Changed from String.format() to simple division for KMM compatibility
- Rounds to 1 decimal place using integer arithmetic

Note: iOS has a known SwiftUI toolbar ambiguity issue that needs fixing.
The functionality is complete, just needs syntax adjustment to compile.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-11 20:36:03 -06:00
Trey t
415799b6d0 Refactor iOS and Android code to follow single responsibility principle
- iOS: Extracted views and helpers into separate files
  - Created Documents/Helpers/DocumentHelpers.swift for type/category helpers
  - Created Documents/Components/ with individual view files:
    - ImageViewerSheet.swift
    - WarrantyCard.swift
    - DocumentCard.swift
    - EmptyStateView.swift
    - WarrantiesTabContent.swift
    - DocumentsTabContent.swift
  - Cleaned up DocumentDetailView.swift and DocumentsWarrantiesView.swift

- Android: Extracted composables into organized component structure
  - Created ui/components/documents/ package with:
    - DocumentCard.kt (WarrantyCardContent, RegularDocumentCardContent, formatFileSize)
    - DocumentStates.kt (EmptyState, ErrorState)
    - DocumentsTabContent.kt
  - Reduced DocumentsScreen.kt from 506 lines to 211 lines
  - Added missing imports to DocumentDetailScreen.kt and EditDocumentScreen.kt

Net result: +770 insertions, -716 deletions across 15 files

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-11 14:39:33 -06:00
Trey t
611f7d853b Add document viewing, editing, and image deletion features
- Add DocumentDetailScreen and EditDocumentScreen for Compose (Android/Web)
- Add DocumentDetailView and EditDocumentView for iOS SwiftUI
- Add DocumentViewModelWrapper for iOS state management
- Implement document image deletion API integration
- Fix iOS navigation issues with edit button using hidden NavigationLink
- Add clickable warranties in iOS with NavigationLink
- Fix iOS build errors with proper type checking and state handling
- Add support for viewing and managing warranty-specific fields

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-11 14:00:01 -06:00
Trey t
e716c919f3 Add documents and warranties feature with image upload support
- Implement complete document management system for warranties, manuals, receipts, and other property documents
- Add DocumentsScreen with tabbed interface for warranties and documents
- Add AddDocumentScreen with comprehensive form including warranty-specific fields
- Integrate image upload functionality (camera + gallery, up to 5 images)
- Fix FAB visibility by adding bottom padding to account for navigation bar
- Fix content being cut off by bottom navigation bar (96dp padding)
- Add DocumentViewModel for state management with CRUD operations
- Add DocumentApi for backend communication with multipart image upload
- Add Document model with comprehensive field support
- Update navigation to include document routes
- Add iOS DocumentsWarrantiesView and AddDocumentView for cross-platform support

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-10 22:38:34 -06:00
Trey t
d3caffa792 Add contractor management and integrate with task completions
Features:
- Add full contractor CRUD functionality (Android & iOS)
- Add contractor selection to task completion dialog
- Display contractor info in completion cards
- Add ContractorSpecialty model and API integration
- Add contractors tab to bottom navigation
- Replace hardcoded specialty lists with API data
- Update lookup endpoints to return arrays instead of paginated responses

Changes:
- Add Contractor models (ContractorSummary, ContractorDetail, ContractorCreate/UpdateRequest)
- Add ContractorApi with endpoints for list, detail, create, update, delete, toggle favorite
- Add ContractorViewModel for state management
- Add ContractorsScreen and ContractorDetailScreen for Android
- Add AddContractorDialog with form validation
- Add Contractor views for iOS (list, detail, form)
- Update CompleteTaskDialog to include contractor selection
- Update CompletionCardView to show contractor name and phone
- Add contractor field to TaskCompletion model
- Update LookupsApi to return List<T> instead of paginated responses
- Update LookupsRepository and LookupsViewModel to handle array responses
- Update LookupsManager (iOS) to handle array responses for contractor specialties

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-10 19:39:41 -06:00
Trey t
764a90cb41 Modernize Android UI design system to match iOS
- Create comprehensive design system with Theme.kt, Type.kt, and Shape.kt
- Update color palette to match iOS (primary #2563EB, accent #8B5CF6)
- Implement modern typography scale across all text styles
- Add consistent corner radius system (AppRadius)

UI Improvements:
- HomeScreen: Add personalized greeting, gradient icons, modern stats
- TaskCard: Pill-style badges, semantic colors, clean metadata
- ResidencesScreen: Gradient circular icons, location indicators
- LoginScreen: Gradient button background, modern card styling

Design Features:
- Gradient backgrounds for visual interest
- Semantic color coding for states
- Flat design with minimal elevation
- Consistent spacing and typography
- Material3 shapes throughout

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-10 12:12:30 -06:00
Trey t
77a118a6f7 Refactor iOS and Android views into separate files
Organized view components by extracting composables and views into separate files following single responsibility principle.

iOS Changes:
- Split MainTabView → extracted ProfileTabView
- Split CompleteTaskView → extracted ImageThumbnailView, CameraPickerView
- Split ManageUsersView → extracted ShareCodeCard, UserListItem
- Consolidated task action buttons into single TaskActionButtons.swift file
- Split HomeScreenView → extracted OverviewCard, StatView, HomeNavigationCard
- Split AllTasksView → extracted DynamicTaskColumnView, DynamicTaskCard
- Split ContentView → extracted ComposeView, CustomView

Android Changes:
- Split ResetPasswordScreen → extracted RequirementItem component
- Split TasksScreen → extracted TaskPill component
- Created TaskDisplayUtils for shared helper functions (getIconFromName, hexToColor)

All extracted components properly organized in:
- iOS: Subviews/Common, Subviews/Task, Subviews/Residence, Profile
- Android: ui/components/auth, ui/components/task, ui/utils

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-10 11:38:17 -06:00
Trey t
29b4c99f08 Add residence deletion functionality for iOS and Android
- Add delete residence button to iOS ResidenceDetailView (primary owners only)
- Add delete confirmation alert for iOS with destructive action
- Implement deleteResidence API call in iOS with navigation on success
- Add delete residence button to Android ResidenceDetailScreen (primary owners only)
- Add delete confirmation dialog for Android with error-colored button
- Add deleteResidenceState to ResidenceViewModel with StateFlow
- Implement deleteResidence() and resetDeleteResidenceState() in ViewModel
- Add LaunchedEffect to handle delete success (navigates back) and errors
- Display delete button with red/error styling on both platforms
- Restrict delete functionality to primary owners only

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-10 10:42:37 -06:00
Trey t
872a7df86f Add camera functionality for task completion photos
- Add camera picker interface to common ImagePicker.kt
- Implement camera capture for Android using ActivityResultContracts.TakePicture
- Implement camera capture for iOS using UIImagePickerController
- Add camera picker stubs for wasmJs, jsMain, and jvmMain platforms
- Update CompleteTaskDialog to show both "Take Photo" and "Choose from Library" buttons
- Add camera permissions to Android manifest (CAMERA permission, camera intent queries)
- Configure Android FileProvider for camera photo sharing
- Add camera and photo library usage descriptions to iOS Info.plist
- Update iOS CompleteTaskView with native camera picker support
- Fix cancel button in CompleteTaskView using @Environment(\.dismiss)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-10 10:25:37 -06:00
Trey t
131637e6f3 Add photo viewer for task completions on iOS and Android
- Add PhotoViewerDialog (Android) and PhotoViewerSheet (iOS) for viewing completion photos
- Add CompletionCardView (iOS) to display completion details with photo button
- Update AllTasksView (iOS) to show full completion details instead of just count
- Update TaskCard (Android) to use CompletionCard component
- Add Coil 3.0.4 image loading library for Android
- Configure ImageLoader in MainActivity with network, memory, and disk caching
- Add getMediaBaseUrl() to ApiClient for loading media files without /api path
- Fix photo viewer background color to match app theme

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 20:42:18 -06:00
Trey t
99228d03b5 Update login and password reset UI across iOS and Android
- Add email/username login support
  - Android: Update LoginScreen with email keyboard type
  - iOS: Update LoginView with email keyboard support

- Refactor iOS password reset screens to use native SwiftUI components
  - Convert ForgotPasswordView to use Form with Sections
  - Convert VerifyResetCodeView to use Form with Sections
  - Convert ResetPasswordView to use Form with Sections
  - Use Label components for error/success messages
  - Add navigation titles and improve iOS-native appearance

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 18:41:47 -06:00
Trey t
fdcc2a2e16 Add password reset feature for iOS and Android with deep link support
Implemented complete password reset flow with email verification and deep linking:

iOS (SwiftUI):
- PasswordResetViewModel: Manages 3-step flow (request, verify, reset) with deep link support
- ForgotPasswordView: Email entry screen with success/error states
- VerifyResetCodeView: 6-digit code verification with resend option
- ResetPasswordView: Password reset with live validation and strength indicators
- PasswordResetFlow: Container managing navigation between screens
- Deep link handling in iOSApp.swift for mycrib://reset-password?token=xxx
- Info.plist: Added CFBundleURLTypes for deep link scheme

Android (Compose):
- PasswordResetViewModel: StateFlow-based state management with coroutines
- ForgotPasswordScreen: Material3 email entry with auto-navigation
- VerifyResetCodeScreen: Code verification with Material3 design
- ResetPasswordScreen: Password reset with live validation checklist
- Deep link handling in MainActivity.kt and AndroidManifest.xml
- Token cleanup callback to prevent reusing expired deep link tokens
- Shared ViewModel scoping across all password reset screens
- Improved error handling for Django validation errors

Shared:
- Routes: Added ForgotPasswordRoute, VerifyResetCodeRoute, ResetPasswordRoute
- AuthApi: Enhanced resetPassword with Django validation error parsing
- User models: Added password reset request/response models

Security features:
- Deep link tokens expire after use
- Proper token validation on backend
- Session invalidation after password change
- Password strength requirements enforced

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 18:29:29 -06:00
Trey t
e6dc54017b Add PDF maintenance report generation feature for Android and iOS
- Add generateTasksReport API endpoint in ResidenceApi
- Implement report generation button in Android residence detail screen
- Add report generation state management in shared ResidenceViewModel
- Add report generation button to iOS residence detail view toolbar
- Implement iOS-specific report generation logic in ResidenceViewModel
- Display loading spinner and success/error alerts for report generation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 10:12:22 -06:00
Trey t
da0493e165 wip 2025-11-08 23:55:57 -06:00
Trey t
7dce211681 wip 2025-11-08 16:02:01 -06:00
Trey t
97eed0eee9 wip 2025-11-08 10:52:28 -06:00
Trey t
364f98a303 Fix logout, share code display, loading states, and multi-user support
iOS Logout Fix:
- Use @EnvironmentObject in MainTabView and ProfileTabView
- Pass loginViewModel from LoginView to MainTabView
- Handle logout by dismissing main tab when isAuthenticated becomes false
- Logout button now properly returns user to login screen

Share Code UX:
- Clear share code on ManageUsers screen open (iOS & Android)
- Remove auto-loading of share codes
- User must explicitly generate code each time
- Improves security with fresh codes

Loading State Improvements:
- iOS ResidenceDetailView shows loading immediately on navigation
- Android ResidenceDetailScreen enhanced with "Loading residence..." text
- Better user feedback during API calls

Multi-User Support:
- Add isPrimaryOwner and userCount to ResidenceWithTasks model
- Update iOS toResidences() extension to include new fields
- Sync with backend API changes for shared user access

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-08 10:51:51 -06:00
Trey t
e271403d9b wip 2025-11-07 22:02:52 -06:00
Trey t
992979f113 wip 2025-11-07 15:26:22 -06:00
Trey t
492d8032f4 wip 2025-11-07 15:14:40 -06:00
Trey t
b922c4fb88 wip 2025-11-07 14:53:14 -06:00
Trey t
4e14352cd1 wip 2025-11-07 12:57:25 -06:00
Trey t
1b777049a8 wip 2025-11-07 12:21:48 -06:00
Trey t
66fe773398 wip 2025-11-06 17:53:41 -06:00
Trey t
e24d1d8559 wip 2025-11-06 09:25:21 -06:00
Trey t
e272e45689 wip 2025-11-05 21:35:52 -06:00
Trey t
a8083380aa wip 2025-11-05 20:52:51 -06:00
Trey t
bc289d6c88 wip 2025-11-05 20:31:01 -06:00
Trey t
6bad8d6b5a wip 2025-11-05 18:16:46 -06:00
Trey t
b2b8cc62de wip 2025-11-05 18:02:34 -06:00
Trey t
194bac1a86 android ui cleanup 2025-11-05 17:25:15 -06:00
Trey t
1d48a9bff1 wip 2025-11-05 15:15:59 -06:00
Trey t
5deac95818 wip 2025-11-05 13:52:02 -06:00
Trey t
2be3a5a3a8 wip 2025-11-05 10:38:46 -06:00
Trey t
025fcf677a wip 2025-11-04 23:11:18 -06:00
Trey t
177e588944 wip 2025-11-04 16:34:05 -06:00
Trey t
219eaa69ee wip 2025-11-04 15:41:03 -06:00
Trey t
f2ade0a1e2 wip 2025-11-04 12:19:17 -06:00
Trey t
ba27ddda71 wip 2025-11-04 11:42:00 -06:00
Trey t
de1c7931e9 wip 2025-11-04 10:51:20 -06:00
Trey t
78c62cfc52 Initial commit: Kotlin Multiplatform project setup
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-04 09:15:49 -06:00