-
Notifications
You must be signed in to change notification settings - Fork 711
[css-nav-1] Improve the name of window.navigate #3387
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
Comments
Migrated from WICG/spatial-navigation#120 (comment)
|
Maybe the spatial navigation starting point (and/or sequential focus navigation starting point) should be exposed as an object that is a subclass of
I don't know if there are use cases for getting the |
I agree that "navigate" is problematic, because of its potential for confusion with The problem extends beyond this particular property to all the interface names. E.g. Throwing out some potential names (forgive me if these have previously been discussed & discarded):
I like "explore". You're exploring the page. You can explore to the left, you can explore up or down, but you can also explore next or previous items in a list. You can explore only focusable items, or all content. For other API names, |
@zcorpan @AmeliaBR Thank you for your opinions!
Interesting idea! Exposing spatial navigation starting point (and/or sequential focus navigation starting point) as an object may be useful because sometimes those aren't the same with However,
I have thought the similar thing about this! What do you think about this idea? (+ @frivoal)
Indeed.
I also like |
@zcorpan using the staring point as the object from which this hangs seems like a good idea but I'm less sure about replacing |
For implementors, I guess it would be the same effort? I prefer an API that's Easy To Use And Hard To Misuse (EUHM). It is possible to misspell a string. Also, with an explicit function for each direction, authors could easily check if a direction is supported (check if the function exists) before calling it? |
I disagree that the extensibility is lost. We can always add more methods, and if something requires an argument (like angle), that can also still be done with a new method. I think there are two advantages of using multiple methods over a single method:
|
I think Other existing or proposed APIs have seemingly been pretty consistent about using unqualified “navigate” to refer to the HTML definition of navigate, with unqualified “navigator” referring to the agent (or ... something along those lines anyway, but it’s intelligible as “the thing that navigates” in the prior sense).
The collision gets a lot uglier with AppHistory on the horizon exposing interaction with HTML’s “navigate” through an evented API:
It’s not great to squat on generic terms for specific concepts. (Seems like there is agreement about that here already overall.) The AppHistory API is an example that avoids the “terminology manspreading” problem by using a consistent prefix for global contstructs (and the events don’t fire on window/document). I think the word “navigate” does make sense here, but it should likely be consistently qualified as spatial navigation (e.g. |
@bathos , Thank you for listing up the issues and discussion related to "navigate"! |
I like the idea of putting a separate For the navigation function name itself, I'd like to suggest Something like |
Migrated from WICG/spatial-navigation#120
Originally created by @frivoal on Wed, 17 Oct 2018 05:21:10 GMT
Previously in #70, we discussed whether
window.navigate()
was a great name for this API or not. It seems like it could be confused with navigating to a new URL, so some better name would be good.However, no suggestion so far seems to work:
focusNavigate()
or other names invoking focus are wrong, because it can also scroll things instead of focusing themdirectionalNavigate()
orspatialNavigate()
or similar are also problematic, because this method should be possible to extend to sequential navigation by passing it a"prev"
or"next"
argument, and that does not work with such names.So, leaving this issue open to see if we can do better.
The text was updated successfully, but these errors were encountered: