Skip to content

feat: add widget type dropdown and PR ID input for easier widget testing#40

Draft
irving-vega wants to merge 4 commits intodevelopfrom
chore/testing-staging-widget-version
Draft

feat: add widget type dropdown and PR ID input for easier widget testing#40
irving-vega wants to merge 4 commits intodevelopfrom
chore/testing-staging-widget-version

Conversation

@irving-vega
Copy link
Contributor

@irving-vega irving-vega commented Oct 24, 2025

🚧 Draft: Update Sample App for Upcoming SDK Release

✨ Summary

This PR updates the public sample Android apps to support the new SDK features
(widget type dropdown, PR ID configuration, etc.).
These changes align the sample app with the upcoming SDK release that includes these new capabilities.


🧩 Changes

  • Added support for:
    • Widget Type Dropdown (PRODUCTION, STAGING, PR)
    • PR ID Text Field for testing pull request builds.
  • Updated the widget URL generation logic to correctly handle PR versions and query parameters.
  • Improved configuration screen UI consistency with the internal test apps.

🧪 Testing

⚠️ Note: This PR cannot be fully tested until the next SDK release is available.

Once released:

  1. Bump the SDK dependency version in build.gradle.
  2. Run the sample app.
  3. Verify the configuration screen correctly updates and loads the appropriate widget version.

🧠 Notes

  • This PR should remain in draft until the new SDK version is published.
  • After the release, update the SDK dependency and this PR can be mark as ready for review.

Summary by cubic

Add a widget type selector (Production, Staging, PR), optional PR ID, and a consent expiration override to the sample Android apps to make testing non‑production widget versions and consent lifespan control easy. Updated SDK init and build config to support these options.

  • New Features

    • Added widget type dropdown and conditional PR ID field in the configuration screen.
    • Persist and expose widgetType/prId and consent expiration settings; pass them to AxeptioSDK init in Kotlin and Java sample apps.
  • Bug Fixes

    • Preserve query parameters when generating widget URLs with staging/PR versions.

Written for commit 92c7501. Summary will update automatically on new commits.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 10 files

Prompt for AI agents (all 1 issues)

Understand the root cause of the following 1 issues and fix them.


<file name="samplekotlin/src/main/java/io/axept/samplekotlin/config/ConfigurationManager.kt">

<violation number="1" location="samplekotlin/src/main/java/io/axept/samplekotlin/config/ConfigurationManager.kt:99">
Guard the widget type lookup against out-of-range persisted values to avoid crashes when the saved ordinal no longer matches the enum entries.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

cookiesVersion = cookiesVersion,
token = if (token.isNullOrEmpty()) null else token,
token = token?.takeIf { it.isNotEmpty() },
widgetType = WidgetType.entries[widgetType],
Copy link

@cubic-dev-ai cubic-dev-ai bot Nov 7, 2025

Choose a reason for hiding this comment

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

Guard the widget type lookup against out-of-range persisted values to avoid crashes when the saved ordinal no longer matches the enum entries.

Prompt for AI agents
Address the following comment on samplekotlin/src/main/java/io/axept/samplekotlin/config/ConfigurationManager.kt at line 99:

<comment>Guard the widget type lookup against out-of-range persisted values to avoid crashes when the saved ordinal no longer matches the enum entries.</comment>

<file context>
@@ -3,148 +3,169 @@ package io.axept.samplekotlin.config
                 cookiesVersion = cookiesVersion,
-                token = if (token.isNullOrEmpty()) null else token,
+                token = token?.takeIf { it.isNotEmpty() },
+                widgetType = WidgetType.entries[widgetType],
+                prId = prId?.takeIf { it.isNotEmpty() },
                 targetService = targetService
</file context>
Suggested change
widgetType = WidgetType.entries[widgetType],
widgetType = WidgetType.entries.getOrElse(widgetType) { WidgetType.PRODUCTION },
Fix with Cubic

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.

1 participant