-
-
Notifications
You must be signed in to change notification settings - Fork 440
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
[General] Refactor and enable spatial navigation #869
Conversation
<Library showRecentsOnly library={recentGames} /> | ||
)} | ||
<Library library={library} /> | ||
<div className="listing"> |
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.
This allows me to remove the position: sticky of the header
}} | ||
className="gameLogo" | ||
/> | ||
<img src={imageSrc} className={imgClasses} alt="cover" /> |
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.
I moved from a span to an img so it handles dimensions with the element, that helps with the dimensions of the wrapper a
tag
@@ -4,6 +4,7 @@ | |||
width: var(--content-width); | |||
height: 100%; | |||
position: fixed; | |||
top: 0px; |
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.
I had to add this fix after adding the .listings
wrapper
@@ -48,6 +48,11 @@ | |||
animation: apparition 0.3s ease-in forwards; | |||
} | |||
|
|||
.listing { |
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.
this puts the scroll here instead of in the .content
element
max-height: 266px; | ||
min-width: 130px; | ||
min-height: 173px; | ||
.gameCard > a { |
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.
There are many changes in this file, some are new styles, some are just me moving things around so similar elements are together, and are refactors like moving width, min-width and max-width to a widh: clamp(...) property and things like that
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.
Tested here and works really good. Great job and thanks for that! :D
This PR adds the
enable-spatial-navigation
flag so the app can be navigated using the arrow keys so the keyboard accessibility is better (and this may enable the spatial navigation to use with the gamepad). The PR includes some refactoring that fixed the bugs with the browser's native spatial navigation, this way we don't have to use a javascript solution.I had to make some refactoring to fix the spatial navigation:
I'll add some comments in the diff.
I tested moving around the app with the arrow keys, tried installing a game, cancelling the installation, opening a game details and executing a game.
EDIT: since I was already refactoring things on that screen, I did a small refactor to fix the
back to top
button that got missing and the html was duplicatedUse the following Checklist if you have changed something on the Backend or Frontend: