-
Notifications
You must be signed in to change notification settings - Fork 901
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
Show on App Launch: Open existing tab if Specific Page url matches #5152
Merged
mikescamell
merged 15 commits into
feature/mike/show-on-app-launch/feature-toggle
from
feature/mike/show-on-app-launch/open-specific-url-tab-if-exists
Oct 22, 2024
Merged
Show on App Launch: Open existing tab if Specific Page url matches #5152
mikescamell
merged 15 commits into
feature/mike/show-on-app-launch/feature-toggle
from
feature/mike/show-on-app-launch/open-specific-url-tab-if-exists
Oct 22, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @mikescamell and the rest of your teammates on Graphite |
10 tasks
mikescamell
changed the title
Show on App Launch: Open existing tab if urls match
Show on App Launch: Open existing tab if Specific Page url matches
Oct 18, 2024
mikescamell
force-pushed
the
feature/mike/show-on-app-launch/open-specific-url-tab-if-exists
branch
from
October 21, 2024 09:52
190ba65
to
f688c6f
Compare
This is going to make it easier for us to search for the url in the DB as we store the fully resolved url for each tab e.g. bbc.com entered in Omnibar ends up as "https://www.bbc.com/" in the DB I also added missing tests for non http/https schemes
mikescamell
force-pushed
the
feature/mike/show-on-app-launch/feature-toggle
branch
from
October 21, 2024 09:56
9786cb1
to
b9f1710
Compare
mikescamell
force-pushed
the
feature/mike/show-on-app-launch/open-specific-url-tab-if-exists
branch
2 times, most recently
from
October 21, 2024 10:25
ec5e402
to
a757aef
Compare
This is extracting the existing behaviour, in a future commit we'll fetch the resolved url Added a test to BrowserViewModelTest which isn't massively helpful but better than nothing
We'll also use the store to keep hold of the tabId that is in used when setting the SpecificPage so that we can more easily identify when we should be attempting to store this url. We'll see this in a future commit.
Now we're storing both the url and resolved urls, we need to check for duplicate tabs. Using a DB query seemed too complex and I think we can assume that we will not have 1000s of tabs to check (maybe it not in my case if XD)
We add a function to our Handler (should it be manager? 🤷) and if we know that we're on the root of the tab, we have a matching tab id with what was stored when we launched the tab, and it's not null, then we can set the resolved url in the store and re-use it for future launches to avoid duplicate tabs Next up, tabs!
I noticed we had nothing for selectTabByUrl so added some for that too
It wasn't working correctly when using queries or fragments previously so move back to using URI builder like we do with the ShowOnAppLaunchConverter I added some more tests as well
These were part of an old approach and are no longer needed
mikescamell
force-pushed
the
feature/mike/show-on-app-launch/open-specific-url-tab-if-exists
branch
from
October 21, 2024 12:03
a757aef
to
fa96fac
Compare
anikiki
approved these changes
Oct 21, 2024
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.
LGTM 👍
10 tasks
Task/Issue URL: https://app.asana.com/0/1207908166761516/1208588631698784/f ### Description When clearing data with the fire button the website set for Specific Page would load if that option was enabled. This stops that happening and instead shows the new tab page. ### Steps to test this PR _Fire button_ - [x] Open Settings - [x] Open General Settings - [x] Open Show on App Launch feature - [x] Enable Specific Page option - [x] Leave default web address - [x] Go back to Browser screen - [x] Press the fire button - [x] Wait until the app relaunches - [x] The default webpage (duckduckgo.com) should not load - [x] The new tab page should be visible ### UI changes N/A ### Demo https://github.com/user-attachments/assets/03298b73-9682-485d-8be7-50b5ad5d13a4
mikescamell
merged commit Oct 22, 2024
1399bd0
into
feature/mike/show-on-app-launch/feature-toggle
4 of 5 checks passed
mikescamell
deleted the
feature/mike/show-on-app-launch/open-specific-url-tab-if-exists
branch
October 22, 2024 16:53
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Task/Issue URL: https://app.asana.com/0/1207908166761516/1208369545355291/f
Description
This has been a marathon 🏃
This PR does the following:
Adds a trailing slash to a user entered url if appropriate
Removes
http/https
schemes andwww
subdomain when comparing the users urlTries to resolve the url entered by the user so that we can prevent duplicating tabs when opening the app
When opening the app for the first time with "Specific Url" set we:
This PR is explicitly focused on the Specific Page Url option and not the Last Opened Tab or New Tab Page options, they remain unchanged.
Steps to test this PR
Setting Specific Tab Option
Simple Duplicate Tab check
Setting Specific Tab Option to URL that resolves to something different
More complex duplicate tab check
Tab duplication only first time
Tab duplication with different paths
Tab duplication with extra tab
UI changes
N/A