Refactor DateTaskFragment to use TaskScreen component#3643
Open
shobhitagarwal1612 wants to merge 12 commits intomasterfrom
Open
Refactor DateTaskFragment to use TaskScreen component#3643shobhitagarwal1612 wants to merge 12 commits intomasterfrom
shobhitagarwal1612 wants to merge 12 commits intomasterfrom
Conversation
- Extract date task UI logic into `DateTaskScreen.kt`, including the `DateTaskContent` and date picker dialog handling. - Update `TaskScreen` to provide default values for optional parameters. - Add `saveFooterPosition` and `handleTaskScreenAction` to `AbstractTaskFragment` to facilitate the transition to Compose-based layouts. - Make `AbstractTaskFragment.TaskBody` open instead of abstract to support incremental migration.
…e `ButtonActionStateChecker` helper - Delete `DateTaskFragmentTest` and migrate its testing logic to the new `DateTaskScreenTest` using Compose-based testing APIs. - Extract button state verification logic into a new reusable `ButtonActionStateChecker` utility class. - Update `BaseTaskFragmentTest` to use `ButtonActionStateChecker` for consistent button assertions. - Enhance test coverage for `DateTaskScreen`, including checks for hint text visibility, date formatting, and dialog interactions (select date, clear response). - Simplify task screen initialization in tests by mocking `DataCollectionViewModel` and `TaskPositionInterface` directly.
…odalBottomSheet` in `DateTaskScreen`
…to ensure the date picker visibility persists across configuration changes.
app/src/main/java/org/groundplatform/android/ui/datacollection/tasks/date/DateTaskScreen.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/groundplatform/android/ui/datacollection/tasks/date/DateTaskScreen.kt
Outdated
Show resolved
Hide resolved
Collaborator
andreia-ferreira
left a comment
There was a problem hiding this comment.
Screen_recording_20260331_123131.webm
when manually typing a date, the progress bar seems to move to the middle of the screen and stay there across tasks
Member
Author
|
I'm unable to reproduce it locally. |
Collaborator
|
sorry should have added that the issue above only happens on smaller devices. I reproduced using the 'Small Phone API 29' emulator in Android Studio |
Member
Author
|
Attaching a screen recording of the same on small phone API 29. Screen_recording_20260331_231226.webmCould you please check what I'm missing in the repro steps? |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #3643 +/- ##
============================================
- Coverage 66.85% 66.83% -0.03%
+ Complexity 1655 1644 -11
============================================
Files 357 358 +1
Lines 8802 8835 +33
Branches 1120 1130 +10
============================================
+ Hits 5885 5905 +20
- Misses 2278 2288 +10
- Partials 639 642 +3
🚀 New features to boost your workflow:
|
This preserves the existing behavior as validated by the e2e test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Towards #3630
Migrate DateTaskFragment to compose component.
DateTaskScreento build the task UI rather thanAbstractTaskFragmentDateTaskFragmentTestwithDateTaskScreenTestOnce all screens are migrated to compose components, fragments can be removed entirely to make the data collection module compatible with KMP (except map based fragment, which will require some iOS based interface).
Before:
date-task-refactor-before.webm
After:
date-task-refactor-after.-.2.webm
@andreia-ferreira PTAL?