-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[PM-24722][PM-27695] - add persistent callout in settings for non-premium users #17246
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
|
New Issues (2)Checkmarx found the following issues in this Pull Request
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #17246 +/- ##
==========================================
+ Coverage 40.51% 40.82% +0.31%
==========================================
Files 3531 3542 +11
Lines 100931 101492 +561
Branches 15092 15219 +127
==========================================
+ Hits 40897 41439 +542
+ Misses 58314 58302 -12
- Partials 1720 1751 +31 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
This looks good to me! |
|
@claude: Review this PR |
libs/angular/src/vault/components/spotlight/spotlight.component.ts
Outdated
Show resolved
Hide resolved
| selector: "bit-spotlight", | ||
| templateUrl: "spotlight.component.html", | ||
| imports: [ButtonModule, CommonModule, IconButtonModule, I18nPipe, TypographyModule], | ||
| changeDetection: ChangeDetectionStrategy.OnPush, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ did you notice any weirdness in the browser extension after making this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gbubemismith Seems to be working as expected.
|
Looks like to have some conflicts |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
libs/angular/src/vault/components/spotlight/spotlight.component.ts
Outdated
Show resolved
Hide resolved
libs/angular/src/vault/components/spotlight/spotlight.component.ts
Outdated
Show resolved
Hide resolved
libs/angular/src/vault/components/spotlight/spotlight.component.html
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was the rationale for removing the separate premium component in favor of the inline spotlight callout?
Are there any other components or services that depend on or reference premium-v2.component?
Just want to make sure we're not missing any cleanup or migration steps for this component removal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cyprain-okeke Thanks for pointing this out. Looks like we have plans to remove this but it's still behind a feature flag. I've re-implemented the premium component for now.
b68cd34
apps/browser/src/tools/popup/settings/settings-v2.component.html
Outdated
Show resolved
Hide resolved
cyprain-okeke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved
| <span class="tw-text-xs" | ||
| >{{ "unlockFeaturesWithPremium" | i18n }} | ||
| <button | ||
| bitLink | ||
| buttonType="primary" | ||
| class="!tw-no-underline tw-text-xs !tw-font-semibold" | ||
| type="button" | ||
| (click)="openUpgradeDialog()" | ||
| [title]="'upgradeNow' | i18n" | ||
| > | ||
| {{ "upgradeNow" | i18n }} | ||
| </button></span | ||
| > |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| <span class="tw-text-xs" | |
| >{{ "unlockFeaturesWithPremium" | i18n }} | |
| <button | |
| bitLink | |
| buttonType="primary" | |
| class="!tw-no-underline tw-text-xs !tw-font-semibold" | |
| type="button" | |
| (click)="openUpgradeDialog()" | |
| [title]="'upgradeNow' | i18n" | |
| > | |
| {{ "upgradeNow" | i18n }} | |
| </button></span | |
| > | |
| <span class="tw-text-xs"> | |
| {{ "unlockFeaturesWithPremium" | i18n }} | |
| <button | |
| bitLink | |
| buttonType="primary" | |
| class="!tw-no-underline tw-text-xs !tw-font-semibold" | |
| type="button" | |
| (click)="openUpgradeDialog()" | |
| [title]="'upgradeNow' | i18n" | |
| > | |
| {{ "upgradeNow" | i18n }} | |
| </button> | |
| </span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed 8e02693
| @Input() persistent = false; | ||
| readonly buttonText = input<string | null>(null); | ||
| // Whether the component can be dismissed, if true, the component will not show a close button | ||
| readonly persistent = input(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: If you use input(false, { transform: booleanAttribute }); it works similar to the native disabled attribute, i.e. rather than having to do <bit-spotlight [persistent]="true" you can just write <bit-spotlight persistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cyprain-okeke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No billing file was changes
Hinton
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved, but consider resolving the comments since they introduce tech debt.
| // FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals | ||
| // eslint-disable-next-line @angular-eslint/prefer-signals | ||
| @Input({ required: true }) title: string | null = null; | ||
| readonly title = input<string | null>(null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just an FYI, but this title is now string | null | undefined. Do you actually use the null case, or could all of these be simplified to input<string> which is string | undefined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think we can remove null for all these inputs. c861772
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: We can clean up the canAccessPremium$ from the ts file, which also lets you cleanup billingAccountProfileStateService.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch! Fixed c861772
| return await this.autofillBrowserSettingsService.isBrowserAutofillSettingOverridden( | ||
| BrowserApi.getBrowserClientVendor(window), | ||
| ); | ||
| }).pipe(shareReplay({ bufferSize: 1, refCount: true })); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: What's up with defer and shareReplay({ bufferSize: 1, refCount: true })?
I don't think defer gains us anything here over from, and this observable should only be subscribed once in the template.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed this is probably overkill. Fixed c861772
| await this.autofillBrowserSettingsService.isBrowserAutofillSettingOverridden( | ||
| BrowserApi.getBrowserClientVendor(window), | ||
| ); | ||
| openUpgradeDialog() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have preferred that this be protected, but I assume it's public for test reasons?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does make testing simpler but we can easily just call component["openUpgradeDialog"]();. Fixed c861772
c861772


🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-24722
https://bitwarden.atlassian.net/browse/PM-27695
📔 Objective
This PR does the following:
📸 Screenshots
Screen.Recording.2025-11-06.at.1.08.33.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