-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[PM-25083] - Autofill confirmation dialog #16835
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
base: main
Are you sure you want to change the base?
Conversation
Claude finished @jaasen-livefront's task —— View job Code Review CompleteSummary of ChangesThis PR adds a confirmation dialog for the "Fill and Save" autofill function, warning users when a site doesn't match saved login details. The implementation includes:
❌ Critical Issues1. Inverted Feature Flag Logic (apps/browser/src/vault/popup/components/vault-v2/item-more-options/item-more-options.component.ts:192)if (!isFeatureFlagEnabled) {
// Shows dialog when flag is FALSE Problem: The dialog is shown when the feature flag is disabled (
Fix: Change to 2. Hardcoded URL in Template (apps/browser/src/vault/popup/components/vault-v2/autofill-confirmation-dialog/autofill-confirmation-dialog.component.html:11)<bit-callout type="warning" icon="bwi-globe" class="tw-mb-2 tw-truncate"
>somereallylongurlthatneedstobeshortened.com</bit-callout
> Problem: The actual Fix: Use 3. TODO Left in Production Code (autofill-confirmation-dialog.component.html:19)href="TODO: Add phishing link" Problem: Production code should not contain TODO comments, especially in user-facing elements. Fix: Either add the actual phishing documentation URL or remove the link temporarily. 4. Unused Parameter (autofill-confirmation-dialog.component.ts:18, 39)savedUris?: string[]; // Defined in params
savedUris: string[] = []; // Initialized but never used Problem: The Fix: Either implement the functionality that uses 🎨 Suggested Improvements5. Missing Test CoverageThe Codecov report shows 0% coverage for 35 new lines. Both new files lack unit tests:
Recommendation: Add unit tests covering:
6. Violation of ADR-0025: TypeScript Enum Usage (libs/common/src/enums/feature-flag.enum.ts:12)export enum FeatureFlag { Issue: The project has standardized on not using TypeScript enums (see CLAUDE.md ADR-0025). This file already has a FIXME comment acknowledging this, but new entries continue to be added. Note: While this is a pre-existing issue, it's worth noting that adding to a known anti-pattern increases technical debt. Consider prioritizing the conversion to const objects. 7. Accessibility: Empty Callout Title (autofill-confirmation-dialog.component.html:10)<bit-callout type="warning" ...> Issue: The callout has an empty title attribute, which may affect screen reader announcements. Recommendation: Either provide a meaningful title (e.g., "Current website") or verify that the component handles empty titles accessibly. 8. Magic Numbers in Static Method (autofill-confirmation-dialog.component.ts:60-68)static open(
dialogService: DialogService,
config: DialogConfig<AutofillConfirmationDialogParams>,
) {
return dialogService.open<AutofillConfirmationDialogResultType>(
AutofillConfirmationDialogComponent,
{ ...config },
);
} Issue: The static Recommendation: Either add meaningful defaults/validation to justify the helper method, or consider removing it and calling 9. Inconsistent Component Initialization (autofill-confirmation-dialog.component.ts:44-46)constructor(
@Inject(DIALOG_DATA) protected params: AutofillConfirmationDialogParams,
private dialogRef: DialogRef,
) {
this.currentUri = params.currentUri;
} Issue: Only Recommendation: Either use both parameters consistently or remove 10. Missing Type Safety for Tab URL (item-more-options.component.ts:193-194)const currentTab = await firstValueFrom(this.vaultPopupAutofillService.currentAutofillTab$);
const currentUri = Utils.getHostname(currentTab.url); Issue: No null check for Recommendation: Add defensive checks: if (!currentTab?.url) {
// Handle error case
return;
} 👍 Good Practices Observed
📋 Action Items for AuthorMust Fix Before Merge:
Should Address: Consider: |
Great job! No new security vulnerabilities introduced in this pull request |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #16835 +/- ##
==========================================
+ Coverage 38.87% 38.91% +0.03%
==========================================
Files 3420 3436 +16
Lines 97313 97518 +205
Branches 14625 14663 +38
==========================================
+ Hits 37830 37947 +117
- Misses 57827 57912 +85
- Partials 1656 1659 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-26650
📔 Objective
This PR adds a new UI flow for the "Fill and Save" function to include a new dialog to confirm autofill function.
📸 Screenshots
Screen.Recording.2025-10-10.at.12.36.03.PM.mov
⏰ Reminders before review
🦮 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