Redesign the Storage Monitor as a storage-composition breakdown (snippets · datasets · app)

This commit is contained in:
2026-06-10 01:32:22 +03:00
parent e7de0cbb8a
commit 7599acd25e
12 changed files with 438 additions and 481 deletions
+5 -6
View File
@@ -5,12 +5,11 @@ import { createSnippet } from '@core/snippet';
import { useSnippetStore } from '../stores/SnippetStore';
import { SnippetLibrary } from './SnippetLibrary';
// StorageMonitor (rendered at the bottom of the pane) fetches an async storage
// estimate on mount; stub it so its setState doesn't fire outside act() and add
// test noise. This suite is about the library, not the monitor.
vi.mock('../infrastructure/storage-estimate', () => ({
readStorageEstimate: () => Promise.resolve({ available: false }),
}));
// StorageMonitor (rendered at the bottom of the pane) measures storage and fetches
// an async estimate on mount; stub the whole component to nothing so its async
// setState doesn't fire outside act() and its legend text doesn't collide with
// library assertions. This suite is about the library, not the monitor.
vi.mock('./StorageMonitor', () => ({ default: () => null }));
// React 19 wants this flag set for act() to drive effects without warnings.
(globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = true;