Skip to content

[PM-21891] Migrate BitwardenOutlinedButton to UI module #5242

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

SaintPatrck
Copy link
Contributor

@SaintPatrck SaintPatrck commented May 21, 2025

🎟️ Tracking

PM-21891

📔 Objective

This commit moves the BitwardenOutlinedButton composable and its associated BitwardenOutlinedButtonColors data class from the app module to the ui module.

This change also updates all import statements across the application to reflect the new location of these components.

The BitwardenOutlinedButton within the authenticator module has been removed, as the ui module's version will now be used.

Important

There is a visual change as a direct result of this migration. See the screenshot below.

📸 Screeshots

Before After
image image

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

This commit renames all `java` source directories to `kotlin`.
This commit replaces the `rememberVectorPainter` composable from `authenticator` with the one provided by the platform UI module. This change promotes code reuse and consistency across the application.

The following files were updated to use the platform UI version of `rememberVectorPainter`:
- `ItemListingScreen.kt`
- `BitwardenActionCard.kt`
- `BitwardenExternalLinkRow.kt`
- `BitwardenSearchActionItem.kt`
- `TutorialScreen.kt`
- `SettingsScreen.kt`
- `BitwardenStandardIconButton.kt`
- `DebugMenuScreen.kt`
- `BitwardenStepper.kt`

The authenticator `rememberVectorPainter.kt` file has been deleted.
The standard, filled, and tonal icon button composables have been moved from the `app` module to the `ui` module. This also includes the associated `BitwardenIconButtonColors` file.

Additionally, the `BitwardenIconButtonWithResource` composable, previously in the authenticator module, has been removed as it was not being used.

The `ic_question_circle` drawable has been added to the `ui` module to support previews for these components.

All usages of these icon buttons across the application have been updated to reflect this change.
This commit introduces a type alias `BitwardenDrawable` for `com.bitwarden.ui.R.drawable`. This allows for a more concise and consistent way to reference drawable resources from the `ui` module.

The following files have been updated to use `BitwardenDrawable`:
- `BitwardenRowOfActions.kt`
- `BitwardenTonalIconButton.kt`
- `BitwardenFilledIconButton.kt`
- `BitwardenStandardIconButton.kt`
- `BitwardenOutlinedButton.kt`
- `BitwardenFilledButton.kt`
- `CompleteRegistrationScreen.kt`
- `BitwardenOutlinedErrorButton.kt`
- `BitwardenFilledErrorButton.kt`
This commit moves the `BitwardenOutlinedButton` composable and its associated `BitwardenOutlinedButtonColors` data class from the `app` module to the `ui` module.

This change also updates all import statements across the application to reflect the new location of these components.

The `BitwardenOutlinedButton` within the `authenticator` module has been removed, as the `ui` module's version will now be used.
@SaintPatrck SaintPatrck changed the title [PM-21891] Move BitwardenOutlinedButton to UI module [PM-21891] Migrate BitwardenOutlinedButton to UI module May 21, 2025
* Colors for a [BitwardenOutlinedButton].
*/
@Immutable
data class BitwardenOutlinedButtonColors(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not new. It was extracted from BitwardenOutlinedButton. It seemed out of place embedded in BitwardenOutlinedButton.

Copy link
Contributor

Logo
Checkmarx One – Scan Summary & Detailscceb21ae-3038-4360-b202-b3ddb5e49a93

Great job, no security vulnerabilities found in this Pull Request

@SaintPatrck SaintPatrck added the hold do not merge yet label May 21, 2025
Copy link

codecov bot commented May 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.57%. Comparing base (67e9bbf) to head (c9bc3b0).

Additional details and impacted files
@@                         Coverage Diff                          @@
##           ui-module/bitwarden-icon-buttons    #5242      +/-   ##
====================================================================
+ Coverage                             82.49%   82.57%   +0.07%     
====================================================================
  Files                                   693      688       -5     
  Lines                                 51381    51176     -205     
  Branches                               6932     6932              
====================================================================
- Hits                                  42389    42258     -131     
+ Misses                                 6685     6611      -74     
  Partials                               2307     2307              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@SaintPatrck SaintPatrck force-pushed the ui-module/bitwarden-icon-buttons branch from 67e9bbf to 2022ab8 Compare May 22, 2025 16:23
Base automatically changed from ui-module/bitwarden-icon-buttons to main May 22, 2025 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hold do not merge yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant