-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Don't show protocol on suggestions in navigation #20350
Conversation
{ ! isURL && | ||
( filterURLForDisplay( | ||
safeDecodeURI( suggestion.url ) | ||
) || | ||
'' ) } |
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.
filterURLForDisplay()
also strips off www
in addition to protocols. I'm not sure that's what we want here.
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.
It might not be what was prescribed by #19670, but if how we're presenting the link here aligns to the purpose of how a function like filterURLForDisplay
is expected to be used, then we should embrace the consistency that comes with it. We might decide that trimming www.
is not something we want to do for URLs filtered for display, but it's a change which should happen in the implementation of filterURLForDisplay
, and not a decision we should want to make at any particular instance of where that function is used.
Or, if it is a decision that depends on the context of where the URL is presented, then we can incorporate that as an option of the function. I'm inclined to think we should try to avoid that if possible, for the sake of consistency (URLs appearing same everywhere), simplicity (smaller function signature), and maintainability (needing to make decisions is a hurdle we can often avoid).
There didn't seem to be a consensus in #19670 about whether this was the right thing to do. For the recent posts from the current site, we may not need to show a domain at all since it's implied and should be known. But for direct entry URLs, we probably should keep the full thing, including protocols. |
I'm personally a bit conflicted:
It probably should have been added to #19670, but I'll add the "Needs Design Feedback" since I think it would help to solicit additional design feedback / perspective here. |
I think visually I prefer it as it is obvious it's URL. Let's get this in and code reviewed. I think because of where it is and format, it's obviously a URL. |
6af81e0
to
7f1bf39
Compare
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.
The branch is quite old, so I've rebased it to ensure everything's still in order against the latest master
. Otherwise, the code looks solid 👍
Closes #19670
Description
On suggestions of navigation, protocols won't be shown.
How has this been tested?
LinkControl
test.LinkControl
. It doesn't affect others.Screenshots
Before:
After:
Types of changes
Simple fix. (I don't think it's either a bug or a new feature) It doesn't break anything.
Checklist: