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

feat: mobile ui and saved scroll position #1001

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open

feat: mobile ui and saved scroll position #1001

wants to merge 26 commits into from

Conversation

ap0nia
Copy link
Collaborator

@ap0nia ap0nia commented Aug 20, 2024

Summary

Save the scroll position of the previous tab when switching to a new tab, and restore the scroll position if the previous tab is revisited.

Move the tabs to the bottom and accommodate for mobile-specific factors like the bottom edge of the phone, rounded corners, etc.

Testing

Mobile Responsiveness

  1. Open the website in desktop mode. The calendar and the tabs with search, added courses, and map should be side-by-side.
  2. Shrink the viewport to a mobile layout. There should be tabs on the bottom.

Ensure that the calendar and tabs are synchronized with their media queries.
Ensure that the elements are visually balanced at all points during the viewport shift.

Scroll Save

  1. Search for "CS" in the "search courses tab."
  2. Scroll down at least two full screen heights, and take note of the courses displayed.
  3. Switch to the "map" tab.
  4. Switch back to the "search" tab and verify that the same courses are displayed.

Project

Continuation of #999. I was originally trying to review it and figure out how I would actually implement it so i could provide feedback, but it ended up covering a larger scope.

Resolves #976

@ap0nia ap0nia self-assigned this Aug 20, 2024
@ap0nia ap0nia requested a review from KevinWu098 August 20, 2024 13:35
Copy link
Member

@KevinWu098 KevinWu098 left a comment

Choose a reason for hiding this comment

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

Broadly speaking, great PR on a much needed update. Separate even from moving tabs from top to bottom, really love that we're refactoring out our hardcoded styling values (which I'm definitely guilty of perpetuating).

Code-wise, I only have nits as to naming and comments. But since this is a "preview", it definitely has some UI problems (including, but not limited to):

  1. Calendar is broken -- tabs don't display right (height is probably not 100dvh)
  2. Search Result is broken -- tabs don't display right (height is probably not 100dvh)
  3. Padding is a little much (maybe padding={0.5} would be better than 1)
  4. On iPhones, although dvh is fantastic, we may want to add padding to the bottom as the iPhone "navigation bar" does still overlap on PWA

apps/antalmanac/src/components/SharedRoot.tsx Show resolved Hide resolved
Comment on lines +1 to +2
import { Event, FormatListBulleted, MyLocation, Search } from '@mui/icons-material';
import { Box, GlobalStyles, Paper, Stack, Tab, Tabs, Typography, useMediaQuery, useTheme } from '@mui/material';
Copy link
Member

Choose a reason for hiding this comment

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

issue (style): tab text color is now blue when selected, rather the original white (contrast problem)

Screenshot 2024-08-20 at 9 37 18 AM

apps/antalmanac/src/components/SharedRoot.tsx Show resolved Hide resolved
@github-actions github-actions bot added the Stale label Sep 21, 2024
@ap0nia ap0nia changed the title chore: preview for mobile responsiveness feat: mobile responsiveness Sep 23, 2024
@ap0nia ap0nia changed the title feat: mobile responsiveness feat: mobile ui and saved scroll position Sep 23, 2024
@github-actions github-actions bot removed the Stale label Sep 23, 2024
Copy link
Member

@KevinWu098 KevinWu098 left a comment

Choose a reason for hiding this comment

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

Looks great, left two comments regarding styling:

  1. We're not accounting for header height, so 100dvh is too tall
  2. Our Mui v5 palette isn't correct, and it makes the tabs hard to read. Without expanding this PR to cover palette updates, I'd suggest using v4's tabs

apps/antalmanac/src/components/Calendar/CalendarRoot.tsx Outdated Show resolved Hide resolved
apps/antalmanac/src/components/Calendar/CalendarRoot.tsx Outdated Show resolved Hide resolved
apps/antalmanac/src/routes/Home.tsx Outdated Show resolved Hide resolved
@ap0nia ap0nia requested a review from KevinWu098 October 1, 2024 20:03
Copy link
Member

@KevinWu098 KevinWu098 left a comment

Choose a reason for hiding this comment

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

Beautiful, fabulous, tremendous!

I don't want to hold up this PR over a slight contrast problem (I'm happy to submit a PR following this one fixing it), so I'm going to approve

Feel free to merge or to rerequest review after looking at the tab contrast stuff, both are fine by me at this point since I think this PR is a big win for mobile users that I don't want held up

@MinhxNguyen7
Copy link
Member

@KevinWu098, I'm going to take your word for it, but @ap0nia, do you know why the tests are failing?

@KevinWu098
Copy link
Member

KevinWu098 commented Oct 10, 2024

@KevinWu098, I'm going to take your word for it, but @ap0nia, do you know why the tests are failing?

looks like this PR is the source: #1004

@ap0nia
Copy link
Collaborator Author

ap0nia commented Oct 10, 2024

Oh, let me try tweaking the test to use real building numbers.

@MinhxNguyen7
Copy link
Member

| looks like this PR is the source: #1004
Oops, that's my bad. I must've ignored it because the deploy doesn't work either (for external contributors)

@ap0nia
Copy link
Collaborator Author

ap0nia commented Oct 10, 2024

I handled possibly nullish values and updated the test snapshots.

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

Successfully merging this pull request may close these issues.

Move Mobile Tabs to Bottom
4 participants