Skip to content

feat: [DEV-1180] NoCodes — typed defaultVariables on the loadScreen entity, remove onScreenShown overloads#838

Merged
SpertsyanKM merged 4 commits into
developfrom
kamo/dev-1180-nocodes-sdk-rework-paywall-data-exposure-typed
Jul 16, 2026
Merged

feat: [DEV-1180] NoCodes — typed defaultVariables on the loadScreen entity, remove onScreenShown overloads#838
SpertsyanKM merged 4 commits into
developfrom
kamo/dev-1180-nocodes-sdk-rework-paywall-data-exposure-typed

Conversation

@SpertsyanKM

Copy link
Copy Markdown
Contributor

Issue: DEV-1180

Android counterpart of qonversion/qonversion-ios-sdk#702 — rework of the DEV-1167 exposure API (#830/#831). That API shipped only in prerelease-nocodes/1.10.0 — the latest public release No-Codes 1.9.3 does not contain it, so removing it is not a public breaking change.

What changed

  • QNoCodeScreen.defaultVariables — typed default variables configured in the builder, plus a defaultVariable(key) lookup; mapped from the payload in loadScreen.
  • QScreenVariable.kind (Custom / Product / Unknown) with tolerant mapping: missing kind (pre-DEV-1180 payload) → Custom, unknown kind (future backend) → Unknown. value is now a typed sealed class (Bool / Str / Num / None) instead of Any? — never publicly released, so free to change.
  • Delegate overloads removed: onScreenShown(screenId, products) and (screenId, products, variables) are gone from NoCodesDelegate, NoCodesDelegateWrapper and the ScreenContract/ScreenPresenter/ScreenFragment chain; only the id-only callback remains (the wrapper now overrides it to keep main-thread posting).
  • products removed from the internal NoCodeScreen DTO and ScreenMapper.

Wire compatibility

Payload key stays variables (additive kind per entry); products key dropped. Backend counterparts: qonversion/dash-mono#556, qonversion/configurator#259, qonversion/api-gateway#580.

Testing

  • :nocodes:compileReleaseKotlin + root detektAll clean; :nocodes/:sdk unit tests green.

Part of DEV-1180

🤖 Generated with Claude Code

https://claude.ai/code/session_015YXuzBxSjRGXowA2ovkXx2

SpertsyanKM and others added 4 commits July 15, 2026 18:48
…ve onScreenShown overloads

Rework of the DEV-1167 exposure API (prerelease-only, no public breaking change):
- QNoCodeScreen gains defaultVariables + defaultVariable(key) lookup, mapped
  from the screen payload in loadScreen.
- QScreenVariable gains Kind (Custom | Product | Unknown) with tolerant
  mapping: a missing kind (pre-DEV-1180 payload) defaults to Custom, an
  unknown kind maps to Unknown instead of failing the screen load. The value
  is now a typed sealed class (Bool / Str / Num / None) instead of Any?.
- The onScreenShown(screenId, products) and (screenId, products, variables)
  overloads are removed from NoCodesDelegate, the wrapper and the fragment
  call chain; only the id-only callback remains. The wrapper now overrides
  the id-only callback to keep main-thread posting.
- products is removed from the internal NoCodeScreen DTO and ScreenMapper.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015YXuzBxSjRGXowA2ovkXx2
…reen

The sample still overrode the removed 3-arg onScreenShown ('overrides
nothing' compile error — caught in review; :sample is not compiled by
pr-checks). The screen-shown handler is now id-only, and the load-then-show
flow showcases the new API instead: it logs the typed defaultVariables
(kind, key, sealed-class value) from the loaded QNoCodeScreen before
presenting.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015YXuzBxSjRGXowA2ovkXx2
Review feedback from testing:
- QScreenVariable.Kind gains SelectedProduct (wire: selected_product) — the
  screen's Default Product, key always default_selected_product.
- defaultVariable(key, kind) — keys are only unique within a kind (a custom
  variable and a product slot may share a name), so the lookup accepts an
  optional kind filter (@jvmoverloads for Java callers).
- QScreenVariableValue.asString() renders any value as a plain string (bools
  as true/false, integral numbers without a trailing .0, None as "").
- Sample logs variables via asString().

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015YXuzBxSjRGXowA2ovkXx2
The selected_product entry's key is an internal wire detail — consumers
should not need a magic string or a kind-only scan. The typed shortcut
resolves the builder's Default Product directly (null when none configured).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015YXuzBxSjRGXowA2ovkXx2
@SpertsyanKM
SpertsyanKM merged commit 156d7c7 into develop Jul 16, 2026
1 check passed
@SpertsyanKM
SpertsyanKM deleted the kamo/dev-1180-nocodes-sdk-rework-paywall-data-exposure-typed branch July 16, 2026 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant