Skip to content

Decouple ui:controller:impl and ui:uistateadapter:capture from ui:components:capture#507

Open
davidjiagoogle wants to merge 13 commits into
mainfrom
david/decoupleFromComponents
Open

Decouple ui:controller:impl and ui:uistateadapter:capture from ui:components:capture#507
davidjiagoogle wants to merge 13 commits into
mainfrom
david/decoupleFromComponents

Conversation

@davidjiagoogle
Copy link
Copy Markdown
Collaborator

Breaks the transitive dependency chain to exclude heavy development/tooling dependencies when JCA is embedded as an external library.

@davidjiagoogle davidjiagoogle requested a review from temcguir May 11, 2026 23:12
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the project by moving capture-related test tags and the DisabledReason enum from the ui:components:capture module to the ui:uistate module, while also adding corresponding localized string resources. Review feedback identifies a missing R class import in CaptureControllerImpl.kt required for string resource access and a bug where HDR_VIDEO_UNSUPPORTED_ON_LENS_TAG was assigned a duplicate string value.

Comment thread ui/uistate/src/main/java/com/google/jetpackcamera/ui/uistate/DisabledReason.kt Outdated
@davidjiagoogle davidjiagoogle removed the request for review from temcguir May 11, 2026 23:27
…eControllerImpl.kt and fix duplicate string value assigned to HDR_VIDEO_UNSUPPORTED_ON_LENS_TAG
…_CAPTURE_EXTERNAL_UNSUPPORTED_TAG from com.google.jetpackcamera.ui.uistate module
…ocated test tag constants across instrumentation source sets
@davidjiagoogle davidjiagoogle requested a review from temcguir May 12, 2026 00:09
Copy link
Copy Markdown
Collaborator

@temcguir temcguir left a comment

Choose a reason for hiding this comment

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

Decoupling ui:controller:impl and ui:uistateadapter:capture from ui:components:capture is the right goal for allowing JCA to be embedded externally.

However, moving test tags and UI string resources into ui:uistate highlights a deeper architectural issue: we are passing test tags through our state layer. Test tags in Compose are meant to identify structural UI nodes (e.g., a "Snackbar" component), not the data passing through them.

The cleanest architecture is to remove the testTag property from both SnackbarData and DisableRationale.

  1. Our UI tests can find the UI element using a single static tag (like SNACKBAR_NODE_TAG defined in ui:components) and then inspect its text or semantics to verify the specific message or severity.
  2. ui:controller should stop constructing SnackbarData and just emit domain events.
  3. ui:uistateadapter:capture should evaluate constraints and provide the string resources for the rationales.

This severs the dependencies on test tags across the board and makes the state layer generic. I have left a few inline comments showing how we can distribute these changes.

Comment thread ui/uistateadapter/capture/src/main/res/values/strings.xml
@davidjiagoogle davidjiagoogle requested a review from temcguir June 5, 2026 21:57
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.

2 participants