@AntonKhorev commented on this pull request.
> + $("#sidebar-content").on("turbo:before-stream-render", event => {
+ const defaultRender = event.detail.render;
+ event.detail.render = function (streamElement) {
+ defaultRender(streamElement);
+ markWikidataLinksAsExplainable();
+ };
+ });
I was going to suggest another modification later after this PR is merged. The
Q-links work differently depending on their state, they either open a wikidata
page or add a row to the tags table. The state is invisible to the user, and
this is not the most intuitive behaviour. So I was going to suggest to keep the
Q-links working as before and have a button, likely with the wikidata logo,
that adds a wikidata row to tags. The button could be placed where we have a
color icon:

But looking at the code here, maybe it's easier to do this right away. We can
have wikidata buttons rendered server-side with delegated click listeners. Then
listening to turbo events that look for new Q-links won't be necessary.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6127#pullrequestreview-2971286305
You are receiving this because you are subscribed to this thread.
Message ID:
<openstreetmap/openstreetmap-website/pull/6127/review/2971286...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev