Skip to content
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

Refactor usage of the ContentCard to always use the ContentBlock component. #4357

Merged
merged 3 commits into from
Nov 21, 2024

Conversation

dseverns-livefront
Copy link
Collaborator

🎟️ Tracking

In support of the changes for https://bitwarden.atlassian.net/browse/PM-15067 and other design audits

📔 Objective

  • Normalize usage of the content block and card to be more consistent.

📸 Screenshots

  • no visual change just syntax

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation 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

val localDensity = LocalDensity.current
Column {
Row(
modifier = modifier
Copy link
Collaborator

Choose a reason for hiding this comment

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

The passed in modifier should always be on the outermost composable.

Copy link
Collaborator

Choose a reason for hiding this comment

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

To avoid the column completely you could always use the bottomDivider modifier extension.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Do'h good catch this is an error

…lock component remove custom instruction row stuffs
Copy link
Contributor

github-actions bot commented Nov 21, 2024

Logo
Checkmarx One – Scan Summary & Detailsd6ddcf3f-023a-4264-a61e-3453e7e8385a

New Issues

Severity Issue Source File / Package Checkmarx Insight
MEDIUM Privacy_Violation /app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemViewModel.kt: 875 Attack Vector

Fixed Issues

Severity Issue Source File / Package
MEDIUM Unpinned Actions Full Length Commit SHA /crowdin-pull.yml: 26

@@ -25,7 +25,7 @@ data class ContentBlockData(
@DrawableRes iconVectorResource: Int? = null,
) : this(
headerText = AnnotatedString(headerText),
subtitleText = subtitleText,
subtitleText = subtitleText?.let { AnnotatedString(it) },
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we make this:

subtitleText = subtitleText?.toAnnotatedString(),

headerText = AnnotatedString(headerText),
subtitleText = subtitleText,
headerText = headerText.toAnnotatedString(),
subtitleText = subtitleText?.toAnnotatedString(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

Row(
modifier = modifier
.fillMaxWidth()
.background(backgroundColor),
.background(backgroundColor)
.bottomDivider(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we have an scenarios where the incoming modifier will have a padding applied?

If so we might want to do something like this:

       modifier = Modifier
            .fillMaxWidth()
            .background(backgroundColor)
            .bottomDivider(
                enabled = showDivider,
                paddingStart = dividerStartPadding,
            )
            .then(modifier),

That will enforce that the background and divider is applied before any padding on the modifier.

Copy link

codecov bot commented Nov 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.00%. Comparing base (d418444) to head (19346b7).
Report is 13 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4357   +/-   ##
=======================================
  Coverage   88.99%   89.00%           
=======================================
  Files         453      452    -1     
  Lines       39097    39076   -21     
  Branches     5510     5509    -1     
=======================================
- Hits        34794    34778   -16     
+ Misses       2377     2372    -5     
  Partials     1926     1926           

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


🚨 Try these New Features:

@dseverns-livefront dseverns-livefront added this pull request to the merge queue Nov 21, 2024
Merged via the queue into main with commit 06b08d5 Nov 21, 2024
9 checks passed
@dseverns-livefront dseverns-livefront deleted the content-block-refactor branch November 21, 2024 20:50
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