mozilla-mobile / firefox-ios

Firefox for iOS
Mozilla Public License 2.0
12.22k stars 2.93k forks source link

[Toolbar redesign] The reader view icon shifts around when exiting the reader view mode #22407

Open abodea opened 1 month ago

abodea commented 1 month ago

Steps to reproduce

  1. Launch FF and access any webpage.
  2. Enter the reader mode and then exit the reader mode.
  3. Repeat step 2 a few times in a row and observe the reader view icon.

    Expected behavior

    The reader view icon should not shift around from the toolbar.

    Actual behavior

    The reader view icon shifts around when exiting the reader view mode.

    Device & build information

https://github.com/user-attachments/assets/fca3c0b0-6405-4aa8-ac87-40d021621d01

┆Issue is synchronized with this Jira Task

cpeterso commented 1 month ago

When we’re exiting reader view, we already know that the original page was reader view compatible. We can use that as a hint to optimistically add the reader view icon immediately to avoid the shifting toolbar layout.

There is a chance that the original page was reader view compatible but was updated to become reader view incompatible while we were in reader view mode, but that send like a low probability and risk. To handle this case, we could still run the reader view check when exiting reader view to determine whether we should remove the reader view icon we optimistically added to the toolbar.

cpeterso commented 3 weeks ago

Here’s a recording of the bug.

https://github.com/user-attachments/assets/8964e8a6-c3eb-4111-aca3-877f404b62d5

data-sync-user commented 1 week ago

➤ Diana Andreea Barladeanu commented:

Verified as fixed on v9000 (46854), with iPhone 15 (17.6).