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

Use protomaps for the tiles layer #1663

Merged
merged 8 commits into from
Jun 13, 2024
Merged

Use protomaps for the tiles layer #1663

merged 8 commits into from
Jun 13, 2024

Conversation

mxdvl
Copy link
Collaborator

@mxdvl mxdvl commented May 10, 2024

What does this change?

Use the protomaps tile base layer instead of OSM:

Before After
osm protomaps

How was this tested?

How have you tested your changes?

  • pnpm dev
  • local Storybook

Accessibility

If applicable to your changes, have you:

  • Tested with screen reader
  • Checked to see if navigable by keyboard
  • Ensured that the colour contrast is passing

Documentation

If applicable to your changes, have you:

  • Added/edited the appropriate documentation
  • Added any component(s) to Storybook

- free non-commercial API usage
- less colourful layer blends better in the background
- support for high-DPI / retina displays out of the box
Copy link

vercel bot commented May 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
toiletmap ✅ Ready (Inspect) Visit Preview Jun 13, 2024 1:45pm

Copy link

📦 Next.js Bundle Analysis for toiletmap

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

@mxdvl mxdvl requested a review from ob6160 May 10, 2024 10:25
Copy link

cypress bot commented May 10, 2024

Passing run #1230 ↗︎

0 63 0 0 Flakiness 0

Details:

Merge 2677bd8 into 2f03ff8...
Project: GBPTM Commit: 335931a8e1 ℹ️
Status: Passed Duration: 01:51 💡
Started: Jun 13, 2024 1:48 PM Ended: Jun 13, 2024 1:50 PM

Review all test suite changes for PR #1663 ↗︎

this does not trigger a re-render
on every map movement by default,
and removes the derived state
Copy link

📦 Next.js Bundle Analysis for toiletmap

This analysis was generated by the Next.js Bundle Analysis action. 🤖

🎉 Global Bundle Size Decreased

Page Size (compressed)
global 194.6 KB (-1 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

@mxdvl mxdvl mentioned this pull request May 10, 2024
5 tasks
@mxdvl mxdvl added ui dependencies Pull requests that update a dependency file suggestion Chromatic starts the Chromatic GitHub action workflow labels May 11, 2024
Copy link
Collaborator

@marxian marxian left a comment

Choose a reason for hiding this comment

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

Hey @mxdvl!

Thanks for this :-) It certainly looks lovely.

I have some worries about color contrast accessibility and also about the removal of map features like landmarks.
I fear that these two aspects will cause problems for folk using the map to find a loo and navigating to it.

Can we affect these aspects?

@mxdvl
Copy link
Collaborator Author

mxdvl commented May 15, 2024

I have some worries about color contrast accessibility and also about the removal of map features like landmarks. I fear that these two aspects will cause problems for folk using the map to find a loo and navigating to it.

Can we affect these aspects?

It’s definitely possible to adjust.

I’ve created two alternative base maps with different colour schemes:

For Points of Interests (POI) the data comes from OSM all the same, so I’ll have a look at adding things like landmarks

EDIT: exploration in #1670

@mxdvl mxdvl mentioned this pull request Jun 10, 2024
5 tasks
Try new map, or revert to old map
Copy link

📦 Next.js Bundle Analysis for toiletmap

This analysis was generated by the Next.js Bundle Analysis action. 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 197.07 KB (🟡 +5 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

@mxdvl
Copy link
Collaborator Author

mxdvl commented Jun 10, 2024

With the latest changes I’ve now made this opt-in with a control in the bottom left corner. This enables us shipping the feature via a soft launch for keen users while we keep improving the base styles. Once we are satisfied with the custom map look, we can make it the default experience and allow users to opt out and try to gather feedback when they do.

ob6160
ob6160 previously approved these changes Jun 11, 2024
Co-authored-by: Rupert Redington <rupert@lola.tech>
Copy link

📦 Next.js Bundle Analysis for toiletmap

This analysis was generated by the Next.js Bundle Analysis action. 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 197.07 KB (🟡 +5 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

One Page Changed Size

The following page changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load % of Budget (200 KB)
/ 12.19 KB 209.26 KB 104.63% (🟢 -0.01%)
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 10% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.

- more constrasting colours
- more distinct public places
- make styles closer to popular maps
- add points of interests
- add railway stations
Copy link

📦 Next.js Bundle Analysis for toiletmap

This analysis was generated by the Next.js Bundle Analysis action. 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 197.07 KB (🟡 +4 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

One Page Changed Size

The following page changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load % of Budget (200 KB)
/ 12.19 KB 209.26 KB 104.63% (🟢 -0.01%)
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 10% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.

@ob6160 ob6160 self-requested a review June 12, 2024 15:03
Copy link
Member

@ob6160 ob6160 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!

I think it'd be good to persist the users' choice in local storage. It seems odd to me that I'd want to opt-in only to lose my opt-in on the next reload.

Edit: We already do this for filter choices, so there is precedent for this

@ob6160 ob6160 self-requested a review June 12, 2024 15:06
@ob6160 ob6160 dismissed their stale review June 12, 2024 15:07

Req changes

for a less jarring return experience
Copy link

📦 Next.js Bundle Analysis for toiletmap

This analysis was generated by the Next.js Bundle Analysis action. 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 197.12 KB (🟡 +53 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

One Page Changed Size

The following page changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load % of Budget (200 KB)
/ 12.19 KB 209.31 KB 104.66% (🟢 -0.02%)
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 10% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.

Copy link

📦 Next.js Bundle Analysis for toiletmap

This analysis was generated by the Next.js Bundle Analysis action. 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 197.13 KB (🟡 +68 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

One Page Changed Size

The following page changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load % of Budget (200 KB)
/ 12.19 KB 209.33 KB 104.66% (🟢 -0.01%)
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 10% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.

Copy link
Member

@ob6160 ob6160 left a comment

Choose a reason for hiding this comment

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

I love this, can't wait to see how it goes!
🗺️ 💎

@mxdvl mxdvl added Chromatic starts the Chromatic GitHub action workflow and removed Chromatic starts the Chromatic GitHub action workflow labels Jun 13, 2024
@mxdvl mxdvl merged commit 58a21b8 into main Jun 13, 2024
19 checks passed
@mxdvl mxdvl deleted the mxdvl/protomaps branch June 13, 2024 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Chromatic starts the Chromatic GitHub action workflow dependencies Pull requests that update a dependency file enhancement suggestion ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants