fix: correct typo in cacheScores debug log and add JSDoc to filterDataByState (#5468) * fix: limit max-height of select[multiple] on mobile to prevent Chrome 145+ full-screen rendering (fixes #5242) * fix: correct typo in cacheScores debug log and add JSDoc to filterDataByState (fixes #5252) * fix: Correct jsdoc syntax --------- Co-authored-by: octo-patch <octo-patch@github.com> Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>

b436971a091d1512c3c3ebaf83e707d38dcfdf26

Octopus <liyuan851277048@icloud.com>

Signed
1 files changed, +11 -1Ignore whitespace
public/scripts/filters.js+11 -1
@@ -289,6 +289,16 @@ export class FilterHelper {
289 return this.filterDataByState(data, state, isFolder);289 return this.filterDataByState(data, state, isFolder);
290 }290 }
291291
292 /**
293 * Filters an array of entities based on a tri-state filter value.
294 * SELECTED keeps entities where filterFunc returns true; EXCLUDED removes them; UNDEFINED returns data unchanged.
295 * @param {any[]} data The data to filter
296 * @param {FilterState|string} state The tri-state filter value (SELECTED, EXCLUDED, or UNDEFINED)
297 * @param {Function} filterFunc A predicate function applied to each entity
298 * @param {object} [options] Options object
299 * @param {boolean} [options.includeFolders=false] If true, entities with type 'tag' always pass through
300 * @returns {any[]} The filtered data
301 */
292 filterDataByState(data, state, filterFunc, { includeFolders = false } = {}) {302 filterDataByState(data, state, filterFunc, { includeFolders = false } = {}) {
293 if (isFilterState(state, FILTER_STATES.SELECTED)) {303 if (isFilterState(state, FILTER_STATES.SELECTED)) {
294 return data.filter(entity => filterFunc(entity) || (includeFolders && entity.type == 'tag'));304 return data.filter(entity => filterFunc(entity) || (includeFolders && entity.type == 'tag'));
@@ -414,7 +424,7 @@ export class FilterHelper {
414 typeScores.set(uid, score);424 typeScores.set(uid, score);
415 }425 }
416 this.scoreCache.set(type, typeScores);426 this.scoreCache.set(type, typeScores);
417 console.debug('search scores chached', type, typeScores);427 console.debug('search scores cached', type, typeScores);
418 }428 }
419429
420 /**430 /**