feat(maintenance): improve store with pending removals + ADR-0006 compliance
- Add pendingRemovals tracking and isEventRemoving() to maintenance store for better in-flight UX in EventsTable. - Strongly type maintenance API client and store (replace unknown[]). - Migrate selectedTask/taskLogs to dedicated lib/stores/selectedTask.svelte.ts (proper rune store with separate subscribers). - Remove legacy central stores.svelte.ts and related dead code (src/pages/, old tests) to comply with ADR-0006 (global stores must be individual files in lib/stores/). - Update mocks, components, models and tests accordingly. - Fix related bugs (subscriber decoupling, test mocks). - Add dedicated test_selectedTask.ts. - Minor cleanups: semantic tokens, @RATIONALE for model-first, contracts update. - All key tests (maintenance, selectedTask, store) pass. Refs: ADR-0006, specs/031-maintenance-banner
This commit is contained in:
@@ -14,6 +14,7 @@ const { mockStoreState, mockStore } = vi.hoisted(() => {
|
||||
dashboardBanners: [],
|
||||
isLoading: false,
|
||||
error: null,
|
||||
pendingRemovals: {},
|
||||
};
|
||||
|
||||
const store = {
|
||||
@@ -23,6 +24,8 @@ const { mockStoreState, mockStore } = vi.hoisted(() => {
|
||||
get dashboardBanners() { return sharedState.dashboardBanners; },
|
||||
get isLoading() { return sharedState.isLoading; },
|
||||
get error() { return sharedState.error; },
|
||||
get pendingRemovals() { return sharedState.pendingRemovals; },
|
||||
isEventRemoving: vi.fn(() => false),
|
||||
loadEvents: vi.fn(),
|
||||
loadSettings: vi.fn(),
|
||||
loadDashboardBanners: vi.fn(),
|
||||
@@ -44,6 +47,7 @@ function resetMockStore() {
|
||||
mockStoreState.dashboardBanners = [];
|
||||
mockStoreState.isLoading = false;
|
||||
mockStoreState.error = null;
|
||||
mockStoreState.pendingRemovals = {};
|
||||
}
|
||||
|
||||
// Mock toasts
|
||||
|
||||
Reference in New Issue
Block a user