This PR started as a fix for the issue of tools crashing on AppleTV hardware (https://github.com/getditto/DittoSwiftTools/issues/153), but has evolved into a more significant refactor to improve the Identity Configuration flow, resulting in a more flexible, maintainable, and user-centered experience. I’m opening this PR now to invite feedback on the current direction, even as final work on some components is still underway. Early review and comments will help refine this approach further.
Changes in Scope
The changes touch several areas:
• Identity Configuration Service: Centralized identity management responsibilities, streamlining keychain interactions and making activeConfiguration handling more robust.
• Form Refactoring: Broke down the form into more modular components (IdentityForm, IdentityFormInputView, etc.), enabling a more adaptable UI that changes based on the identity type selected.
• Validation and Supplementary Fields: Added support for identity-specific fields and supplementary credentials (e.g., AuthDelegate details) in the form, with validation and input management centralized within the ViewModel.
• Error Handling and Sync State Management: Improved error handling with dedicated DittoServiceError cases, better encapsulating sync state and managing initialization flows.
Key Changes
• DittoService: Refined to distinguish between identity setup and sync management, now using distinct methods for initializing, starting, and stopping the sync engine.
• Configuration Data Flow: Moved identity and supplementary data persistence into the ConfigurationService, with Keychain integration for storage and retrieval.
• View Structure: Updated ConfigurationView to encapsulate form data binding and apply consistent identity configuration handling across iOS and tvOS.
• Delegates: Enhanced AuthDelegate integration to interact seamlessly with ConfigurationService, reducing duplicate identity configuration code.
Still in Progress
• UI Adjustments: Fine-tuning visual aspects of the form, especially on tvOS, to better align with system conventions.
• Validation and Error Messaging: Additional UI messaging for invalid configurations, with further error handling around sync restarts.
Next Steps
• Testing: I’ll continue testing each identity configuration type and sync state management in various scenarios, especially around error and edge cases.
• Further Review: Any feedback on architecture, naming, or potential simplifications would be highly appreciated at this stage.
Thanks for taking a look early. I’m excited to hear any thoughts and adjust as needed!
This PR started as a fix for the issue of tools crashing on AppleTV hardware (https://github.com/getditto/DittoSwiftTools/issues/153), but has evolved into a more significant refactor to improve the Identity Configuration flow, resulting in a more flexible, maintainable, and user-centered experience. I’m opening this PR now to invite feedback on the current direction, even as final work on some components is still underway. Early review and comments will help refine this approach further.
Changes in Scope
The changes touch several areas: • Identity Configuration Service: Centralized identity management responsibilities, streamlining keychain interactions and making activeConfiguration handling more robust. • Form Refactoring: Broke down the form into more modular components (IdentityForm, IdentityFormInputView, etc.), enabling a more adaptable UI that changes based on the identity type selected. • Validation and Supplementary Fields: Added support for identity-specific fields and supplementary credentials (e.g., AuthDelegate details) in the form, with validation and input management centralized within the ViewModel. • Error Handling and Sync State Management: Improved error handling with dedicated DittoServiceError cases, better encapsulating sync state and managing initialization flows.
Key Changes
• DittoService: Refined to distinguish between identity setup and sync management, now using distinct methods for initializing, starting, and stopping the sync engine. • Configuration Data Flow: Moved identity and supplementary data persistence into the ConfigurationService, with Keychain integration for storage and retrieval. • View Structure: Updated ConfigurationView to encapsulate form data binding and apply consistent identity configuration handling across iOS and tvOS. • Delegates: Enhanced AuthDelegate integration to interact seamlessly with ConfigurationService, reducing duplicate identity configuration code.
Still in Progress
• UI Adjustments: Fine-tuning visual aspects of the form, especially on tvOS, to better align with system conventions. • Validation and Error Messaging: Additional UI messaging for invalid configurations, with further error handling around sync restarts.
Next Steps
• Testing: I’ll continue testing each identity configuration type and sync state management in various scenarios, especially around error and edge cases. • Further Review: Any feedback on architecture, naming, or potential simplifications would be highly appreciated at this stage.
Thanks for taking a look early. I’m excited to hear any thoughts and adjust as needed!