Skip to content

Commit

Permalink
merge develop into hotfix branch
Browse files Browse the repository at this point in the history
  • Loading branch information
blackforestboi committed May 10, 2024
2 parents 31b03b0 + 67bbe81 commit 4679c4b
Show file tree
Hide file tree
Showing 8 changed files with 895 additions and 663 deletions.
2 changes: 1 addition & 1 deletion external/@worldbrain/memex-common

This file was deleted.

This file was deleted.

11 changes: 8 additions & 3 deletions src/dashboard-refactor/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
initNormalizedState,
NormalizedState,
} from '@worldbrain/memex-common/lib/common-ui/utils/normalized-state'
import { eventProviderDomains } from '@worldbrain/memex-common/lib/constants'
import { EVENT_PROVIDER_DOMAINS } from '@worldbrain/memex-common/lib/constants'
import type {
PageAnnotationsCacheInterface,
UnifiedList,
Expand Down Expand Up @@ -110,12 +110,17 @@ export const stateToSearchParams = (
filterByListIds.push(listData.localId!)
}

const isBlankSearch = !searchFilters.searchQuery.trim().length

// Blank search doesn't use standard skip+limit pagination. Instead it requires the caller to keep
// track of the oldest timestamp and supply that as the new upper-bound on each reinvocation
const blankSearchUpperBound = !searchFilters.searchQuery.trim().length
const blankSearchUpperBound = isBlankSearch
? searchResults.blankSearchOldestResultTimestamp
: null

// Use a larger page size for blank searches to reduce the chance of duped results, due to annots/visits/bookmarks appearing in different result pages
const limit = isBlankSearch ? searchFilters.limit * 3 : searchFilters.limit

// TODO: Dynamically set these flags based on state
const termsSearchOpts: TermsSearchOpts = {
matchNotes: true,
Expand All @@ -126,8 +131,8 @@ export const stateToSearchParams = (
}

return {
limit,
skip: searchFilters.skip,
limit: searchFilters.limit,
query: searchFilters.searchQuery,
filterByDomains: searchFilters.domainsIncluded,
filterByListIds,
Expand Down
Loading

0 comments on commit 4679c4b

Please sign in to comment.