Commit ac00ff4
Add spinner feedback when clicking UMAP clusters
Show the UMAP spinner immediately when a user clicks on a cluster or image in the semantic map, providing visual feedback during processing. The spinner is hidden after the cluster selection and UI updates complete.
- Added showUmapSpinner() call at the start of handleClusterClick()
- Added showUmapSpinner() call at the start of handleImageClick()
- Wrapped operations in try/finally to ensure spinner is always hidden
- Added requestAnimationFrame delay to ensure UI updates before hiding spinner
This improves UX on large photo collections where cluster selection can be slow.
Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
Add setTimeout(0) to allow spinner to render before heavy computation
The issue was that the synchronous operations were executing immediately after showing the spinner, without giving the browser a chance to paint the DOM changes. By adding `await new Promise(resolve => setTimeout(resolve, 0))`, we yield control back to the event loop, allowing the browser to render the spinner before the expensive cluster sorting operations begin.
This ensures the spinner is visible during the 1-3 second delay on large clusters.
Co-authored-by: lstein <111189+lstein@users.noreply.github.com>1 parent 3f698b1 commit ac00ff4
File tree
3 files changed
+60
-36
lines changed- photomap/frontend
- static
- css
- javascript
- templates/modules
3 files changed
+60
-36
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1256 | 1256 | | |
1257 | 1257 | | |
1258 | 1258 | | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
1259 | 1286 | | |
1260 | | - | |
1261 | | - | |
1262 | | - | |
1263 | | - | |
1264 | | - | |
1265 | | - | |
1266 | | - | |
1267 | | - | |
1268 | | - | |
1269 | | - | |
1270 | | - | |
1271 | | - | |
1272 | | - | |
1273 | | - | |
1274 | | - | |
1275 | | - | |
1276 | | - | |
1277 | | - | |
1278 | | - | |
1279 | | - | |
1280 | | - | |
1281 | | - | |
1282 | | - | |
1283 | | - | |
1284 | | - | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
1285 | 1292 | | |
1286 | | - | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
1287 | 1298 | | |
1288 | 1299 | | |
1289 | 1300 | | |
1290 | 1301 | | |
1291 | 1302 | | |
1292 | 1303 | | |
1293 | | - | |
1294 | | - | |
1295 | | - | |
1296 | 1304 | | |
1297 | | - | |
1298 | | - | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
1299 | 1310 | | |
1300 | | - | |
1301 | | - | |
1302 | | - | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
1303 | 1325 | | |
1304 | 1326 | | |
1305 | 1327 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
| 121 | + | |
121 | 122 | | |
122 | 123 | | |
123 | 124 | | |
| |||
0 commit comments