Extend search by including documentation content

This commit broadens the search functionality within privacy.sexy by
including documentation text in the search scope. Users can now find
scripts and categories not only by their names but also by content in
their documentation. This improvement aims to make the discovery of
relevant scripts and information more intuitive and comprehensive.

Key changes:

- Documentation text is now searchable, enhancing the ability to
  discover scripts and categories based on content details.

Other supporting changes:

- Remove interface prefixes (`I`) from related interfaces to adhere to
  naming conventions, enhancing code readability.
- Refactor filtering to separate actual filtering logic from filter
  state management, improving the structure for easier maintenance.
- Improve test coverage to ensure relability of existing and new search
  capabilities.
- Test coverage expanded to ensure the reliability of the new search
  capabilities.
This commit is contained in:
undergroundwires
2024-02-14 12:10:49 +01:00
parent 63366a4ec2
commit 6142f3a297
36 changed files with 917 additions and 525 deletions

View File

@@ -11,8 +11,8 @@ import { expectExists } from '@tests/shared/Assertions/ExpectExists';
import { ReadonlyScriptSelection } from '@/application/Context/State/Selection/Script/ScriptSelection';
import { ScriptSelectionStub } from '@tests/unit/shared/Stubs/ScriptSelectionStub';
import { SelectedScript } from '@/application/Context/State/Selection/Script/SelectedScript';
import { UserFilterStub } from '@tests/unit/shared/Stubs/UserFilterStub';
import type { CodeFactory, FilterFactory, SelectionFactory } from '@/application/Context/State/CategoryCollectionState';
import { FilterContextStub } from '@tests/unit/shared/Stubs/FilterContextStub';
describe('CategoryCollectionState', () => {
describe('code', () => {
@@ -113,7 +113,7 @@ describe('CategoryCollectionState', () => {
let actualCollection: ICategoryCollection | undefined;
const filterFactoryMock: FilterFactory = (collection) => {
actualCollection = collection;
return new UserFilterStub();
return new FilterContextStub();
};
// act
new CategoryCollectionStateBuilder()
@@ -134,7 +134,7 @@ class CategoryCollectionStateBuilder {
private selectionFactory: SelectionFactory = () => new UserSelectionStub();
private filterFactory: FilterFactory = () => new UserFilterStub();
private filterFactory: FilterFactory = () => new FilterContextStub();
public withCollection(collection: ICategoryCollection): this {
this.collection = collection;