[openstreetmap/openstreetmap-website] Viewing a changeset loses context of previous changeset list (#647)

Anton Khorev notifications at github.com
Tue Nov 1 14:53:23 UTC 2022


> > It seems that "fixing" this involves an awful lot of complicated and fragile javascript

~350 lines added, ~50 lines removed, 4 files and this is including tests.

> If the basic behaviour was that pagination worked properly without javascript, then we could use a small amount of javascript to enhance this (e.g. viewing more items without a full page reload).
> But what we have is javascript-only psuedo-pagination,

I don't alter the current pagination to make a smaller change first. This way I can avoid making server-side changes.

Currently the pagination works with these requests
https://www.openstreetmap.org/user/(username)/history?list=1&max_id=(id)
returning a limited amount of changesets starting from the specified id. It's possible to add full pages with urls like this, for example
https://www.openstreetmap.org/user/(username)/history?max_id=(id)
then have "Load more" to link to them. Is it going to be "pagination working properly without javascript"?

> and then we're looking at adding even more javascript to make it behave more like regular page loads. This seems the wrong strategy.

That's what router.js already does.

> I also think adding more javascript that's changing urls,

Which I don't do yet.

> hooking into the browser page reloads etc, 

Which I also don't do. https://github.com/openstreetmap/openstreetmap-website/pull/3774 only detects if a reload happened. And it's not required, you just wouldn't know about a reload and wouldn't know to flush the cache for this reason.

> is either duplicating or will eventually conflict with [turbo](https://turbo.hotwired.dev/), which broadly covers this kind of functionality. I'm not saying we should use turbo to as part of the fix (although I'd happily review that) but what I want to avoid is making our lives harder in future.

Do you want a bigger rewrite?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/647#issuecomment-1298624196
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/issues/647/1298624196 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20221101/7c135151/attachment.htm>


More information about the rails-dev mailing list