forked from trent_larson/crowd-funder-for-time-pwa
refactor(cursor-rules): restructure rules architecture with meta-rule system
- Reorganize cursor rules into logical domain-based directories - Implement meta-rule system for workflow-specific rule bundling - Move core rules to dedicated /core directory - Consolidate development rules under /development namespace - Add architectural patterns and implementation examples - Create workflow-specific meta-rules for common development tasks - Remove deprecated standalone rule files - Update package dependencies for new rule structure BREAKING CHANGE: Cursor rules file structure has been reorganized Files moved from root rules directory to domain-specific subdirectories
This commit is contained in:
225
.cursor/rules/features/camera_platforms.mdc
Normal file
225
.cursor/rules/features/camera_platforms.mdc
Normal file
@@ -0,0 +1,225 @@
|
||||
# Camera Platform-Specific Implementation
|
||||
|
||||
> **Agent role**:
|
||||
Reference this file for platform-specific camera implementation details.
|
||||
|
||||
## Web Platform
|
||||
|
||||
### Implementation Details
|
||||
|
||||
- Uses `getUserMedia` API for camera access
|
||||
|
||||
- Implements fallback to file input if camera unavailable
|
||||
|
||||
- Handles browser compatibility issues
|
||||
|
||||
- Requires HTTPS for camera access
|
||||
|
||||
### Browser Support
|
||||
|
||||
- Chrome: Full support
|
||||
|
||||
- Firefox: Full support
|
||||
|
||||
- Safari: Limited support
|
||||
|
||||
- Edge: Full support
|
||||
|
||||
### Fallback Mechanisms
|
||||
|
||||
1. Camera access via getUserMedia
|
||||
|
||||
2. File input for image upload
|
||||
|
||||
3. Drag and drop support
|
||||
|
||||
4. Clipboard paste support
|
||||
|
||||
## Mobile Platform (Capacitor)
|
||||
|
||||
### iOS Implementation
|
||||
|
||||
- Uses `@capacitor-mlkit/barcode-scanning`
|
||||
|
||||
- Implements proper permission handling
|
||||
|
||||
- Supports both front and back cameras
|
||||
|
||||
- Handles camera switching
|
||||
|
||||
### Android Implementation
|
||||
|
||||
- Uses `@capacitor-mlkit/barcode-scanning`
|
||||
|
||||
- Implements proper permission handling
|
||||
|
||||
- Supports both front and back cameras
|
||||
|
||||
- Handles camera switching
|
||||
|
||||
### Permission Handling
|
||||
|
||||
- Camera permissions requested at runtime
|
||||
|
||||
- Permission state tracked and cached
|
||||
|
||||
- Graceful handling of denied permissions
|
||||
|
||||
- Clear user guidance for enabling permissions
|
||||
|
||||
## Desktop Platform (Electron)
|
||||
|
||||
### Current Status
|
||||
|
||||
- Camera implementation pending
|
||||
|
||||
- Will use platform-specific APIs
|
||||
|
||||
- Requires proper permission handling
|
||||
|
||||
- Will support both built-in and external cameras
|
||||
|
||||
### Planned Implementation
|
||||
|
||||
- Native camera access via Electron
|
||||
|
||||
- Platform-specific camera APIs
|
||||
|
||||
- Proper permission handling
|
||||
|
||||
- Camera switching support
|
||||
|
||||
## Platform Detection
|
||||
|
||||
### Implementation
|
||||
|
||||
- Uses `PlatformServiceFactory` for platform detection
|
||||
|
||||
- Implements platform-specific camera services
|
||||
|
||||
- Handles platform-specific error conditions
|
||||
|
||||
- Provides platform-specific user guidance
|
||||
|
||||
### Service Selection
|
||||
|
||||
- Web: `WebPlatformService`
|
||||
|
||||
- Mobile: `CapacitorPlatformService`
|
||||
|
||||
- Desktop: `ElectronPlatformService`
|
||||
|
||||
## Cross-Platform Compatibility
|
||||
|
||||
### Common Interface
|
||||
|
||||
- Unified camera service interface
|
||||
|
||||
- Platform-specific implementations
|
||||
|
||||
- Consistent error handling
|
||||
|
||||
- Unified user experience
|
||||
|
||||
### Feature Parity
|
||||
|
||||
- Core camera functionality across platforms
|
||||
|
||||
- Platform-specific optimizations
|
||||
|
||||
- Consistent user interface
|
||||
|
||||
- Unified error messages
|
||||
|
||||
## Platform-Specific Features
|
||||
|
||||
### Web
|
||||
|
||||
- Browser-based camera access
|
||||
|
||||
- File upload fallback
|
||||
|
||||
- Drag and drop support
|
||||
|
||||
- Clipboard paste support
|
||||
|
||||
### Mobile
|
||||
|
||||
- Native camera access
|
||||
|
||||
- Barcode scanning
|
||||
|
||||
- Photo capture
|
||||
|
||||
- Camera switching
|
||||
|
||||
### Desktop
|
||||
|
||||
- Native camera access (planned)
|
||||
|
||||
- External camera support (planned)
|
||||
|
||||
- Advanced camera controls (planned)
|
||||
|
||||
## Testing Strategy
|
||||
|
||||
### Platform Coverage
|
||||
|
||||
- Web: Multiple browsers
|
||||
|
||||
- Mobile: iOS and Android devices
|
||||
|
||||
- Desktop: Windows, macOS, Linux
|
||||
|
||||
### Test Scenarios
|
||||
|
||||
- Permission handling
|
||||
|
||||
- Camera access
|
||||
|
||||
- Error conditions
|
||||
|
||||
- Platform compatibility
|
||||
|
||||
- Performance metrics
|
||||
|
||||
---
|
||||
|
||||
**See also**:
|
||||
|
||||
- `.cursor/rules/features/camera-implementation.mdc` for
|
||||
|
||||
core implementation overview
|
||||
|
||||
- `.cursor/rules/features/camera_technical.mdc` for
|
||||
|
||||
technical implementation details
|
||||
|
||||
**Status**: Active platform-specific implementation guide
|
||||
**Priority**: Medium
|
||||
**Estimated Effort**: Ongoing reference
|
||||
**Dependencies**: camera-implementation.mdc
|
||||
**Stakeholders**: Development team, Platform team
|
||||
|
||||
## Model Implementation Checklist
|
||||
|
||||
### Before Camera Platform Implementation
|
||||
|
||||
- [ ] **Platform Analysis**: Identify target platforms and their camera capabilities
|
||||
- [ ] **Feature Planning**: Plan platform-specific camera features
|
||||
- [ ] **Integration Planning**: Plan integration with existing camera systems
|
||||
- [ ] **Testing Strategy**: Plan testing across all target platforms
|
||||
|
||||
### During Camera Platform Implementation
|
||||
|
||||
- [ ] **Platform Services**: Implement platform-specific camera functionality
|
||||
- [ ] **Feature Development**: Implement planned camera features for each platform
|
||||
- [ ] **Integration**: Integrate with existing camera infrastructure
|
||||
- [ ] **Performance Optimization**: Optimize camera performance for each platform
|
||||
|
||||
### After Camera Platform Implementation
|
||||
|
||||
- [ ] **Cross-Platform Testing**: Test camera functionality across all platforms
|
||||
- [ ] **Feature Validation**: Verify all planned features work correctly
|
||||
- [ ] **Performance Testing**: Ensure camera performance meets requirements
|
||||
- [ ] **Documentation Update**: Update platform-specific camera documentation
|
||||
Reference in New Issue
Block a user