Repository navigation
Compile the Android screenshot module again - #1014
Merged
Merged
Conversation
:screenshot compiles app sources through srcDirs and symlinks, and the app moved on without it. 438 compile errors had two causes: - 360 unresolved `R`: shared sources import dev.opencode.mobile.R, but the module's namespace generated dev.opencode.mobile.screenshot.R. Use the app's namespace. - 78 from app files the included sources now depend on but the module never compiled: UiText, keyboard navigation, focus ring and pointer input, bottom sheet detents and follow, tag, skeleton illustration, and SessionFailure with its domain message models. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Optional. Adds a JDK 21 step to Android Checks that compiles :screenshot so app refactors that break it fail the pull request. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ivanfenenko
marked this pull request as ready for review
November 10, 2026 08:15
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.
What was broken
android/screenshot(the Paparazzi module behind thepublish-ui-snapshotsskill and./gradlew :screenshot:recordPaparazziDebug) failed:screenshot:compileDebugKotlinwith 438 errors. It compiles app sources throughsrcDirs and symlinks, it is only in the build on a Java 21 Gradle JVM, and CI runs on JDK 17. So nothing noticed when app changes broke it.Two causes:
R. The module's namespace wasdev.opencode.mobile.screenshot, so it generateddev.opencode.mobile.screenshot.R. Shared app sources (file-type icon tables, theme, split pane, sheet, failure chrome, …) importdev.opencode.mobile.R. The icon tables alone account for 315.UiText(theme), keyboard navigation (OpenCodeInputFocus)openCodeFocusRingandopenCodeSecondaryClick/openCodeSwallowSecondaryPress(buttons, inputs, top bar, gallery)OpenCodeTag,OpenCodeSkeletonIllustration(OpenCodeBottomSheet)SessionFailure, whichSessionFailureChromenow imports fromdomain.messageJudging by
git log, this started with the file-type icons (#772) and grew with session failures (#834), keyboard support (#928), localisation (#975), and bottom sheet stops (#996). I inferred that from the history and did not bisect.What changed
screenshot/build.gradle.kts: use the app's namespace,dev.opencode.mobile, so shared sources resolveR. Add theui/keyboard,ui/text, anddomain/textsource directories.ui/components/:OpenCodeFocusRing,OpenCodePointerInput,OpenCodeBottomSheetDetents,OpenCodeBottomSheetFollow,OpenCodeTag,OpenCodeSkeletonIllustrationdomain/message/:MessageModels,FollowUpDelivery,ToolInterruption,TimelineNoticedomain/agent/AgentModels,domain/json/ServerPayloadJson./gradlew :screenshot:compileDebugKotlin. Locally the compile takes a few seconds once the app's dependencies are resolved. Drop that commit if you don't want a second JDK on the runner.Checks
JAVA_HOME=<JDK 21> ./gradlew :screenshot:compileDebugKotlin: 438 errors onmainbefore the change; BUILD SUCCESSFUL after it, with 0 errors and 0 warnings.JAVA_HOME=<JDK 21> ./gradlew :screenshot:compileDebugKotlin --rerun-tasks --no-build-cache --no-configuration-cache: BUILD SUCCESSFUL.JAVA_HOME=<JDK 21> ./gradlew :screenshot:assembleDebug: BUILD SUCCESSFUL.JAVA_HOME=<JDK 21> ./gradlew :screenshot:recordPaparazziDebugwith the skill's throwawayTextInputSnapshotEvidencetest: BUILD SUCCESSFUL. It recorded a correct PNG of the text input on the JVM, with no emulator. The test and PNG were deleted afterwards (both are gitignored)../gradlew :app:assembleDebug :app:testDebugUnitTest(JDK 17): BUILD SUCCESSFUL, 3507 tests, 0 failures, 0 errors, 1 skipped.:screenshot: clean merge, BUILD SUCCESSFUL.gitleaks git --pre-commit --stagedbefore each commit: no leaks.Risks / Follow-ups
UiTexttodomain.text, which is already a source directory here, and movesSplitPanePreferencesintoui/components/layout, which is also a source directory. Its deletion of theSplitPanePreferencessymlink does not overlap this diff. After Type live events in the domain; move UiText and SplitPanePreferences out of the wrong layer #1012 merges, theui/textsrcDir points at an empty or missing directory. That is harmless, and it can be deleted in a follow-up.MessageModelsand its same-package dependencies), all of which are plain Kotlin and serialization. If those files start depending on Hilt or repository code, the screenshot module will need another symlink or a narrower seam. The optional CI step would catch that.:screenshot. It would clash only if the module were ever added as a dependency of:app.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.