Skip to content

fix(formplayer): support object GPS questions - #1033

Merged
najuna-brian merged 10 commits into
OpenDataEnsemble:devfrom
Grace256c:fix/formplayer-gps-object-rendering
Oct 28, 2026
Merged

najuna-brian merged 10 commits into
OpenDataEnsemble:devfrom
Grace256c:fix/formplayer-gps-object-rendering

Conversation

@Grace256c

@Grace256c Grace256c commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

What & Why

Fix GPS questions using the documented type: "object" schema so they render and store location data correctly.

The GPS renderer previously used formatIs('gps'), which only matched string schemas. It also expected existing GPS values to be JSON strings and always serialized newly captured locations as strings.

This change supports object-based GPS schemas while preserving compatibility with legacy string-based GPS values.

Closes #1024.

Type of Change

  • Bug fix
  • New feature / enhancement
  • Refactor / cleanup
  • Documentation
  • Chore / other

Component(s) Changed

  • formulus (React Native mobile app)
  • formulus-formplayer (form WebView UI)
  • synkronus (Go backend)
  • synkronus-cli (command-line client)
  • synkronus-portal (web admin UI)
  • desktop (Tauri app)
  • packages (tokens / components)
  • Documentation / DevOps / CI

Testing

  • Added/updated tests
  • Manually tested
  • Not applicable

Added coverage for:

  • GPS renderer selection with an object schema
  • Displaying existing object GPS values
  • Storing captured GPS data according to schema type
  • Test isolation for GPS renderer tests

Local verification:

  • pnpm run lint
  • pnpm run format:check
  • pnpm test run — 39 test files, 252 tests passed
  • pnpm run build

Checklist

  • Pre-flight checks for changed packages passed (lint / format / tests)
  • Breaking changes (if any) have migration steps
  • Related issue linked, e.g. Closes #1024

@Grace256c

Copy link
Copy Markdown
Contributor Author

Hi @najuna-brian , @Mishael-2584 , @r0ssing , I’ve completed the changes and opened the PR. When you get a chance, could you please review it and let me know if there’s anything I should adjust? Thank you.

Mishael-2584
Mishael-2584 previously approved these changes Oct 28, 2026

@Mishael-2584 Mishael-2584 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The renderer now supports object GPS schemas and stores captured data in the corresponding shape, while preserving the legacy string path.

No blocking findings from code review. Formplayer CI and the Android build are green. My local test run was blocked by missing jsdom in the existing dependency installation.

Approved from my side. Good Stuff! @Grace256c

Optional coverage improvement: add cases for legacy string values and an object GPS schema without properties, matching the original reproduction.

@Grace256c

Copy link
Copy Markdown
Contributor Author

Thank you @Mishael-2584 for the suggestion. I added coverage for legacy string GPS values and object GPS schemas without properties, and pushed the update.

@najuna-brian najuna-brian left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM! Thanks @Grace256c
Image

@najuna-brian
najuna-brian merged commit f8aa0dd into OpenDataEnsemble:dev Oct 28, 2026
15 checks passed
@github-project-automation github-project-automation Bot moved this from Triage to Done in ODE Community Board Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

[Formplayer] GPS question with type object renders an empty card; docs disagree on the type

3 participants