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

BWA-124 - 'Copy' Option Missing from Long-Press Menu #300

Merged

Conversation

phil-livefront
Copy link
Collaborator

@phil-livefront phil-livefront commented Dec 11, 2024

🎟️ Tracking

BWA-124

📔 Objective

  • Implemented the option to copy an item from the long-press menu. While items could already be copied by clicking on them, adding this functionality to the menu was straightforward.
  • Renamed "Copy to Bitwarden" to "Move to Bitwarden" to align with the updated Figma design.
  • Refactored the action handling logic to use an enum for dropdown menu actions, consolidating logic and improving maintainability. Added missing tests to cover the new functionality.

📸 Screenshots

Screen_recording_20241211_001056.mp4

⏰ 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

Copy link
Contributor

github-actions bot commented Dec 11, 2024

Logo
Checkmarx One – Scan Summary & Detailsd035b246-918b-429e-b0f6-92e90265c438

No New Or Fixed Issues Found


is ItemListingAction.EditItemClick -> {
handleEditItemClick(action)
handleItemClick(action.authCode)

Choose a reason for hiding this comment

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

Not a blocker for me, but more a discussion. @david-livefront on the password manager I know we have been avoiding unwrapping actions at this level and always passing the full action into the handle*() function. I am seeing there are somethings in the when that already kind of break away from some of those conventions like sending events, but curious if we want to keep that pattern up in Auth too.

Copy link
Collaborator

Choose a reason for hiding this comment

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

That is a good point, it is a little odd here that these are not actions though. I wonder if the handle moniker is the problem 🤔

)

viewModel.trySendAction(
ItemListingAction.DropdownMenuClick(VaultDropdownMenuAction.DELETE, LOCAL_CODE),

Choose a reason for hiding this comment

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

⛏️ named args


viewModel.eventFlow.test {
viewModel.trySendAction(
ItemListingAction.DropdownMenuClick(VaultDropdownMenuAction.COPY, LOCAL_CODE),

Choose a reason for hiding this comment

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

⛏️ named args here too :)

.first { it.data != null }

val didLaunchAddTotpFlow = authenticatorBridgeManager.startAddTotpLoginItemFlow(
totpUri = item.data!!.toOtpAuthUriString(),
totpUri = item.data?.toOtpAuthUriString() ?: "",

Choose a reason for hiding this comment

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

we can replace the ?: "" with .orEmpty()

message = R.string.value_has_been_copied.asText(action.authCode),
),
)
private fun handleItemClick(authCode: String) {
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 add copy to this function name

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 good call

*/
data class MoveToBitwardenClick(val entityId: String) : ItemListingAction()
data class DropdownMenuClick(
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️

Copy link

@dseverns-livefront dseverns-livefront left a comment

Choose a reason for hiding this comment

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

@phil-livefront phil-livefront merged commit ad90785 into main Dec 12, 2024
7 checks passed
@phil-livefront phil-livefront deleted the phil/BWA-124-copy-option-missing-from-long-press-menu branch December 12, 2024 05:29
Copy link

codecov bot commented Dec 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 0.00%. Comparing base (ea1a4e4) to head (3bf48d3).
Report is 1 commits behind head on main.

Additional details and impacted files
@@     Coverage Diff     @@
##   main   #300   +/-   ##
===========================
===========================

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

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