Skip to content

Conversation

@matt-livefront
Copy link
Collaborator

@matt-livefront matt-livefront commented Nov 10, 2025

🎟️ Tracking

PM-27246

📔 Objective

Fixes a spacing issue for the "Learn More" button in the "Sync with the Bitwarden app" card. I ended up moving ActionCard into BitwardenKit and adopting that in Authenticator, which brings this component up to the latest designs.

📸 Screenshots

Before After
Screenshot 2025-11-10 at 1 17 43 PM Screenshot 2025-11-10 at 1 10 10 PM
Screenshot 2025-11-10 at 1 17 32 PM Screenshot 2025-11-10 at 1 13 56 PM

⏰ 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

@matt-livefront matt-livefront requested a review from a team as a code owner November 10, 2025 20:29
@claude
Copy link

claude bot commented Nov 10, 2025

Claude finished @matt-livefront's task —— View job


Code Review Complete

Summary

The PR successfully consolidates ActionCard into BitwardenKit and updates Authenticator to use the shared component. The implementation is clean and follows established patterns.

Status of Previous Review Items

Previous Claude Finding 1 (❌): Missing shouldFillWidth parameter - FIXED in commit 077d663
Previous Claude Finding 2 (⚠️): Missing test coverage for button sizes - Remains open
Human Reviewer Request: Update icon colors - ADDRESSED in commit 95abb8a

Findings

⚠️ Finding 1: Missing test coverage for BitwardenBorderlessButtonStyle size functionality.

The style gained significant new functionality (size support with padding/font variations) but lacks test coverage. While the secondary button test was added for ActionCard, the underlying button style's size behavior remains untested.

Suggested approach

Create tests verifying:

  • Size options (small, medium, large) apply correct padding and fonts
  • shouldFillWidth parameter affects layout correctly
  • Disabled state styling works across all sizes

let message: String?

/// State that describes the secondary button.
let secondaryButtonState: ButtonState?
Copy link

Choose a reason for hiding this comment

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

💭 Consider adding test coverage for the secondary button

While the moved test file includes tests for the action and dismiss buttons, there's no test verifying the secondary button's tap interaction. Consider adding test coverage for this new functionality in ActionCard+ViewInspectorTests.swift.

Suggested test implementation
@MainActor
func test_secondaryButton_tap() async throws {
    var secondaryButtonTapped = false
    let subject = ActionCard(
        title: "Title",
        message: "Message",
        secondaryButtonState: ActionCard.ButtonState(title: "Secondary") { 
            secondaryButtonTapped = true 
        }
    )
    
    let button = try subject.inspect().find(asyncButton: "Secondary")
    try await button.tap()
    
    XCTAssertTrue(secondaryButtonTapped)
}

@github-actions
Copy link
Contributor

github-actions bot commented Nov 10, 2025

Logo
Checkmarx One – Scan Summary & Details6ee151b1-b122-488d-a1e3-8a2592f1ec58

Great job! No new security vulnerabilities introduced in this pull request

@codecov
Copy link

codecov bot commented Nov 10, 2025

Codecov Report

❌ Patch coverage is 64.64646% with 35 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.80%. Comparing base (c3ba556) to head (077d663).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...ared/UI/Vault/ItemList/ItemList/ItemListView.swift 43.39% 30 Missing ⚠️
...arance/Styles/BitwardenBorderlessButtonStyle.swift 44.44% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2123      +/-   ##
==========================================
- Coverage   85.22%   83.80%   -1.43%     
==========================================
  Files        1708     1969     +261     
  Lines      145420   160852   +15432     
==========================================
+ Hits       123940   134803   +10863     
- Misses      21480    26049    +4569     

☔ 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.

Copy link
Contributor

@KatherineInCode KatherineInCode left a comment

Choose a reason for hiding this comment

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

Looks good, just one small question.

)
) {
Image(decorative: SharedAsset.Icons.shield24)
.foregroundColor(Asset.Colors.primaryBitwardenLight.swiftUIColor)
Copy link
Contributor

Choose a reason for hiding this comment

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

🤔 Do we want to take this opportunity to update the colors here, as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, great idea.

shouldFillWidth: Bool = true,
size: ButtonStyleSize,
) -> BitwardenBorderlessButtonStyle {
BitwardenBorderlessButtonStyle(size: size)
Copy link

Choose a reason for hiding this comment

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

Finding 1: The shouldFillWidth parameter is not being passed to the initializer.

The function accepts shouldFillWidth but doesn't use it, causing the parameter to have no effect. The struct property shouldFillWidth will always use its default value of false.

Suggested fix
static func bitwardenBorderless(
    shouldFillWidth: Bool = true,
    size: ButtonStyleSize
) -> BitwardenBorderlessButtonStyle {
    BitwardenBorderlessButtonStyle(shouldFillWidth: shouldFillWidth, size: size)
}

}

/// If this button should fill to take up as much width as possible.
var shouldFillWidth = false
Copy link

Choose a reason for hiding this comment

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

⚠️ Finding 2: Missing test coverage for button size functionality.

BitwardenBorderlessButtonStyle gained significant new functionality (size support with padding/font variations), but there are no tests verifying this behavior. Consider adding tests similar to those for other button styles in the codebase.

Copy link
Member

@fedemkr fedemkr left a comment

Choose a reason for hiding this comment

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

🤔 As Claude is suggesting, should we add snapshot tests for the new behavior in ActionCard and the button style?

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.

4 participants