-
Notifications
You must be signed in to change notification settings - Fork 11
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
Pinned tabs #639
Pinned tabs #639
Conversation
…pinned tabs to disk
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.
Hi @samsymons! Thank you very much for the review. The problem you highlighted is actually a regression and it's caused by adding I missed the fact that adding I will remove the With this change, the glitch you reported will only be visible in the following scenario:
Other cases would work fine, feel free to test it after my 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.
Re-approved 🎉
…ear about scoping pinned tabs burning to a set of domains
Hi @samsymons! There are some small changes that I had to make as a result of the Product Review. It's mainly removing previous changes:
It would be great if you could have another look. Many thanks 🙌 |
Neat, I was able to see the constraint visualizer in action. 🙂 Not through any error on your part, this is an existing problem. I actually have all sorts of problems with this pop-up window, including a possible retain cycle... I'll write it up. That's all unrelated to the new changes and just some things I noticed while testing, the new code looks good. 👍 |
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.
New changes and behaviour look good, nice job getting that done with a short turnaround time. 👍
* release/0.27.0: Set version to 0.27.0. Update embedded data. Avoid the data import button being disabled too frequently (#650) Autoconsent refactoring (#643) Refresh top level entities when updating a bookmark (#651) Pinned tabs (#639) Remove local history of the remaining window's tab collection after burning all data (#645) Revert "bump BSK to shane/autofill-username" bump BSK to shane/autofill-username Scroll to selected tab after inserting to ensure that it is visible (#642)
Task/Issue URL: https://app.asana.com/0/0/1187695805145593/f
Tech Design URL:
Description:
Pinned tabs are shared between windows. As such, the TabCollection, TabViewModels
and Tabs live in a PinnedTabsManager instance owned by WindowControllersManager.
Even though pinned tabs collection is the same for every window, the selection
is local to window and interferes with window's unpinned tab collection.
Hence, every TabCollectionViewModel contains a reference to pinned tabs manager and:
is used to update the unpinned tabs collection view),
selectionIndex
andselectedTabViewModel
,removing, duplicating and replacing).
TabIndex
enum was introduced to describe tabs in the tab bar area (both unpinnedand pinned). Pinning and unpinning happens via TabCollectionViewModel API as well.
Since pinned tabs are shared between windows, so are their webviews, and it becomes
a bit tricky with multiple windows and selecting the same pinned tab in more than
one window. BrowserViewController intercepts window become/resign key events and
performs additional logic to replace a webview with its snapshot as needed. It gets
even more complicated because WKWebView contents can only be snapshotted using
a dedicated, asynchronous method. Some glitches can be observed, but Safari is not
much better at it. This has become even more tricky to handle at application startup,
so I ended up not persisting pinned tab selected index and default to first unpinned
tab in such situation (that's also in line with Safari).
Navigating from a pinned tab to a different domain always opens a new unpinned tab,
hence some additional logic inside
Tab.webView(_:decidePolicyFor:)
.Tab Lazy Loading starts with pinned tabs when there are any, before moving on to
other tabs.
Fire button action does not work on pinned tabs, but they are not explicitly listed
anywhere (only the information about pinned tabs is displayed). This is achieved
by fireproofing pinned tabs' domains right before the fire action and removing
fireproofing right after. This can of course cause pinned tabs to become permanently
fireproof if you quit the app while burning, but we have an even more serious privacy
issue related to that.
Steps to test this PR:
Testing checklist:
Internal references:
Software Engineering Expectations
Technical Design Template
When ready for review, remember to post the PR in MM