Commit dd4821794e
Unsigned
Layout: unified · split
docs/.vitepress/theme/components/Search.vue +44 −2
| @@ -466,6 +466,11 @@ const results: Ref<(SearchResult & Result)[]> = shallowRef([]) | |||
| 466 | const currentTerms = shallowRef(new Set<string>()) | 466 | const currentTerms = shallowRef(new Set<string>()) |
| 467 | 467 | ||
| 468 | const enableNoResults = ref(false) | 468 | const enableNoResults = ref(false) |
| 469 | const textSearchLoading = ref(false) | ||
| 470 | const urlSearchLoading = ref(false) | ||
| 471 | const searchLoading = computed(() => | ||
| 472 | urlSearchMode.value ? urlSearchLoading.value : textSearchLoading.value | ||
| 473 | ) | ||
| 469 | 474 | ||
| 470 | const pageMeta = (() => { | 475 | const pageMeta = (() => { |
| 471 | const map = new Map<string, { label: string; order: number }>() | 476 | const map = new Map<string, { label: string; order: number }>() |
| @@ -670,10 +675,15 @@ watch( | |||
| 670 | if (!active || !isOpen || !query.trim()) { | 675 | if (!active || !isOpen || !query.trim()) { |
| 671 | urlMatches.value = [] | 676 | urlMatches.value = [] |
| 672 | urlPageGroupCounts.value = [] | 677 | urlPageGroupCounts.value = [] |
| 678 | urlSearchLoading.value = false | ||
| 679 | return | ||
| 680 | } | ||
| 681 | if (!ready) { | ||
| 682 | urlSearchLoading.value = false | ||
| 673 | return | 683 | return |
| 674 | } | 684 | } |
| 675 | if (!ready) return | ||
| 676 | 685 | ||
| 686 | urlSearchLoading.value = true | ||
| 677 | try { | 687 | try { |
| 678 | const payload = await postSearchWorker<UrlSearchWorkerPayload>({ | 688 | const payload = await postSearchWorker<UrlSearchWorkerPayload>({ |
| 679 | type: 'url-search', | 689 | type: 'url-search', |
| @@ -683,11 +693,13 @@ watch( | |||
| 683 | if (canceled) return | 693 | if (canceled) return |
| 684 | urlMatches.value = payload.matches | 694 | urlMatches.value = payload.matches |
| 685 | urlPageGroupCounts.value = payload.pageGroups | 695 | urlPageGroupCounts.value = payload.pageGroups |
| 696 | urlSearchLoading.value = false | ||
| 686 | } catch (error) { | 697 | } catch (error) { |
| 687 | if (!canceled) { | 698 | if (!canceled) { |
| 688 | console.error('[search] URL search worker request failed', error) | 699 | console.error('[search] URL search worker request failed', error) |
| 689 | urlMatches.value = [] | 700 | urlMatches.value = [] |
| 690 | urlPageGroupCounts.value = [] | 701 | urlPageGroupCounts.value = [] |
| 702 | urlSearchLoading.value = false | ||
| 691 | } | 703 | } |
| 692 | } | 704 | } |
| 693 | }, | 705 | }, |
| @@ -1064,13 +1076,17 @@ watchDebounced( | |||
| 1064 | canceled = true | 1076 | canceled = true |
| 1065 | }) | 1077 | }) |
| 1066 | 1078 | ||
| 1067 | if (!ready || !isOpen) return | 1079 | if (!ready || !isOpen) { |
| 1080 | textSearchLoading.value = false | ||
| 1081 | return | ||
| 1082 | } | ||
| 1068 | 1083 | ||
| 1069 | // In URL search mode, skip normal text search | 1084 | // In URL search mode, skip normal text search |
| 1070 | if (mode === 'url') { | 1085 | if (mode === 'url') { |
| 1071 | results.value = [] | 1086 | results.value = [] |
| 1072 | currentTerms.value = new Set() | 1087 | currentTerms.value = new Set() |
| 1073 | enableNoResults.value = Boolean(filterTextValue.trim()) | 1088 | enableNoResults.value = Boolean(filterTextValue.trim()) |
| 1089 | textSearchLoading.value = false | ||
| 1074 | return | 1090 | return |
| 1075 | } | 1091 | } |
| 1076 | 1092 | ||
| @@ -1079,9 +1095,11 @@ watchDebounced( | |||
| 1079 | results.value = [] | 1095 | results.value = [] |
| 1080 | currentTerms.value = new Set() | 1096 | currentTerms.value = new Set() |
| 1081 | enableNoResults.value = false | 1097 | enableNoResults.value = false |
| 1098 | textSearchLoading.value = false | ||
| 1082 | return | 1099 | return |
| 1083 | } | 1100 | } |
| 1084 | 1101 | ||
| 1102 | textSearchLoading.value = true | ||
| 1085 | let workerPayload: TextSearchWorkerPayload | 1103 | let workerPayload: TextSearchWorkerPayload |
| 1086 | try { | 1104 | try { |
| 1087 | const workerIndexKey = | 1105 | const workerIndexKey = |
| @@ -1113,6 +1131,7 @@ watchDebounced( | |||
| 1113 | results.value = [] | 1131 | results.value = [] |
| 1114 | currentTerms.value = new Set() | 1132 | currentTerms.value = new Set() |
| 1115 | enableNoResults.value = true | 1133 | enableNoResults.value = true |
| 1134 | textSearchLoading.value = false | ||
| 1116 | } | 1135 | } |
| 1117 | return | 1136 | return |
| 1118 | } | 1137 | } |
| @@ -1125,6 +1144,7 @@ watchDebounced( | |||
| 1125 | 1144 | ||
| 1126 | if (!_result.length) { | 1145 | if (!_result.length) { |
| 1127 | results.value = [] | 1146 | results.value = [] |
| 1147 | textSearchLoading.value = false | ||
| 1128 | return | 1148 | return |
| 1129 | } | 1149 | } |
| 1130 | 1150 | ||
| @@ -1213,6 +1233,7 @@ watchDebounced( | |||
| 1213 | centerExcerptsUntilSettled() | 1233 | centerExcerptsUntilSettled() |
| 1214 | } | 1234 | } |
| 1215 | } | 1235 | } |
| 1236 | textSearchLoading.value = false | ||
| 1216 | }, | 1237 | }, |
| 1217 | { debounce: 80, immediate: true } | 1238 | { debounce: 80, immediate: true } |
| 1218 | ) | 1239 | ) |
| @@ -1680,6 +1701,13 @@ function onMouseMove(e: MouseEvent) { | |||
| 1680 | type="search" | 1701 | type="search" |
| 1681 | /> | 1702 | /> |
| 1682 | <div class="search-actions"> | 1703 | <div class="search-actions"> |
| 1704 | <img | ||
| 1705 | v-if="searchLoading" | ||
| 1706 | class="search-loading-bubba" | ||
| 1707 | src="/bubba.webp" | ||
| 1708 | alt="" | ||
| 1709 | aria-hidden="true" | ||
| 1710 | /> | ||
| 1683 | <div | 1711 | <div |
| 1684 | v-if="!disableDetailedView && searchMode !== 'url'" | 1712 | v-if="!disableDetailedView && searchMode !== 'url'" |
| 1685 | class="view-group toolbar-group" | 1713 | class="view-group toolbar-group" |
| @@ -2374,6 +2402,8 @@ function onMouseMove(e: MouseEvent) { | |||
| 2374 | } | 2402 | } |
| 2375 | 2403 | ||
| 2376 | .search-input { | 2404 | .search-input { |
| 2405 | flex: 1 1 auto; | ||
| 2406 | min-width: 0; | ||
| 2377 | padding: 6px 12px; | 2407 | padding: 6px 12px; |
| 2378 | font-size: inherit; | 2408 | font-size: inherit; |
| 2379 | width: 100%; | 2409 | width: 100%; |
| @@ -2390,10 +2420,22 @@ function onMouseMove(e: MouseEvent) { | |||
| 2390 | } | 2420 | } |
| 2391 | 2421 | ||
| 2392 | .search-actions { | 2422 | .search-actions { |
| 2423 | flex: 0 0 auto; | ||
| 2393 | display: flex; | 2424 | display: flex; |
| 2425 | align-items: center; | ||
| 2394 | gap: 4px; | 2426 | gap: 4px; |
| 2395 | } | 2427 | } |
| 2396 | 2428 | ||
| 2429 | .search-loading-bubba { | ||
| 2430 | width: 32px; | ||
| 2431 | height: 28px; | ||
| 2432 | margin-inline-end: 6px; | ||
| 2433 | object-fit: contain; | ||
| 2434 | image-rendering: pixelated; | ||
| 2435 | pointer-events: none; | ||
| 2436 | user-select: none; | ||
| 2437 | } | ||
| 2438 | |||
| 2397 | @media (any-pointer: coarse) { | 2439 | @media (any-pointer: coarse) { |
| 2398 | .search-actions { | 2440 | .search-actions { |
| 2399 | gap: 8px; | 2441 | gap: 8px; |
docs/credits.md +1
| @@ -40,6 +40,7 @@ import Credits from './.vitepress/theme/components/Contributors.vue' | |||
| 40 | | Feel. | [Akane Mizuno](https://myanimelist.net/anime/34822/Tsuki_ga_Kirei/episode/4) | Extension Repos default link embed | | 40 | | Feel. | [Akane Mizuno](https://myanimelist.net/anime/34822/Tsuki_ga_Kirei/episode/4) | Extension Repos default link embed | |
| 41 | | **frakon98** | [Kaiji - Rolling the dice](https://www.deviantart.com/frakon98/art/Kaiji-Rolling-the-dice-860584411) | Madokami link embed | | 41 | | **frakon98** | [Kaiji - Rolling the dice](https://www.deviantart.com/frakon98/art/Kaiji-Rolling-the-dice-860584411) | Madokami link embed | |
| 42 | | **藤ちょこ (Fujichoco)** | [Hatsune Miku “Magical Mirai 2020” Osaka](https://magicalmirai.com/2020/osaka/) | [Audio glossary banner](/glossary/audio#japanese-music-genres) | | 42 | | **藤ちょこ (Fujichoco)** | [Hatsune Miku “Magical Mirai 2020” Osaka](https://magicalmirai.com/2020/osaka/) | [Audio glossary banner](/glossary/audio#japanese-music-genres) | |
| 43 | | **Holocure** | [Bubba](https://store.steampowered.com/app/2420510/HoloCure__Save_the_Fans/) | Searchbox loading image | | ||
| 43 | | **Huu** | [Rem](https://www.pixiv.net/en/artworks/79939625) | [Music banner](/music#radio) | | 44 | | **Huu** | [Rem](https://www.pixiv.net/en/artworks/79939625) | [Music banner](/music#radio) | |
| 44 | | **あきふゆはるか (Ibushi Roun)** | [Reimu vs Patchouli](https://www.pixiv.net/en/artworks/109967460) | Game link embed | | 45 | | **あきふゆはるか (Ibushi Roun)** | [Reimu vs Patchouli](https://www.pixiv.net/en/artworks/109967460) | Game link embed | |
| 45 | | **幾田 (Ikuta)** | [Copy](https://x.com/ikuta41/status/1733423740644684243/) | Default link embed | | 46 | | **幾田 (Ikuta)** | [Copy](https://x.com/ikuta41/status/1733423740644684243/) | Default link embed | |
docs/public/bubba.webp added
Binary file not shown.