Conversation
Extracted Proto DataStore implementation into a new :data:settings-datastore module. This improves modularity and separation of concerns by isolating the persistence layer. :data:settings now solely defines interfaces and handles constraints.
Extracted Proto DataStore implementation into a new :data:settings-datastore module. This improves modularity and separation of concerns by isolating the persistence layer. :data:settings now solely defines interfaces and handles constraints. # Conflicts: # data/settings-datastore/src/main/java/com/google/jetpackcamera/data/settingsdatastore/LocalSettingsRepository.kt
Moves all proto/domain conversion logic into a dedicated mappers layer in core:model. This cleans up data models and LocalSettingsRepositor and improves testability and reusability of conversion logic.
Summary of ChangesHello @Kimblebee, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly refactors the data model and settings persistence layers by centralizing Protobuf conversion logic into dedicated mapper files and introducing a new DataStore module. This change improves code organization, enhances readability by removing inline conversion logic from core models and repositories, and boosts testability with comprehensive conversion tests. The overall impact is a cleaner, more maintainable codebase for handling settings and data serialization. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request is a great refactoring effort that significantly improves the codebase's structure and maintainability. By centralizing the domain-to-proto mapping logic into dedicated mapper files (ProtoMappers.kt and DebugSettingsMapper.kt), you've made the model classes cleaner and the data layer (LocalSettingsRepository) more concise and readable. The creation of the new data:settings-datastore module is a solid architectural improvement that better separates concerns. The addition of comprehensive unit tests in ProtoConversionTest.kt ensures the correctness of these new mappers. I have one minor suggestion for simplification.
Summary of changes:
Model Mappers:
* Migrate domain <--> proto conversion functions to dedicated files.
* These files now contain the
toProto()andtoDomain()extension functions for various domain model enums and data classes, centralizing the logic for converting between domain and Protobuf types.Refactoring of
LocalSettingsRepository* removed the inline when statements that previously handled conversions
package, making the repository's code cleaner and more concise.
Updated Navigation Components:
*
DebugSettingsNavType.ktandPreviewNavigation.kthave been updated to utilize the newDebugSettingsMapperfor handling the serialization and deserialization ofDebugSettingswhen navigating.Comprehensive Proto Conversion Tests:
*
ProtoConversionTest.kt, has more extensive coverage of the proto/domain functions