Skip to content

Fix issue 3541, Can't complete polygon after getting an interception error popup#3606

Open
hassan-nsubuga wants to merge 1 commit intomasterfrom
bugfix/3541
Open

Fix issue 3541, Can't complete polygon after getting an interception error popup#3606
hassan-nsubuga wants to merge 1 commit intomasterfrom
bugfix/3541

Conversation

@hassan-nsubuga
Copy link
Collaborator

@hassan-nsubuga hassan-nsubuga commented Mar 11, 2026

Fixes #3541

Can't complete polygon after getting an interception error popup, this happens after getting the intersection error and it's not possible to complete a polygon unless a new point is added.
Reset hasSelfIntersection to false after an intersection error to enable the completion button in order to complete a polygon without adding a new point

  • Refactor DrawAreaTaskViewModel to reset value for hasSelfIntersection to false in updateVertices method
  • Call updateVertices to handle vertices update from checkVertexIntersection

@... PTAL?

…nd refactor checkVertexIntersection to call updateVertices
@codecov
Copy link

codecov bot commented Mar 11, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 69.50%. Comparing base (c394f74) to head (01e9e74).

Files with missing lines Patch % Lines
...acollection/tasks/polygon/DrawAreaTaskViewModel.kt 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master    #3606   +/-   ##
=========================================
  Coverage     69.50%   69.50%           
  Complexity     1812     1812           
=========================================
  Files           346      346           
  Lines          9579     9580    +1     
  Branches       1028     1028           
=========================================
+ Hits           6658     6659    +1     
  Misses         2291     2291           
  Partials        630      630           
Files with missing lines Coverage Δ
...acollection/tasks/polygon/DrawAreaTaskViewModel.kt 81.72% <50.00%> (+0.09%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a critical bug preventing users from completing a polygon after a self-intersection error. By ensuring the hasSelfIntersection flag is correctly reset when vertices are updated, the changes restore the ability to finalize polygon drawing without requiring additional, unnecessary points. This improves the user experience by making the polygon drawing tool more robust and predictable.

Highlights

  • Polygon Completion Fix: Resolved an issue where users could not complete a polygon after encountering a self-intersection error without adding a new point.
  • Refactored Vertex Handling: Modified the checkVertexIntersection method to utilize updateVertices when removing the last vertex after a self-intersection, ensuring consistent state management.
  • hasSelfIntersection Reset: Implemented a reset of the hasSelfIntersection flag to false within the updateVertices method, enabling the completion button after an intersection error.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • app/src/main/java/org/groundplatform/android/ui/datacollection/tasks/polygon/DrawAreaTaskViewModel.kt
    • Changed checkVertexIntersection to call updateVertices when dropping the last vertex.
    • Added hasSelfIntersection = false to the updateVertices method.
Activity
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

The DrawAreaTaskViewModel was updated to ensure that when a self-intersecting polygon's last vertex is removed, the hasSelfIntersection flag is explicitly reset to false within the updateVertices method, which is now consistently used for all vertex list modifications.

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.

[Draw area] Can't complete polygon after getting an interception error popup

1 participant