Skip to content
This repository was archived by the owner on Aug 21, 2025. It is now read-only.

Store private phone&email locally#82

Merged
hamorillo merged 1 commit intotrunkfrom
adam/GRA-593
Jul 29, 2025
Merged

Store private phone&email locally#82
hamorillo merged 1 commit intotrunkfrom
adam/GRA-593

Conversation

@AdamGrzybkowski
Copy link
Contributor

Description

This PR implements the local storage for private contact fields: phone and email.

The storing is debounced by 500ms to prevent saving on each input field change when the user is typing.

Testing Steps

  1. Launch the app
  2. Go to share tab and fill in the private info
  3. Kill the app
  4. Open the app
  5. Got to share tab
  6. Confirm the values are there

@AdamGrzybkowski AdamGrzybkowski added the enhancement New feature or request label Jul 25, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements local storage functionality for private contact fields (phone and email) in the user component. The implementation includes debounced saving to prevent excessive storage operations during user input.

  • Added use cases for getting and updating private contact information with debounced storage
  • Extended the DataStore persistence layer to handle private contact info storage
  • Updated the Share screen ViewModel to collect and save private contact information with 500ms debounce delay

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
UpdatePrivateContactInfoUseCase.kt New use case for updating private contact info with storage interface
GetPrivateContactInfoUseCase.kt New use case for retrieving private contact info with flow-based data access
UserComponentModule.kt Dependency injection setup for new private contact info use cases
DatastoreModule.kt DataStore module configuration for private contact info storage
UserPrefsStorage.kt Extended storage interface and implementation for private contact persistence
ShareViewModelTest.kt Comprehensive test coverage for private contact info functionality and debouncing
ShareViewModel.kt ViewModel updates to handle private contact info with debounced saving logic

internal val uiState: StateFlow<ShareUiState> = _uiState.asStateFlow()

private var saveContactInfoJob: Job? = null
private val debounceDelay = 500L // 500ms debounce delay
Copy link

Copilot AI Jul 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The debounce delay should be extracted as a constant at the class or companion object level, or made configurable, rather than being a magic number in the property declaration.

Suggested change
private val debounceDelay = 500L // 500ms debounce delay
companion object {
const val DEBOUNCE_DELAY = 500L // 500ms debounce delay
}

Copilot uses AI. Check for mistakes.
@hamorillo hamorillo force-pushed the adam/GRA-601 branch 4 times, most recently from a7033c0 to 9a2f82e Compare July 28, 2025 21:10
Base automatically changed from adam/GRA-601 to trunk July 28, 2025 21:39
Copy link

@hamorillo hamorillo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@hamorillo hamorillo merged commit 974f26c into trunk Jul 29, 2025
10 of 11 checks passed
@hamorillo hamorillo deleted the adam/GRA-593 branch July 29, 2025 08:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants