Commit 24b5d46
Simplify and optimize MapView, NodePanel, and popup
Code reuse:
- Export getOsmUrl from popup.ts and import it in NodePanel.vue, removing
the identical duplicate that existed in both files
i18n:
- Fix hardcoded English "by" in popup.ts organizingEntityHtml — now uses
t('panel.by'), which is already translated in all 9 locales
Code quality:
- Extract getOrganizerNames() in NodePanel.vue so formatOrganizers() and
hasMoreHosts() share the name-extraction logic instead of duplicating it
- Hoist isTextInput guard in MapView handleKeydown to a single early-return,
removing the repeated !isTextInput && check from every key branch
Performance:
- Build nodeMap (id → Node) alongside markerMap in MapView; applyMarkerLabels
now does O(1) map lookups instead of O(n) Array.find per marker
- Replace non-terminating forEach in slidingWindowHandler with a for…of loop
that breaks on first match, and use nodeMap for O(1) node lookup
- Add descPreview and calLinks computed properties in NodePanel so
getDescPreview() and calendarLinks() are not called twice per render
- Remove unnecessary document.body.appendChild/removeChild in downloadIcs —
the anchor element does not need to be in the DOM to trigger a download
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent f2851d7 commit 24b5d46
3 files changed
Lines changed: 34 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
205 | 206 | | |
206 | 207 | | |
207 | 208 | | |
208 | | - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
209 | 215 | | |
210 | 216 | | |
211 | 217 | | |
212 | 218 | | |
213 | 219 | | |
214 | 220 | | |
215 | 221 | | |
216 | | - | |
| 222 | + | |
217 | 223 | | |
218 | 224 | | |
219 | 225 | | |
220 | | - | |
| 226 | + | |
221 | 227 | | |
222 | 228 | | |
223 | 229 | | |
224 | | - | |
| 230 | + | |
225 | 231 | | |
226 | 232 | | |
227 | 233 | | |
228 | | - | |
| 234 | + | |
229 | 235 | | |
230 | 236 | | |
231 | 237 | | |
| |||
354 | 360 | | |
355 | 361 | | |
356 | 362 | | |
| 363 | + | |
357 | 364 | | |
358 | 365 | | |
359 | 366 | | |
| |||
368 | 375 | | |
369 | 376 | | |
370 | 377 | | |
371 | | - | |
| 378 | + | |
372 | 379 | | |
373 | 380 | | |
374 | 381 | | |
| |||
430 | 437 | | |
431 | 438 | | |
432 | 439 | | |
433 | | - | |
| 440 | + | |
434 | 441 | | |
435 | | - | |
| 442 | + | |
| 443 | + | |
436 | 444 | | |
437 | | - | |
| 445 | + | |
438 | 446 | | |
439 | 447 | | |
440 | 448 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
135 | 136 | | |
136 | 137 | | |
137 | 138 | | |
138 | | - | |
139 | 139 | | |
140 | | - | |
141 | 140 | | |
142 | 141 | | |
143 | 142 | | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | 143 | | |
151 | 144 | | |
152 | 145 | | |
153 | 146 | | |
154 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
155 | 152 | | |
156 | | - | |
| 153 | + | |
157 | 154 | | |
158 | 155 | | |
159 | 156 | | |
160 | 157 | | |
161 | 158 | | |
162 | | - | |
| 159 | + | |
163 | 160 | | |
164 | 161 | | |
165 | 162 | | |
| |||
189 | 186 | | |
190 | 187 | | |
191 | 188 | | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
| |||
365 | 365 | | |
366 | 366 | | |
367 | 367 | | |
368 | | - | |
| 368 | + | |
369 | 369 | | |
370 | 370 | | |
371 | 371 | | |
372 | 372 | | |
373 | 373 | | |
374 | 374 | | |
375 | 375 | | |
376 | | - | |
| 376 | + | |
377 | 377 | | |
378 | 378 | | |
379 | 379 | | |
| |||
417 | 417 | | |
418 | 418 | | |
419 | 419 | | |
420 | | - | |
| 420 | + | |
421 | 421 | | |
422 | 422 | | |
423 | | - | |
| 423 | + | |
424 | 424 | | |
425 | 425 | | |
426 | 426 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
0 commit comments