Skip to content

feat: screenshot testing#4681

Open
jamesarich wants to merge 5 commits intomainfrom
feat/screenshot-testing
Open

feat: screenshot testing#4681
jamesarich wants to merge 5 commits intomainfrom
feat/screenshot-testing

Conversation

@jamesarich
Copy link
Collaborator

@jamesarich jamesarich commented Mar 2, 2026

This pull request introduces screenshot testing to the core/ui module and refactors several UI components for broader accessibility and improved modularity. The changes also include workflow updates to support the new screenshot tests and clean up of code for consistency.

Testing and Build System Enhancements:

  • Added screenshot testing support to the core/ui module by enabling experimental screenshot testing and including required dependencies in core/ui/build.gradle.kts. [1] [2]
  • Updated the reusable GitHub workflow (.github/workflows/reusable-check.yml) to allow conditional execution of screenshot tests for different flavors (Google and F-Droid). [1] [2]

Component Refactoring and Relocation:

  • Moved multiple UI components (CooldownIconButton, DeliveryInfoDialog, InfoCard, MessageActions, MessageActionsBottomSheet, MessageBubble, MessageItem, NodeItem) from feature-specific modules to core/ui/component for better reuse and maintainability. [1] [2] [3] [4] [5] [6] [7] [8]

API Accessibility Improvements:

  • Changed several functions and constants from internal to public (e.g., DrawableInfoCard, ReactionButton, ReplyButton, MessageStatusButton, MessageActions, MessageItem, MessageItemPreview, getMessageBubbleShape, cooldown constants), making them accessible outside their original modules. [1] [2] [3] [4] [5] [6] [7] [8]

Code Cleanup and Consistency:

  • Removed the unused ClickableTextField component from core/ui/component.
  • Standardized package imports and fixed minor logic issues (e.g., nullability checks and default values in NodeItem). [1] [2] [3]

These changes collectively improve test coverage, code organization, and the public API surface for UI components.

@github-actions github-actions bot added the enhancement New feature or request label Mar 2, 2026
@jamesarich jamesarich enabled auto-merge March 2, 2026 17:22
@codecov
Copy link

codecov bot commented Mar 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 16.03%. Comparing base (8c6bd8a) to head (315a507).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4681      +/-   ##
==========================================
+ Coverage   15.18%   16.03%   +0.85%     
==========================================
  Files          83       80       -3     
  Lines        4353     4122     -231     
  Branches      734      700      -34     
==========================================
  Hits          661      661              
+ Misses       3566     3335     -231     
  Partials      126      126              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jamesarich jamesarich force-pushed the feat/screenshot-testing branch 2 times, most recently from a530834 to 5caa28f Compare March 2, 2026 18:35
Integrate the experimental Android screenshot testing plugin into the `core:ui` module. This includes initial visual regression tests for Alert components and updates to the CI workflow for automated validation.

- core/ui: Add `AlertScreenshotTest` and screenshot test dependencies
- gradle.properties: Enable `android.experimental.enableScreenshotTest`
- libs.versions.toml: Add `com.android.compose.screenshot` plugin and validation API
- reusable-check.yml: Add screenshot validation tasks to GitHub Actions workflow
Move various informational UI components from the node feature module to the core UI module to improve reusability across the application. Add a comprehensive screenshot testing suite for core components.

- Relocate ChannelInfo, DistanceInfo, ElevationInfo, HopsInfo, IconInfo, LastHeardInfo, SatelliteCountInfo, and TelemetryInfo to `org.meshtastic.core.ui.component`.
- Add `ComponentScreenshotTest` in `core:ui` along with baseline reference images for battery, signal, node chips, and other UI elements.
- Remove unused `ClickableTextField` from `core:ui`.
- Update `CompassBottomSheet` to use the relocated components.
Relocate messaging and node-related UI components from feature modules to the shared core:ui module to improve reusability across the project. Enable the screenshot testing plugin and add comprehensive baseline tests for shared components.

- **feature/messaging**: Move `MessageItem`, `MessageActions`, `MessageBubble`, and `Reaction` components to core:ui.
- **feature/node**: Move `NodeItem`, `NodeStatusIcons`, `InfoCard`, and `CooldownIconButton` to core:ui.
- **core/ui**: Add new screenshot tests for `MainAppBar`, `NodeItem`, `MessageItem`, and various common UI components.
- **build.gradle.kts**: Configure the screenshot testing plugin and dependencies for node and messaging feature modules.
- Update imports and references across the codebase to reflect relocated components.
@jamesarich jamesarich force-pushed the feat/screenshot-testing branch from 5caa28f to a5be7fa Compare March 2, 2026 18:40
@jamesarich jamesarich disabled auto-merge March 2, 2026 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant