Skip to content

Fix zoom in draw area task - #3913

Merged
andreia-ferreira merged 5 commits into
masterfrom
andreia/3833/maintain-zoom
Sep 1, 2026
Merged

Fix zoom in draw area task#3913
andreia-ferreira merged 5 commits into
masterfrom
andreia/3833/maintain-zoom

Conversation

@andreia-ferreira

Copy link
Copy Markdown
Collaborator

Fixes #3833

When entering a draw area task, the map would jump to the max zoom instead of keeping the current zoom value of the home screen. This would happen because, since in the beginning there is only one draft vertex, there were no bounds to zoom to, so it would jump to the max zoom.

getDefaultViewPort() was added to the DrawAreaTaskViewModel to decide the camera position, and if there is only 1 point, it will only center on it. The setDefaultViewPort call site was also modified so that it will only be triggered once after the STARTED state, instead of every time it entered that state as it was previously

Before

Screen_recording_20260831_174746.webm

After

Screen_recording_20260831_173314.webm

@shobhitagarwal1612 PTAL?

@codecov

codecov Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 46.15385% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.47%. Comparing base (94baf3c) to head (3d4f25c).

Files with missing lines Patch % Lines
...ollection/tasks/polygon/DrawAreaTaskMapFragment.kt 25.00% 3 Missing ⚠️
.../android/ui/common/AbstractMapContainerFragment.kt 0.00% 1 Missing ⚠️
...ui/datacollection/tasks/AbstractTaskMapFragment.kt 0.00% 1 Missing ⚠️
...tacollection/tasks/point/DropPinTaskMapFragment.kt 0.00% 1 Missing ⚠️
...acollection/tasks/polygon/DrawAreaTaskViewModel.kt 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3913      +/-   ##
============================================
+ Coverage     69.36%   69.47%   +0.10%     
- Complexity     1963     1966       +3     
============================================
  Files           412      412              
  Lines         11015    11018       +3     
  Branches       1453     1453              
============================================
+ Hits           7641     7655      +14     
+ Misses         2624     2612      -12     
- Partials        750      751       +1     
Files with missing lines Coverage Δ
.../android/ui/common/AbstractMapContainerFragment.kt 15.49% <0.00%> (+0.42%) ⬆️
...ui/datacollection/tasks/AbstractTaskMapFragment.kt 60.27% <0.00%> (ø)
...tacollection/tasks/point/DropPinTaskMapFragment.kt 14.28% <0.00%> (ø)
...acollection/tasks/polygon/DrawAreaTaskViewModel.kt 82.11% <83.33%> (+0.05%) ⬆️
...ollection/tasks/polygon/DrawAreaTaskMapFragment.kt 52.38% <25.00%> (+2.38%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@andreia-ferreira
andreia-ferreira merged commit 2c03e47 into master Sep 1, 2026
19 checks passed
@andreia-ferreira
andreia-ferreira deleted the andreia/3833/maintain-zoom branch September 1, 2026 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Map] Maintain zoom-level from start screen for geometry-making

2 participants