Klimatbyran / klimatkollen

https://www.klimatkollen.se
MIT License
45 stars 48 forks source link

Municipality links take long to do anything #640

Open LudwikJaniuk opened 5 months ago

LudwikJaniuk commented 5 months ago

In the list of all municipalities, each municipality name is a link, but there is a delay when you click it. You only see something happen after 1-2 seconds (on my machine)

To Reproduce image Click on a municiaplity name (clearing caches might make a difference) and notice that it takes a long time from the click to something actually happening. For me it's 1-2 seconds.

Expected behavior I expected to directly get some feedback that I had clicked, e.g. seeing the new page start to load.

Additional context Based on a comment from @Greenheart:

Kanske för att det tog lång tid att ladda kommunsidorna efter att de klickats? Det kommer nog bli snabbare när vi förbättrar hur vi laddar in data osv.

This might be because it takes a long time for the municipality page to load. Reducing that time could certainly improve this. However, IMO the navigation should happen immediately, and not wait for any loading to happen.

Greenheart commented 5 months ago

I think this is caused by several factors, but here are my main ideas of how to speed up the navigation:

It probably won't be worth making major changes for the existing site though, but we'll keep this in mind for the new site. This is also one of the reasons to move away from Next.js and React to reduce both the code and data needed to show the webpage. I expect to see good improvements in this area in the coming months :)