Skip to content

Use compose UI#168

Closed
kirklandsign wants to merge 10 commits into
mainfrom
compose-p2
Closed

Use compose UI#168
kirklandsign wants to merge 10 commits into
mainfrom
compose-p2

Conversation

@kirklandsign

Copy link
Copy Markdown
Contributor

No description provided.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jan 21, 2026
The app was rewritten from View-based Java to Compose-based Kotlin.
The tests were still using Espresso with View IDs which no longer exist.

Changes:
- Replace ActivityScenario with createAndroidComposeRule
- Replace Espresso matchers with Compose semantics matchers
- Use onNodeWithText/onNodeWithContentDescription instead of withId
- Update dialog dismissal to use Compose AlertDialog button text
- Simplify test structure while maintaining same test coverage
- Add scrollTrigger counter in ChatViewModel that increments on each token
- Update ChatScreen LaunchedEffect to scroll on scrollTrigger changes
- Add FocusManager and clickable modifier to clear focus when tapping
  outside the input field, which dismisses the keyboard
The BasicTextField was using the default primary color (blue) for the
cursor while the text was white/black depending on theme. Added
cursorBrush parameter with SolidColor(appColors.textOnInput) to ensure
the cursor matches the text color.
- Add testTag("chat_input_field") to BasicTextField for reliable test access
- Create typeInChatInput() and clearChatInput() helper functions
- Improve waitForModelLoaded() to detect both success and error states
- Increase model loading timeout from 60s to 90s for slower devices
- Update all tests to use testTag-based text input instead of text matching

BasicTextField doesn't support performTextInput() without semantic actions,
so using testTag allows Compose testing framework to properly interact
with the text field.
@kirklandsign kirklandsign deleted the compose-p2 branch January 21, 2026 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant