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

Improve scigateway mobile support #1281

Merged
merged 7 commits into from
Jul 28, 2023
Merged

Conversation

kennethnym
Copy link
Member

@kennethnym kennethnym commented Jun 15, 2023

Description

This PR improves scigatway mobile support by tweaking the overall UI layout on mobile. The following components are modified:

  • Top app bar
  • Drawer
  • Home page
  • Footer

Top app bar

The app bar contains several elements:

  • Drawer button
  • Website logo
  • Page links (e.g. admin page, help page)
  • Action buttons (tutorial, settings, etc.)
  • User avatar
  • Notifications

This is fine on larger viewports, but on smaller viewports there is not enough space to show everything at once. This PR introduces a new mobile overflow menu that consolidates page links, action buttons, and the settings menu into a single menu, accessible through a new menu overflow button that is only visible on small viewports. The app bar retains the current layout on larger viewports.

New mobile overflow menu:

localhost_3000_(iPhone SE) (1)

Drawer

Currently, on larger viewports, the drawer appears next to the main content. On smaller viewports, however, this causes the main content to be too narrow to be readable or usable. This PR tweaks the behavior of the drawer so that it overlaps the main content instead. The drawer is dismissable by clicking outside of the drawer.

The drawer is also changed so that it is hidden by default on small viewports.

New drawer:

localhost_3000_(iPhone SE)

Home page

This PR improves the layout on the home page so that texts are not overflowing and are comfortably readable.

localhost_3000_(iPhone SE) (2)

Footer

Footer is now hidden on mobile. I don't know if it is required to show the footer on mobile. If it is, a mobile version of the footer needs to be designed.

Testing instructions

Add a set up instructions describing how the reviewer should test the code

  • Review code
  • Check Actions build
  • Review changes to test coverage

Agile board tracking

Closes #1254

Drawer now behaves differently on mobile
- Drawer is closed by default
- Drawer overlaps the content instead of pushing the content aside
- Drawer can be dismissed by clicking outside of it
App bar now behaves differently on mobile to prevent overcrowding:
- Page links and action buttons are collapsed into a new overflow menu
- Settings menu is embedded into the overflow menu for a unified experience
@kennethnym kennethnym added the enhancement New feature or request label Jun 15, 2023
@kennethnym kennethnym marked this pull request as draft June 15, 2023 15:45
@codecov
Copy link

codecov bot commented Jun 15, 2023

Codecov Report

Patch coverage: 96.95% and project coverage change: -0.40 ⚠️

Comparison is base (8e8e37b) 96.98% compared to head (8c1cc3d) 96.59%.

❗ Current head 8c1cc3d differs from pull request most recent head 6380a48. Consider uploading reports for the commit 6380a48 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1281      +/-   ##
===========================================
- Coverage    96.98%   96.59%   -0.40%     
===========================================
  Files           43       47       +4     
  Lines         1594     1701     +107     
  Branches       432      474      +42     
===========================================
+ Hits          1546     1643      +97     
- Misses          45       54       +9     
- Partials         3        4       +1     
Impacted Files Coverage Δ
src/routing/routing.component.tsx 96.59% <83.33%> (-2.13%) ⬇️
src/mainAppBar/mobileOverflowMenu.component.tsx 92.00% <92.00%> (ø)
...rc/navigationDrawer/navigationDrawer.component.tsx 98.30% <97.05%> (-1.70%) ⬇️
src/authentication/testAuthProvider.tsx 100.00% <100.00%> (ø)
src/homePage/homePage.component.tsx 85.00% <100.00%> (+7.22%) ⬆️
src/mainAppBar/mainAppBar.component.tsx 92.30% <100.00%> (-7.70%) ⬇️
src/mainAppBar/pageLinks.component.tsx 100.00% <100.00%> (ø)
src/mainAppBar/settingsMenu.component.tsx 100.00% <100.00%> (ø)
src/mainAppBar/styles.ts 100.00% <100.00%> (ø)
src/pageContainer.component.tsx 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@louise-davies louise-davies self-requested a review July 6, 2023 13:01
@louise-davies louise-davies marked this pull request as ready for review July 6, 2023 13:01
Copy link
Member

@louise-davies louise-davies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, just a minor issue:

The facility card is squished on mobile:
image

But otherwise, I believe it addresses all the issues raised in #1254

louise-davies
louise-davies previously approved these changes Jul 7, 2023
Copy link
Member

@louise-davies louise-davies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually ignore me - that's me being dumb. The card is only that small because the text content is small - once you fill it with more words in the description it sizes properly 😅

@kennethnym
Copy link
Member Author

kennethnym commented Jul 7, 2023

I actually think it should take up the whole width regardless of the content, as it looks more natural imo. Good catch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Visual issues with SG on mobiles
2 participants