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

Merged
merged 30 commits into from
Oct 31, 2024
Merged

feat: mobile ui and saved scroll position #1001

merged 30 commits into from
Oct 31, 2024

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
Resolves #1016 by optional chaining the custom event location's name.

@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

@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.

Copy link
Member

@MinhxNguyen7 MinhxNguyen7 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@MinhxNguyen7 MinhxNguyen7 left a comment

Choose a reason for hiding this comment

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

Oops I didn't see that @KevinWu098 had a comment that hasn't been resolved, and it does actually matter.

@ap0nia
Copy link
Collaborator Author

ap0nia commented Oct 24, 2024

Which one? The white color on the tabs? I already fixed that, forgot to resolve it. Any other theming issues are due to the differences in MUI version, which should be resolved separately.

Oh wait, need to fix map issue.

@ap0nia
Copy link
Collaborator Author

ap0nia commented Oct 24, 2024

Wait, is the map broken on live? It looks weird on my side ...

@ap0nia
Copy link
Collaborator Author

ap0nia commented Oct 24, 2024

Ok, I think it was because the CSS from leaflet wasn't imported. Should be sorted out now. For reference, this is what I see on my screen for the live site:

image

@MinhxNguyen7
Copy link
Member

The white color on the tabs? I already fixed that, forgot to resolve it. Any other theming issues are due to the differences in MUI version, which should be resolved separately.

If you updated the MUI version, and it changed the color undesirably, than the PR would be atomic if you changed the code such that that does not occur.

Copy link
Member

@MinhxNguyen7 MinhxNguyen7 left a comment

Choose a reason for hiding this comment

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

LGTM!

@MinhxNguyen7 MinhxNguyen7 merged commit 278af4c into main Oct 31, 2024
4 checks passed
@KevinWu098 KevinWu098 mentioned this pull request Nov 4, 2024
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.

download .ics file not working Move Mobile Tabs to Bottom
4 participants