This commit is contained in:
seb
2026-10-04 23:38:46 +02:00
parent a90069d340
commit 81b59fd309
11 changed files with 454 additions and 83 deletions

View File

@@ -1,12 +1,13 @@
/**
* @file articleSearchAutomat.js
* @description In-memory article search state for the `/artikel` overview and
* search pages, querying against the cached `articleIndexAutomat`.
* search pages, querying against the derived `articleIndexAutomat`.
*
* Upstream Triggers:
* - UI / Search input: Components call `actions.search(query)` or `actions.reset()`.
* - Reads data from `articleIndexAutomat`: Ensures the cached index is loaded
* before filtering.
* - Reads data from `articleIndexAutomat`: Ensures the derived index is available
* before filtering. The index is built from the loaded category views, so a
* search never issues a request of its own.
*/
import { Automat } from 'react-automat';
@@ -61,8 +62,8 @@ const actions = {
/**
* Runs a client-side search over the article index.
*
* The full index is already cached by `articleIndexAutomat`, so this does not
* hit the network once the index has loaded.
* The index is already derived from the cached category views, so this does
* not hit the network once the tree has loaded.
*
* @param {string} target Search term; an empty string returns everything.
* @returns {Promise<ArticleSearchResult>} Search outcome.