Skip to content

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

Open
arpitagarwal1301 wants to merge 1 commit into
google:masterfrom
arpitagarwal1301:fix/3553-show-add-loi-fab
Open

fix: show add LOI button when zoomed out#3858
arpitagarwal1301 wants to merge 1 commit 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.46%. Comparing base (44bcd71) to head (60a872a).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3858      +/-   ##
============================================
+ Coverage     67.37%   67.46%   +0.09%     
- Complexity     1838     1842       +4     
============================================
  Files           407      407              
  Lines         10755    10755              
  Branches       1418     1415       -3     
============================================
+ Hits           7246     7256      +10     
+ Misses         2763     2762       -1     
+ Partials        746      737       -9     
Files with missing lines Coverage Δ
...me/mapcontainer/HomeScreenMapContainerViewModel.kt 71.79% <100.00%> (+1.92%) ⬆️

... and 4 files with indirect coverage changes

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

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