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 and rewrite mobile styling #899

Merged
merged 50 commits into from
Dec 27, 2023

Conversation

anth-volk
Copy link
Collaborator

@anth-volk anth-volk commented Nov 26, 2023

This commit reworks our current mobile styling templates so as to make the site more mobile-friendly. Fixes #844 and #877.

In my opinion, this should be pushed after #867. After #867, this PR will likely face merge conflict errors, at which point I would need to fix the buttons (as #867 changes the default button padding and renames/rewrites certain buttons). This PR is built with those changes in mind, which is why if you preview this commit off that branch, certain buttons are slightly off padding-wise.

🤖[deprecated] Generated by Copilot at 5a4cfe7

Summary

📱🔎♻️

This pull request improves the responsiveness, usability, and modularity of the policy engine app, especially for mobile devices. It refactors the policy and household calculator pages, extracts and adds props to some components, adjusts the styles and layouts of some components, and hides or deletes some redundant components. It also removes some whitespace in a markdown table in a blog post.

We're the masters of the grid, we flex our styles with skill
We search and edit variables, we shape the policy at will
We optimize for mobile devices, we make the calculators shine
We're the PolicyRightSidebar, we're the rulers of the line

Walkthrough

  • Add moreOnClick prop to NavigationButton component to enable extra functionality on click (link, link)
  • Adjust marginTop style of VariableEditor component for mobile devices (link)
  • Hide BottomCarousel component for mobile devices in HouseholdOutput and PolicyOutput components (link, link)
  • Use useDisplayCategory hook to get display category based on window width and adjust fontSize and flexDirection styles accordingly in NetIncomeBreakdown and CalculatorInterstitial components (link, link, link, link, link, link, link)
  • Change layout of PolicyRightSidebar component from flex to grid and remove or modify margin styles of SearchOptions and PolicySearch components (link, link, link, link)
  • Move ParameterSearch component from PolicyPage to controls folder and add callback prop (link, link)
  • Rename MobileHouseholdPage component to MobileCalculatorPage and move it to layout folder (link)
  • Use MobileCalculatorPage component for both household and policy calculators and pass type prop (link, link, link)
  • Add callback prop to VariableSearch component (link, link)
  • Remove whitespace in markdown table of Budgetary impacts section in autumn-statement-2023 post (link)
  • Delete src/pages/household/MobileHouseholdPage.jsx file (link)

Copy link
Contributor

@nikhilwoodruff nikhilwoodruff left a comment

Choose a reason for hiding this comment

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

Some comments here- looks amazing.

image

  • Can we get the chart to fill the space sensibly?

  • Can we use the drawer from antd for the new menu?

image

  • Can we avoid centering horizontally?

@anth-volk
Copy link
Collaborator Author

I'm going to convert this to a draft PR so that it doesn't re-run actions every time I commit

@anth-volk anth-volk marked this pull request as draft November 29, 2023 00:01
@nikhilwoodruff nikhilwoodruff marked this pull request as ready for review December 4, 2023 10:48
@nikhilwoodruff nikhilwoodruff marked this pull request as draft December 4, 2023 17:21
@anth-volk anth-volk force-pushed the fix/mobile_styling branch 3 times, most recently from ffda4bc to 1a65f3f Compare December 19, 2023 01:34
@nikhilwoodruff nikhilwoodruff marked this pull request as ready for review December 20, 2023 16:29
@anth-volk
Copy link
Collaborator Author

A Loom video of what these edits do in mobile is available at https://www.loom.com/share/4af0bc7cae8d435d9f51c0e0549c50a9?sid=c2b00346-ad40-4fab-8adc-bfff547b78bb. Please note that the reason there are two scroll boxes at some points in the video is that I selected a simulated mobile device longer than my desktop browser screen.

@anth-volk
Copy link
Collaborator Author

@nikhilwoodruff was hoping you might be able to review this second round of edits.

Copy link
Contributor

@nikhilwoodruff nikhilwoodruff left a comment

Choose a reason for hiding this comment

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

Video looks great- thanks @anth-volk!

@nikhilwoodruff nikhilwoodruff merged commit a576977 into PolicyEngine:master Dec 27, 2023
2 checks passed
@anth-volk anth-volk deleted the fix/mobile_styling branch November 8, 2024 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Fix obscured/scrolled elements in mobile view
2 participants