Skip to content

fix: show add LOI button when zoomed out - #3858

Merged
andreia-ferreira merged 2 commits into
google:masterfrom
arpitagarwal1301:fix/3553-show-add-loi-fab
Jul 29, 2026
Merged

fix: show add LOI button when zoomed out#3858
andreia-ferreira merged 2 commits into
google:masterfrom
arpitagarwal1301:fix/3553-show-add-loi-fab

Conversation

@arpitagarwal1301

Copy link
Copy Markdown
Contributor

Fixes #3553

  • Keep the Add LOI FAB available regardless of map zoom level.
  • Preserve zoom-dependent LOI viewport filtering and map clustering behavior.
  • Add focused coverage for the below-clustering-threshold case.

Verification

  • ./gradlew checkCode
  • ./gradlew :app:ktfmtCheck :app:testLocalDebugUnitTest --tests 'org.groundplatform.android.ui.home.mapcontainer.HomeScreenMapContainerViewModelTest'
  • git diff --check

Limitations

  • The behavior was not visually exercised on a device; the affected ViewModel state is covered by Robolectric.

Comment on lines +180 to 181
if (survey == null) listOf()
else survey.jobs.filter { it.canDataCollectorsAddLois && it.getAddLoiTask() != null }

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

optional: can be slightly simplified with

Suggested change
if (survey == null) listOf()
else survey.jobs.filter { it.canDataCollectorsAddLois && it.getAddLoiTask() != null }
survey?.jobs?.filter { it.canDataCollectorsAddLois && it.getAddLoiTask() != null } ?: listOf()

@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.58%. Comparing base (4b17121) to head (231fb08).

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3858      +/-   ##
============================================
+ Coverage     67.49%   67.58%   +0.08%     
- Complexity     1850     1853       +3     
============================================
  Files           410      410              
  Lines         10818    10818              
  Branches       1428     1425       -3     
============================================
+ Hits           7302     7311       +9     
  Misses         2768     2768              
+ Partials        748      739       -9     
Files with missing lines Coverage Δ
...me/mapcontainer/HomeScreenMapContainerViewModel.kt 71.79% <100.00%> (+1.92%) ⬆️

... and 3 files 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 68cac2d into google:master Jul 29, 2026
21 checks passed
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.

[Home screen] "+" fab only shown when zoomed in

2 participants