Repository navigation
Conversation
…urvey renderer [ENG-3645]
Dhruwang
marked this pull request as ready for review
October 8, 2026 07:06
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…eir coverage [ENG-3645]
…ut [ENG-3645] The report read android/build/tmp/kotlin-classes/debug, which AGP 9 no longer writes, so every coverage run produced an empty report (main shows 0.0% too) and any PR adding coverable lines failed the new-coverage gate.
itsjavi
reviewed
Oct 8, 2026
itsjavi
reviewed
Oct 8, 2026
setAppearance called before the renderer existed was a no-op, yet it was recorded as applied, so the survey stayed light and repeats were dropped. The page now reports onSurveyRendered and the fragment holds the change until then; the listener is registered before the first resolve.
…ion [ENG-3645] Creating the first WebView resets the Activity's configuration to the phone's, so an app forced dark via AppCompatDelegate got a light survey. An explicit AppCompat night mode (local, else default) now wins.
|
itsjavi
approved these changes
Oct 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Ref ENG-3645
What & why
Was: Android surveys always rendered light, and the SDK dropped the workspace's compiled custom CSS.
Now:
Formbricks.setAppearance(LIGHT | DARK | SYSTEM)switches surveys, live while open. Compiled workspace and survey CSS reach the renderer.setup, or via the config builder. Surviveslogout, resets on app restart, never sent to the server. Unknown strings log and fall back to light.SYSTEMfollows the app's night mode (Activity configuration, soAppCompatDelegatecounts), not the phone's.evaluateJavascriptwith?., so older servers stay light. The listener is removed inonDestroyView.isAlgorithmicDarkeningAllowed, 29-32forceDark) so it cannot invert the survey.customCssforwarded untouched, empty fields omitted, no key when there is none.Where to look
FormbricksFragment.kt: live switch,onConfigurationChanged, listener cleanup.Appearance.kt: state andSYSTEMresolution.FormbricksViewModel.kt:appearanceandcustomCssprops.Coverage
SYSTEMresolution, listeners,customCssomit/forward, Settings decode with and without itAppearanceInstrumentedTestandFormbricksViewModelInstrumentedTest(new cases). Rerun:./gradlew :android:connectedDebugAndroidTestScreen recording and screenshots
Full-quality recording (mp4)
Emulator (Pixel, API 36) against a local server on the dark-mode and custom-CSS epic branch; workspace CSS gives pill buttons in light and amber in dark. The demo build temporarily allowed
http://localhost; that is not in this PR.Open gaps
uiModeinconfigChanges, a night-mode change recreates it and the survey reloads (answers lost), as on rotation. Documented in the README.setAppearance; older servers stay light.Breaking changes
FormbricksConfiggains a defaultedappearancefield,SettingsandSurveya defaultedcustomCss).Migrations & env
None. CI fix: JaCoCo and
sonar.java.binariesreadbuild/tmp/kotlin-classes/debug, which AGP 9 no longer writes, so coverage was empty on every run (includingmain). They now readbuild/intermediates/built_in_kotlinc/debug/compileDebugKotlin/classes.Agent: claude-sonnet-5-5 (Claude Code), effort unknown.