feat(us1): add dataset review orchestration automatic review slice

This commit is contained in:
2026-03-17 10:57:49 +03:00
parent e916cb1f17
commit 023bacde39
24 changed files with 4870 additions and 131 deletions

View File

@@ -0,0 +1,16 @@
// [DEF:state_mock:Module]
// @COMPLEXITY: 2
// @PURPOSE: Mock for $app/state in vitest route/component tests.
// @LAYER: UI Tests
export const page = {
params: {},
route: { id: "test" },
url: new URL("http://localhost"),
status: 200,
error: null,
data: {},
form: null,
};
// [/DEF:state_mock:Module]

View File

@@ -1,9 +1,10 @@
// [DEF:frontend.src.lib.stores.__tests__.test_datasetReviewSession:Module]
// [DEF:DatasetReviewSessionStoreTests:Module]
// @COMPLEXITY: 3
// @SEMANTICS: dataset-review, store, session, tests
// @PURPOSE: Unit tests for dataset review session store
// @PURPOSE: Unit tests for dataset review session store.
// @LAYER: UI
// @RELATION: VERIFIES -> [datasetReviewSession:Store]
// @UX_STATE: Idle -> Store helpers are exercised without asynchronous UI transitions.
import { describe, it, expect, beforeEach, vi } from 'vitest';
@@ -109,4 +110,4 @@ describe('datasetReviewSession store', () => {
});
});
// [/DEF:frontend.src.lib.stores.__tests__.test_datasetReviewSession:Module]
// [/DEF:DatasetReviewSessionStoreTests:Module]

View File

@@ -1,8 +1,12 @@
// [DEF:datasetReviewSession:Store]
// @COMPLEXITY: 4
// @PURPOSE: Manage active dataset review session state, including loading, updates, and navigation guards.
// @PURPOSE: Manage active dataset review session state, including loading, local edits, error capture, and reset semantics for the active review workspace.
// @LAYER: UI
// @RELATION: DEPENDS_ON -> api_module (requestApi/fetchApi)
// @RELATION: DEPENDS_ON -> [api_module]
// @PRE: Consumers provide session-shaped payloads when setting or patching state and initialize the store before reading derived session fields.
// @POST: Store transitions keep session, loading, error, and dirty flags internally consistent after each helper call.
// @SIDE_EFFECT: Mutates the writable dataset review session store in frontend memory.
// @DATA_CONTRACT: Input[SessionDetail | Partial<SessionDetail> | boolean | string | null] -> Output[DatasetReviewSessionStoreState]
//
// @UX_STATE: Loading -> Session detail is being fetched.
// @UX_STATE: Ready -> Session detail is available for UI binding.