-
Notifications
You must be signed in to change notification settings - Fork 325
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
Per-site Redirect Opt-out #687
Conversation
Changes: - moved global redirect toggle from Browser Action menu to the utility icon row, under "redirect" icon - added animation to utility icons - global redirect icon will enable integrations if clicked when in suspended state - menu items specific to the Active Tab are marked with additional border (just a prototype, needs refinement) - Redirect opt-out per site - new menu item in Active Tab section - when clicked on regular site toggles redirect for current FQDN and all its subdomains - when clicked on /ipns/<fqdn>/ (DNSLink) website, toggles redirect for <fqdn> - after redirect preference changes for current website, the tab is reloaded - DNSLink websites are reloaded to with URL change between IPNS path and original URL - redirect preference applies not only to requests to URLs with with FQDN of the active tab, but also to all subresource requests that have it in `originUrl` (Firefox) or `Referer` header (Chrome)
This is pretty cool @lidel 👌 In regard to the UI, I'd drop the dashed border as it gives a temporary feeling. Here's a suggestion. One minor UI change: when you hover over the power or redirect toggle, the text always refers to when everything is turned on: |
Following suggestion from #687 (comment)
The request for main page (request.type=main_request) is often optimized early by preloading DNSLink etc. We switch tests to one of subrequest types to ensure the test is not impacted by main_test logic.
This removes dotted border and introduces familiar grandient as sugegsted in #687 (comment)
@fsdiogo thank you, I switched style to follow your suggestion, looks bit cleaner: |
This adds a textarea for editing per-site opt-outs. Array is converted into multi-line text. Entries that are not valid FQDNs are dropped. The list is sorted lexicographically.
- removed unused paths from redirect-icon SVG - small code cleanup
Created some GIFs for README:
|
Added ipfsPathValidator.isRedirectPageActionsContext with tests: Per-site toggle won't be shown on internal pages and non-IPNS urls loaded from local gateway (confusing to users) Removed redundant variables in Browser Action context and made UI less jittery.
e2b2fe3
to
82cae05
Compare
Ok, I think this has been brewing for long enough.
|
@lidel in general I'm +1 on the idea. If we borrow from the UI language of IPFS Web UI, then we'd use a small caps label like: Which i think works pretty well |
@ericronne I know you have no context for this, but it's would be a useful exercise to talk you through it and get your thoughts. |
@lidel i made a prototype which packs lots of ideas out of this PR scope https://codesandbox.io/s/14y8r7qjo3 but basically i like toggles with explicit label and tooltip explaining everything like i'm 5. I prefer label texts that don't change with state.
|
@olizilla yes, would love a walkthrough! Looks like an interesting workstream; would love to get some context before attempting to lend any sage (ha) advice … |
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.
As a brand-newbie to IPFS, i don't yet grok much about this tool. Once i've taken the time to learn more, i'll open a new issue with broader design suggestions. For now, i would enclose the arrow icon with a circle, to better coordinate with the other two buttons. Then maybe move it to the front of the row. Otherwise i wonder if users might think that clicking it performs some kind of swapping function on the two functions that it lies between (f that makes any sense). Thanks!
It was raised during the review that labels should not change. This changes the UI of redirect toggles from dynamic label to static label + @material/switch
We already have it as regular menu item, and the switch glyph seems to confuse people about its purpose, so let's remove UI cruft and hide the icon toggle for now. Another small tweak is to fade out global toggle instead of hiding it in offline mode, which removes unnecessary jitter from UI.
Thank you for the feedback! Just pushed some tweaks, here is the summary of changes:
|
looks awesome !!! I would move active tab up and tools down and change "Gateway Redirect" to "Redirect to gateway". This way both global and tab redirect are together in the UI to create a visual connection between them. Another option is to change "Redirect on docs.ipfs.io" to "Gateway Redirect on docs.ipfs.io" but this one makes it bigger and with big origins it might get weird. |
+ unify labels related to redirects
I believe it is ready for a test ride in Beta channel. Update: Ready for testing: v2.7.5.748 (Beta) |
When we introduced option to opt-out from redirect per site (#687), it came with a side effect of removing IPFS context actions. This PR (aka Show IPFS Actions on DNSLink Sites): - Adds context actions on DNSLink sites (when redirect is disabled) - Adds a bunch of tests - Tweaks behavior of pin/unpin via browser action menu - Works around missing dnslink resolver under js
Changes
Icon-based global redirect toggle
To avoid miss-clicks, confusion, and to disincentivise disabling global redirect, we moved global toggle from Browser Action menu to the utility icon row, and used custom "redirect" icon:
Redirect opt-out per site
originUrl
(Firefox) orReferer
header (Chrome). This means toggle is useful to restore functionality of complex websites such as d.tube (which uses IPFS subresources from various subdomains):Opt-out Test URLs
Use below to test the per-site opt-out:
/ipns/docs.ipfs.io
)d.tube
restores playback (note: additional toggle does not impact current video, as data is cached by the website)Other
(just a prototype, needs refinement)
TODO
redirect-icon.js
(100K right now)requestId
from caches inonCompleted
||onErrorOccurred
browser.*
from browser action page to background pagelooking for feedback and ideas!