-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
MobileNav
component for smaller devices
#2361
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
MobileNav
component for smaller devices
#2361
Conversation
# Conflicts: # client/modules/IDE/components/Header/Toolbar.jsx
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 is coming along great! IMO we should clean it up a bit before merging.
opacity: 0; | ||
transform-origin: top; | ||
transition: opacity 100ms; | ||
transition: transform 100ms 200ms; |
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 think if you have two transition lines that the second overrides the first? It should be one line with both transitions in it.
The transitions are really nice though! Good work ⭐
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.
got it! replaced it with a single line, transition: opacity 100ms, transform 100ms 200ms;
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.
transform 100ms 200ms
-- that's a delay of 200ms and then 100ms for the scale transform. So the opacity transition will have completed (from 0-100ms) before the transform starts (from 200-300ms). When opening you will only see the transform and when closing you will only see the opacity. Seems like that's probably not what you intended? Maybe should be 100ms
for both with no delay? If we want different transitions for opening vs closing we could use react-transition-group
.
default: | ||
return project.name; | ||
} | ||
} |
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 don’t love this switch based on location. It feels a bit fragile, like if we were to add a new page or change a path or something we would have to change it here as well. Perhaps the alternative is that each page which includes the Nav
specifies a mobileTitle
prop which we pass down. Like <Nav layout=“dashboard” mobileTitle={t(‘Login’)} />
.
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.
yeah that's better, will update it in the future for sure, added a TODO
<Nav /> | ||
<Header | ||
syncFileContent={this.syncFileContent} | ||
key={this.props.project.id} |
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 wonder if this key
prop actually does anything? I see it’s part of the existing code. It doesn’t hurt to leave it but I strongly suspect that it’s useless.
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.
should I remove it?
|
||
Button: { | ||
primary: { | ||
default: { | ||
foreground: colors.black, | ||
foreground: grays.mediumDark, |
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 change will have implications on all button text colors throughout the app. Is that what we want? @shujuuu Probably yes but I want to double check.
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.
yeah this is should be discussed
}, | ||
secondary: { | ||
foreground: colors.black, | ||
background: grays.mediumLight |
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.
If secondary
is its own complete object then does it need a border
color?
If the only difference between primary
and secondary
(and potential tertiary
) is the background color and the rest is the same then maybe we structure it a bit differently.
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.
in mobile Panel we don't have borders, I'll check though
It seems like the "Find" command isn't working. It's very strange because "Tidy Code" does work. I confirmed that the This could be a real rabbit hole so I will look into it. It seems like the modal is appearing but somehow it's inside of the nav bar and not visible. Edit: turns out it's just a |
<button onClick={newSketch}>{t('Nav.File.New')}</button> | ||
</li> | ||
<li> | ||
<button onClick={() => saveSketch(cmRef.current)}> |
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.
On the desktop nav we have some conditions to hide the "Save" button if the user is not logged in, so we should probably do that here.
Although the usability for clicking it when logged out is pretty decent, it opens a modal telling me to log in.
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 like that we're showing the modal to log in instead of hiding the save button when the user is not logged in, what do you think?
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.
Yeah I kind of like it too 🤷 Let's keep it for now but I don't like having different logic on mobile vs desktop. When you get a chance maybe you can open an issue for discussion on how we should handle this. Like whether we should show the "Save" option on desktop and have it open the modal.
We could also def make that modal nicer. Emphasize the "Log In" action (maybe a big button?) and use a friendlier title than "Error".
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.
yeah I agree In the future we should make it nicer by adding a welcoming message with a login button to continue
A couple minor style things. Probably to save for later.
|
Use core Nav logic in MobileNav.
…T/p5.js-web-editor into dewanshmobile/mobilenav
@lindapaiste, I just added an overlay to select language, please have a look, it also indicates the selected language. |
# Conflicts: # client/modules/IDE/components/Header/Toolbar.jsx # client/modules/IDE/components/Header/Toolbar.unit.test.jsx
….js-web-editor into dewanshmobile/mobilenav
hey @lindapaiste, added the use of ProjectName, please check it out. |
Looking just like the mockups! |
className={classNames({ | ||
'current-language': label === languageKeyToLabel(language) | ||
})} | ||
aria-label={label} |
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 need to read up on ARIA best practices because I don't know if it's necessary to have an aria-label
when it's the same as the text content of the button. But we'll leave it for now.
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.
You did it! 🥳 🎊 We've fixed all of the major usability issues and I think it's ready to go! This will be such a huge improvement for our mobile users. Next up...the IDE screen.
@raclim We've been through a lot of revisions on this PR and we've gotten it to a point where it makes a lot of things better and doesn't make anything worse. There is still a lot to be improved, but it's ready to release! |
This is super amazing!!! It looks really awesome so far and I think it'll definitely gain a lot of traction from users over the next few weeks, especially as students start going back to school! Thanks again to you both for all of your work! :) I'll try to merge in #2306, #2052, and #2362 as well before starting the process for the next release, and will give an update when that's happening. Please let me know if you both feel otherwise or would prefer to prioritize any others! |
Changes:
added a
MobileNav
component to be used in smaller devices and, modified theNav
component to use the component in smaller screens.I have verified that this pull request:
npm run lint
)npm run test
)develop
branch.