Skip to content

Conversation

@latin-panda
Copy link
Collaborator

@latin-panda latin-panda commented Dec 30, 2025

Closes #560

I have verified this PR works in these browsers (latest versions):

  • Chrome
  • Firefox
  • Safari (macOS)
  • Safari (iOS)
  • Chrome for Android
  • Not applicable

What else has been done to verify that this works as intended?

Test case: Errors messages in desktop
Test case: Errors messages in mobile
Test case: Full-screen experience
Test case: readonly map
readonly-map.mp4
Test case: geoshape
test-shape.mp4
Test case: geotrace
test-trace.mp4
Regression test: geopoint with "maps" and "placement-map" appearances
geopoint-regression.mp4
Regression test: select with "map" appearance
select-with-map-regression.mp4

Why is this the best possible solution? Were any other approaches considered?

This is an extension of the current feature:

  • Follows the same pattern of small components for modularity and ease of maintenance
  • Follows the same pattern of adding new features as configurable capabilities in each mode type.
  • Reuses existing utilities without having side effects on existing features due to small pure functions with defined responsibilities.

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

  • Mostly extension code, regression test is done in case an unintended reactive value state is in the selected feature/vertex

Do we need any specific form for testing your changes? If so, please attach one.

  • It can be tested using existing test forms.

What's changed

  • Adds a dialog component to allow users to paste a value or upload a GeoJSON or CSV file
  • Adds an expandable component to display advanced features in the map
  • Updates the status bar component to fit a new button that displays the advanced features panel
  • Adds a new utility function in mapHelpers.ts to perform basic validation and return coordinates based on whether the expected feature is a point, line string, or polygon. This is used to return the correct coordinate format after the user pastes a value or uploads a file to overwrite an existing feature.
  • Exposes existing utility functions that parse GeoJSON format for reusability and renames file from createFeatureCollectionAndProps.ts to ‎geojson-parsers.ts
  • Adds utility functions to parse the first feature in a GeoJSON file and CSV file to geojson-parsers.ts
  • Adds two new capabilities to the mode config of the map: 'canUpdateFeatureCoordinates' and 'canUpdateVertexCoordinates'
  • Adds test coverage and updates visual e2e tests

@changeset-bot
Copy link

changeset-bot bot commented Dec 30, 2025

🦋 Changeset detected

Latest commit: 3478e9e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@getodk/web-forms Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

mapFeatures?.saveFeature(feature);
// Refresh selected vertex.
const vertexIndex = feature.get(SELECTED_VERTEX_INDEX_PROPERTY) as number | undefined;
events.onVertexSelect(getVertexByIndex(feature, vertexIndex));
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This refresh updates the status bar and the advanced panel after a vertex is deleted or updated.

@latin-panda
Copy link
Collaborator Author

Testing finished and recorded evidence

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.

Editing coordinates for a vertex

2 participants