Skip to content

[PM-16915] fix: Disable custom field name confirmation for blank names - #7484

Merged
andrebispo5 merged 3 commits into
mainfrom
PM-16915-custom-field-name-required
Oct 14, 2026
Merged

andrebispo5 merged 3 commits into
mainfrom
PM-16915-custom-field-name-required

Conversation

@andrebispo5

@andrebispo5 andrebispo5 commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

PM-16915 fix: [Android] Custom fields can be saved with no labels (Name) [bug-factory poc]

branch: poc/PM-16915
base: main

🎟️ Tracking

PM-16915

📔 Objective

Automated fix produced by the bug factory (AI-49 proof of concept). POC output — review, do not merge.

verified: genuine, live, unduplicated. BitwardenTextEntryDialog's Okay button is always enabled (BitwardenTextEntryDialog.kt:60-64). Product already settled the intended behaviour on the iOS clone

📸 Screenshots

The bug was driven on an emulator before the fix; the phases' captures are in the run directory (device/). The fix itself is proven by a JVM unit test.

After fix:

image image

🧪 Proof

./gradlew :app:testStandardDebugUnitTest --tests "*VaultAddEditScreenTest*blank custom field name*" on the base code (must fail) exited 1; with the fix (must pass) exited 0.

Base run
vailable at: file:///Users/andrebispo/workspace/bitwarden/android/build/reports/problems/problems-report.html

Deprecated Gradle features were used in this build, making it incompatible with Gradle 10.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/9.8.0/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
205 actionable tasks: 5 executed, 16 from cache, 184 up-to-date

The google-services Gradle plugin needs to be applied on a project with com.android.application or com.android.dynamic-feature.
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by org.robolectric.nativeruntime.DefaultNativeRuntimeLoader in an unnamed module
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled


2 tests completed, 2 failed

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:testStandardDebugUnitTest'.
> There were failing tests. See the report at: file:///Users/andrebispo/workspace/bitwarden/android/app/build/reports/tests/testStandardDebugUnitTest/index.html

* Try:
> Run with --scan to get full insights from a Build Scan (powered by Develocity).

BUILD FAILED in 25s

Fix run

> Task :app:hiltAggregateDepsStandardDebugUnitTest UP-TO-DATE
> Task :app:hiltJavaCompileStandardDebugUnitTest NO-SOURCE
> Task :app:transformStandardDebugUnitTestClassesWithAsm FROM-CACHE
> Task :app:testStandardDebugUnitTest

[Incubating] Problems report is available at: file:///Users/andrebispo/workspace/bitwarden/android/build/reports/problems/problems-report.html

Deprecated Gradle features were used in this build, making it incompatible with Gradle 10.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/9.8.0/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD SUCCESSFUL in 23s
205 actionable tasks: 5 executed, 16 from cache, 184 up-to-date
Consider enabling configuration cache to speed up this build: https://docs.gradle.org/9.8.0/userguide/configuration_cache_enabling.html

The google-services Gradle plugin needs to be applied on a project with com.android.application or com.android.dynamic-feature.
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by org.robolectric.nativeruntime.DefaultNativeRuntimeLoader in an unnamed module
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled


🤖 Automated review

  • Round 1: 0 blocking finding(s)

⏰ Reminders before merge

  • An engineer from the owning team has reviewed this (AI-49 AC i18n #4)
  • Feedback captured as findings

Run artifacts: /Users/andrebispo/.local/share/bug-factory/runs/PM-16915

@andrebispo5 andrebispo5 added the ai-review Request a Claude code review label Oct 14, 2026
@github-actions github-actions Bot added app:password-manager Bitwarden Password Manager app context app:authenticator Bitwarden Authenticator app context t:bug Change Type - Bug labels Oct 14, 2026
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

This PR disables the Okay button in BitwardenTextEntryDialog whenever the entered text is blank (isEnabled = text.isNotBlank()). Following reviewer feedback, the check now lives inside the dialog instead of in an isConfirmEnabled parameter. The dialog has only two callers, the add-custom-field and rename-custom-field dialogs in VaultAddEditCustomFieldsButton.kt and VaultAddEditCustomField.kt, so making the check internal changes nothing for any other screen. The two new Compose tests cover empty, whitespace-only and valid names, and confirm that clicking the disabled button sends no action.

Code Review Details

No findings.

@codecov

codecov Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.80%. Comparing base (26771c2) to head (f90a1ce).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7484   +/-   ##
=======================================
  Coverage   86.80%   86.80%           
=======================================
  Files         895      895           
  Lines       65676    65676           
  Branches     9384     9384           
=======================================
  Hits        57007    57007           
  Misses       5189     5189           
  Partials     3480     3480           
Flag Coverage Δ
app-data 18.65% <ø> (ø)
app-ui-auth-tools 18.68% <ø> (ø)
app-ui-platform 16.49% <ø> (ø)
app-ui-vault 26.88% <ø> (ø)
authenticator 6.03% <ø> (ø)
lib-core-network-bridge 4.11% <ø> (ø)
lib-data-ui 1.25% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@andrebispo5
andrebispo5 marked this pull request as ready for review October 14, 2026 08:56
@andrebispo5
andrebispo5 requested review from a team and david-livefront as code owners October 14, 2026 08:56
Copilot AI balanced review requested due to automatic review settings October 14, 2026 08:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The targeted validation is correctly implemented and covered by regression tests.

0 open findings

What changed in this PR

Prevents creating or renaming custom fields with blank names.

Changes:

  • Adds configurable confirm-button validation to BitwardenTextEntryDialog.
  • Requires nonblank custom-field names.
  • Adds Compose regression tests for add and rename flows.

❓ No screenshots were provided for the disabled-button UI state.

File Description
BitwardenTextEntryDialog.kt Supports conditional confirmation.
VaultAddEditCustomFieldsButton.kt Validates new field names.
VaultAddEditCustomField.kt Validates renamed field names.
VaultAddEditScreenTest.kt Tests blank-name prevention.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

onDismissRequest: () -> Unit,
autoFocus: Boolean = false,
initialText: String? = null,
isConfirmEnabled: (String) -> Boolean = { true },

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can this be handled internally?

It looks like it is always disabled when blank

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I believe that If we use this component in other scenarios that accept empty strings, it would void that ability.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ok checked and it is not used anywhere else, let's fix that.

@andrebispo5
andrebispo5 added this pull request to the merge queue Oct 14, 2026
Merged via the queue into main with commit 5bacc94 Oct 14, 2026
28 checks passed
@andrebispo5
andrebispo5 deleted the PM-16915-custom-field-name-required branch October 14, 2026 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Request a Claude code review app:authenticator Bitwarden Authenticator app context app:password-manager Bitwarden Password Manager app context t:bug Change Type - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants