Skip to content
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

Redesign nav bar, GlobalSearch, and dropdowns #3155

Open
wants to merge 57 commits into
base: master
Choose a base branch
from

Conversation

taneliang
Copy link
Member

@taneliang taneliang commented Jan 14, 2021

Summary

This PR redesigns our nav bar, global search, and all dropdowns throughout the app.

The design is inspired by FB5 (the recent facebook.com redesign) and @jiholim's NUSMods V4 mockups from 2018.

Because a huge number of things have been changed, it'll probably be easier to review this PR without looking at the existing code or behavior.

Fixes #3060 and resolves #1646 (no sidebar => no problem)

Thanks to @eugenood, @williamhutech, @chrisgzf, and @chuabingquan for the valuable input!

Redesigned nav bar

Why

We need space to put a lot more buttons in the future, including user account/info, and possibly an MPE button and planner button. The tab bar is full on mobile, and the top bar is full on desktop, leaving no good place to put auth info. This PR unifies both the mobile and desktop nav experience, and provides space on the right for logged-in user info + a dropdown menu for extra pages e.g. Contribute, Settings, MPE, etc.

Design Inspiration

FB5:

image

@jiholim's mockup:

image

GitHub:

image

What Changed

  • Nav tabs on sm-width and above are moved to the nav bar.
  • A nav dropdown has been added.
  • AY week string has been moved into the dropdown, and an academic calendar link has been added.
  • NUS Business link added.
  • Global search is now always expanded, for simpler code and greater visibility.
  • Centered page content, and tweak Today and Venues page layouts.
Before After
320px (xs) nusmods com_modules_CS1010E_programming-methodology nusmods-website-git-eliang-new-nav nusmodifications vercel app_modules_CS1010E_programming-methodology
1024px (sm) nusmods com_modules_CS1010E_programming-methodology (1) nusmods-website-git-eliang-new-nav nusmodifications vercel app_modules_CS1010E_programming-methodology (2)
1440px (xl) nusmods com_modules_CS1010E_programming-methodology (2) nusmods-website-git-eliang-new-nav nusmodifications vercel app_modules_CS1010E_programming-methodology (3)

Nav dropdown on xs

nusmods-website-git-eliang-new-nav nusmodifications vercel app_modules_CS1010E_programming-methodology (1)

Redesigned dropdown

Why

The existing dropdown did not look particularly good, and would have been weird as a nav dropdown. As I had designed a new one for the nav dropdown based on FB5's design (but it's also pretty common elsewhere), I just moved that into our global styles for consistency throughout the whole app.

The new dropdown styles also include CSS classes for items with icons and right contents.

Design Inspiration

FB5

image

Screenshots

Before After
ExportMenu image image
DropdownListFilters image image
AddModuleDropdown image image

Redesigned global search

Why

Our GlobalSearch design was a little inconsistent with the rest of NUSMods, and was extremely awkward when used with the new nav bar design, and felt dated and out of place when placed beside the new dropdown.

Design Inspiration

@jiholim's mockup:

image

What Changed

  • Dropdown now uses the global dropdown-menu styles instead of its own custom stuff.
  • The section headers (i.e. Modules and Venues) are now sticky, though this is broken on iOS. I don't know why sticky is broken on iOS, but we can fix that in a future PR as the existing design doesn't have sticky at all so we've already improved on it 😆.
  • The section headers are no longer clickable; only the View All buttons are.
  • The dropdown no longer expands as wide as it used to.
Before After
Both modules and venues present image image
Only modules image image
View All hover image image
sm viewport image image

@vercel
Copy link

vercel bot commented Jan 14, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

nusmods-website – ./website

🔍 Inspect: https://vercel.com/nusmodifications/nusmods-website/2a280s2q6
✅ Preview: https://nusmods-website-git-eliang-new-nav.nusmodifications.vercel.app

nusmods-export – ./export

🔍 Inspect: https://vercel.com/nusmodifications/nusmods-export/6m3yujq77
✅ Preview: https://nusmods-export-git-eliang-new-nav.nusmodifications.vercel.app

@taneliang taneliang marked this pull request as draft January 14, 2021 16:21
@chrisgzf
Copy link
Member

I like the idea of this! Could possibly be a fresh new change with some tweaks! How many buttons are you expecting for the mobile version of this. Might be a little cramped (espc for 320px viewports).

@chrisgzf
Copy link
Member

Toyed around with smth like this for Hack&Roll. For 1 row-nav, it felt a bit cramped already.

image

On 320px
image

Are we sticking with the 2-row nav like we currently have for mobile?

bottomBar was position:relative, which caused it to float above the page
regardless of where its parent nav bar was. This causes the tabs to
stick to the top of the screen when you rubberband-scroll on iOS.

To fix this, this commit brings the tabs inline, laying out the nav bar
using flex magic instead.

This also allows us to easily prevent the search box or other nav
bar components from overlapping with the tabs. Global search is now much
less buggy than before.
@vercel
Copy link

vercel bot commented Jan 16, 2021

Deployment failed with the following error:

Resource is limited - try again after in 9 minutes (more than 100, code: "api-deployments-free-per-day").

@vercel
Copy link

vercel bot commented Jan 16, 2021

Deployment failed with the following error:

Resource is limited - try again after in 6 minutes (more than 100, code: "api-deployments-free-per-day").

@taneliang
Copy link
Member Author

Hey @chrisgzf! Sorry I didn't notice that you commented on this haha.

For 1 row-nav, it felt a bit cramped already.

Yeah we're definitely not gonna do a 1-row nav on mobile. I'm doing something similar to the current 2-row nav.

image

@taneliang taneliang changed the title Redesign nav bar Redesign nav bar, GlobalSearch, and dropdowns Jan 27, 2021
@bnjmnt4n
Copy link
Contributor

I quite like the look of the new components, and the removal of the sidebar, but one area that bugged me was the centered links in the navbar, especially on larger viewports. I think there's a distinct feeling of the navbar being unbalanced, when the links are in the center and the large-ish search field on the right. I think a good solution would simply be to shift the navigation links to the left, next to the NUSMods logo. Will send a PR with screenshots later for reference/comparison.

@taneliang taneliang enabled auto-merge (squash) July 17, 2021 08:20
@taneliang taneliang disabled auto-merge July 17, 2021 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GlobalSearch renders unnecessarily when not empty Footer overlaps with side navbar
3 participants