[openstreetmap/openstreetmap-website] Image download with user feedback (PR #6192)

mmd notifications at github.com
Thu Jul 24 19:42:53 UTC 2025


@mmd-osm commented on this pull request.



> +    $("#export-image").on("turbo:submit-end", async function (event) {
+      if (event.detail.success) {
+        await handleExportSuccess(event.detail.fetchResponse);
+      } else {
+        await handleExportError(event);
+      }
+    });

I tested this version, and it seems to work. However, both handle* functions would still return a Promise which is resolved later. In the meantime, Turbo submit cleanup code continues to run. That's not so bad here as it resets UI element statuses mainly, and it's the very last event in this whole process.

One thing I found a bit strange is that I see jquery-simulate as Event dispatcher, based on a jquery 1.7.2 version. 

That's function `dispatch` in the screenshot below, node_modules/jquery-simulate/external/jquery-1.7.2/jquery.js:3331

<img width="813" height="376" alt="image" src="https://github.com/user-attachments/assets/2d984a61-2a88-4a72-a6f6-31363e440298" />

I'm not so sure why I'm seeing this code outside of unit tests. It would be nicer to test Turbo without this intermediate jquery code.

jquery-simulate describes itself as "Simulate events to help unit test user interactions.". Maybe it's used in a different way in this project?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6192#discussion_r2229429352
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/6192/review/3053053790 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250724/370f9f10/attachment.htm>


More information about the rails-dev mailing list