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

[CL-509][PM-16190] Avoid double scrollbar appearing when default zoom is >100% #12427

Merged
merged 4 commits into from
Dec 27, 2024

Conversation

vleague2
Copy link
Contributor

@vleague2 vleague2 commented Dec 16, 2024

🎟️ Tracking

CL-509

📔 Objective

When the default zoom is set to >100% in a chromium-based browser, the browser extension was displaying a 2nd scrollbar. This was due to the fact that we had set the extension to the max chrome extension height of 600px, but when zoomed in, less than 600px of height were available. This caused the content to need to scroll to reach its 600px height.

We had some code already to adjust the max height of the extension depending on how many pixels were available, but it was not working. This PR updates the checks so that the code works and applies the correct body size class for the height available, and also adds a check for the extension being open in a chrome tab so that we can ensure it stretches to fill the content in a tab. Zoom of up to 200% is supported.

Firefox and Safari do not apply the browser's default zoom to the extension, so the bug does not exist in those browsers and the fix should not cause any regressions there.

Note that this PR does not provide the ability to set the extension to a different zoom level than your default zoom level in a chromium browser. It also does not adjust the size of the window when you pop out the extension, so some content clipping will still occur at higher zoom levels in the popped out view. The latter can be resolved by resizing the popped out window.

📸 Screenshots

Zoom Result
100% Screenshot 2024-12-16 at 11 01 18 AM
110% Screenshot 2024-12-16 at 11 01 27 AM
125% Screenshot 2024-12-16 at 11 01 35 AM
150% Screenshot 2024-12-16 at 11 01 43 AM
175% Screenshot 2024-12-16 at 11 01 53 AM
200% Screenshot 2024-12-16 at 11 02 06 AM

⏰ 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 16, 2024

Logo
Checkmarx One – Scan Summary & Detailsd27cf528-0d45-4e5d-831c-71c7020bce7d

New Issues

Severity Issue Source File / Package Checkmarx Insight
MEDIUM Client_Privacy_Violation /bitwarden_license/bit-web/src/app/tools/access-intelligence/password-health.component.html: 50 Attack Vector
MEDIUM Client_Privacy_Violation /bitwarden_license/bit-web/src/app/tools/access-intelligence/password-health.component.html: 40 Attack Vector

Fixed Issues

Severity Issue Source File / Package
MEDIUM Client_Privacy_Violation /bitwarden_license/bit-web/src/app/tools/access-intelligence/password-health.component.html: 40
MEDIUM Client_Privacy_Violation /bitwarden_license/bit-web/src/app/tools/access-intelligence/password-health.component.html: 50

Copy link

codecov bot commented Dec 16, 2024

Codecov Report

Attention: Patch coverage is 13.88889% with 31 lines in your changes missing coverage. Please review.

Project coverage is 33.49%. Comparing base (a4db527) to head (4e4a172).
Report is 62 commits behind head on main.

Files with missing lines Patch % Lines
...er/src/platform/popup/layout/popup-size.service.ts 12.50% 14 Missing ⚠️
apps/browser/src/platform/browser/browser-api.ts 0.00% 5 Missing ⚠️
.../browser/src/platform/popup/browser-popup-utils.ts 16.66% 5 Missing ⚠️
apps/browser/src/popup/services/init.service.ts 0.00% 4 Missing ⚠️
apps/browser/src/popup/main.ts 0.00% 2 Missing ⚠️
...rc/vault/popup/settings/appearance-v2.component.ts 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12427      +/-   ##
==========================================
- Coverage   33.50%   33.49%   -0.02%     
==========================================
  Files        2916     2917       +1     
  Lines       91158    91179      +21     
  Branches    17351    17353       +2     
==========================================
- Hits        30540    30536       -4     
- Misses      58211    58243      +32     
+ Partials     2407     2400       -7     

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

@@ -8,7 +8,7 @@ import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.servic
templateUrl: "popup-page.component.html",
standalone: true,
host: {
class: "tw-h-full tw-flex tw-flex-col tw-flex-1 tw-overflow-y-hidden",
Copy link
Contributor Author

@vleague2 vleague2 Dec 16, 2024

Choose a reason for hiding this comment

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

ℹ️ I think this class was a leftover from previous implementations -- it would need to be in a flex parent, so I'm removing it since it's not doing anything. (Stumbled upon it as I was testing out different css-only approaches for this ticket.)

@djsmith85 djsmith85 linked an issue Dec 16, 2024 that may be closed by this pull request
@vleague2 vleague2 marked this pull request as ready for review December 17, 2024 14:53
@vleague2 vleague2 requested review from a team as code owners December 17, 2024 14:53
Copy link
Contributor

@willmartian willmartian left a comment

Choose a reason for hiding this comment

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

Overall looks good! Few small things:

apps/browser/src/platform/popup/browser-popup-utils.ts Outdated Show resolved Hide resolved
apps/browser/src/popup/scss/base.scss Outdated Show resolved Hide resolved
@willmartian willmartian changed the title [CL-509] Avoid double scrollbar appearing when default zoom is >100% [CL-509][PM-16190] Avoid double scrollbar appearing when default zoom is >100% Dec 18, 2024
@vleague2 vleague2 requested a review from willmartian December 19, 2024 15:11
Copy link
Contributor

@willmartian willmartian left a comment

Choose a reason for hiding this comment

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

LGTM

@vleague2 vleague2 linked an issue Dec 27, 2024 that may be closed by this pull request
1 task
@vleague2 vleague2 merged commit 4f060d8 into main Dec 27, 2024
27 checks passed
@vleague2 vleague2 deleted the ds/cl-509/double-scrollbar branch December 27, 2024 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Browser extension: bottom menu does not fit in popup Double scrollbar with default zoom greater than 100%
4 participants