feat: instant search becomes optional#1851
Conversation
…/instant-search-configuration
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
…/instant-search-configuration
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis pull request adds an "instant search" toggle to settings and changes the global search flow to support manual versus instant submission. useSettings now exposes an Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
app/pages/search.vue (1)
199-199: Use a trimmed committed query for fetch/render gating.Whitespace-only committed input currently passes the
v-ifgate and can trigger avoidable search work.♻️ Suggested refinement
const { model: searchQuery, committedModel: committedQuery, provider: searchProvider, } = useGlobalSearch() +const committedQueryTrimmed = computed(() => committedQuery.value.trim()) @@ } = useSearch( - committedQuery, + committedQueryTrimmed, searchProvider, () => ({ size: requestedSize.value, }), { suggestions: true }, ) @@ - <section v-if="committedQuery" class="results-layout"> + <section v-if="committedQueryTrimmed" class="results-layout">Also applies to: 675-675
app/composables/useGlobalSearch.ts (1)
31-35: Synchronise committed query when instant search is toggled on.Switching
instantSearchfrom off → on currently waits for another input change beforecommittedSearchQueryupdates.♻️ Suggested refinement
watch(searchQuery, val => { if (settings.value.instantSearch) { committedSearchQuery.value = val } }) + +watch( + () => settings.value.instantSearch, + enabled => { + if (enabled) { + committedSearchQuery.value = searchQuery.value + } + }, +)
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
app/components/Header/SearchBox.vueapp/composables/useGlobalSearch.tsapp/composables/useSettings.tsapp/pages/index.vueapp/pages/search.vueapp/pages/settings.vuei18n/locales/en.jsoni18n/schema.json
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
🔗 Linked issue
Resolved #1710
🧭 Context
For a11y purposes we want to make instant search optional, so user could disable it in settings
📚 Description
useGlobalSearchcomposable, Index page, Search page to be dependent oninstantSearchsetting