**refactor(PhotoDialog, PlatformService): Implement cross-platform photo capture and encapsulated image processing**

- Replace direct camera library with platform-agnostic `PlatformService`
- Move platform-specific image processing logic to respective platform implementations
- Introduce `ImageResult` interface for consistent image handling across platforms
- Add support for native camera and image picker across all platforms
- Simplify `PhotoDialog` by removing platform-specific logic
- Maintain existing cropping and upload functionality
- Improve error handling and logging throughout
- Clean up UI for better user experience
- Add comprehensive documentation for usage and architecture

**BREAKING CHANGE:** Removes direct camera library dependency in favor of `PlatformService`

This change improves separation of concerns, enhances maintainability, and standardizes cross-platform image handling.
This commit is contained in:
Matthew Raymer
2025-04-06 13:04:26 +00:00
parent 2c6bfc30bc
commit b0a66d790d
8 changed files with 187 additions and 250 deletions

View File

@@ -1,28 +1,28 @@
import { PlatformService } from '../PlatformService';
import { PlatformService } from "../PlatformService";
export class ElectronPlatformService implements PlatformService {
async readFile(path: string): Promise<string> {
throw new Error('Not implemented');
throw new Error("Not implemented");
}
async writeFile(path: string, content: string): Promise<void> {
throw new Error('Not implemented');
throw new Error("Not implemented");
}
async deleteFile(path: string): Promise<void> {
throw new Error('Not implemented');
throw new Error("Not implemented");
}
async listFiles(directory: string): Promise<string[]> {
throw new Error('Not implemented');
throw new Error("Not implemented");
}
async takePicture(): Promise<string> {
throw new Error('Not implemented');
throw new Error("Not implemented");
}
async pickImage(): Promise<string> {
throw new Error('Not implemented');
throw new Error("Not implemented");
}
isCapacitor(): boolean {
@@ -42,6 +42,6 @@ export class ElectronPlatformService implements PlatformService {
}
async handleDeepLink(url: string): Promise<void> {
throw new Error('Not implemented');
throw new Error("Not implemented");
}
}
}