owid / owid-grapher

A platform for creating interactive data visualizations
https://ourworldindata.org
MIT License
1.35k stars 227 forks source link

✨ (grapher) prevent controls from overflowing #3642

Closed sophiamersmann closed 3 weeks ago

sophiamersmann commented 1 month ago

Keeps controls from overflowing on smaller screens. See screenshots 👇🏻

The "Show selection only" toggle on the table tab is moved into the settings drawer. The rest are just CSS touchups.

We compute the widths of the content switchers and the toggle to determine if there is enough space for the table toggle. I could have implemented this in a simpler way using breakpoints, but I wanted to make sure that we only hide the table toggle if absolutely necessary.

Before After
Screenshot 2024-05-23 at 18 36 23 Screenshot 2024-05-23 at 18 36 02
Screenshot 2024-05-23 at 18 35 18 Screenshot 2024-05-23 at 18 35 02
Screenshot 2024-05-23 at 18 35 27 Screenshot 2024-05-23 at 18 35 51
sophiamersmann commented 1 month ago

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @sophiamersmann and the rest of your teammates on Graphite Graphite

owidbot commented 1 month ago
Quick links (staging server): Site Admin Wizard

Login: ssh owid@staging-site-grapher-controls

SVG tester: Number of differences (default views): 1 ([3c9272](https://github.com/owid/owid-grapher-svgs/commit/3c927209d7ab6505459b3acb3b0cd8fcbc41feec)) ❌ Number of differences (all views): 6 ([99535c](https://github.com/owid/owid-grapher-svgs/commit/99535ca22831359df4e81d1282c687c2a402eec8)) ❌

Edited: 2024-06-10 12:14:38 UTC Execution time: 1.27 seconds

notion-workspace[bot] commented 1 month ago

Prevent Controls from Overflowing