Skip to content

refactor: rename returnOnly to subObservationMode for clarity in form handling#605

Merged
najuna-brian merged 1 commit intodevfrom
sub-observation
Apr 14, 2026
Merged

refactor: rename returnOnly to subObservationMode for clarity in form handling#605
najuna-brian merged 1 commit intodevfrom
sub-observation

Conversation

@Mishael-2584
Copy link
Copy Markdown
Contributor

@Mishael-2584 Mishael-2584 commented Apr 14, 2026

Description

Follow-up to the sub-observation / embedded child-form work: rename the init and openFormplayer flag from returnOnly to subObservationMode, tidy formplayer draft handling, and drop noisy logging on the no–persist path.

What changed

Area Change
Bridge contract FormInitData and openFormplayer options use subObservationMode?: boolean (see formulus/src/webview/FormulusInterfaceDefinition.ts).
Native (Formulus) App.tsx, FormplayerModal.tsx, and FormulusMessageHandlers.ts pass/read the new field; formInitData uses subObservationMode.
Compatibility Older bundles that still send returnOnly (top-level or under options) are still honored for one transition period.
Formplayer Types synced from Formulus; App.tsx uses subObservationMode and merges the draft-session reset when subObservationMode || observationId != null (with the same legacy read where applicable).
Logging Removed the success-path console.log in FormplayerModal for the path that does not save to the DB.

Files touched (high level)

Package Paths
formulus App.tsx, src/components/FormplayerModal.tsx, src/webview/FormulusInterfaceDefinition.ts, src/webview/FormulusMessageHandlers.ts
formulus-formplayer src/App.tsx, src/types/FormulusInterfaceDefinition.ts (via npm run sync-interface)

How to verify

  • Open a flow that uses embedded child / sub-observation mode and confirm the child session still returns JSON to the parent and does not create a stray top-level observation.
  • Smoke-test a bundle that still sends returnOnly (if you have one) to confirm it still works.

Notes

  • Run npm run sync-interface (and your usual npm run build:rn in formulus-formplayer if you ship RN-bundled assets) before merging or releasing.
  • If npm run generate for the WebView injection script fails in your environment, it is separate from this rename; native handling of options is what matters for the new key.

Copy link
Copy Markdown
Contributor

@najuna-brian najuna-brian left a comment

Choose a reason for hiding this comment

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

Confirmed working
Thanks @Mishael-2584
Image

@najuna-brian najuna-brian merged commit d5afa0c into dev Apr 14, 2026
12 checks passed
@najuna-brian najuna-brian deleted the sub-observation branch April 14, 2026 22:49
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.

2 participants