Skip to content

Wire up AGP Compose Preview screenshot tests in feature-purchase-apartment (RND-1965)#2954

Closed
hugokallstrom wants to merge 14 commits into
feat/in-app-apartment-purchasefrom
eng/screenshot-test-poc
Closed

Wire up AGP Compose Preview screenshot tests in feature-purchase-apartment (RND-1965)#2954
hugokallstrom wants to merge 14 commits into
feat/in-app-apartment-purchasefrom
eng/screenshot-test-poc

Conversation

@hugokallstrom
Copy link
Copy Markdown
Contributor

Summary

  • Adds the com.android.compose.screenshot plugin (alpha15) so Compose @Preview composables annotated with @PreviewTest render to PNGs on the JVM via LayoutLib — no emulator needed.
  • Sets up feature-purchase-apartment as the canonical reference module: experimental flag, screenshotTest dependencies, and one @PreviewTest rendering ApartmentFormContent in its filled state.
  • Widens ApartmentFormContent from private to internal so the screenshotTest source set can call it.

Test plan

  • ./gradlew :feature-purchase-apartment:updateDebugScreenshotTest succeeds and writes the reference PNG to src/screenshotTestDebug/reference/...
  • ./gradlew :feature-purchase-apartment:validateDebugScreenshotTest passes against the committed reference
  • Reference PNG renders the apartment form with Storgatan 1 / 12345 / 65 / Du + 1 and the Beräkna pris button

🤖 Generated with Claude Code

hugokallstrom and others added 14 commits March 31, 2026 18:30
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ls, and GraphQL

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…re module restriction

The hedvig.gradle.plugin prevents feature modules from depending on other
feature modules. Moving the shared purchase code out of the feature/ directory
makes it a library module that feature modules can depend on.

Also fixes: Apollo fragment resolution (each module gets its own fragment),
Material3 dropdown replaced with design system DropdownWithDialog.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…uting

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Shows a HedvigNotificationCard with error priority when the form
submission fails, instead of silently swallowing the error.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary screen now shows an error notification card when add-to-cart or
start-sign fails, instead of navigating to a separate failure screen.

Signing screen now shows an error with retry button when polling fails
or signing is rejected, instead of navigating away.

Removed the Failure destination from both nav graphs since all errors
are now handled inline with retry.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ng screen, remove form titles

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…er flow

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…-apartment

Adds the com.android.compose.screenshot plugin (alpha15) so @previewTest
composables render to PNGs on the JVM via LayoutLib. Sets the apartment
form's filled-state preview as the first screenshot test.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hugokallstrom hugokallstrom requested a review from a team as a code owner May 22, 2026 12:14
@notion-workspace
Copy link
Copy Markdown

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