Refactor FXIOS-14403 - [Performance] - Eliminate redundant blur view updates during BVC dismissal
:scroll: Tickets
:bulb: Description
-
Performance profiling revealed that frequent calls to
updateBlurViewswere causing tab tray hangs during BVC dismissal. This PR eliminates unnecessary blur view updates during view controller transitions. -
Root Cause:
updateBlurViewswas invoked repeatedly duringBVCdismissal, creating performance bottlenecks. -
As you can see, pretty bad hangs related to
updateBlurViewsmethod. -
Solution: Introduced a
shouldLayoutSubviewsflag that prevents blur view updates during transitions: -
When the tab tray button is tapped,
viewDidLayoutSubviewswas called approximately 2 times afterviewWillDisappear. -
Each call triggered
updateBlurViews, which was unnecessary during the transition animation. -
The new flag blocks these updates during BVC → Tab Tray transitions.
Hangs before these changes:
Hangs with changes in this PR.
- No more hangs related to
updateBlurViewsmethod, only micro hangs left to solve during presenting/dismissal animations.
:pencil: Checklist
- [x] I filled in the ticket numbers and a description of my work
- [x] I updated the PR name to follow our PR naming guidelines
- [x] I ensured unit tests pass and wrote tests for new code
- [x] If working on UI, I checked and implemented accessibility (Dynamic Text and VoiceOver)
- [x] If adding telemetry, I read the data stewardship requirements and will request a data review
- [x] If adding or modifying strings, I read the guidelines and will request a string review from l10n
- [x] If needed, I updated documentation and added comments to complex code
Tested with these changes, did not see any regressions regarding translucency.
| Messages | |
|---|---|
| :book: | Project coverage: 38.1% |
🧹 Tidy commit
Just 1 file(s) touched. Thanks for keeping it clean and review-friendly!
💬 Description craftsman
Great PR description! Reviewers salute you 🫡
🦊 BrowserViewController Check
We’re tracking the size of BrowserViewController.swift to keep it healthy.
- ✨ Change in file size: +16 lines
❌ Per-file test coverage gate
The following changed file(s) are below 35.0% coverage:
| File | Coverage | Required |
|---|---|---|
firefox-ios/Client/Frontend/Browser/BrowserViewController/Views/BrowserViewController.swift |
29.7% | 35.0% |
Client.app: Coverage: 37.28
| File | Coverage | |
|---|---|---|
| BrowserViewController.swift | 29.68% | ⚠️ |
Generated by :no_entry_sign: Danger Swift against ccb71e7d530178b929f372d3acd4c0edcf31fc0f
We should wrab all changes in a toolbarTranslucencyRefactor check.
Ok, I will.
Closing... It is easier to fix some of the issues for isToolbarTranslucencyRefactorEnabled in a new PR.