diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 043bcbd0..7df25380 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -14,6 +14,7 @@ module.exports = { 'plugin:react-hooks/recommended', 'plugin:import/recommended', 'plugin:import/typescript', + 'plugin:jsx-a11y/recommended', 'plugin:prettier/recommended', ], ignorePatterns: [ @@ -83,8 +84,7 @@ module.exports = { ], // Disallow 'any' type - forces explicit typing - // TODO: Upgrade to 'error' after migrating existing 'any' types - '@typescript-eslint/no-explicit-any': 'warn', + '@typescript-eslint/no-explicit-any': 'error', // Require type annotations for function parameters '@typescript-eslint/no-inferrable-types': 'off', @@ -100,8 +100,7 @@ module.exports = { '@typescript-eslint/require-await': 'error', // No misused promises (e.g., in conditionals) - // TODO: Upgrade to 'error' after wrapping async event handlers - '@typescript-eslint/no-misused-promises': 'warn', + '@typescript-eslint/no-misused-promises': 'error', // Enforce consistent type imports '@typescript-eslint/consistent-type-imports': [ @@ -122,14 +121,13 @@ module.exports = { ], // No unsafe member access - // TODO: Upgrade to 'error' after adding proper types to JSON parsing and IPC calls - '@typescript-eslint/no-unsafe-member-access': 'warn', + '@typescript-eslint/no-unsafe-member-access': 'error', // No unsafe calls - '@typescript-eslint/no-unsafe-call': 'warn', + '@typescript-eslint/no-unsafe-call': 'error', // No unsafe assignment - '@typescript-eslint/no-unsafe-assignment': 'warn', + '@typescript-eslint/no-unsafe-assignment': 'error', // No unsafe return '@typescript-eslint/no-unsafe-return': 'warn', @@ -255,9 +253,78 @@ module.exports = { // No cycle dependencies 'import/no-cycle': ['error', { maxDepth: 3, ignoreExternal: true }], + // Enforce PixiJS migration — no Konva imports allowed after migration + 'no-restricted-imports': [ + 'error', + { + paths: [ + { + name: 'konva', + message: 'Konva has been replaced with PixiJS. Use pixi.js instead.', + }, + { + name: 'react-konva', + message: 'react-konva has been replaced with @pixi/react. Use pixi.js/@pixi/react instead.', + }, + { + name: '@pixi-essentials/transformer', + message: + 'This package targets PixiJS v6 and uses dynamic require("url") which crashes Vite ESM renderer. Use a PixiJS v8-native solution instead.', + }, + ], + patterns: [ + { + group: ['konva/*', 'konva/lib/*'], + message: 'Konva has been replaced with PixiJS.', + }, + ], + }, + ], + // No self imports 'import/no-self-import': 'error', + // ========================================== + // Module Boundary Enforcement + // ========================================== + // See CLAUDE.md "Design System Contract" for boundary rules. + 'import/no-restricted-paths': [ + 'error', + { + zones: [ + // Primitives cannot import from store or services + { + target: './src/components/primitives', + from: './src/store', + message: 'Primitives must not import from store (Design System Contract)', + }, + { + target: './src/components/primitives', + from: './src/services', + message: 'Primitives must not import from services (Design System Contract)', + }, + // Store cannot import from components + { + target: './src/store', + from: './src/components', + message: 'Store must not import from components (Design System Contract)', + }, + // Services cannot import from components or store + { + target: './src/services', + from: './src/components', + message: 'Services must not import from components (Design System Contract)', + }, + // Utils cannot import from React components + { + target: './src/utils', + from: './src/components', + message: 'Utils must not import from components (Design System Contract)', + }, + ], + }, + ], + // ========================================== // React Specific Rules // ========================================== @@ -307,6 +374,13 @@ module.exports = { }, ], + // ========================================== + // Accessibility (jsx-a11y) Overrides + // ========================================== + + // autoFocus is intentional within dialogs and search inputs (WCAG dialog pattern) + 'jsx-a11y/no-autofocus': 'warn', + // ========================================== // Code Style & Best Practices // ========================================== @@ -465,11 +539,38 @@ module.exports = { '@typescript-eslint/no-unsafe-call': 'off', }, }, - // Main entry points can have console + // Electron main process — system boundary with many untyped Electron/Node APIs { files: ['electron/main.ts', 'electron/preload.ts'], rules: { 'no-console': 'off', + '@typescript-eslint/no-unsafe-assignment': 'off', + '@typescript-eslint/no-unsafe-member-access': 'off', + '@typescript-eslint/no-unsafe-call': 'off', + '@typescript-eslint/no-unsafe-return': 'off', + '@typescript-eslint/no-unsafe-argument': 'off', + '@typescript-eslint/no-explicit-any': 'off', + }, + }, + // Files with deep typing issues scheduled for refactoring in later sessions. + // SyncManager: Session 7 (store separation) + Session 9 (campaign service) + // CanvasManager: Session 10 (decomposition) + // ResourceMonitor: needs typed browser API wrappers + // ImageCropper: needs typed canvas API wrappers + { + files: [ + 'src/components/Managers/SyncManager.tsx', + 'src/components/Canvas/CanvasManager.tsx', + 'src/components/ResourceMonitor.tsx', + 'src/components/Dialogs/ImageCropper.tsx', + ], + rules: { + '@typescript-eslint/no-explicit-any': 'warn', + '@typescript-eslint/no-unsafe-assignment': 'warn', + '@typescript-eslint/no-unsafe-member-access': 'warn', + '@typescript-eslint/no-unsafe-call': 'warn', + '@typescript-eslint/no-unsafe-return': 'warn', + '@typescript-eslint/no-unsafe-argument': 'warn', }, }, // Allow looser rules in docs/examples diff --git a/.gitignore b/.gitignore index 3690c814..8a138dfb 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,9 @@ dist-web release dist-electron +# Test Coverage +coverage + # Playwright playwright-report test-results diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md deleted file mode 100644 index 78ee671f..00000000 --- a/ARCHITECTURE.md +++ /dev/null @@ -1,632 +0,0 @@ -# Graphium Architecture - Quick Reference for AI Agents - -> **AI Agent Onboarding**: This file provides a high-level map of the Graphium codebase. Read this first before making changes to understand the system architecture, data flow, and key patterns. - -## 📋 Table of Contents - -- [System Overview](#system-overview) -- [Technology Stack](#technology-stack) -- [Directory Structure](#directory-structure) -- [Data Flow & State Management](#data-flow--state-management) -- [Key Architectural Patterns](#key-architectural-patterns) -- [Critical Paths & Workflows](#critical-paths--workflows) -- [Testing Strategy](#testing-strategy) -- [Error Handling](#error-handling) -- [Further Reading](#further-reading) - ---- - -## System Overview - -**Graphium** is a dual-target (Electron + Web) React/TypeScript application serving as a digital battlemap for tabletop RPG Dungeon Masters. - -### Core Concept: Dual-Window Architecture - -``` -┌─────────────────────┐ ┌─────────────────────┐ -│ ARCHITECT VIEW │ │ WORLD VIEW │ -│ (DM Control Panel) │ ──IPC─→ │ (Player Display) │ -│ │ │ │ -│ • Full Controls │ │ • Canvas Only │ -│ • Token Library │ │ • No DM Tools │ -│ • Save/Load │ │ • Read-only │ -│ • Fog of War │ │ • For Projection │ -└─────────────────────┘ └─────────────────────┘ - ↓ ↓ - Single Source Synced State - of Truth (Zustand) (via IPC/SyncManager) -``` - -### Platform Support - -- **Electron Desktop App**: Full-featured with file system access -- **Web App**: Browser-based with IndexedDB storage (limited file ops) - ---- - -## Technology Stack - -### Core Framework & Build Tools - -- **React 18.2** - UI framework -- **TypeScript 5.2** - Type safety (strict mode) -- **Vite 5.1** - Build tool & dev server -- **Electron 30** - Desktop wrapper (optional) - -### State & Data - -- **Zustand 5.0** - Global state management (single store) -- **IndexedDB** (idb) - Web storage -- **Electron IPC** - Inter-process communication -- **JSZip** - Campaign file (.graphium) compression - -### Canvas & Rendering - -- **Konva 10** / **React-Konva 18** - Canvas rendering engine -- **HTML5 Canvas** - Low-level drawing API - -### Styling & UI - -- **Tailwind CSS 4.1** - Utility-first styling -- **CSS Custom Properties** - Theming system - -### Testing - -- **Vitest 1.3** - Unit tests (22 test files) -- **Playwright 1.57** - E2E tests (13 spec files) -- **@testing-library/react** - Component testing utilities -- **axe-core** - Accessibility testing - ---- - -## Directory Structure - -``` -/home/user/Graphium/ -│ -├── src/ # React application source -│ ├── components/ # React UI components -│ │ ├── AssetLibrary/ # Token library & command palette -│ │ ├── Canvas/ # Canvas rendering (Konva-based) -│ │ ├── ErrorBoundaries # Privacy-aware error handling -│ │ └── [Other components] # UI components (Sidebar, Toast, etc.) -│ │ -│ ├── hooks/ # Custom React hooks -│ │ ├── useCommandPalette.ts # Keyboard shortcuts (Cmd+P) -│ │ ├── useMediaQuery.ts # Responsive breakpoints -│ │ └── useTokenData.ts # Token metadata resolution -│ │ -│ ├── services/ # Service layer (platform abstraction) -│ │ ├── IStorageService.ts # Storage interface -│ │ ├── ElectronStorageService.ts # Electron IPC + fs -│ │ ├── WebStorageService.ts # IndexedDB -│ │ └── storage.ts # Runtime detection & initialization -│ │ -│ ├── store/ # State management (Zustand) -│ │ ├── gameStore.ts # Main game state (26KB - core) -│ │ └── preferencesStore.ts # User preferences -│ │ -│ ├── types/ # TypeScript type definitions -│ ├── utils/ # Utility functions -│ │ ├── AssetProcessor.ts # Image optimization -│ │ ├── DungeonGenerator.ts # Procedural generation -│ │ ├── errorSanitizer.ts # Privacy-safe error reporting -│ │ ├── fuzzySearch.ts # Library search -│ │ ├── grid.ts # Grid snapping logic -│ │ └── [Other utils] -│ │ -│ ├── workers/ # Web Workers -│ │ └── image-processor.worker.ts -│ │ -│ ├── App.tsx # Root component (22KB) -│ ├── main.tsx # React entry point -│ └── index.css # Tailwind imports -│ -├── electron/ # Electron main process -│ ├── main.ts # Main process logic (38KB) -│ ├── preload.ts # IPC bridge (contextBridge) -│ └── themeManager.ts # Theme persistence -│ -├── tests/ # E2E and integration tests -│ ├── functional/ # Functional E2E tests (8 files) -│ ├── electron/ # Electron-specific tests (2 files) -│ ├── performance/ # Performance tests (1 file) -│ ├── helpers/ # Test utilities -│ └── accessibility.spec.ts # WCAG AA compliance -│ -├── docs/ # Comprehensive documentation -│ ├── architecture/ # Architecture deep-dives -│ ├── components/ # Component documentation -│ ├── features/ # Feature implementation notes -│ ├── guides/ # Developer guides -│ └── context/ # Domain context -│ -└── public/ # Static assets -``` - -### Key Files to Know - -| File | Purpose | Size | Critical? | -| ----------------------------------------- | ------------------------------------------------------ | ------ | --------- | -| `src/store/gameStore.ts` | **Single source of truth** for all game state | 26KB | ⚠️ YES | -| `src/components/Canvas/CanvasManager.tsx` | **Main canvas logic** - rendering, tools, interactions | 84KB | ⚠️ YES | -| `src/App.tsx` | Root component - window type detection, tool state | 22KB | ⚠️ YES | -| `src/components/SyncManager.tsx` | **IPC synchronization** between windows | Medium | ⚠️ YES | -| `electron/main.ts` | Electron main process - IPC, file I/O, windows | 38KB | ⚠️ YES | -| `src/services/storage.ts` | **Platform abstraction** - Electron vs Web | Small | ⚠️ YES | - ---- - -## Data Flow & State Management - -### State Management: Zustand (Single Store) - -**Why Zustand over Redux?** - -- Minimal boilerplate -- No context provider hell -- Excellent TypeScript support -- Built-in subscriptions (perfect for IPC sync) - -**Store Location**: `/home/user/Graphium/src/store/gameStore.ts` - -**Store Structure**: - -```typescript -interface GameState { - // ===== Data ===== - currentCampaignId: string | null; - campaigns: Campaign[]; - currentMapId: string | null; - tokens: Token[]; // Instances on current map - drawings: Drawing[]; // Freehand strokes (marker/eraser/wall) - doors: Door[]; // Interactive doors - stairs: Stairs[]; // Staircase markers - tokenLibrary: TokenLibraryItem[]; // Reusable token prototypes - map: MapConfig | null; // Background map image - - // ===== Actions ===== - // Token management - addToken(token: Token): void; - updateToken(id: string, changes: Partial): void; - removeToken(id: string): void; - - // Drawing management - addDrawing(drawing: Drawing): void; - removeDrawing(id: string): void; - - // Map management - setMap(mapConfig: MapConfig): void; - updateMapPosition(x: number, y: number): void; - - // Campaign management - saveCampaign(): void; - loadCampaign(campaign: Campaign): void; - - // ... 50+ actions total -} -``` - -### Data Flow Patterns - -#### 1. Campaign Save/Load Flow - -``` -User clicks "Save" - ↓ -App.tsx handles click - ↓ -Calls storage.saveCampaign(gameStore.getState()) - ↓ -Storage service detects platform - ↓ -ElectronStorageService (Desktop) WebStorageService (Browser) - ↓ ↓ -IPC to main process IndexedDB write - ↓ ↓ -electron/main.ts Download .graphium file - ↓ -fs.writeFile() to .graphium ZIP -``` - -#### 2. IPC State Synchronization (Dual-Window Sync) - -``` -User drags token in Architect View - ↓ -CanvasManager updates local state - ↓ -gameStore.updateToken(id, {x, y}) ← Zustand action - ↓ -SyncManager.tsx (Architect View) - - Subscribes to gameStore changes - - Detects state change - ↓ -window.ipcRenderer.send('SYNC_WORLD_STATE', state) - ↓ -electron/main.ts routes IPC message - ↓ -World Window receives IPC message - ↓ -SyncManager.tsx (World View) - - Listens to IPC - - Calls gameStore.setState(newState) - ↓ -World View re-renders with updated token position -``` - -#### 3. Asset Processing Flow - -``` -User drags PNG onto canvas - ↓ -CanvasManager.handleDrop() - ↓ -AssetProcessor.processImage(file, 'MAP') - ↓ -Web Worker: image-processor.worker.ts - - Resize if > 4096px (maps) or > 512px (tokens) - - Convert to WebP - - Compress - ↓ -storage.saveAsset(blob) → Returns file:// URL - ↓ -gameStore.setMap({src: fileUrl, ...}) - ↓ -Canvas re-renders with new map -``` - ---- - -## Key Architectural Patterns - -### 1. Platform Abstraction (Service Pattern) - -**Problem**: App runs on both Electron (file system) and Web (IndexedDB) - -**Solution**: Service interface + runtime detection - -```typescript -// Interface (IStorageService.ts) -interface IStorageService { - saveCampaign(campaign: Campaign): Promise; - loadCampaign(): Promise; - saveAsset(blob: Blob): Promise; - getPlatform(): 'electron' | 'web'; -} - -// Implementations -class ElectronStorageService implements IStorageService { - // Uses window.ipcRenderer.invoke() → main process → fs -} - -class WebStorageService implements IStorageService { - // Uses IndexedDB + File System Access API -} - -// Runtime detection (storage.ts) -const storage = window.ipcRenderer ? new ElectronStorageService() : new WebStorageService(); -``` - -**Location**: `/home/user/Graphium/src/services/` - -### 2. Prototype/Instance Pattern (Token Library) - -**Problem**: Users want reusable tokens without duplicating data - -**Solution**: Library items as prototypes, map tokens as instances - -```typescript -// Prototype (in tokenLibrary[]) -interface TokenLibraryItem { - id: string; - name: string; - src: string; - defaultScale: number; - defaultType: 'PC' | 'NPC'; - defaultVisionRadius: number; - tags: string[]; -} - -// Instance (in tokens[]) -interface Token { - id: string; - x: number; // Instance-specific - y: number; // Instance-specific - src: string; // Inherited from library - libraryItemId?: string; // Reference to prototype - scale?: number; // Override (falls back to defaultScale) - type?: 'PC' | 'NPC'; // Override (falls back to defaultType) - visionRadius?: number; // Override (falls back to defaultVisionRadius) - name?: string; // Override (falls back to library name) -} -``` - -**Resolution Logic**: `src/hooks/useTokenData.ts` - -### 3. Error Boundary Granularity - -**Problem**: Single component crash shouldn't take down entire app - -**Solution**: Layered error boundaries with privacy-aware sanitization - -``` - ← Root-level (catches catastrophic errors) - - ← Image cropping - - - - - ← Per-token - - - - ← Per-overlay - - - - ← Minimap - - - - - ← Library modal - - - -``` - -**Error Sanitization**: All errors are sanitized to remove PII (usernames, file paths) before reporting. See `src/utils/errorSanitizer.ts`. - -### 4. Grid Snapping Logic - -**Problem**: Different token sizes need different snap behavior - -**Solution**: Size-aware snapping - -```typescript -// Large tokens (2x2) snap to grid intersections -// Medium tokens (1x1) snap to cell centers - -function snapToGrid(x: number, y: number, tokenScale: number, gridSize: number) { - if (tokenScale >= 2) { - // Large token: snap to intersection - return { - x: Math.round(x / gridSize) * gridSize, - y: Math.round(y / gridSize) * gridSize, - }; - } else { - // Medium/small token: snap to cell center - const halfGrid = gridSize / 2; - return { - x: Math.round((x - halfGrid) / gridSize) * gridSize + halfGrid, - y: Math.round((y - halfGrid) / gridSize) * gridSize + halfGrid, - }; - } -} -``` - -**Location**: `/home/user/Graphium/src/utils/grid.ts` - -### 5. Fog of War Raycasting - -**Algorithm**: Real-time line-of-sight calculation with wall occlusion - -``` -For each PC token: - 1. Get token position and visionRadius - 2. Cast rays in a circle (360 degrees, configurable step) - 3. For each ray: - - Check intersection with wall drawings - - If intersects: truncate ray at wall - - If no intersection: extend to visionRadius - 4. Merge all PC vision polygons - 5. Render blurred overlay for unseen areas -``` - -**Location**: `/home/user/Graphium/src/components/Canvas/FogOfWarLayer.tsx` - ---- - -## Critical Paths & Workflows - -### Campaign Workflow - -1. **New Campaign**: `HomeScreen` → Create campaign → Set name → Start Editor -2. **Load Campaign**: `HomeScreen` → Load .graphium → Extract assets → Populate store → Start Editor -3. **Save Campaign**: Toolbar → Save → Serialize store → Embed assets → Write .graphium ZIP -4. **Auto-Save**: `AutoSaveManager` polls store every 30s → IndexedDB write - -### Token Workflow - -1. **Add to Library**: Drag image → Crop → Set metadata → Add to `tokenLibrary[]` -2. **Place on Map**: Drag from library → `addLibraryTokenToMap()` → Creates instance with `libraryItemId` -3. **Edit Token**: Click token → `TokenInspector` → Edit properties → `updateToken()` -4. **Delete Token**: Select → Delete key → `removeToken()` - -### Drawing Workflow - -1. **Select Tool**: Toolbar → Click Marker/Eraser/Wall → `setTool()` -2. **Draw**: Mouse down → Capture points → Mouse up → `addDrawing()` -3. **Erase**: Eraser tool → Draw over existing → Remove intersecting drawings -4. **Walls**: Wall tool → Draw → Tagged as `tool: 'wall'` → Blocks vision - -### Fog of War Workflow - -1. **Enable**: Preferences → Turn on Fog of War -2. **Set Vision**: Select PC token → TokenInspector → Set visionRadius -3. **Reveal**: FogOfWarLayer calculates vision → Blurs unseen areas -4. **Wall Occlusion**: Walls block vision automatically - ---- - -## Testing Strategy - -### Unit Tests (Vitest) - -**Location**: Co-located with source files (`*.test.ts`, `*.test.tsx`) - -**Coverage**: 22 test files - -- Utils: `grid.test.ts`, `measurement.test.ts`, `errorSanitizer.test.ts`, `fuzzySearch.test.ts` (⚠️ **MISSING**) -- Hooks: `useTokenData.test.ts` -- Components: `HomeScreen.test.tsx`, `Sidebar.test.tsx`, `Toast.test.tsx` -- Error Boundaries: `PrivacyErrorBoundary.test.tsx`, `CanvasOverlayErrorBoundary.test.tsx` - -**Run**: `npm run test` or `npm run test:coverage` - -### E2E Tests (Playwright) - -**Location**: `/home/user/Graphium/tests/` - -**Coverage**: 13 spec files - -- **Functional**: `campaign-workflow.spec.ts`, `token-management.spec.ts`, `door-sync.spec.ts`, etc. -- **Electron**: `ipc.electron.spec.ts`, `startup.electron.spec.ts` -- **Performance**: `drawing-performance.spec.ts` -- **Accessibility**: `accessibility.spec.ts` (WCAG AA with axe-core) - -**Run**: - -- `npm run test:e2e` (all tests) -- `npm run test:e2e:web` (web only) -- `npm run test:e2e:electron` (Electron only) - -### Testing Philosophy - -- **Behavior over implementation**: Test user-facing behavior, not internal state -- **Functional over visual**: No screenshot tests (too brittle) -- **Privacy-aware**: All error tests verify PII sanitization -- **Platform coverage**: Both Electron and Web tested - -**Further Reading**: `/home/user/Graphium/TESTING_STRATEGY.md` - ---- - -## Error Handling - -### 3-Layer Error Handling Architecture - -#### Layer 1: React Error Boundaries - -- **PrivacyErrorBoundary** (root level) -- **TokenErrorBoundary** (per-token granularity) -- **CanvasOverlayErrorBoundary** (per-overlay granularity) -- **MinimapErrorBoundary** (minimap component) -- **LibraryModalErrorBoundary** (library modal) -- **AssetProcessingErrorBoundary** (image cropping) -- **DungeonGeneratorErrorBoundary** (dungeon generator) - -**Location**: `/home/user/Graphium/src/components/` - -#### Layer 2: Global Error Handlers - -- `window.onerror` - Catches uncaught JS errors -- `window.onunhandledrejection` - Catches unhandled promise rejections -- Both sanitize errors and expose to `window.errorReporting` API - -**Location**: `/home/user/Graphium/src/utils/globalErrorHandler.ts` - -#### Layer 3: Main Process Error Handling - -- Electron main process error handlers -- IPC error handling -- File I/O error handling - -**Location**: `/home/user/Graphium/electron/main.ts` - -### Privacy Guarantees - -All errors are sanitized before reporting: - -- Usernames → `` -- File paths → Relative paths -- System info → Redacted - -**Implementation**: `/home/user/Graphium/src/utils/errorSanitizer.ts` - -**Further Reading**: `/home/user/Graphium/docs/features/error-boundaries.md` - ---- - -## Further Reading - -### Essential Docs (Read These First) - -1. **[docs/context/CONTEXT.md](docs/context/CONTEXT.md)** - Domain knowledge, business rules, user workflows -2. **[docs/architecture/ARCHITECTURE.md](docs/architecture/ARCHITECTURE.md)** - Deep-dive architecture with diagrams -3. **[docs/components/state-management.md](docs/components/state-management.md)** - Zustand store patterns -4. **[TESTING_STRATEGY.md](TESTING_STRATEGY.md)** - Testing philosophy and guidelines - -### Component-Specific Docs - -- **[docs/components/canvas.md](docs/components/canvas.md)** - CanvasManager deep-dive -- **[docs/components/electron.md](docs/components/electron.md)** - Electron/IPC patterns -- **[docs/features/error-boundaries.md](docs/features/error-boundaries.md)** - Error boundary strategy -- **[docs/features/theming.md](docs/features/theming.md)** - Theme system - -### Developer Guides - -- **[docs/guides/CONVENTIONS.md](docs/guides/CONVENTIONS.md)** - Code style, naming conventions -- **[docs/guides/TUTORIALS.md](docs/guides/TUTORIALS.md)** - How to add features -- **[docs/guides/TROUBLESHOOTING.md](docs/guides/TROUBLESHOOTING.md)** - Common issues - -### Architecture Deep-Dives - -- **[docs/architecture/IPC_API.md](docs/architecture/IPC_API.md)** - IPC message reference -- **[docs/architecture/PERFORMANCE_OPTIMIZATIONS.md](docs/architecture/PERFORMANCE_OPTIMIZATIONS.md)** - Performance patterns -- **[docs/architecture/DECISIONS.md](docs/architecture/DECISIONS.md)** - Architectural decision records (ADRs) - -### Full Documentation Index - -See **[docs/index.md](docs/index.md)** for complete documentation catalog. - ---- - -## Quick Start for AI Agents - -### When Making Changes: - -1. **Read this file first** ✅ (You're here!) -2. **Check `docs/context/CONTEXT.md`** for domain knowledge -3. **Find the relevant component** in `src/components/` -4. **Check if tests exist** in co-located `.test.tsx` files -5. **Write tests first** (TDD approach preferred) -6. **Make changes** following patterns in this doc -7. **Run tests**: `npm run test` + `npm run test:e2e` -8. **Update docs** if you change architecture - -### Common Pitfalls to Avoid: - -❌ **Don't** bypass the storage service abstraction -✅ **Do** use `getStorage()` for all file operations - -❌ **Don't** mutate Zustand state directly -✅ **Do** use store actions (`gameStore.updateToken()`) - -❌ **Don't** forget to sync World View via IPC -✅ **Do** ensure `SyncManager.tsx` handles your state changes - -❌ **Don't** expose PII in errors -✅ **Do** use error sanitization utilities - -❌ **Don't** create global CSS -✅ **Do** use Tailwind utilities or scoped styles - -❌ **Don't** assume Electron environment -✅ **Do** check `window.ipcRenderer` existence - -### Need Help? - -- **Architecture questions**: Read `docs/architecture/ARCHITECTURE.md` -- **Business logic questions**: Read `docs/context/CONTEXT.md` -- **Testing questions**: Read `TESTING_STRATEGY.md` -- **Component questions**: Read `docs/components/.md` -- **Error handling**: Read `docs/features/error-boundaries.md` - ---- - -**Last Updated**: 2025-12-30 -**Maintainer**: AI Agents + Human Developers -**Status**: Living Document (Update as architecture evolves) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3426e864..86704459 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,59 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +#### Modular Architecture Refactor + +- **Design System Separation**: UI presentation fully separable from business logic + - CSS custom properties for all colors (theme.css, brand.css) — swap visual identity without touching logic + - UI Primitives: Button (5 variants), Dialog (focus trap, a11y), Input, Card, ToggleSwitch + - HomeScreen CSS extracted to standalone stylesheet (1,032 lines out of JSX) + +- **State Architecture**: Domain state cleanly separated from UI state + - `uiStore.ts` — toast, dialogs, pause, sidebar (UI ephemeral state) + - `gameStore.ts` — tokens, drawings, doors, campaign (domain-only, SyncManager-watched) + - `campaignService.ts` — save/load/new campaign orchestration (zero React imports) + - Domain types in `src/types/domain.ts` — importable without Zustand + +- **Logic Extraction**: Business logic extracted to testable pure functions and hooks + - `vision.ts` — raycasting/visibility polygon (100% test coverage) + - `useToolState` — tool selection, colors, keyboard shortcuts + - `useMenuCommands` — Electron IPC menu handler registration + - `useRecentCampaigns` / `usePlatformDetection` — HomeScreen logic hooks + - CanvasManager decomposed: 4 hooks + DoorContextMenu extracted (1,892 → 1,450 lines) + +- **Accessibility (WCAG 2.2 AA)**: + - Canvas ARIA live region — announces token/door/tool changes to screen readers + - Keyboard token navigation (Tab cycle, Enter activate, Arrow move) + - Skip-to-content link, landmark roles (nav, main) + - Global `:focus-visible` indicators on all interactive elements + - `prefers-contrast: more` support, `prefers-reduced-motion` respected + - `eslint-plugin-jsx-a11y` enforcing a11y rules + +- **Performance**: + - Code splitting via React.lazy: 891KB → 810KB main chunk (-9%) + - Konva pixelRatio capped on low-end devices (deviceMemory ≤ 4GB) + - FogOfWarLayer explored regions Konva-level caching + - CSS transitions scoped to UI elements only (canvas unaffected) + +- **Quality Tooling**: + - Import boundary linting (primitives can't import store, store can't import components) + - 5 TypeScript ESLint rules upgraded warn → error (no-explicit-any, no-unsafe-\*) + - 975 tests across 48 files, coverage targets met on all extracted modules + +### Changed + +- Reorganized component directory: ErrorBoundaries/, Dialogs/, Managers/, Mobile/ +- Consolidated root docs: 13+ files → 5 at root, rest in docs/ subdirectories +- Removed 7 redundant Radix dark-mode CSS imports from theme.css +- Removed backward-compat re-exports from gameStore (types now in types/domain) +- Deleted ToggleSwitch re-export shim (all consumers migrated to primitives/) + +### Removed + +- Dead Vite boilerplate: App.css, react.svg, 3 public SVGs +- ~40 lines of unguarded console.log in FogOfWarLayer (gated behind DEBUG_VISION flag) +- UI state from gameStore (migrated to uiStore) + #### Hexagonal and Isometric Grid Support - **New Grid Types**: Added support for Hexagonal (flat-top) and Isometric grids alongside existing Square grids diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 00000000..2b51e3e3 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,136 @@ +# Graphium — Hyle + +Electron + React + TypeScript tabletop RPG battlemap app. +Branch: `claude/refactor-modular-architecture-GUfVC` (modular refactor — complete) + +--- + +## Commands + +```bash +npm run dev # Start dev server +npm run build:web # Build web version (verify after changes) +npm run lint # ESLint check +npm run type-check # TypeScript check +npm run test:run # Run unit tests +npm run test:a11y # Run accessibility tests +npm run test:coverage # Generate coverage report +``` + +--- + +## Architecture + +``` +src/ +├── types/domain.ts # Core domain types (Token, Drawing, Door, Campaign…) +├── styles/ +│ ├── theme.css # CSS custom properties (all app colors) +│ ├── brand.css # Brand overrides — edit to rebrand +│ ├── primitives.css # UI primitive component styles +│ ├── home-screen.css # Landing page styles +│ └── app.css # Global utility classes + focus indicators +├── components/ +│ ├── primitives/ # Button, Dialog, Input, Card, ToggleSwitch +│ ├── Canvas/ # CanvasManager + rendering layers + hooks/ +│ ├── Dialogs/ # ConfirmDialog, PreferencesDialog, AboutModal… +│ ├── ErrorBoundaries/ # All error boundary components +│ ├── Managers/ # SyncManager, ThemeManager, AutoSaveManager… +│ └── Mobile/ # MobileToolbar, MobileBottomSheet… +├── store/ +│ ├── gameStore.ts # Domain state: tokens, drawings, campaign, maps +│ └── uiStore.ts # UI state: toast, dialogs, sidebar, pause +├── services/ +│ └── campaignService.ts # All campaign save/load/new I/O +├── hooks/ +│ ├── useToolState.ts # Tool selection, color, keyboard shortcuts +│ ├── useMenuCommands.ts # Electron IPC menu handlers +│ └── useRecentCampaigns.ts # Recent file list (localStorage) +└── utils/ + └── vision.ts # Raycasting / fog of war (pure functions) +``` + +--- + +## Design System Contract + +Enforced by ESLint `import/no-restricted-paths`. + +| Layer | Can import from | Cannot import from | +| ---------- | ------------------------------------ | ---------------------- | +| primitives | styles/, types/ | store/, services/ | +| store | types/ | components/, services/ | +| services | types/, store/ (imperative getState) | components/ | +| utils | types/ | components/, store/ | +| hooks | store/, services/, types/ | components/ | +| components | anything above | (integration layer) | + +--- + +## Key Files + +| File | Lines | Role | +| ----------------------------------------- | ----- | ------------------------------------- | +| `src/components/Canvas/CanvasManager.tsx` | 1,450 | Canvas layer compositor | +| `src/components/HomeScreen.tsx` | 723 | Landing page | +| `src/store/gameStore.ts` | 607 | Domain state (tokens, drawings, maps) | +| `src/store/uiStore.ts` | 79 | UI ephemeral state | +| `src/utils/vision.ts` | 205 | Raycasting (100% test coverage) | +| `src/App.tsx` | 325 | Root compositor + landmarks | +| `src/hooks/useToolState.ts` | 152 | Tool state + keyboard shortcuts | +| `src/services/campaignService.ts` | 91 | Campaign save/load/new | +| `src/components/Toolbar.tsx` | 228 | Desktop toolbar (extracted from App) | +| `src/styles/theme.css` | 530 | All CSS custom properties | +| `electron/main.ts` | 1,283 | Electron main process | + +--- + +## Gotchas & Patterns + +**Konva + CSS variables:** Konva renders to `` — `var(--app-*)` doesn't work in +Konva props. Use `*_COLORS` const objects at file top with JSDoc referencing the token name: + +```ts +// mirrors var(--app-canvas-fog) +const FOG_COLORS = { fog: 'rgba(0,0,0,0.94)' }; +``` + +**Store split:** `useGameStore` = domain state. `useUiStore` = UI state. SyncManager only +watches gameStore — UI changes (toast, dialogs) do NOT trigger IPC sync to World View. + +**Campaign I/O:** Always use `campaignService.ts`. Never call the storage service directly +from a component. + +**Async event handlers:** Wrap with `void` to satisfy `no-misused-promises`: + +```ts +onClick={() => { void asyncFn(); }} +``` + +**React.lazy named exports:** + +```ts +const C = lazy(() => import('./C').then((m) => ({ default: m.C }))); +``` + +**noUncheckedIndexedAccess:** `array[i]` is `T | undefined`. Use `!` where bounds are +guaranteed, or add a guard. + +**Error boundaries:** All extend `Component` — need `override` on `componentDidCatch`, +`render`, AND the `state` property declaration. + +**Cross-store calls:** Only one: `gameStore.deleteMap()` calls `useUiStore.getState().showToast()` +for the "cannot delete last map" error. + +--- + +## Documentation + +| Doc | Location | +| -------------------------------------- | ------------------------------------- | +| Modular refactor history (14 sessions) | `docs/planning/REFACTOR_SESSIONS.md` | +| Architecture decisions (ADRs) | `docs/architecture/DECISIONS.md` | +| Testing strategy | `TESTING_STRATEGY.md` | +| Linting guide | `docs/guides/LINTING.md` | +| Device compatibility | `docs/guides/DEVICE_COMPATIBILITY.md` | +| Changelog | `CHANGELOG.md` | diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 66c1656e..c10d63b1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -58,8 +58,17 @@ graphium/ ├── src/ # Renderer process code (React) │ ├── components/ # React components │ │ ├── Canvas/ # Map & Token rendering (Konva) -│ ├── store/ # Zustand state management (gameStore.ts) -│ └── utils/ # Utility functions (syncUtils.ts, assetProcessor.ts) +│ │ ├── Dialogs/ # Modal/dialog components +│ │ ├── ErrorBoundaries/ # Error boundary components +│ │ ├── Managers/ # Non-visual coordination (Sync, Theme, AutoSave) +│ │ ├── Mobile/ # Mobile-specific components +│ │ └── primitives/ # UI design system (Button, Dialog, Input, Card) +│ ├── hooks/ # App-wide custom hooks (useToolState, useMenuCommands) +│ ├── services/ # Platform abstraction & campaign I/O +│ ├── store/ # Zustand state (gameStore + uiStore) +│ ├── styles/ # CSS tokens, themes, primitives +│ ├── types/ # Domain types (Token, Drawing, Door, etc.) +│ └── utils/ # Pure utility functions (vision, grid, sync) └── public/ # Static assets ``` @@ -73,9 +82,10 @@ graphium/ ### State Management (Zustand) -- **Single Store**: `useGameStore` is the source of truth. -- **Sync Logic**: We use a `syncUtils.ts` delta detector to sync state between windows. +- **Two stores**: `useGameStore` for domain state (tokens, drawings, maps) and `useUiStore` for ephemeral UI state (toasts, dialogs, sidebar). +- **Sync Logic**: We use a `syncUtils.ts` delta detector to sync domain state between windows. Only `gameStore` changes trigger IPC sync. - **Do not manually dispatch IPC events** for state changes. Let `SyncManager` handle it automatically via diffing. +- **Campaign I/O**: Use `campaignService.ts` for save/load/new — it orchestrates between stores and storage. ### Testing @@ -133,7 +143,7 @@ Update documentation when you: ### Adding a New Feature -1. **Plan**: Review `AI_CONTEXT.md` and `ARCHITECTURE.md`. +1. **Plan**: Review `docs/context/AI_CONTEXT.md` and `docs/architecture/ARCHITECTURE.md`. 2. **Implement**: Follow existing patterns (Command Palette, Sidebar). 3. **Test**: Manual testing in **both** Architect and World views. 4. **Document**: Update relevant docs. diff --git a/README.md b/README.md index 753a6f4d..abd6646f 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ ![License](https://img.shields.io/badge/license-MIT-blue) ![Build Status](https://github.com/kocheck/Graphium/actions/workflows/build-release.yml/badge.svg) ![Tests](https://github.com/kocheck/Graphium/actions/workflows/test.yml/badge.svg) -![Coverage](https://img.shields.io/badge/coverage-100%25-brightgreen) +![Coverage](https://img.shields.io/badge/coverage-36%25-yellow) @@ -222,7 +222,7 @@ Linting runs automatically before commits via Husky. All checks must pass before ### Documentation -- **[LINTING.md](LINTING.md)** - Complete linting guide with examples and troubleshooting +- **[LINTING.md](docs/guides/LINTING.md)** - Complete linting guide with examples and troubleshooting - **[.ai-rules.md](.ai-rules.md)** - AI agent code generation rules and requirements ### Editor Setup diff --git a/coverage/.tmp/coverage-0.json b/coverage/.tmp/coverage-0.json deleted file mode 100644 index 8ac7ffb2..00000000 --- a/coverage/.tmp/coverage-0.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "result": [ - { - "scriptId": "1196", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/test/setup.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "HTMLCanvasElement.getContext", - "ranges": [{ "startOffset": 1405, "endOffset": 2722, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "HTMLCanvasElement.toDataURL", - "ranges": [{ "startOffset": 2766, "endOffset": 2819, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2930, "endOffset": 2964, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 3071, "endOffset": 3102, "count": 0 }], - "isBlockCoverage": false - } - ] - } - ] -} diff --git a/coverage/.tmp/coverage-1.json b/coverage/.tmp/coverage-1.json deleted file mode 100644 index 54fa558e..00000000 --- a/coverage/.tmp/coverage-1.json +++ /dev/null @@ -1,492 +0,0 @@ -{ - "result": [ - { - "scriptId": "1196", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/test/setup.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "HTMLCanvasElement.getContext", - "ranges": [{ "startOffset": 1405, "endOffset": 2722, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "HTMLCanvasElement.toDataURL", - "ranges": [{ "startOffset": 2766, "endOffset": 2819, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2930, "endOffset": 2964, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 3071, "endOffset": 3102, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1371", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/utils/measurement.test.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 44154, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 44154, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 667, "endOffset": 15204, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 729, "endOffset": 2230, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 814, "endOffset": 986, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1055, "endOffset": 1232, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1299, "endOffset": 1476, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1546, "endOffset": 1724, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1796, "endOffset": 1972, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2041, "endOffset": 2224, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2283, "endOffset": 4728, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2394, "endOffset": 2574, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2653, "endOffset": 2833, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2918, "endOffset": 3098, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3194, "endOffset": 3376, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3480, "endOffset": 3662, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3747, "endOffset": 3929, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4018, "endOffset": 4200, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4270, "endOffset": 4454, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4534, "endOffset": 4722, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4780, "endOffset": 6901, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4866, "endOffset": 5791, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4947, "endOffset": 5104, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5179, "endOffset": 5338, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5405, "endOffset": 5562, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5627, "endOffset": 5783, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5844, "endOffset": 6895, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5936, "endOffset": 6255, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6324, "endOffset": 6641, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6731, "endOffset": 6887, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6955, "endOffset": 8295, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7043, "endOffset": 7220, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7300, "endOffset": 7489, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7570, "endOffset": 7757, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7839, "endOffset": 8033, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8101, "endOffset": 8289, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8356, "endOffset": 9681, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8442, "endOffset": 8626, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8706, "endOffset": 8893, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8974, "endOffset": 9159, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9237, "endOffset": 9424, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9489, "endOffset": 9675, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9742, "endOffset": 13120, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9822, "endOffset": 10057, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10130, "endOffset": 10358, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10439, "endOffset": 10945, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 11024, "endOffset": 11421, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 11500, "endOffset": 11977, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 12045, "endOffset": 12617, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 12692, "endOffset": 13114, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13180, "endOffset": 15200, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13241, "endOffset": 13778, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13314, "endOffset": 13422, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13487, "endOffset": 13593, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13660, "endOffset": 13770, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13832, "endOffset": 14389, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13915, "endOffset": 14028, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 14091, "endOffset": 14202, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 14266, "endOffset": 14381, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 14441, "endOffset": 15194, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 14524, "endOffset": 14641, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 14713, "endOffset": 14826, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 14889, "endOffset": 15004, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 15069, "endOffset": 15186, "count": 1 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1372", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/utils/measurement.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 14430, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 14430, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 221, "endOffset": 348, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 471, "endOffset": 499, "count": 7 }], - "isBlockCoverage": true - }, - { - "functionName": "euclideanDistance", - "ranges": [{ "startOffset": 529, "endOffset": 635, "count": 24 }], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 742, "endOffset": 775, "count": 15 }], - "isBlockCoverage": true - }, - { - "functionName": "dnd5eDistance", - "ranges": [{ "startOffset": 801, "endOffset": 1275, "count": 11 }], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 1378, "endOffset": 1407, "count": 9 }], - "isBlockCoverage": true - }, - { - "functionName": "pixelsToFeet", - "ranges": [ - { "startOffset": 1432, "endOffset": 1712, "count": 7 }, - { "startOffset": 1543, "endOffset": 1548, "count": 3 }, - { "startOffset": 1549, "endOffset": 1554, "count": 2 }, - { "startOffset": 1556, "endOffset": 1636, "count": 2 }, - { "startOffset": 1636, "endOffset": 1711, "count": 5 } - ], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 1814, "endOffset": 1842, "count": 7 }], - "isBlockCoverage": true - }, - { - "functionName": "calculateAngle", - "ranges": [{ "startOffset": 1869, "endOffset": 1931, "count": 19 }], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2035, "endOffset": 2065, "count": 5 }], - "isBlockCoverage": true - }, - { - "functionName": "calculateAngleDegrees", - "ranges": [ - { "startOffset": 2099, "endOffset": 2248, "count": 5 }, - { "startOffset": 2220, "endOffset": 2229, "count": 4 }, - { "startOffset": 2230, "endOffset": 2245, "count": 1 } - ], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2359, "endOffset": 2396, "count": 5 }], - "isBlockCoverage": true - }, - { - "functionName": "calculateConeVertices", - "ranges": [{ "startOffset": 2430, "endOffset": 3041, "count": 9 }], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 3152, "endOffset": 3189, "count": 9 }], - "isBlockCoverage": true - }, - { - "functionName": "formatDistance", - "ranges": [{ "startOffset": 3216, "endOffset": 3251, "count": 3 }], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 3355, "endOffset": 3385, "count": 3 }], - "isBlockCoverage": true - }, - { - "functionName": "formatRadius", - "ranges": [{ "startOffset": 3410, "endOffset": 3464, "count": 3 }], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 3566, "endOffset": 3594, "count": 3 }], - "isBlockCoverage": true - }, - { - "functionName": "formatCone", - "ranges": [{ "startOffset": 3617, "endOffset": 3705, "count": 4 }], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 3805, "endOffset": 3831, "count": 4 }], - "isBlockCoverage": true - } - ] - } - ] -} diff --git a/coverage/.tmp/coverage-10.json b/coverage/.tmp/coverage-10.json deleted file mode 100644 index 3f25f778..00000000 --- a/coverage/.tmp/coverage-10.json +++ /dev/null @@ -1,631 +0,0 @@ -{ - "result": [ - { - "scriptId": "1196", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/test/setup.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "HTMLCanvasElement.getContext", - "ranges": [{ "startOffset": 1405, "endOffset": 2722, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "HTMLCanvasElement.toDataURL", - "ranges": [{ "startOffset": 2766, "endOffset": 2819, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2930, "endOffset": 2964, "count": 7 }], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 3071, "endOffset": 3102, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1371", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/PendingErrorsIndicator.test.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 78335, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 78335, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 345, "endOffset": 481, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1015, "endOffset": 30729, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1439, "endOffset": 1540, "count": 28 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1521, "endOffset": 1534, "count": 4 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1567, "endOffset": 5500, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1628, "endOffset": 2142, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2207, "endOffset": 2746, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2820, "endOffset": 3423, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3471, "endOffset": 4087, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4145, "endOffset": 4780, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4841, "endOffset": 5494, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5540, "endOffset": 8445, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5600, "endOffset": 6319, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6209, "endOffset": 6311, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6369, "endOffset": 7176, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6978, "endOffset": 7168, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 7240, "endOffset": 8439, "count": 1 }, - { "startOffset": 8223, "endOffset": 8286, "count": 0 }, - { "startOffset": 8433, "endOffset": 8438, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7849, "endOffset": 7951, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8081, "endOffset": 8190, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8323, "endOffset": 8431, "count": 17 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8481, "endOffset": 11028, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8545, "endOffset": 9254, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9154, "endOffset": 9246, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9331, "endOffset": 10125, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10026, "endOffset": 10117, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10174, "endOffset": 11022, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10783, "endOffset": 11014, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 11063, "endOffset": 14776, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 11128, "endOffset": 12201, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 11737, "endOffset": 11835, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 11995, "endOffset": 12193, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 12275, "endOffset": 13459, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 12998, "endOffset": 13096, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13256, "endOffset": 13451, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13522, "endOffset": 14770, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 14131, "endOffset": 14229, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 14389, "endOffset": 14490, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 14655, "endOffset": 14762, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 14809, "endOffset": 20282, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 14893, "endOffset": 16238, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 15502, "endOffset": 15600, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 15760, "endOffset": 15865, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 16038, "endOffset": 16230, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 16312, "endOffset": 17563, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 16921, "endOffset": 17019, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 17179, "endOffset": 17284, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 17457, "endOffset": 17555, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 17633, "endOffset": 18882, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 18242, "endOffset": 18340, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 18500, "endOffset": 18605, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 18778, "endOffset": 18874, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 18944, "endOffset": 20276, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 19667, "endOffset": 19765, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 19925, "endOffset": 20030, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 20203, "endOffset": 20268, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 20312, "endOffset": 25875, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 20391, "endOffset": 21641, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 21000, "endOffset": 21098, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 21258, "endOffset": 21351, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 21508, "endOffset": 21633, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 21706, "endOffset": 23054, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 22440, "endOffset": 22538, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 22698, "endOffset": 22791, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 22948, "endOffset": 23046, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 23117, "endOffset": 24528, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 23841, "endOffset": 23939, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 24099, "endOffset": 24192, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 24349, "endOffset": 24520, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 24578, "endOffset": 25869, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 25288, "endOffset": 25386, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 25546, "endOffset": 25639, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 25796, "endOffset": 25861, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 25914, "endOffset": 28737, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 25999, "endOffset": 26785, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 26674, "endOffset": 26777, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 26869, "endOffset": 27680, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 27478, "endOffset": 27580, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 27745, "endOffset": 28731, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 28420, "endOffset": 28523, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 28769, "endOffset": 29820, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 28845, "endOffset": 29814, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 29709, "endOffset": 29806, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 29856, "endOffset": 30725, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 29916, "endOffset": 30719, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 30605, "endOffset": 30711, "count": 1 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1726", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/PendingErrorsIndicator.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 49242, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 49242, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "PendingErrorsIndicator", - "ranges": [ - { "startOffset": 1050, "endOffset": 22590, "count": 98 }, - { "startOffset": 4731, "endOffset": 4753, "count": 29 }, - { "startOffset": 4753, "endOffset": 5019, "count": 68 }, - { "startOffset": 5019, "endOffset": 6727, "count": 28 }, - { "startOffset": 5847, "endOffset": 5852, "count": 4 }, - { "startOffset": 5853, "endOffset": 5857, "count": 24 }, - { "startOffset": 6101, "endOffset": 6499, "count": 26 }, - { "startOffset": 6744, "endOffset": 22416, "count": 40 }, - { "startOffset": 8481, "endOffset": 12723, "count": 23 }, - { "startOffset": 12745, "endOffset": 20950, "count": 17 }, - { "startOffset": 15158, "endOffset": 15540, "count": 1 }, - { "startOffset": 17518, "endOffset": 17553, "count": 3 }, - { "startOffset": 17554, "endOffset": 17646, "count": 14 }, - { "startOffset": 17581, "endOffset": 17612, "count": 1 }, - { "startOffset": 17613, "endOffset": 17646, "count": 13 }, - { "startOffset": 17700, "endOffset": 18395, "count": 3 }, - { "startOffset": 18396, "endOffset": 19101, "count": 14 }, - { "startOffset": 21546, "endOffset": 22043, "count": 4 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1537, "endOffset": 1709, "count": 35 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1750, "endOffset": 1996, "count": 28 }], - "isBlockCoverage": true - }, - { - "functionName": "handleNewError", - "ranges": [{ "startOffset": 1806, "endOffset": 1842, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1914, "endOffset": 1991, "count": 28 }], - "isBlockCoverage": true - }, - { - "functionName": "handleReportError", - "ranges": [ - { "startOffset": 2044, "endOffset": 3956, "count": 4 }, - { "startOffset": 2206, "endOffset": 2279, "count": 0 }, - { "startOffset": 2738, "endOffset": 3476, "count": 0 }, - { "startOffset": 3610, "endOffset": 3794, "count": 3 }, - { "startOffset": 3794, "endOffset": 3952, "count": 1 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3751, "endOffset": 3780, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3910, "endOffset": 3939, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "handleSaveError", - "ranges": [ - { "startOffset": 3984, "endOffset": 4383, "count": 4 }, - { "startOffset": 4166, "endOffset": 4195, "count": 3 }, - { "startOffset": 4195, "endOffset": 4294, "count": 2 }, - { "startOffset": 4309, "endOffset": 4379, "count": 1 } - ], - "isBlockCoverage": true - }, - { - "functionName": "handleDismissReported", - "ranges": [{ "startOffset": 4417, "endOffset": 4526, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "formatTimestamp", - "ranges": [{ "startOffset": 4780, "endOffset": 4872, "count": 24 }], - "isBlockCoverage": true - }, - { - "functionName": "onClick", - "ranges": [{ "startOffset": 5109, "endOffset": 5134, "count": 21 }], - "isBlockCoverage": true - }, - { - "functionName": "onClick", - "ranges": [{ "startOffset": 7510, "endOffset": 7605, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 8596, "endOffset": 12537, "count": 24 }, - { "startOffset": 9632, "endOffset": 10005, "count": 20 }, - { "startOffset": 10045, "endOffset": 10491, "count": 2 }, - { "startOffset": 11258, "endOffset": 11276, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "onClick", - "ranges": [{ "startOffset": 8700, "endOffset": 8729, "count": 11 }], - "isBlockCoverage": true - }, - { - "functionName": "onClick", - "ranges": [{ "startOffset": 13050, "endOffset": 13078, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "onClick", - "ranges": [{ "startOffset": 17340, "endOffset": 17378, "count": 4 }], - "isBlockCoverage": true - }, - { - "functionName": "onClick", - "ranges": [{ "startOffset": 19498, "endOffset": 19534, "count": 4 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 21527, "endOffset": 21544, "count": 41 }], - "isBlockCoverage": true - } - ] - } - ] -} diff --git a/coverage/.tmp/coverage-11.json b/coverage/.tmp/coverage-11.json deleted file mode 100644 index b0477119..00000000 --- a/coverage/.tmp/coverage-11.json +++ /dev/null @@ -1,642 +0,0 @@ -{ - "result": [ - { - "scriptId": "1196", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/test/setup.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "HTMLCanvasElement.getContext", - "ranges": [{ "startOffset": 1405, "endOffset": 2722, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "HTMLCanvasElement.toDataURL", - "ranges": [{ "startOffset": 2766, "endOffset": 2819, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2930, "endOffset": 2964, "count": 15 }], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 3071, "endOffset": 3102, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1371", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/PrivacyErrorBoundary.test.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 54268, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 54268, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "ThrowError", - "ranges": [ - { "startOffset": 903, "endOffset": 1267, "count": 85 }, - { "startOffset": 961, "endOffset": 1009, "count": 84 }, - { "startOffset": 1009, "endOffset": 1266, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "ErrorTrigger", - "ranges": [{ "startOffset": 1268, "endOffset": 1553, "count": 43 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1609, "endOffset": 26206, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1652, "endOffset": 1797, "count": 22 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1778, "endOffset": 1791, "count": 65 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1876, "endOffset": 2714, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 2788, "endOffset": 3548, "count": 1 }, - { "startOffset": 3544, "endOffset": 3547, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3409, "endOffset": 3542, "count": 18 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3619, "endOffset": 4389, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4240, "endOffset": 4383, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4449, "endOffset": 5318, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5070, "endOffset": 5312, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5384, "endOffset": 6133, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6005, "endOffset": 6127, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6205, "endOffset": 6962, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6826, "endOffset": 6956, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7028, "endOffset": 7780, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7651, "endOffset": 7774, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7855, "endOffset": 9022, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8478, "endOffset": 8608, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8782, "endOffset": 9016, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9090, "endOffset": 10221, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9713, "endOffset": 9843, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10017, "endOffset": 10215, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10303, "endOffset": 11363, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10926, "endOffset": 11056, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 11230, "endOffset": 11357, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 11446, "endOffset": 12576, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 12069, "endOffset": 12199, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 12373, "endOffset": 12570, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 12646, "endOffset": 13503, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13361, "endOffset": 13497, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 13581, "endOffset": 14448, "count": 1 }, - { "startOffset": 14444, "endOffset": 14447, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 14309, "endOffset": 14442, "count": 20 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 14527, "endOffset": 15722, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 15280, "endOffset": 15410, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 15584, "endOffset": 15716, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 15778, "endOffset": 26202, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 15853, "endOffset": 16638, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 16501, "endOffset": 16630, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 16723, "endOffset": 17808, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 17371, "endOffset": 17500, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 17675, "endOffset": 17800, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 17894, "endOffset": 19161, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 17998, "endOffset": 18079, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 18016, "endOffset": 18078, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 18040, "endOffset": 18072, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 18723, "endOffset": 18852, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 19027, "endOffset": 19153, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 19245, "endOffset": 20489, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 20054, "endOffset": 20183, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 20358, "endOffset": 20481, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 20567, "endOffset": 21817, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 21358, "endOffset": 21487, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "__vite_ssr_import_2__.waitFor.timeout", - "ranges": [{ "startOffset": 21662, "endOffset": 21791, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 21893, "endOffset": 23129, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 22681, "endOffset": 22810, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 22985, "endOffset": 23121, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 23211, "endOffset": 24412, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 23964, "endOffset": 24093, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 24268, "endOffset": 24404, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 24491, "endOffset": 26196, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 25139, "endOffset": 25281, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 25483, "endOffset": 25702, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 25885, "endOffset": 26188, "count": 1 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1726", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/PrivacyErrorBoundary.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 88354, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 88354, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "PrivacyErrorBoundary", - "ranges": [{ "startOffset": 930, "endOffset": 1202, "count": 44 }], - "isBlockCoverage": true - }, - { - "functionName": "getDerivedStateFromError", - "ranges": [{ "startOffset": 1362, "endOffset": 1442, "count": 42 }], - "isBlockCoverage": true - }, - { - "functionName": "componentDidCatch", - "ranges": [{ "startOffset": 1697, "endOffset": 1786, "count": 21 }], - "isBlockCoverage": true - }, - { - "functionName": "sanitizeAndSetError", - "ranges": [ - { "startOffset": 2031, "endOffset": 3345, "count": 21 }, - { "startOffset": 2243, "endOffset": 2253, "count": 20 }, - { "startOffset": 2253, "endOffset": 2309, "count": 0 }, - { "startOffset": 2318, "endOffset": 2451, "count": 1 }, - { "startOffset": 2588, "endOffset": 2593, "count": 0 }, - { "startOffset": 2639, "endOffset": 2644, "count": 0 }, - { "startOffset": 2929, "endOffset": 3341, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3467, "endOffset": 7947, "count": 43 }], - "isBlockCoverage": true - }, - { - "functionName": "handleReportOnGitHub", - "ranges": [ - { "startOffset": 3490, "endOffset": 5884, "count": 5 }, - { "startOffset": 3632, "endOffset": 3661, "count": 0 }, - { "startOffset": 3811, "endOffset": 3821, "count": 0 }, - { "startOffset": 3891, "endOffset": 3964, "count": 0 }, - { "startOffset": 4711, "endOffset": 4985, "count": 7150 }, - { "startOffset": 4843, "endOffset": 4879, "count": 5 }, - { "startOffset": 4879, "endOffset": 4985, "count": 7145 }, - { "startOffset": 5136, "endOffset": 5190, "count": 0 }, - { "startOffset": 5332, "endOffset": 5487, "count": 4 }, - { "startOffset": 5487, "endOffset": 5880, "count": 1 }, - { "startOffset": 5622, "endOffset": 5737, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5409, "endOffset": 5473, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5803, "endOffset": 5867, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "handleSaveToFile", - "ranges": [ - { "startOffset": 6024, "endOffset": 7492, "count": 7 }, - { "startOffset": 6197, "endOffset": 6439, "count": 1 }, - { "startOffset": 6440, "endOffset": 6444, "count": 6 }, - { "startOffset": 6609, "endOffset": 6775, "count": 0 }, - { "startOffset": 6842, "endOffset": 6869, "count": 6 }, - { "startOffset": 6869, "endOffset": 7019, "count": 4 }, - { "startOffset": 7019, "endOffset": 7271, "count": 2 }, - { "startOffset": 7059, "endOffset": 7271, "count": 1 }, - { "startOffset": 7278, "endOffset": 7488, "count": 1 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6678, "endOffset": 6744, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6938, "endOffset": 7004, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7190, "endOffset": 7256, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7413, "endOffset": 7475, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "handleContextChange", - "ranges": [{ "startOffset": 7576, "endOffset": 7640, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "toggleContextInput", - "ranges": [{ "startOffset": 7727, "endOffset": 7815, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7753, "endOffset": 7809, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "handleReload", - "ranges": [{ "startOffset": 7906, "endOffset": 7947, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "render", - "ranges": [ - { "startOffset": 7951, "endOffset": 37479, "count": 126 }, - { "startOffset": 8138, "endOffset": 37454, "count": 83 }, - { "startOffset": 10518, "endOffset": 12434, "count": 42 }, - { "startOffset": 12435, "endOffset": 36884, "count": 41 }, - { "startOffset": 16627, "endOffset": 16640, "count": 4 }, - { "startOffset": 16641, "endOffset": 16645, "count": 37 }, - { "startOffset": 18285, "endOffset": 19858, "count": 4 }, - { "startOffset": 20476, "endOffset": 20511, "count": 4 }, - { "startOffset": 20512, "endOffset": 20604, "count": 37 }, - { "startOffset": 20539, "endOffset": 20570, "count": 1 }, - { "startOffset": 20571, "endOffset": 20604, "count": 36 }, - { "startOffset": 20660, "endOffset": 22392, "count": 4 }, - { "startOffset": 22393, "endOffset": 26046, "count": 37 }, - { "startOffset": 22420, "endOffset": 24162, "count": 1 }, - { "startOffset": 24163, "endOffset": 26046, "count": 36 }, - { "startOffset": 26639, "endOffset": 26674, "count": 3 }, - { "startOffset": 26675, "endOffset": 26828, "count": 38 }, - { "startOffset": 26700, "endOffset": 26731, "count": 2 }, - { "startOffset": 26732, "endOffset": 26828, "count": 36 }, - { "startOffset": 26758, "endOffset": 26788, "count": 7 }, - { "startOffset": 26789, "endOffset": 26828, "count": 29 }, - { "startOffset": 26932, "endOffset": 28656, "count": 3 }, - { "startOffset": 28657, "endOffset": 34063, "count": 38 }, - { "startOffset": 28682, "endOffset": 30424, "count": 2 }, - { "startOffset": 30425, "endOffset": 34063, "count": 36 }, - { "startOffset": 30451, "endOffset": 32284, "count": 7 }, - { "startOffset": 32285, "endOffset": 34063, "count": 29 }, - { "startOffset": 37454, "endOffset": 37478, "count": 43 } - ], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1729", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/utils/errorSanitizer.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 23518, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 23518, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "sanitizePII", - "ranges": [{ "startOffset": 1247, "endOffset": 1575, "count": 42 }], - "isBlockCoverage": true - }, - { - "functionName": "sanitizeStack", - "ranges": [ - { "startOffset": 1576, "endOffset": 2703, "count": 21 }, - { "startOffset": 1649, "endOffset": 1659, "count": 0 }, - { "startOffset": 1696, "endOffset": 1701, "count": 0 }, - { "startOffset": 1734, "endOffset": 1739, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2805, "endOffset": 2834, "count": 21 }], - "isBlockCoverage": true - }, - { - "functionName": "generateReportBody", - "ranges": [ - { "startOffset": 2838, "endOffset": 3954, "count": 21 }, - { "startOffset": 2962, "endOffset": 2973, "count": 0 }, - { "startOffset": 3048, "endOffset": 3059, "count": 0 }, - { "startOffset": 3136, "endOffset": 3147, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 4061, "endOffset": 4095, "count": 21 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1730", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/utils/systemMessages.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 46982, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 46982, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "rollForMessage", - "ranges": [ - { "startOffset": 14659, "endOffset": 15306, "count": 166 }, - { "startOffset": 14794, "endOffset": 14953, "count": 0 }, - { "startOffset": 15088, "endOffset": 15278, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 15131, "endOffset": 15272, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 15409, "endOffset": 15439, "count": 166 }], - "isBlockCoverage": true - } - ] - } - ] -} diff --git a/coverage/.tmp/coverage-12.json b/coverage/.tmp/coverage-12.json deleted file mode 100644 index 2b0558c7..00000000 --- a/coverage/.tmp/coverage-12.json +++ /dev/null @@ -1,311 +0,0 @@ -{ - "result": [ - { - "scriptId": "1196", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/test/setup.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "HTMLCanvasElement.getContext", - "ranges": [{ "startOffset": 1405, "endOffset": 2722, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "HTMLCanvasElement.toDataURL", - "ranges": [{ "startOffset": 2766, "endOffset": 2819, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2930, "endOffset": 2964, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 3071, "endOffset": 3102, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1371", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/utils/recentCampaigns.test.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 35189, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 35189, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 626, "endOffset": 12291, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 669, "endOffset": 752, "count": 19 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 810, "endOffset": 2581, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 905, "endOffset": 1045, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1111, "endOffset": 1632, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1709, "endOffset": 1918, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1997, "endOffset": 2575, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2638, "endOffset": 6271, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2718, "endOffset": 3121, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3197, "endOffset": 3789, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3866, "endOffset": 4724, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4800, "endOffset": 5577, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5186, "endOffset": 5249, "count": 4 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5661, "endOffset": 6265, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6340, "endOffset": 8201, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6428, "endOffset": 6988, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7087, "endOffset": 7679, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7778, "endOffset": 8195, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8261, "endOffset": 9790, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8330, "endOffset": 8977, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9057, "endOffset": 9516, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9590, "endOffset": 9784, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9850, "endOffset": 10756, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9917, "endOffset": 10487, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10564, "endOffset": 10750, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10810, "endOffset": 12287, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10917, "endOffset": 11512, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 11023, "endOffset": 11038, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 11160, "endOffset": 11217, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 11613, "endOffset": 12281, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 11719, "endOffset": 11734, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 11856, "endOffset": 11913, "count": 1 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1372", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/utils/recentCampaigns.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 9709, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 9709, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "getRecentCampaigns", - "ranges": [ - { "startOffset": 252, "endOffset": 558, "count": 41 }, - { "startOffset": 363, "endOffset": 373, "count": 16 }, - { "startOffset": 373, "endOffset": 442, "count": 24 }, - { "startOffset": 442, "endOffset": 556, "count": 2 } - ], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 665, "endOffset": 699, "count": 18 }], - "isBlockCoverage": true - }, - { - "functionName": "addRecentCampaign", - "ranges": [ - { "startOffset": 703, "endOffset": 1125, "count": 20 }, - { "startOffset": 1025, "endOffset": 1123, "count": 1 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 830, "endOffset": 857, "count": 12 }], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 1231, "endOffset": 1264, "count": 17 }], - "isBlockCoverage": true - }, - { - "functionName": "addRecentCampaignWithPlatform", - "ranges": [ - { "startOffset": 1268, "endOffset": 1695, "count": 3 }, - { "startOffset": 1431, "endOffset": 1442, "count": 2 }, - { "startOffset": 1444, "endOffset": 1576, "count": 1 }, - { "startOffset": 1576, "endOffset": 1693, "count": 2 } - ], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 1813, "endOffset": 1858, "count": 3 }], - "isBlockCoverage": true - }, - { - "functionName": "removeRecentCampaign", - "ranges": [ - { "startOffset": 1862, "endOffset": 2194, "count": 3 }, - { "startOffset": 2092, "endOffset": 2192, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1994, "endOffset": 2020, "count": 3 }], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2303, "endOffset": 2339, "count": 3 }], - "isBlockCoverage": true - }, - { - "functionName": "clearRecentCampaigns", - "ranges": [ - { "startOffset": 2343, "endOffset": 2533, "count": 2 }, - { "startOffset": 2431, "endOffset": 2531, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2642, "endOffset": 2678, "count": 2 }], - "isBlockCoverage": true - } - ] - } - ] -} diff --git a/coverage/.tmp/coverage-13.json b/coverage/.tmp/coverage-13.json deleted file mode 100644 index 177433f1..00000000 --- a/coverage/.tmp/coverage-13.json +++ /dev/null @@ -1,247 +0,0 @@ -{ - "result": [ - { - "scriptId": "1196", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/test/setup.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "HTMLCanvasElement.getContext", - "ranges": [{ "startOffset": 1405, "endOffset": 2722, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "HTMLCanvasElement.toDataURL", - "ranges": [{ "startOffset": 2766, "endOffset": 2819, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2930, "endOffset": 2964, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 3071, "endOffset": 3102, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1371", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/utils/errorSanitizer.test.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 33524, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 33524, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 524, "endOffset": 12246, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 582, "endOffset": 9480, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 669, "endOffset": 1304, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1382, "endOffset": 1805, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1890, "endOffset": 2462, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2539, "endOffset": 2984, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3059, "endOffset": 3482, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3559, "endOffset": 3911, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3984, "endOffset": 4308, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4394, "endOffset": 4783, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 4865, "endOffset": 5357, "count": 1 }, - { "startOffset": 5203, "endOffset": 5208, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5419, "endOffset": 5694, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5752, "endOffset": 9474, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5826, "endOffset": 6337, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6405, "endOffset": 6876, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6935, "endOffset": 7393, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7460, "endOffset": 7949, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8029, "endOffset": 8434, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8517, "endOffset": 8923, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9007, "endOffset": 9466, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9538, "endOffset": 12242, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9605, "endOffset": 9916, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9987, "endOffset": 10295, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10355, "endOffset": 10755, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10827, "endOffset": 11334, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 11404, "endOffset": 11809, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 11881, "endOffset": 12236, "count": 1 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1372", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/utils/errorSanitizer.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 23518, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 23518, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "sanitizePII", - "ranges": [{ "startOffset": 1247, "endOffset": 1575, "count": 34 }], - "isBlockCoverage": true - }, - { - "functionName": "sanitizeStack", - "ranges": [ - { "startOffset": 1576, "endOffset": 2703, "count": 17 }, - { "startOffset": 1649, "endOffset": 1659, "count": 0 }, - { "startOffset": 1696, "endOffset": 1701, "count": 1 }, - { "startOffset": 1734, "endOffset": 1739, "count": 1 }, - { "startOffset": 1756, "endOffset": 1778, "count": 16 }, - { "startOffset": 1780, "endOffset": 2531, "count": 16 } - ], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2805, "endOffset": 2834, "count": 17 }], - "isBlockCoverage": true - }, - { - "functionName": "generateReportBody", - "ranges": [ - { "startOffset": 2838, "endOffset": 3954, "count": 6 }, - { "startOffset": 2962, "endOffset": 2973, "count": 0 }, - { "startOffset": 3048, "endOffset": 3059, "count": 0 }, - { "startOffset": 3136, "endOffset": 3147, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 4061, "endOffset": 4095, "count": 6 }], - "isBlockCoverage": true - } - ] - } - ] -} diff --git a/coverage/.tmp/coverage-14.json b/coverage/.tmp/coverage-14.json deleted file mode 100644 index d2ad1bc7..00000000 --- a/coverage/.tmp/coverage-14.json +++ /dev/null @@ -1,178 +0,0 @@ -{ - "result": [ - { - "scriptId": "1196", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/test/setup.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "HTMLCanvasElement.getContext", - "ranges": [{ "startOffset": 1405, "endOffset": 2722, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "HTMLCanvasElement.toDataURL", - "ranges": [{ "startOffset": 2766, "endOffset": 2819, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2930, "endOffset": 2964, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 3071, "endOffset": 3102, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1371", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/Canvas/DoorBlocking.test.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 31228, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 31228, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 381, "endOffset": 8978, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 457, "endOffset": 4084, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 551, "endOffset": 1308, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1395, "endOffset": 2149, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 2229, "endOffset": 2756, "count": 1 }, - { "startOffset": 2490, "endOffset": 2684, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2838, "endOffset": 4078, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3531, "endOffset": 3553, "count": 3 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 3563, "endOffset": 4004, "count": 2 }, - { "startOffset": 3662, "endOffset": 3996, "count": 1 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4159, "endOffset": 7532, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "lineSegmentIntersection", - "ranges": [ - { "startOffset": 4171, "endOffset": 4675, "count": 4 }, - { "startOffset": 4340, "endOffset": 4352, "count": 1 }, - { "startOffset": 4352, "endOffset": 4526, "count": 3 }, - { "startOffset": 4527, "endOffset": 4536, "count": 2 }, - { "startOffset": 4537, "endOffset": 4546, "count": 2 }, - { "startOffset": 4548, "endOffset": 4650, "count": 2 }, - { "startOffset": 4650, "endOffset": 4674, "count": 1 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4760, "endOffset": 5344, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5429, "endOffset": 6013, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6100, "endOffset": 6498, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 6573, "endOffset": 7526, "count": 1 }, - { "startOffset": 7134, "endOffset": 7520, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7594, "endOffset": 8974, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7672, "endOffset": 8249, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7955, "endOffset": 7977, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7983, "endOffset": 8175, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8331, "endOffset": 8968, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8674, "endOffset": 8696, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8702, "endOffset": 8894, "count": 1 }], - "isBlockCoverage": true - } - ] - } - ] -} diff --git a/coverage/.tmp/coverage-15.json b/coverage/.tmp/coverage-15.json deleted file mode 100644 index 68afa2f3..00000000 --- a/coverage/.tmp/coverage-15.json +++ /dev/null @@ -1,396 +0,0 @@ -{ - "result": [ - { - "scriptId": "1196", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/test/setup.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "HTMLCanvasElement.getContext", - "ranges": [{ "startOffset": 1405, "endOffset": 2722, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "HTMLCanvasElement.toDataURL", - "ranges": [{ "startOffset": 2766, "endOffset": 2819, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2930, "endOffset": 2964, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 3071, "endOffset": 3102, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1371", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/AssetLibrary/LibraryModalErrorBoundary.test.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 51233, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 51233, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "ThrowError", - "ranges": [ - { "startOffset": 799, "endOffset": 1216, "count": 85 }, - { "startOffset": 857, "endOffset": 903, "count": 84 }, - { "startOffset": 903, "endOffset": 1215, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1277, "endOffset": 24815, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1339, "endOffset": 1533, "count": 20 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1514, "endOffset": 1527, "count": 96 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1612, "endOffset": 2508, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2583, "endOffset": 3418, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3279, "endOffset": 3412, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3486, "endOffset": 4360, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4182, "endOffset": 4354, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4421, "endOffset": 5574, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4531, "endOffset": 4544, "count": 4 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5229, "endOffset": 5533, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5635, "endOffset": 6505, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6331, "endOffset": 6499, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6587, "endOffset": 7627, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7285, "endOffset": 7418, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7703, "endOffset": 8792, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8401, "endOffset": 8534, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8870, "endOffset": 10016, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9568, "endOffset": 9701, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10100, "endOffset": 11088, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10798, "endOffset": 10924, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 11172, "endOffset": 12006, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 11870, "endOffset": 12000, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 12077, "endOffset": 13079, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 12753, "endOffset": 12886, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 12999, "endOffset": 13059, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 13151, "endOffset": 15098, "count": 1 }, - { "startOffset": 15094, "endOffset": 15097, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13870, "endOffset": 14003, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 14840, "endOffset": 15092, "count": 19 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 15174, "endOffset": 16209, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 15872, "endOffset": 15995, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 16290, "endOffset": 17413, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "DeepErrorComponent", - "ranges": [{ "startOffset": 16308, "endOffset": 16592, "count": 5 }], - "isBlockCoverage": true - }, - { - "functionName": "level1", - "ranges": [{ "startOffset": 16346, "endOffset": 16551, "count": 5 }], - "isBlockCoverage": true - }, - { - "functionName": "level2", - "ranges": [{ "startOffset": 16374, "endOffset": 16525, "count": 5 }], - "isBlockCoverage": true - }, - { - "functionName": "level3", - "ranges": [{ "startOffset": 16404, "endOffset": 16495, "count": 5 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 17266, "endOffset": 17407, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 17481, "endOffset": 18662, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "TypeErrorModal", - "ranges": [{ "startOffset": 17499, "endOffset": 17853, "count": 5 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 18523, "endOffset": 18656, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 18737, "endOffset": 20532, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 19456, "endOffset": 19589, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 20393, "endOffset": 20526, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 20600, "endOffset": 21508, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 21298, "endOffset": 21502, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 21580, "endOffset": 22452, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 22278, "endOffset": 22446, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 22525, "endOffset": 23781, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "AsyncErrorModal", - "ranges": [{ "startOffset": 22543, "endOffset": 22971, "count": 5 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 22594, "endOffset": 22655, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [{ "startOffset": 23642, "endOffset": 23775, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 23870, "endOffset": 24811, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "SpecialCharErrorModal", - "ranges": [{ "startOffset": 23888, "endOffset": 23990, "count": 5 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 24667, "endOffset": 24805, "count": 1 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1726", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/AssetLibrary/LibraryModalErrorBoundary.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 19680, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 19680, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "LibraryModalErrorBoundary", - "ranges": [{ "startOffset": 543, "endOffset": 652, "count": 40 }], - "isBlockCoverage": true - }, - { - "functionName": "getDerivedStateFromError", - "ranges": [{ "startOffset": 662, "endOffset": 753, "count": 50 }], - "isBlockCoverage": true - }, - { - "functionName": "componentDidCatch", - "ranges": [{ "startOffset": 756, "endOffset": 914, "count": 25 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 917, "endOffset": 1089, "count": 39 }], - "isBlockCoverage": true - }, - { - "functionName": "handleClose", - "ranges": [ - { "startOffset": 931, "endOffset": 1089, "count": 6 }, - { "startOffset": 1061, "endOffset": 1085, "count": 5 } - ], - "isBlockCoverage": true - }, - { - "functionName": "render", - "ranges": [ - { "startOffset": 1093, "endOffset": 8852, "count": 103 }, - { "startOffset": 1203, "endOffset": 8827, "count": 52 }, - { "startOffset": 8827, "endOffset": 8851, "count": 51 } - ], - "isBlockCoverage": true - }, - { - "functionName": "onClick", - "ranges": [{ "startOffset": 1618, "endOffset": 1644, "count": 6 }], - "isBlockCoverage": true - } - ] - } - ] -} diff --git a/coverage/.tmp/coverage-16.json b/coverage/.tmp/coverage-16.json deleted file mode 100644 index 4f284b35..00000000 --- a/coverage/.tmp/coverage-16.json +++ /dev/null @@ -1,153 +0,0 @@ -{ - "result": [ - { - "scriptId": "1196", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/test/setup.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "HTMLCanvasElement.getContext", - "ranges": [{ "startOffset": 1405, "endOffset": 2722, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "HTMLCanvasElement.toDataURL", - "ranges": [{ "startOffset": 2766, "endOffset": 2819, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2930, "endOffset": 2964, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 3071, "endOffset": 3102, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1371", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/utils/tokenHelpers.test.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 24519, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 24519, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 524, "endOffset": 7713, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 589, "endOffset": 7709, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 656, "endOffset": 721, "count": 10 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 816, "endOffset": 1930, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2017, "endOffset": 2722, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2810, "endOffset": 3528, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3615, "endOffset": 4056, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4133, "endOffset": 4642, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4721, "endOffset": 5140, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5210, "endOffset": 5789, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5865, "endOffset": 6574, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6655, "endOffset": 7075, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7157, "endOffset": 7703, "count": 1 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1372", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/utils/tokenHelpers.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 3870, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 3870, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "addLibraryTokenToMap", - "ranges": [ - { "startOffset": 185, "endOffset": 746, "count": 11 }, - { "startOffset": 267, "endOffset": 302, "count": 5 }, - { "startOffset": 303, "endOffset": 308, "count": 6 }, - { "startOffset": 332, "endOffset": 368, "count": 5 }, - { "startOffset": 369, "endOffset": 374, "count": 6 } - ], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 855, "endOffset": 891, "count": 11 }], - "isBlockCoverage": true - } - ] - } - ] -} diff --git a/coverage/.tmp/coverage-17.json b/coverage/.tmp/coverage-17.json deleted file mode 100644 index 13d7da5e..00000000 --- a/coverage/.tmp/coverage-17.json +++ /dev/null @@ -1,221 +0,0 @@ -{ - "result": [ - { - "scriptId": "1196", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/test/setup.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "HTMLCanvasElement.getContext", - "ranges": [{ "startOffset": 1405, "endOffset": 2722, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "HTMLCanvasElement.toDataURL", - "ranges": [{ "startOffset": 2766, "endOffset": 2819, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2930, "endOffset": 2964, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 3071, "endOffset": 3102, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1371", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/utils/grid.test.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 20222, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 20222, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 486, "endOffset": 5804, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 594, "endOffset": 1567, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 695, "endOffset": 851, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 927, "endOffset": 1084, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1154, "endOffset": 1314, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1399, "endOffset": 1561, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1631, "endOffset": 5265, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1721, "endOffset": 2598, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1806, "endOffset": 1984, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2064, "endOffset": 2290, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2370, "endOffset": 2590, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2685, "endOffset": 3320, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2777, "endOffset": 3003, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3090, "endOffset": 3312, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3379, "endOffset": 3944, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3475, "endOffset": 3659, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3750, "endOffset": 3936, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3996, "endOffset": 5259, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4091, "endOffset": 4315, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4406, "endOffset": 4630, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4721, "endOffset": 4939, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5027, "endOffset": 5251, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5325, "endOffset": 5800, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5403, "endOffset": 5562, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5636, "endOffset": 5794, "count": 1 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1372", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/utils/grid.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 8168, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 8168, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "snapToGrid", - "ranges": [ - { "startOffset": 204, "endOffset": 875, "count": 17 }, - { "startOffset": 264, "endOffset": 284, "count": 14 }, - { "startOffset": 286, "endOffset": 402, "count": 3 }, - { "startOffset": 402, "endOffset": 874, "count": 14 } - ], - "isBlockCoverage": true - }, - { - "functionName": "snapDimension", - "ranges": [ - { "startOffset": 427, "endOffset": 792, "count": 28 }, - { "startOffset": 604, "endOffset": 680, "count": 16 }, - { "startOffset": 680, "endOffset": 754, "count": 12 } - ], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 975, "endOffset": 1001, "count": 17 }], - "isBlockCoverage": true - } - ] - } - ] -} diff --git a/coverage/.tmp/coverage-18.json b/coverage/.tmp/coverage-18.json deleted file mode 100644 index 432d801e..00000000 --- a/coverage/.tmp/coverage-18.json +++ /dev/null @@ -1,389 +0,0 @@ -{ - "result": [ - { - "scriptId": "1196", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/test/setup.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "HTMLCanvasElement.getContext", - "ranges": [{ "startOffset": 1405, "endOffset": 2722, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "HTMLCanvasElement.toDataURL", - "ranges": [{ "startOffset": 2766, "endOffset": 2819, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2930, "endOffset": 2964, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 3071, "endOffset": 3102, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1371", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/Canvas/CanvasOverlayErrorBoundary.test.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 38352, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 38352, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "ThrowError", - "ranges": [ - { "startOffset": 772, "endOffset": 1197, "count": 29 }, - { "startOffset": 830, "endOffset": 885, "count": 28 }, - { "startOffset": 885, "endOffset": 1196, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1259, "endOffset": 19138, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1302, "endOffset": 1447, "count": 13 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1428, "endOffset": 1441, "count": 49 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1526, "endOffset": 2418, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2512, "endOffset": 3494, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3573, "endOffset": 4659, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3677, "endOffset": 3690, "count": 7 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4740, "endOffset": 5788, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4844, "endOffset": 4857, "count": 7 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5862, "endOffset": 6884, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6949, "endOffset": 8604, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8687, "endOffset": 10350, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10425, "endOffset": 12110, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "NestedComponent", - "ranges": [{ "startOffset": 10437, "endOffset": 11351, "count": 3 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 12184, "endOffset": 14006, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 14077, "endOffset": 15425, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "AsyncErrorComponent", - "ranges": [{ "startOffset": 14089, "endOffset": 14517, "count": 5 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 14144, "endOffset": 14206, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [{ "startOffset": 14614, "endOffset": 14627, "count": 7 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 15506, "endOffset": 16781, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "CustomErrorComponent", - "ranges": [{ "startOffset": 15518, "endOffset": 15634, "count": 5 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 15731, "endOffset": 15744, "count": 7 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 16838, "endOffset": 17952, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "TypeErrorComponent", - "ranges": [{ "startOffset": 16850, "endOffset": 17198, "count": 5 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 18014, "endOffset": 19134, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "ReferenceErrorComponent", - "ranges": [{ "startOffset": 18026, "endOffset": 18365, "count": 5 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1726", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/Canvas/CanvasOverlayErrorBoundary.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 13280, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 13280, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "CanvasOverlayErrorBoundary", - "ranges": [{ "startOffset": 703, "endOffset": 866, "count": 27 }], - "isBlockCoverage": true - }, - { - "functionName": "getDerivedStateFromError", - "ranges": [{ "startOffset": 876, "endOffset": 1001, "count": 22 }], - "isBlockCoverage": true - }, - { - "functionName": "componentDidCatch", - "ranges": [ - { "startOffset": 1004, "endOffset": 2323, "count": 11 }, - { "startOffset": 1611, "endOffset": 1620, "count": 0 }, - { "startOffset": 1692, "endOffset": 1701, "count": 0 }, - { "startOffset": 1775, "endOffset": 1802, "count": 10 }, - { "startOffset": 1803, "endOffset": 1807, "count": 1 }, - { "startOffset": 1985, "endOffset": 2067, "count": 10 }, - { "startOffset": 2067, "endOffset": 2166, "count": 1 } - ], - "isBlockCoverage": true - }, - { - "functionName": "render", - "ranges": [ - { "startOffset": 2326, "endOffset": 3223, "count": 59 }, - { "startOffset": 2442, "endOffset": 3198, "count": 33 }, - { "startOffset": 2581, "endOffset": 2590, "count": 0 }, - { "startOffset": 2739, "endOffset": 2752, "count": 30 }, - { "startOffset": 2776, "endOffset": 2788, "count": 3 }, - { "startOffset": 3173, "endOffset": 3198, "count": 0 }, - { "startOffset": 3198, "endOffset": 3222, "count": 26 } - ], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1729", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/utils/errorBoundaryUtils.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 37774, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 13, "endOffset": 37774, "count": 1 }, - { "startOffset": 9462, "endOffset": 9509, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "addBreadcrumb", - "ranges": [{ "startOffset": 292, "endOffset": 513, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 615, "endOffset": 644, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "captureErrorContext", - "ranges": [ - { "startOffset": 648, "endOffset": 2825, "count": 11 }, - { "startOffset": 992, "endOffset": 1254, "count": 0 }, - { "startOffset": 1408, "endOffset": 1623, "count": 0 }, - { "startOffset": 1748, "endOffset": 1777, "count": 0 }, - { "startOffset": 1778, "endOffset": 1823, "count": 0 }, - { "startOffset": 1824, "endOffset": 1866, "count": 0 }, - { "startOffset": 1867, "endOffset": 1921, "count": 0 }, - { "startOffset": 1923, "endOffset": 2124, "count": 0 }, - { "startOffset": 2672, "endOffset": 2681, "count": 0 }, - { "startOffset": 2766, "endOffset": 2801, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2933, "endOffset": 2968, "count": 11 }], - "isBlockCoverage": true - }, - { - "functionName": "sanitizeForLogging", - "ranges": [ - { "startOffset": 2972, "endOffset": 3833, "count": 22 }, - { "startOffset": 3021, "endOffset": 3035, "count": 0 }, - { "startOffset": 3068, "endOffset": 3082, "count": 0 }, - { "startOffset": 3801, "endOffset": 3831, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 3200, "endOffset": 3766, "count": 191 }, - { "startOffset": 3260, "endOffset": 3302, "count": 11 }, - { "startOffset": 3302, "endOffset": 3341, "count": 180 }, - { "startOffset": 3341, "endOffset": 3358, "count": 123 }, - { "startOffset": 3360, "endOffset": 3476, "count": 73 }, - { "startOffset": 3393, "endOffset": 3439, "count": 0 }, - { "startOffset": 3476, "endOffset": 3510, "count": 180 }, - { "startOffset": 3510, "endOffset": 3531, "count": 1 }, - { "startOffset": 3533, "endOffset": 3601, "count": 0 }, - { "startOffset": 3601, "endOffset": 3640, "count": 180 }, - { "startOffset": 3640, "endOffset": 3661, "count": 16 }, - { "startOffset": 3663, "endOffset": 3736, "count": 0 }, - { "startOffset": 3736, "endOffset": 3765, "count": 180 } - ], - "isBlockCoverage": true - }, - { - "functionName": "logErrorWithContext", - "ranges": [ - { "startOffset": 3834, "endOffset": 5933, "count": 11 }, - { "startOffset": 3997, "endOffset": 4011, "count": 0 }, - { "startOffset": 4433, "endOffset": 4449, "count": 0 }, - { "startOffset": 4747, "endOffset": 4898, "count": 0 }, - { "startOffset": 5015, "endOffset": 5357, "count": 0 }, - { "startOffset": 5394, "endOffset": 5570, "count": 0 }, - { "startOffset": 5705, "endOffset": 5719, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4839, "endOffset": 4868, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 6041, "endOffset": 6076, "count": 11 }], - "isBlockCoverage": true - }, - { - "functionName": "getErrorHistory", - "ranges": [{ "startOffset": 6080, "endOffset": 6138, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 6242, "endOffset": 6273, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "clearErrorHistory", - "ranges": [{ "startOffset": 6277, "endOffset": 6336, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 6442, "endOffset": 6475, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "exportErrorToClipboard", - "ranges": [{ "startOffset": 6479, "endOffset": 6748, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 6859, "endOffset": 6897, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "formatErrorReport", - "ranges": [{ "startOffset": 6901, "endOffset": 9248, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 9354, "endOffset": 9387, "count": 0 }], - "isBlockCoverage": false - } - ] - } - ] -} diff --git a/coverage/.tmp/coverage-19.json b/coverage/.tmp/coverage-19.json deleted file mode 100644 index 197affaf..00000000 --- a/coverage/.tmp/coverage-19.json +++ /dev/null @@ -1,166 +0,0 @@ -{ - "result": [ - { - "scriptId": "1196", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/test/setup.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "HTMLCanvasElement.getContext", - "ranges": [{ "startOffset": 1405, "endOffset": 2722, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "HTMLCanvasElement.toDataURL", - "ranges": [{ "startOffset": 2766, "endOffset": 2819, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2930, "endOffset": 2964, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 3071, "endOffset": 3102, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1371", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/Canvas/CanvasManager.test.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 14351, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 14351, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 675, "endOffset": 3493, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 718, "endOffset": 775, "count": 16 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 835, "endOffset": 1455, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 918, "endOffset": 984, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1074, "endOffset": 1140, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1232, "endOffset": 1298, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1383, "endOffset": 1449, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1514, "endOffset": 1975, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1606, "endOffset": 1672, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1748, "endOffset": 1814, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1903, "endOffset": 1969, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2033, "endOffset": 3131, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2106, "endOffset": 2172, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2282, "endOffset": 2348, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2452, "endOffset": 2518, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2617, "endOffset": 2683, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2771, "endOffset": 2837, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2907, "endOffset": 2973, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3059, "endOffset": 3125, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3186, "endOffset": 3489, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3271, "endOffset": 3337, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3417, "endOffset": 3483, "count": 1 }], - "isBlockCoverage": true - } - ] - } - ] -} diff --git a/coverage/.tmp/coverage-2.json b/coverage/.tmp/coverage-2.json deleted file mode 100644 index eac8f65b..00000000 --- a/coverage/.tmp/coverage-2.json +++ /dev/null @@ -1,592 +0,0 @@ -{ - "result": [ - { - "scriptId": "1196", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/test/setup.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "HTMLCanvasElement.getContext", - "ranges": [{ "startOffset": 1405, "endOffset": 2722, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "HTMLCanvasElement.toDataURL", - "ranges": [{ "startOffset": 2766, "endOffset": 2819, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2930, "endOffset": 2964, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 3071, "endOffset": 3102, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1371", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/hooks/useTokenData.test.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 53073, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 53073, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 523, "endOffset": 17419, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 603, "endOffset": 11352, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 698, "endOffset": 1971, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2082, "endOffset": 3328, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3444, "endOffset": 4599, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4676, "endOffset": 5608, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5695, "endOffset": 6625, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6704, "endOffset": 7447, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7548, "endOffset": 8840, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8909, "endOffset": 9469, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9549, "endOffset": 10491, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10577, "endOffset": 11346, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 11409, "endOffset": 12461, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 11487, "endOffset": 12455, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 12528, "endOffset": 13460, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 12604, "endOffset": 13454, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13529, "endOffset": 17415, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13623, "endOffset": 13981, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 14054, "endOffset": 14421, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 14494, "endOffset": 14856, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 14930, "endOffset": 15310, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 15386, "endOffset": 15737, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 15804, "endOffset": 16165, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 16263, "endOffset": 17409, "count": 1 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1372", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/hooks/useTokenData.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 8357, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 8357, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "useTokenData", - "ranges": [{ "startOffset": 427, "endOffset": 678, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 779, "endOffset": 807, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "resolveTokenData", - "ranges": [ - { "startOffset": 811, "endOffset": 1921, "count": 18 }, - { "startOffset": 902, "endOffset": 964, "count": 9 }, - { "startOffset": 965, "endOffset": 973, "count": 9 }, - { "startOffset": 1070, "endOffset": 1098, "count": 11 }, - { "startOffset": 1084, "endOffset": 1098, "count": 4 }, - { "startOffset": 1099, "endOffset": 1115, "count": 9 }, - { "startOffset": 1151, "endOffset": 1178, "count": 15 }, - { "startOffset": 1165, "endOffset": 1178, "count": 6 }, - { "startOffset": 1230, "endOffset": 1265, "count": 15 }, - { "startOffset": 1244, "endOffset": 1265, "count": 5 }, - { "startOffset": 1301, "endOffset": 1321, "count": 11 }, - { "startOffset": 1315, "endOffset": 1321, "count": 5 }, - { "startOffset": 1322, "endOffset": 1337, "count": 6 }, - { "startOffset": 1630, "endOffset": 1669, "count": 11 }, - { "startOffset": 1644, "endOffset": 1658, "count": 4 }, - { "startOffset": 1705, "endOffset": 1743, "count": 15 }, - { "startOffset": 1719, "endOffset": 1732, "count": 6 }, - { "startOffset": 1795, "endOffset": 1841, "count": 15 }, - { "startOffset": 1809, "endOffset": 1830, "count": 5 }, - { "startOffset": 1877, "endOffset": 1908, "count": 11 }, - { "startOffset": 1891, "endOffset": 1897, "count": 5 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 922, "endOffset": 963, "count": 9 }], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2026, "endOffset": 2058, "count": 18 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1377", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/store/gameStore.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 63542, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 13, "endOffset": 63542, "count": 1 }, - { "startOffset": 13397, "endOffset": 13444, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "createDefaultMap", - "ranges": [{ "startOffset": 499, "endOffset": 715, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "createDefaultCampaign", - "ranges": [ - { "startOffset": 747, "endOffset": 969, "count": 1 }, - { "startOffset": 786, "endOffset": 820, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1021, "endOffset": 13191, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "loadCampaign", - "ranges": [{ "startOffset": 2011, "endOffset": 2763, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "resetToNewCampaign", - "ranges": [{ "startOffset": 2789, "endOffset": 3375, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addTokenToLibrary", - "ranges": [{ "startOffset": 3400, "endOffset": 3555, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeTokenFromLibrary", - "ranges": [{ "startOffset": 3585, "endOffset": 3762, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateLibraryToken", - "ranges": [{ "startOffset": 3788, "endOffset": 4024, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "syncActiveMapToCampaign", - "ranges": [{ "startOffset": 4055, "endOffset": 4757, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addMap", - "ranges": [{ "startOffset": 4771, "endOffset": 5468, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "deleteMap", - "ranges": [{ "startOffset": 5485, "endOffset": 7020, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "switchMap", - "ranges": [{ "startOffset": 7037, "endOffset": 7808, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "renameMap", - "ranges": [{ "startOffset": 7825, "endOffset": 8122, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addToken", - "ranges": [{ "startOffset": 8191, "endOffset": 8256, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeToken", - "ranges": [{ "startOffset": 8275, "endOffset": 8352, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeTokens", - "ranges": [{ "startOffset": 8372, "endOffset": 8458, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateTokenPosition", - "ranges": [{ "startOffset": 8485, "endOffset": 8596, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateTokenTransform", - "ranges": [{ "startOffset": 8624, "endOffset": 8749, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateTokenProperties", - "ranges": [{ "startOffset": 8778, "endOffset": 8904, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addDrawing", - "ranges": [{ "startOffset": 8953, "endOffset": 9026, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeDrawing", - "ranges": [{ "startOffset": 9047, "endOffset": 9128, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeDrawings", - "ranges": [{ "startOffset": 9150, "endOffset": 9240, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateDrawingTransform", - "ranges": [{ "startOffset": 9270, "endOffset": 9399, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addDoor", - "ranges": [{ "startOffset": 9442, "endOffset": 9637, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeDoor", - "ranges": [{ "startOffset": 9655, "endOffset": 9730, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeDoors", - "ranges": [{ "startOffset": 9749, "endOffset": 9833, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "toggleDoor", - "ranges": [{ "startOffset": 9851, "endOffset": 10114, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateDoorState", - "ranges": [{ "startOffset": 10137, "endOffset": 10250, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateDoorLock", - "ranges": [{ "startOffset": 10272, "endOffset": 10389, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateAllDoorStates", - "ranges": [{ "startOffset": 10416, "endOffset": 10524, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateAllDoorLocks", - "ranges": [{ "startOffset": 10550, "endOffset": 10647, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addStairs", - "ranges": [{ "startOffset": 10694, "endOffset": 10761, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeStairs", - "ranges": [{ "startOffset": 10781, "endOffset": 10858, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeMultipleStairs", - "ranges": [{ "startOffset": 10886, "endOffset": 10972, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setGridSize", - "ranges": [{ "startOffset": 11023, "endOffset": 11056, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setGridType", - "ranges": [{ "startOffset": 11075, "endOffset": 11108, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setMap", - "ranges": [{ "startOffset": 11122, "endOffset": 11143, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateMapPosition", - "ranges": [{ "startOffset": 11168, "endOffset": 11256, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateMapScale", - "ranges": [{ "startOffset": 11278, "endOffset": 11368, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateMapTransform", - "ranges": [{ "startOffset": 11394, "endOffset": 11496, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setIsCalibrating", - "ranges": [{ "startOffset": 11551, "endOffset": 11592, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addExploredRegion", - "ranges": [{ "startOffset": 11617, "endOffset": 11898, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "clearExploredRegions", - "ranges": [{ "startOffset": 11926, "endOffset": 11960, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setActiveVisionPolygons", - "ranges": [{ "startOffset": 11991, "endOffset": 12044, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setDaylightMode", - "ranges": [{ "startOffset": 12067, "endOffset": 12112, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setTokens", - "ranges": [{ "startOffset": 12129, "endOffset": 12156, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setState", - "ranges": [{ "startOffset": 12172, "endOffset": 12193, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "showToast", - "ranges": [{ "startOffset": 12210, "endOffset": 12262, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "clearToast", - "ranges": [{ "startOffset": 12280, "endOffset": 12306, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "showConfirmDialog", - "ranges": [{ "startOffset": 12331, "endOffset": 12427, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "clearConfirmDialog", - "ranges": [{ "startOffset": 12453, "endOffset": 12487, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setShowResourceMonitor", - "ranges": [{ "startOffset": 12517, "endOffset": 12561, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "showDungeonDialog", - "ranges": [{ "startOffset": 12586, "endOffset": 12620, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "clearDungeonDialog", - "ranges": [{ "startOffset": 12646, "endOffset": 12681, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setIsGamePaused", - "ranges": [{ "startOffset": 12704, "endOffset": 12749, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setMobileSidebarOpen", - "ranges": [{ "startOffset": 12777, "endOffset": 12825, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setCommandPaletteOpen", - "ranges": [{ "startOffset": 12854, "endOffset": 12903, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setActiveMeasurement", - "ranges": [{ "startOffset": 12966, "endOffset": 13022, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setBroadcastMeasurement", - "ranges": [{ "startOffset": 13053, "endOffset": 13108, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setDmMeasurement", - "ranges": [{ "startOffset": 13132, "endOffset": 13184, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 13294, "endOffset": 13322, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1381", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/utils/systemMessages.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 46982, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 46982, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "rollForMessage", - "ranges": [{ "startOffset": 14659, "endOffset": 15306, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 15409, "endOffset": 15439, "count": 0 }], - "isBlockCoverage": false - } - ] - } - ] -} diff --git a/coverage/.tmp/coverage-20.json b/coverage/.tmp/coverage-20.json deleted file mode 100644 index 49d9da53..00000000 --- a/coverage/.tmp/coverage-20.json +++ /dev/null @@ -1,738 +0,0 @@ -{ - "result": [ - { - "scriptId": "1196", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/test/setup.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "HTMLCanvasElement.getContext", - "ranges": [{ "startOffset": 1405, "endOffset": 2722, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "HTMLCanvasElement.toDataURL", - "ranges": [{ "startOffset": 2766, "endOffset": 2819, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2930, "endOffset": 2964, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 3071, "endOffset": 3102, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1371", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/DungeonGeneratorDialog.test.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 28037, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 28037, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 343, "endOffset": 605, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 399, "endOffset": 601, "count": 3 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1140, "endOffset": 11815, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1161, "endOffset": 1295, "count": 15 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1352, "endOffset": 1720, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1772, "endOffset": 2228, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2277, "endOffset": 2991, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3049, "endOffset": 3692, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3526, "endOffset": 3607, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3753, "endOffset": 4338, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4212, "endOffset": 4253, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4396, "endOffset": 5067, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4918, "endOffset": 4982, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5133, "endOffset": 5770, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5619, "endOffset": 5686, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5837, "endOffset": 6530, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6323, "endOffset": 6366, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6579, "endOffset": 7224, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7039, "endOffset": 7129, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7271, "endOffset": 7914, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7731, "endOffset": 7820, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7961, "endOffset": 8606, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8421, "endOffset": 8511, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8659, "endOffset": 9261, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9157, "endOffset": 9219, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9332, "endOffset": 10364, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10086, "endOffset": 10148, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10175, "endOffset": 10218, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10312, "endOffset": 10346, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10412, "endOffset": 11199, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 11062, "endOffset": 11105, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 11251, "endOffset": 11811, "count": 1 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1728", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/DungeonGeneratorDialog.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 33179, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 33179, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "DungeonGeneratorDialog", - "ranges": [ - { "startOffset": 733, "endOffset": 16730, "count": 24 }, - { "startOffset": 2214, "endOffset": 2226, "count": 4 }, - { "startOffset": 2226, "endOffset": 16729, "count": 20 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 797, "endOffset": 824, "count": 77 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 880, "endOffset": 904, "count": 77 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 967, "endOffset": 998, "count": 77 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1058, "endOffset": 1086, "count": 77 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1151, "endOffset": 1176, "count": 77 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1238, "endOffset": 1260, "count": 77 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1317, "endOffset": 1342, "count": 77 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1409, "endOffset": 1444, "count": 77 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1506, "endOffset": 1536, "count": 77 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 1871, "endOffset": 2152, "count": 18 }, - { "startOffset": 1903, "endOffset": 1910, "count": 4 }, - { "startOffset": 1910, "endOffset": 2151, "count": 14 } - ], - "isBlockCoverage": true - }, - { - "functionName": "handleKeyDown", - "ranges": [{ "startOffset": 1937, "endOffset": 2021, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2089, "endOffset": 2147, "count": 14 }], - "isBlockCoverage": true - }, - { - "functionName": "handleGenerate", - "ranges": [ - { "startOffset": 2252, "endOffset": 2957, "count": 3 }, - { "startOffset": 2302, "endOffset": 2309, "count": 0 }, - { "startOffset": 2355, "endOffset": 2362, "count": 0 }, - { "startOffset": 2712, "endOffset": 2827, "count": 1 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2756, "endOffset": 2767, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2807, "endOffset": 2818, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2849, "endOffset": 2881, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2902, "endOffset": 2925, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "onClick", - "ranges": [{ "startOffset": 3489, "endOffset": 3515, "count": 7 }], - "isBlockCoverage": true - }, - { - "functionName": "onChange", - "ranges": [{ "startOffset": 5020, "endOffset": 5064, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "onChange", - "ranges": [{ "startOffset": 7538, "endOffset": 7585, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "onChange", - "ranges": [{ "startOffset": 10059, "endOffset": 10106, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "onChange", - "ranges": [{ "startOffset": 12150, "endOffset": 12189, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 16842, "endOffset": 16880, "count": 15 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1729", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/store/gameStore.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 63542, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 13, "endOffset": 63542, "count": 1 }, - { "startOffset": 13397, "endOffset": 13444, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "createDefaultMap", - "ranges": [{ "startOffset": 499, "endOffset": 715, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "createDefaultCampaign", - "ranges": [ - { "startOffset": 747, "endOffset": 969, "count": 1 }, - { "startOffset": 786, "endOffset": 820, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1021, "endOffset": 13191, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "loadCampaign", - "ranges": [{ "startOffset": 2011, "endOffset": 2763, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "resetToNewCampaign", - "ranges": [{ "startOffset": 2789, "endOffset": 3375, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addTokenToLibrary", - "ranges": [{ "startOffset": 3400, "endOffset": 3555, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeTokenFromLibrary", - "ranges": [{ "startOffset": 3585, "endOffset": 3762, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateLibraryToken", - "ranges": [{ "startOffset": 3788, "endOffset": 4024, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "syncActiveMapToCampaign", - "ranges": [{ "startOffset": 4055, "endOffset": 4757, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addMap", - "ranges": [{ "startOffset": 4771, "endOffset": 5468, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "deleteMap", - "ranges": [{ "startOffset": 5485, "endOffset": 7020, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "switchMap", - "ranges": [{ "startOffset": 7037, "endOffset": 7808, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "renameMap", - "ranges": [{ "startOffset": 7825, "endOffset": 8122, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addToken", - "ranges": [{ "startOffset": 8191, "endOffset": 8256, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeToken", - "ranges": [{ "startOffset": 8275, "endOffset": 8352, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeTokens", - "ranges": [{ "startOffset": 8372, "endOffset": 8458, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateTokenPosition", - "ranges": [{ "startOffset": 8485, "endOffset": 8596, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateTokenTransform", - "ranges": [{ "startOffset": 8624, "endOffset": 8749, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateTokenProperties", - "ranges": [{ "startOffset": 8778, "endOffset": 8904, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addDrawing", - "ranges": [{ "startOffset": 8953, "endOffset": 9026, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeDrawing", - "ranges": [{ "startOffset": 9047, "endOffset": 9128, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeDrawings", - "ranges": [{ "startOffset": 9150, "endOffset": 9240, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9163, "endOffset": 9239, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9209, "endOffset": 9235, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "updateDrawingTransform", - "ranges": [{ "startOffset": 9270, "endOffset": 9399, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addDoor", - "ranges": [{ "startOffset": 9442, "endOffset": 9637, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeDoor", - "ranges": [{ "startOffset": 9655, "endOffset": 9730, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeDoors", - "ranges": [{ "startOffset": 9749, "endOffset": 9833, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9762, "endOffset": 9832, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9802, "endOffset": 9828, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "toggleDoor", - "ranges": [{ "startOffset": 9851, "endOffset": 10114, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateDoorState", - "ranges": [{ "startOffset": 10137, "endOffset": 10250, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateDoorLock", - "ranges": [{ "startOffset": 10272, "endOffset": 10389, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateAllDoorStates", - "ranges": [{ "startOffset": 10416, "endOffset": 10524, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateAllDoorLocks", - "ranges": [{ "startOffset": 10550, "endOffset": 10647, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addStairs", - "ranges": [{ "startOffset": 10694, "endOffset": 10761, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeStairs", - "ranges": [{ "startOffset": 10781, "endOffset": 10858, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeMultipleStairs", - "ranges": [{ "startOffset": 10886, "endOffset": 10972, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setGridSize", - "ranges": [{ "startOffset": 11023, "endOffset": 11056, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setGridType", - "ranges": [{ "startOffset": 11075, "endOffset": 11108, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setMap", - "ranges": [{ "startOffset": 11122, "endOffset": 11143, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateMapPosition", - "ranges": [{ "startOffset": 11168, "endOffset": 11256, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateMapScale", - "ranges": [{ "startOffset": 11278, "endOffset": 11368, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateMapTransform", - "ranges": [{ "startOffset": 11394, "endOffset": 11496, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setIsCalibrating", - "ranges": [{ "startOffset": 11551, "endOffset": 11592, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addExploredRegion", - "ranges": [{ "startOffset": 11617, "endOffset": 11898, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "clearExploredRegions", - "ranges": [{ "startOffset": 11926, "endOffset": 11960, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setActiveVisionPolygons", - "ranges": [{ "startOffset": 11991, "endOffset": 12044, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setDaylightMode", - "ranges": [{ "startOffset": 12067, "endOffset": 12112, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setTokens", - "ranges": [{ "startOffset": 12129, "endOffset": 12156, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setState", - "ranges": [{ "startOffset": 12172, "endOffset": 12193, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "showToast", - "ranges": [{ "startOffset": 12210, "endOffset": 12262, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "clearToast", - "ranges": [{ "startOffset": 12280, "endOffset": 12306, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "showConfirmDialog", - "ranges": [{ "startOffset": 12331, "endOffset": 12427, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "clearConfirmDialog", - "ranges": [{ "startOffset": 12453, "endOffset": 12487, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setShowResourceMonitor", - "ranges": [{ "startOffset": 12517, "endOffset": 12561, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "showDungeonDialog", - "ranges": [{ "startOffset": 12586, "endOffset": 12620, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "clearDungeonDialog", - "ranges": [{ "startOffset": 12646, "endOffset": 12681, "count": 3 }], - "isBlockCoverage": true - }, - { - "functionName": "setIsGamePaused", - "ranges": [{ "startOffset": 12704, "endOffset": 12749, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setMobileSidebarOpen", - "ranges": [{ "startOffset": 12777, "endOffset": 12825, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setCommandPaletteOpen", - "ranges": [{ "startOffset": 12854, "endOffset": 12903, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setActiveMeasurement", - "ranges": [{ "startOffset": 12966, "endOffset": 13022, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setBroadcastMeasurement", - "ranges": [{ "startOffset": 13053, "endOffset": 13108, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setDmMeasurement", - "ranges": [{ "startOffset": 13132, "endOffset": 13184, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 13294, "endOffset": 13322, "count": 252 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1733", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/utils/systemMessages.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 46982, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 46982, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "rollForMessage", - "ranges": [{ "startOffset": 14659, "endOffset": 15306, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 15409, "endOffset": 15439, "count": 0 }], - "isBlockCoverage": false - } - ] - } - ] -} diff --git a/coverage/.tmp/coverage-21.json b/coverage/.tmp/coverage-21.json deleted file mode 100644 index 87717042..00000000 --- a/coverage/.tmp/coverage-21.json +++ /dev/null @@ -1,219 +0,0 @@ -{ - "result": [ - { - "scriptId": "1196", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/test/setup.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "HTMLCanvasElement.getContext", - "ranges": [{ "startOffset": 1405, "endOffset": 2722, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "HTMLCanvasElement.toDataURL", - "ranges": [{ "startOffset": 2766, "endOffset": 2819, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2930, "endOffset": 2964, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 3071, "endOffset": 3102, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1371", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/types/geometry.test.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 20894, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 20894, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 547, "endOffset": 6416, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 608, "endOffset": 3004, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 686, "endOffset": 865, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 956, "endOffset": 1190, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1268, "endOffset": 1552, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1632, "endOffset": 1919, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1999, "endOffset": 2257, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2339, "endOffset": 2600, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2673, "endOffset": 2998, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3063, "endOffset": 4420, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3148, "endOffset": 3332, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3422, "endOffset": 3871, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3962, "endOffset": 4414, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4478, "endOffset": 6412, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4563, "endOffset": 4717, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4804, "endOffset": 5097, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5188, "endOffset": 5475, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5568, "endOffset": 5858, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5933, "endOffset": 6406, "count": 1 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1372", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/types/geometry.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 6930, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 6930, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "isPointInPolygon", - "ranges": [ - { "startOffset": 185, "endOffset": 657, "count": 24 }, - { "startOffset": 255, "endOffset": 268, "count": 2 }, - { "startOffset": 268, "endOffset": 362, "count": 22 }, - { "startOffset": 362, "endOffset": 638, "count": 86 }, - { "startOffset": 529, "endOffset": 585, "count": 14 }, - { "startOffset": 603, "endOffset": 634, "count": 7 }, - { "startOffset": 638, "endOffset": 656, "count": 22 } - ], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 762, "endOffset": 794, "count": 7 }], - "isBlockCoverage": true - }, - { - "functionName": "isPointInAnyPolygon", - "ranges": [{ "startOffset": 798, "endOffset": 918, "count": 22 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 869, "endOffset": 914, "count": 17 }], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 1026, "endOffset": 1061, "count": 3 }], - "isBlockCoverage": true - }, - { - "functionName": "isRectInAnyPolygon", - "ranges": [ - { "startOffset": 1065, "endOffset": 1554, "count": 6 }, - { "startOffset": 1258, "endOffset": 1280, "count": 2 }, - { "startOffset": 1280, "endOffset": 1553, "count": 4 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1501, "endOffset": 1550, "count": 13 }], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 1661, "endOffset": 1695, "count": 6 }], - "isBlockCoverage": true - } - ] - } - ] -} diff --git a/coverage/.tmp/coverage-22.json b/coverage/.tmp/coverage-22.json deleted file mode 100644 index c6c283cd..00000000 --- a/coverage/.tmp/coverage-22.json +++ /dev/null @@ -1,174 +0,0 @@ -{ - "result": [ - { - "scriptId": "1196", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/test/setup.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "HTMLCanvasElement.getContext", - "ranges": [{ "startOffset": 1405, "endOffset": 2722, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "HTMLCanvasElement.toDataURL", - "ranges": [{ "startOffset": 2766, "endOffset": 2819, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2930, "endOffset": 2964, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 3071, "endOffset": 3102, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1371", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/utils/AssetProcessor.test.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 9541, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 9541, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 348, "endOffset": 381, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 590, "endOffset": 2911, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 636, "endOffset": 1427, "count": 3 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 825, "endOffset": 1086, "count": 3 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1309, "endOffset": 1421, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1442, "endOffset": 1503, "count": 3 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1559, "endOffset": 2096, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2154, "endOffset": 2548, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2587, "endOffset": 2907, "count": 1 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1372", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/utils/AssetProcessor.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 28377, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 28377, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "processImage", - "ranges": [ - { "startOffset": 391, "endOffset": 698, "count": 3 }, - { "startOffset": 458, "endOffset": 522, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 800, "endOffset": 828, "count": 3 }], - "isBlockCoverage": true - }, - { - "functionName": "wrapPromiseAsHandle", - "ranges": [{ "startOffset": 832, "endOffset": 1011, "count": 3 }], - "isBlockCoverage": true - }, - { - "functionName": "cancel", - "ranges": [{ "startOffset": 908, "endOffset": 1004, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "processImageWithWorker", - "ranges": [{ "startOffset": 1012, "endOffset": 3323, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "processImageMainThread", - "ranges": [ - { "startOffset": 3324, "endOffset": 4621, "count": 3 }, - { "startOffset": 3406, "endOffset": 3420, "count": 0 }, - { "startOffset": 3487, "endOffset": 3502, "count": 0 }, - { "startOffset": 3535, "endOffset": 3554, "count": 1 }, - { "startOffset": 3555, "endOffset": 3576, "count": 2 }, - { "startOffset": 3657, "endOffset": 3675, "count": 0 }, - { "startOffset": 3737, "endOffset": 3809, "count": 1 }, - { "startOffset": 3809, "endOffset": 3887, "count": 2 }, - { "startOffset": 3910, "endOffset": 3925, "count": 0 }, - { "startOffset": 4030, "endOffset": 4105, "count": 0 }, - { "startOffset": 4188, "endOffset": 4203, "count": 0 }, - { "startOffset": 4314, "endOffset": 4329, "count": 0 }, - { "startOffset": 4584, "endOffset": 4600, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "processBatch", - "ranges": [{ "startOffset": 4643, "endOffset": 5744, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 5846, "endOffset": 5874, "count": 0 }], - "isBlockCoverage": false - } - ] - } - ] -} diff --git a/coverage/.tmp/coverage-23.json b/coverage/.tmp/coverage-23.json deleted file mode 100644 index 7bb7d56a..00000000 --- a/coverage/.tmp/coverage-23.json +++ /dev/null @@ -1,515 +0,0 @@ -{ - "result": [ - { - "scriptId": "1196", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/test/setup.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "HTMLCanvasElement.getContext", - "ranges": [{ "startOffset": 1405, "endOffset": 2722, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "HTMLCanvasElement.toDataURL", - "ranges": [{ "startOffset": 2766, "endOffset": 2819, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2930, "endOffset": 2964, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 3071, "endOffset": 3102, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1371", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/Toast.test.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 11701, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 11701, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1034, "endOffset": 5419, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1077, "endOffset": 1200, "count": 6 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1237, "endOffset": 1342, "count": 6 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1424, "endOffset": 1800, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1872, "endOffset": 2495, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2569, "endOffset": 3187, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3258, "endOffset": 3868, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3937, "endOffset": 4666, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4496, "endOffset": 4562, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4747, "endOffset": 5415, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5271, "endOffset": 5311, "count": 1 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1728", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/Toast.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 7791, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 7791, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "Toast", - "ranges": [ - { "startOffset": 573, "endOffset": 2676, "count": 8 }, - { "startOffset": 873, "endOffset": 885, "count": 3 }, - { "startOffset": 885, "endOffset": 927, "count": 5 }, - { "startOffset": 927, "endOffset": 941, "count": 2 }, - { "startOffset": 942, "endOffset": 1001, "count": 3 }, - { "startOffset": 969, "endOffset": 985, "count": 1 }, - { "startOffset": 986, "endOffset": 1001, "count": 2 }, - { "startOffset": 1454, "endOffset": 1460, "count": 2 }, - { "startOffset": 1461, "endOffset": 1500, "count": 3 }, - { "startOffset": 1488, "endOffset": 1493, "count": 1 }, - { "startOffset": 1494, "endOffset": 1500, "count": 2 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 685, "endOffset": 835, "count": 8 }, - { "startOffset": 708, "endOffset": 831, "count": 5 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 741, "endOffset": 778, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 799, "endOffset": 824, "count": 5 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1729", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/store/gameStore.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 63542, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 13, "endOffset": 63542, "count": 1 }, - { "startOffset": 13397, "endOffset": 13444, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "createDefaultMap", - "ranges": [{ "startOffset": 499, "endOffset": 715, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "createDefaultCampaign", - "ranges": [ - { "startOffset": 747, "endOffset": 969, "count": 1 }, - { "startOffset": 786, "endOffset": 820, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1021, "endOffset": 13191, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "loadCampaign", - "ranges": [{ "startOffset": 2011, "endOffset": 2763, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "resetToNewCampaign", - "ranges": [{ "startOffset": 2789, "endOffset": 3375, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addTokenToLibrary", - "ranges": [{ "startOffset": 3400, "endOffset": 3555, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeTokenFromLibrary", - "ranges": [{ "startOffset": 3585, "endOffset": 3762, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateLibraryToken", - "ranges": [{ "startOffset": 3788, "endOffset": 4024, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "syncActiveMapToCampaign", - "ranges": [{ "startOffset": 4055, "endOffset": 4757, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addMap", - "ranges": [{ "startOffset": 4771, "endOffset": 5468, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "deleteMap", - "ranges": [{ "startOffset": 5485, "endOffset": 7020, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "switchMap", - "ranges": [{ "startOffset": 7037, "endOffset": 7808, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "renameMap", - "ranges": [{ "startOffset": 7825, "endOffset": 8122, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addToken", - "ranges": [{ "startOffset": 8191, "endOffset": 8256, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeToken", - "ranges": [{ "startOffset": 8275, "endOffset": 8352, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeTokens", - "ranges": [{ "startOffset": 8372, "endOffset": 8458, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateTokenPosition", - "ranges": [{ "startOffset": 8485, "endOffset": 8596, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateTokenTransform", - "ranges": [{ "startOffset": 8624, "endOffset": 8749, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateTokenProperties", - "ranges": [{ "startOffset": 8778, "endOffset": 8904, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addDrawing", - "ranges": [{ "startOffset": 8953, "endOffset": 9026, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeDrawing", - "ranges": [{ "startOffset": 9047, "endOffset": 9128, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeDrawings", - "ranges": [{ "startOffset": 9150, "endOffset": 9240, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateDrawingTransform", - "ranges": [{ "startOffset": 9270, "endOffset": 9399, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addDoor", - "ranges": [{ "startOffset": 9442, "endOffset": 9637, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeDoor", - "ranges": [{ "startOffset": 9655, "endOffset": 9730, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeDoors", - "ranges": [{ "startOffset": 9749, "endOffset": 9833, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "toggleDoor", - "ranges": [{ "startOffset": 9851, "endOffset": 10114, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateDoorState", - "ranges": [{ "startOffset": 10137, "endOffset": 10250, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateDoorLock", - "ranges": [{ "startOffset": 10272, "endOffset": 10389, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateAllDoorStates", - "ranges": [{ "startOffset": 10416, "endOffset": 10524, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateAllDoorLocks", - "ranges": [{ "startOffset": 10550, "endOffset": 10647, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addStairs", - "ranges": [{ "startOffset": 10694, "endOffset": 10761, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeStairs", - "ranges": [{ "startOffset": 10781, "endOffset": 10858, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeMultipleStairs", - "ranges": [{ "startOffset": 10886, "endOffset": 10972, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setGridSize", - "ranges": [{ "startOffset": 11023, "endOffset": 11056, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setGridType", - "ranges": [{ "startOffset": 11075, "endOffset": 11108, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setMap", - "ranges": [{ "startOffset": 11122, "endOffset": 11143, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateMapPosition", - "ranges": [{ "startOffset": 11168, "endOffset": 11256, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateMapScale", - "ranges": [{ "startOffset": 11278, "endOffset": 11368, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateMapTransform", - "ranges": [{ "startOffset": 11394, "endOffset": 11496, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setIsCalibrating", - "ranges": [{ "startOffset": 11551, "endOffset": 11592, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addExploredRegion", - "ranges": [{ "startOffset": 11617, "endOffset": 11898, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "clearExploredRegions", - "ranges": [{ "startOffset": 11926, "endOffset": 11960, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setActiveVisionPolygons", - "ranges": [{ "startOffset": 11991, "endOffset": 12044, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setDaylightMode", - "ranges": [{ "startOffset": 12067, "endOffset": 12112, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setTokens", - "ranges": [{ "startOffset": 12129, "endOffset": 12156, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setState", - "ranges": [{ "startOffset": 12172, "endOffset": 12193, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "showToast", - "ranges": [{ "startOffset": 12210, "endOffset": 12262, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "clearToast", - "ranges": [{ "startOffset": 12280, "endOffset": 12306, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "showConfirmDialog", - "ranges": [{ "startOffset": 12331, "endOffset": 12427, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "clearConfirmDialog", - "ranges": [{ "startOffset": 12453, "endOffset": 12487, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setShowResourceMonitor", - "ranges": [{ "startOffset": 12517, "endOffset": 12561, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "showDungeonDialog", - "ranges": [{ "startOffset": 12586, "endOffset": 12620, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "clearDungeonDialog", - "ranges": [{ "startOffset": 12646, "endOffset": 12681, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setIsGamePaused", - "ranges": [{ "startOffset": 12704, "endOffset": 12749, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setMobileSidebarOpen", - "ranges": [{ "startOffset": 12777, "endOffset": 12825, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setCommandPaletteOpen", - "ranges": [{ "startOffset": 12854, "endOffset": 12903, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setActiveMeasurement", - "ranges": [{ "startOffset": 12966, "endOffset": 13022, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setBroadcastMeasurement", - "ranges": [{ "startOffset": 13053, "endOffset": 13108, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setDmMeasurement", - "ranges": [{ "startOffset": 13132, "endOffset": 13184, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 13294, "endOffset": 13322, "count": 21 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1733", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/utils/systemMessages.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 46982, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 46982, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "rollForMessage", - "ranges": [{ "startOffset": 14659, "endOffset": 15306, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 15409, "endOffset": 15439, "count": 0 }], - "isBlockCoverage": false - } - ] - } - ] -} diff --git a/coverage/.tmp/coverage-24.json b/coverage/.tmp/coverage-24.json deleted file mode 100644 index c4f02502..00000000 --- a/coverage/.tmp/coverage-24.json +++ /dev/null @@ -1,124 +0,0 @@ -{ - "result": [ - { - "scriptId": "1196", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/test/setup.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "HTMLCanvasElement.getContext", - "ranges": [{ "startOffset": 1405, "endOffset": 2722, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "HTMLCanvasElement.toDataURL", - "ranges": [{ "startOffset": 2766, "endOffset": 2819, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2930, "endOffset": 2964, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 3071, "endOffset": 3102, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1371", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/utils/tokenUtils.test.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 7004, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 7004, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 497, "endOffset": 2430, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 557, "endOffset": 2426, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 908, "endOffset": 1021, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1102, "endOffset": 1549, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1603, "endOffset": 2030, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2095, "endOffset": 2420, "count": 1 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1372", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/utils/tokenUtils.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 3470, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 3470, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "getRecentTokens", - "ranges": [ - { "startOffset": 185, "endOffset": 652, "count": 4 }, - { "startOffset": 350, "endOffset": 374, "count": 8 }, - { "startOffset": 381, "endOffset": 633, "count": 7 }, - { "startOffset": 448, "endOffset": 629, "count": 6 }, - { "startOffset": 580, "endOffset": 623, "count": 5 }, - { "startOffset": 633, "endOffset": 651, "count": 7 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 522, "endOffset": 554, "count": 12 }], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 756, "endOffset": 787, "count": 4 }], - "isBlockCoverage": true - } - ] - } - ] -} diff --git a/coverage/.tmp/coverage-25.json b/coverage/.tmp/coverage-25.json deleted file mode 100644 index f7531d9f..00000000 --- a/coverage/.tmp/coverage-25.json +++ /dev/null @@ -1,163 +0,0 @@ -{ - "result": [ - { - "scriptId": "1196", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/test/setup.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "HTMLCanvasElement.getContext", - "ranges": [{ "startOffset": 1405, "endOffset": 2722, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "HTMLCanvasElement.toDataURL", - "ranges": [{ "startOffset": 2766, "endOffset": 2819, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2930, "endOffset": 2964, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 3071, "endOffset": 3102, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1371", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/GlobalErrorBoundary.test.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 10798, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 10798, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "ThrowError", - "ranges": [ - { "startOffset": 813, "endOffset": 1152, "count": 13 }, - { "startOffset": 855, "endOffset": 895, "count": 12 }, - { "startOffset": 895, "endOffset": 1151, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1208, "endOffset": 5432, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1295, "endOffset": 1552, "count": 4 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1533, "endOffset": 1546, "count": 12 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1589, "endOffset": 1760, "count": 4 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1833, "endOffset": 2550, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2618, "endOffset": 3457, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3542, "endOffset": 4362, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4431, "endOffset": 5428, "count": 1 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1726", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/GlobalErrorBoundary.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 15399, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 15399, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 537, "endOffset": 1115, "count": 7 }], - "isBlockCoverage": true - }, - { - "functionName": "getDerivedStateFromError", - "ranges": [{ "startOffset": 619, "endOffset": 711, "count": 6 }], - "isBlockCoverage": true - }, - { - "functionName": "componentDidCatch", - "ranges": [{ "startOffset": 714, "endOffset": 845, "count": 3 }], - "isBlockCoverage": true - }, - { - "functionName": "handleReload", - "ranges": [{ "startOffset": 863, "endOffset": 904, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "handleCopyError", - "ranges": [{ "startOffset": 926, "endOffset": 1115, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "render", - "ranges": [ - { "startOffset": 1119, "endOffset": 7439, "count": 16 }, - { "startOffset": 1159, "endOffset": 7403, "count": 9 }, - { "startOffset": 1192, "endOffset": 1237, "count": 3 }, - { "startOffset": 1237, "endOffset": 4513, "count": 6 }, - { "startOffset": 4863, "endOffset": 4879, "count": 2 }, - { "startOffset": 7403, "endOffset": 7438, "count": 7 } - ], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 7549, "endOffset": 7584, "count": 4 }], - "isBlockCoverage": true - } - ] - } - ] -} diff --git a/coverage/.tmp/coverage-26.json b/coverage/.tmp/coverage-26.json deleted file mode 100644 index 11202538..00000000 --- a/coverage/.tmp/coverage-26.json +++ /dev/null @@ -1,1140 +0,0 @@ -{ - "result": [ - { - "scriptId": "1196", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/test/setup.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "HTMLCanvasElement.getContext", - "ranges": [{ "startOffset": 1405, "endOffset": 2722, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "HTMLCanvasElement.toDataURL", - "ranges": [{ "startOffset": 2766, "endOffset": 2819, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2930, "endOffset": 2964, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 3071, "endOffset": 3102, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1371", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/Sidebar.test.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 11621, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 11621, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 341, "endOffset": 376, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 909, "endOffset": 3883, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 930, "endOffset": 1105, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 1162, "endOffset": 2183, "count": 1 }, - { "startOffset": 2179, "endOffset": 2182, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1944, "endOffset": 2177, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 2247, "endOffset": 3879, "count": 1 }, - { "startOffset": 3725, "endOffset": 3878, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2513, "endOffset": 2534, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2662, "endOffset": 2714, "count": 0 }], - "isBlockCoverage": true - }, - { - "functionName": "get src", - "ranges": [{ "startOffset": 2722, "endOffset": 2767, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "set src", - "ranges": [{ "startOffset": 2774, "endOffset": 2964, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3486, "endOffset": 3723, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1726", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/Sidebar.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 62832, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 62832, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "Sidebar", - "ranges": [ - { "startOffset": 2409, "endOffset": 26107, "count": 9 }, - { "startOffset": 6495, "endOffset": 6512, "count": 0 }, - { "startOffset": 6513, "endOffset": 6569, "count": 0 }, - { "startOffset": 6931, "endOffset": 6944, "count": 0 }, - { "startOffset": 6945, "endOffset": 6970, "count": 0 }, - { "startOffset": 7866, "endOffset": 9105, "count": 0 }, - { "startOffset": 9460, "endOffset": 23691, "count": 0 }, - { "startOffset": 23962, "endOffset": 24299, "count": 0 }, - { "startOffset": 24300, "endOffset": 24316, "count": 0 }, - { "startOffset": 24615, "endOffset": 24624, "count": 0 }, - { "startOffset": 25392, "endOffset": 25397, "count": 0 }, - { "startOffset": 25398, "endOffset": 25405, "count": 0 }, - { "startOffset": 25445, "endOffset": 25451, "count": 0 }, - { "startOffset": 25452, "endOffset": 25459, "count": 0 }, - { "startOffset": 25503, "endOffset": 25509, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2471, "endOffset": 2496, "count": 16 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2556, "endOffset": 2593, "count": 16 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2651, "endOffset": 2677, "count": 16 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2738, "endOffset": 2776, "count": 16 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2834, "endOffset": 2860, "count": 16 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2915, "endOffset": 2938, "count": 16 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3002, "endOffset": 3086, "count": 8 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4071, "endOffset": 4107, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4175, "endOffset": 4212, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4249, "endOffset": 4322, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "handleDragStart", - "ranges": [{ "startOffset": 4363, "endOffset": 5190, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "handleTokenUpload", - "ranges": [{ "startOffset": 5220, "endOffset": 6218, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6274, "endOffset": 6312, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "onClick", - "ranges": [{ "startOffset": 8120, "endOffset": 8168, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9805, "endOffset": 14406, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "onClick", - "ranges": [{ "startOffset": 14694, "endOffset": 14838, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "onClick", - "ranges": [{ "startOffset": 16787, "endOffset": 16813, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "onClick", - "ranges": [{ "startOffset": 18536, "endOffset": 18572, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "onClick", - "ranges": [{ "startOffset": 19755, "endOffset": 19790, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [{ "startOffset": 21468, "endOffset": 22973, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "onClose", - "ranges": [{ "startOffset": 24079, "endOffset": 24111, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "onClose", - "ranges": [{ "startOffset": 24465, "endOffset": 24554, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "onClose", - "ranges": [{ "startOffset": 24981, "endOffset": 25017, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "onClose", - "ranges": [{ "startOffset": 25528, "endOffset": 25625, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "onConfirm", - "ranges": [{ "startOffset": 25646, "endOffset": 25743, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1729", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/store/gameStore.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 63542, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 13, "endOffset": 63542, "count": 1 }, - { "startOffset": 13397, "endOffset": 13444, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "createDefaultMap", - "ranges": [{ "startOffset": 499, "endOffset": 715, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "createDefaultCampaign", - "ranges": [ - { "startOffset": 747, "endOffset": 969, "count": 1 }, - { "startOffset": 786, "endOffset": 820, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1021, "endOffset": 13191, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "loadCampaign", - "ranges": [{ "startOffset": 2011, "endOffset": 2763, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "resetToNewCampaign", - "ranges": [{ "startOffset": 2789, "endOffset": 3375, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addTokenToLibrary", - "ranges": [{ "startOffset": 3400, "endOffset": 3555, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeTokenFromLibrary", - "ranges": [{ "startOffset": 3585, "endOffset": 3762, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateLibraryToken", - "ranges": [{ "startOffset": 3788, "endOffset": 4024, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "syncActiveMapToCampaign", - "ranges": [{ "startOffset": 4055, "endOffset": 4757, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addMap", - "ranges": [{ "startOffset": 4771, "endOffset": 5468, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "deleteMap", - "ranges": [{ "startOffset": 5485, "endOffset": 7020, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "switchMap", - "ranges": [{ "startOffset": 7037, "endOffset": 7808, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "renameMap", - "ranges": [{ "startOffset": 7825, "endOffset": 8122, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addToken", - "ranges": [{ "startOffset": 8191, "endOffset": 8256, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeToken", - "ranges": [{ "startOffset": 8275, "endOffset": 8352, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeTokens", - "ranges": [{ "startOffset": 8372, "endOffset": 8458, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateTokenPosition", - "ranges": [{ "startOffset": 8485, "endOffset": 8596, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateTokenTransform", - "ranges": [{ "startOffset": 8624, "endOffset": 8749, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateTokenProperties", - "ranges": [{ "startOffset": 8778, "endOffset": 8904, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addDrawing", - "ranges": [{ "startOffset": 8953, "endOffset": 9026, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeDrawing", - "ranges": [{ "startOffset": 9047, "endOffset": 9128, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeDrawings", - "ranges": [{ "startOffset": 9150, "endOffset": 9240, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateDrawingTransform", - "ranges": [{ "startOffset": 9270, "endOffset": 9399, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addDoor", - "ranges": [{ "startOffset": 9442, "endOffset": 9637, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeDoor", - "ranges": [{ "startOffset": 9655, "endOffset": 9730, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeDoors", - "ranges": [{ "startOffset": 9749, "endOffset": 9833, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "toggleDoor", - "ranges": [{ "startOffset": 9851, "endOffset": 10114, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateDoorState", - "ranges": [{ "startOffset": 10137, "endOffset": 10250, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateDoorLock", - "ranges": [{ "startOffset": 10272, "endOffset": 10389, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateAllDoorStates", - "ranges": [{ "startOffset": 10416, "endOffset": 10524, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateAllDoorLocks", - "ranges": [{ "startOffset": 10550, "endOffset": 10647, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addStairs", - "ranges": [{ "startOffset": 10694, "endOffset": 10761, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeStairs", - "ranges": [{ "startOffset": 10781, "endOffset": 10858, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeMultipleStairs", - "ranges": [{ "startOffset": 10886, "endOffset": 10972, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setGridSize", - "ranges": [{ "startOffset": 11023, "endOffset": 11056, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setGridType", - "ranges": [{ "startOffset": 11075, "endOffset": 11108, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setMap", - "ranges": [{ "startOffset": 11122, "endOffset": 11143, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateMapPosition", - "ranges": [{ "startOffset": 11168, "endOffset": 11256, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateMapScale", - "ranges": [{ "startOffset": 11278, "endOffset": 11368, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateMapTransform", - "ranges": [{ "startOffset": 11394, "endOffset": 11496, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setIsCalibrating", - "ranges": [{ "startOffset": 11551, "endOffset": 11592, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addExploredRegion", - "ranges": [{ "startOffset": 11617, "endOffset": 11898, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "clearExploredRegions", - "ranges": [{ "startOffset": 11926, "endOffset": 11960, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setActiveVisionPolygons", - "ranges": [{ "startOffset": 11991, "endOffset": 12044, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setDaylightMode", - "ranges": [{ "startOffset": 12067, "endOffset": 12112, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setTokens", - "ranges": [{ "startOffset": 12129, "endOffset": 12156, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setState", - "ranges": [{ "startOffset": 12172, "endOffset": 12193, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "showToast", - "ranges": [{ "startOffset": 12210, "endOffset": 12262, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "clearToast", - "ranges": [{ "startOffset": 12280, "endOffset": 12306, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "showConfirmDialog", - "ranges": [{ "startOffset": 12331, "endOffset": 12427, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "clearConfirmDialog", - "ranges": [{ "startOffset": 12453, "endOffset": 12487, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setShowResourceMonitor", - "ranges": [{ "startOffset": 12517, "endOffset": 12561, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "showDungeonDialog", - "ranges": [{ "startOffset": 12586, "endOffset": 12620, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "clearDungeonDialog", - "ranges": [{ "startOffset": 12646, "endOffset": 12681, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setIsGamePaused", - "ranges": [{ "startOffset": 12704, "endOffset": 12749, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setMobileSidebarOpen", - "ranges": [{ "startOffset": 12777, "endOffset": 12825, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setCommandPaletteOpen", - "ranges": [{ "startOffset": 12854, "endOffset": 12903, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setActiveMeasurement", - "ranges": [{ "startOffset": 12966, "endOffset": 13022, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setBroadcastMeasurement", - "ranges": [{ "startOffset": 13053, "endOffset": 13108, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setDmMeasurement", - "ranges": [{ "startOffset": 13132, "endOffset": 13184, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 13294, "endOffset": 13322, "count": 67 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1733", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/utils/systemMessages.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 46982, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 46982, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "rollForMessage", - "ranges": [{ "startOffset": 14659, "endOffset": 15306, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 15409, "endOffset": 15439, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1734", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/AssetLibrary/AddToLibraryDialog.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 33944, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 33944, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "AddToLibraryDialog", - "ranges": [{ "startOffset": 1046, "endOffset": 14672, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1735", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/services/storage.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 6762, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 6762, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "initStorage", - "ranges": [{ "startOffset": 213, "endOffset": 1049, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 1149, "endOffset": 1176, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "getStorage", - "ranges": [{ "startOffset": 1180, "endOffset": 1375, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 1474, "endOffset": 1500, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "isStorageInitialized", - "ranges": [{ "startOffset": 1504, "endOffset": 1574, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 1683, "endOffset": 1719, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1736", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/hooks/useMediaQuery.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 6943, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 6943, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "useMediaQuery", - "ranges": [{ "startOffset": 319, "endOffset": 901, "count": 8 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 414, "endOffset": 537, "count": 8 }, - { "startOffset": 515, "endOffset": 536, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 574, "endOffset": 870, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 1003, "endOffset": 1032, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "useIsMobile", - "ranges": [{ "startOffset": 1036, "endOffset": 1108, "count": 8 }], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 1208, "endOffset": 1235, "count": 8 }], - "isBlockCoverage": true - }, - { - "functionName": "useIsTablet", - "ranges": [{ "startOffset": 1239, "endOffset": 1335, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 1435, "endOffset": 1462, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "useIsDesktop", - "ranges": [{ "startOffset": 1466, "endOffset": 1540, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 1641, "endOffset": 1669, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "useIsTouchDevice", - "ranges": [{ "startOffset": 1673, "endOffset": 2015, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2120, "endOffset": 2152, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1737", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/AssetLibrary/LibraryManager.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 64554, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 64554, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "LibraryManager", - "ranges": [{ "startOffset": 2036, "endOffset": 31166, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1738", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/utils/fuzzySearch.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 12908, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 12908, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "scoreMatch", - "ranges": [{ "startOffset": 185, "endOffset": 1317, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "fuzzySearch", - "ranges": [{ "startOffset": 1318, "endOffset": 2189, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2289, "endOffset": 2316, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "filterByCategory", - "ranges": [{ "startOffset": 2320, "endOffset": 2526, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2631, "endOffset": 2663, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "getCategories", - "ranges": [{ "startOffset": 2667, "endOffset": 2806, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2908, "endOffset": 2937, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1739", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/utils/tokenHelpers.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 3870, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 3870, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "addLibraryTokenToMap", - "ranges": [{ "startOffset": 185, "endOffset": 746, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 855, "endOffset": 891, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1740", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/AssetLibrary/TokenMetadataEditor.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 47708, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 47708, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "TokenMetadataEditor", - "ranges": [{ "startOffset": 859, "endOffset": 24019, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1742", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/AssetLibrary/LibraryModalErrorBoundary.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 19680, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 19680, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "LibraryModalErrorBoundary", - "ranges": [{ "startOffset": 543, "endOffset": 652, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "getDerivedStateFromError", - "ranges": [{ "startOffset": 662, "endOffset": 753, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "componentDidCatch", - "ranges": [{ "startOffset": 756, "endOffset": 914, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [{ "startOffset": 917, "endOffset": 1089, "count": 0 }], - "isBlockCoverage": true - }, - { - "functionName": "render", - "ranges": [{ "startOffset": 1093, "endOffset": 8852, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1743", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/MobileSidebarDrawer.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 7337, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 7337, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "MobileSidebarDrawer", - "ranges": [{ "startOffset": 486, "endOffset": 2468, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1744", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/DoorControls.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 21427, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 21427, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "DoorControls", - "ranges": [{ "startOffset": 629, "endOffset": 10885, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1745", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/CollapsibleSection.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 5941, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 5941, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "CollapsibleSection", - "ranges": [{ "startOffset": 607, "endOffset": 2681, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1746", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/MapSettingsSheet.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 52009, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 52009, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "MapSettingsSheet", - "ranges": [{ "startOffset": 994, "endOffset": 22991, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1747", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/ToggleSwitch.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 10371, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 10371, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "ToggleSwitch", - "ranges": [{ "startOffset": 336, "endOffset": 3949, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1748", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/Tooltip.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 10484, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 10484, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "Tooltip", - "ranges": [{ "startOffset": 629, "endOffset": 4107, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1751", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/hooks/useCommandPalette.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 3859, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 3859, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "useCommandPalette", - "ranges": [{ "startOffset": 429, "endOffset": 1069, "count": 8 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 512, "endOffset": 549, "count": 16 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 607, "endOffset": 645, "count": 16 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 682, "endOffset": 1014, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 1175, "endOffset": 1208, "count": 8 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1752", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/utils/tokenUtils.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 3470, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 3470, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "getRecentTokens", - "ranges": [ - { "startOffset": 185, "endOffset": 652, "count": 8 }, - { "startOffset": 350, "endOffset": 374, "count": 0 }, - { "startOffset": 381, "endOffset": 651, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 522, "endOffset": 554, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 756, "endOffset": 787, "count": 8 }], - "isBlockCoverage": true - } - ] - } - ] -} diff --git a/coverage/.tmp/coverage-27.json b/coverage/.tmp/coverage-27.json deleted file mode 100644 index 92ccc06b..00000000 --- a/coverage/.tmp/coverage-27.json +++ /dev/null @@ -1,297 +0,0 @@ -{ - "result": [ - { - "scriptId": "1196", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/test/setup.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "HTMLCanvasElement.getContext", - "ranges": [{ "startOffset": 1405, "endOffset": 2722, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "HTMLCanvasElement.toDataURL", - "ranges": [{ "startOffset": 2766, "endOffset": 2819, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2930, "endOffset": 2964, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 3071, "endOffset": 3102, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1371", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/utils/syncUtils.test.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 6772, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 6772, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 503, "endOffset": 2438, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 555, "endOffset": 1596, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 614, "endOffset": 974, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1032, "endOffset": 1338, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1388, "endOffset": 1590, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1649, "endOffset": 2434, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1712, "endOffset": 2018, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2074, "endOffset": 2428, "count": 1 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1372", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/utils/syncUtils.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 25845, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 25845, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "isEqual", - "ranges": [ - { "startOffset": 185, "endOffset": 1856, "count": 33 }, - { "startOffset": 237, "endOffset": 249, "count": 19 }, - { "startOffset": 249, "endOffset": 284, "count": 14 }, - { "startOffset": 286, "endOffset": 299, "count": 0 }, - { "startOffset": 299, "endOffset": 327, "count": 14 }, - { "startOffset": 327, "endOffset": 350, "count": 0 }, - { "startOffset": 352, "endOffset": 403, "count": 0 }, - { "startOffset": 403, "endOffset": 433, "count": 14 }, - { "startOffset": 433, "endOffset": 458, "count": 0 }, - { "startOffset": 460, "endOffset": 513, "count": 0 }, - { "startOffset": 513, "endOffset": 540, "count": 14 }, - { "startOffset": 540, "endOffset": 562, "count": 0 }, - { "startOffset": 564, "endOffset": 770, "count": 0 }, - { "startOffset": 770, "endOffset": 797, "count": 14 }, - { "startOffset": 797, "endOffset": 819, "count": 0 }, - { "startOffset": 821, "endOffset": 970, "count": 0 }, - { "startOffset": 970, "endOffset": 1023, "count": 14 }, - { "startOffset": 1024, "endOffset": 1046, "count": 14 }, - { "startOffset": 1047, "endOffset": 1069, "count": 14 }, - { "startOffset": 1070, "endOffset": 1093, "count": 14 }, - { "startOffset": 1094, "endOffset": 1119, "count": 14 }, - { "startOffset": 1120, "endOffset": 1142, "count": 14 }, - { "startOffset": 1143, "endOffset": 1165, "count": 14 }, - { "startOffset": 1167, "endOffset": 1190, "count": 0 }, - { "startOffset": 1190, "endOffset": 1217, "count": 14 }, - { "startOffset": 1217, "endOffset": 1239, "count": 6 }, - { "startOffset": 1241, "endOffset": 1416, "count": 6 }, - { "startOffset": 1280, "endOffset": 1293, "count": 0 }, - { "startOffset": 1336, "endOffset": 1395, "count": 4 }, - { "startOffset": 1376, "endOffset": 1389, "count": 1 }, - { "startOffset": 1395, "endOffset": 1416, "count": 5 }, - { "startOffset": 1416, "endOffset": 1465, "count": 8 }, - { "startOffset": 1467, "endOffset": 1480, "count": 0 }, - { "startOffset": 1480, "endOffset": 1512, "count": 8 }, - { "startOffset": 1512, "endOffset": 1539, "count": 4 }, - { "startOffset": 1541, "endOffset": 1662, "count": 4 }, - { "startOffset": 1662, "endOffset": 1675, "count": 0 }, - { "startOffset": 1675, "endOffset": 1738, "count": 4 }, - { "startOffset": 1738, "endOffset": 1839, "count": 6 }, - { "startOffset": 1768, "endOffset": 1781, "count": 0 }, - { "startOffset": 1822, "endOffset": 1835, "count": 2 }, - { "startOffset": 1839, "endOffset": 1855, "count": 2 } - ], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 1952, "endOffset": 1975, "count": 8 }], - "isBlockCoverage": true - }, - { - "functionName": "detectChanges", - "ranges": [ - { "startOffset": 1979, "endOffset": 6531, "count": 2 }, - { "startOffset": 2125, "endOffset": 2609, "count": 0 }, - { "startOffset": 2648, "endOffset": 2653, "count": 0 }, - { "startOffset": 2699, "endOffset": 2704, "count": 0 }, - { "startOffset": 3896, "endOffset": 4902, "count": 0 }, - { "startOffset": 5084, "endOffset": 5302, "count": 0 }, - { "startOffset": 5352, "endOffset": 5426, "count": 0 }, - { "startOffset": 5560, "endOffset": 6511, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2755, "endOffset": 2771, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2777, "endOffset": 2793, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2852, "endOffset": 2868, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2874, "endOffset": 2890, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 2918, "endOffset": 3059, "count": 2 }, - { "startOffset": 2989, "endOffset": 3055, "count": 1 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 3083, "endOffset": 3241, "count": 1 }, - { "startOffset": 3157, "endOffset": 3237, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 3268, "endOffset": 3742, "count": 2 }, - { "startOffset": 3310, "endOffset": 3317, "count": 0 }, - { "startOffset": 3387, "endOffset": 3738, "count": 1 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 3448, "endOffset": 3565, "count": 3 }, - { "startOffset": 3509, "endOffset": 3557, "count": 1 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3953, "endOffset": 3969, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3975, "endOffset": 3991, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4056, "endOffset": 4072, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4078, "endOffset": 4094, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4126, "endOffset": 4688, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4716, "endOffset": 4896, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5611, "endOffset": 5627, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5633, "endOffset": 5649, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5708, "endOffset": 5724, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5730, "endOffset": 5746, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5775, "endOffset": 6321, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6346, "endOffset": 6505, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 6633, "endOffset": 6662, "count": 2 }], - "isBlockCoverage": true - } - ] - } - ] -} diff --git a/coverage/.tmp/coverage-28.json b/coverage/.tmp/coverage-28.json deleted file mode 100644 index 34590e9c..00000000 --- a/coverage/.tmp/coverage-28.json +++ /dev/null @@ -1,720 +0,0 @@ -{ - "result": [ - { - "scriptId": "1196", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/test/setup.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "HTMLCanvasElement.getContext", - "ranges": [{ "startOffset": 1405, "endOffset": 2722, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "HTMLCanvasElement.toDataURL", - "ranges": [{ "startOffset": 2766, "endOffset": 2819, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2930, "endOffset": 2964, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 3071, "endOffset": 3102, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1371", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/DungeonGeneratorErrorBoundary.test.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 31844, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 31844, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "ThrowError", - "ranges": [ - { "startOffset": 1016, "endOffset": 1396, "count": 53 }, - { "startOffset": 1074, "endOffset": 1129, "count": 52 }, - { "startOffset": 1129, "endOffset": 1395, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "ErrorTrigger", - "ranges": [{ "startOffset": 1397, "endOffset": 1691, "count": 25 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1756, "endOffset": 16066, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1799, "endOffset": 2018, "count": 13 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1925, "endOffset": 1938, "count": 78 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2097, "endOffset": 2953, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 3027, "endOffset": 3809, "count": 1 }, - { "startOffset": 3805, "endOffset": 3808, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3666, "endOffset": 3803, "count": 20 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 3898, "endOffset": 5117, "count": 1 }, - { "startOffset": 5113, "endOffset": 5116, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4537, "endOffset": 5111, "count": 18 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5178, "endOffset": 5941, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5817, "endOffset": 5935, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6006, "endOffset": 6773, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6645, "endOffset": 6767, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6859, "endOffset": 7634, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7498, "endOffset": 7628, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7717, "endOffset": 8716, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8358, "endOffset": 8529, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8481, "endOffset": 8521, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8572, "endOffset": 8710, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 8800, "endOffset": 10996, "count": 1 }, - { "startOffset": 9969, "endOffset": 10995, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "ConditionalErrorTrigger", - "ranges": [{ "startOffset": 8846, "endOffset": 9170, "count": 3 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9830, "endOffset": 9967, "count": 20 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10105, "endOffset": 10148, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [{ "startOffset": 11078, "endOffset": 12096, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 11719, "endOffset": 11837, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 11943, "endOffset": 11983, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 12157, "endOffset": 12957, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 12871, "endOffset": 12951, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13043, "endOffset": 14021, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13684, "endOffset": 14015, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 14080, "endOffset": 14841, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 14721, "endOffset": 14835, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 14935, "endOffset": 16062, "count": 1 }, - { "startOffset": 15715, "endOffset": 16061, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 15576, "endOffset": 15713, "count": 20 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 15855, "endOffset": 15934, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1728", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/DungeonGeneratorErrorBoundary.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 8274, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 8274, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "DungeonGeneratorErrorBoundary", - "ranges": [{ "startOffset": 683, "endOffset": 778, "count": 26 }], - "isBlockCoverage": true - }, - { - "functionName": "getDerivedStateFromError", - "ranges": [{ "startOffset": 903, "endOffset": 978, "count": 26 }], - "isBlockCoverage": true - }, - { - "functionName": "componentDidCatch", - "ranges": [{ "startOffset": 1229, "endOffset": 1434, "count": 13 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1488, "endOffset": 1567, "count": 25 }], - "isBlockCoverage": true - }, - { - "functionName": "resetError", - "ranges": [{ "startOffset": 1501, "endOffset": 1567, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "render", - "ranges": [ - { "startOffset": 1697, "endOffset": 2122, "count": 53 }, - { "startOffset": 1737, "endOffset": 2086, "count": 26 }, - { "startOffset": 2086, "endOffset": 2121, "count": 27 } - ], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1729", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/ErrorFallbackUI.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 17231, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 17231, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "ErrorFallbackUI", - "ranges": [{ "startOffset": 685, "endOffset": 9085, "count": 26 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 796, "endOffset": 831, "count": 66 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 885, "endOffset": 961, "count": 26 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1023, "endOffset": 1098, "count": 26 }], - "isBlockCoverage": true - }, - { - "functionName": "handleClose", - "ranges": [{ "startOffset": 1132, "endOffset": 1184, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "handleRetry", - "ranges": [{ "startOffset": 1208, "endOffset": 1234, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "onClick", - "ranges": [{ "startOffset": 1703, "endOffset": 1729, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 9189, "endOffset": 9220, "count": 26 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1730", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/store/gameStore.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 63542, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 13, "endOffset": 63542, "count": 1 }, - { "startOffset": 13397, "endOffset": 13444, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "createDefaultMap", - "ranges": [{ "startOffset": 499, "endOffset": 715, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "createDefaultCampaign", - "ranges": [ - { "startOffset": 747, "endOffset": 969, "count": 1 }, - { "startOffset": 786, "endOffset": 820, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1021, "endOffset": 13191, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "loadCampaign", - "ranges": [{ "startOffset": 2011, "endOffset": 2763, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "resetToNewCampaign", - "ranges": [{ "startOffset": 2789, "endOffset": 3375, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addTokenToLibrary", - "ranges": [{ "startOffset": 3400, "endOffset": 3555, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeTokenFromLibrary", - "ranges": [{ "startOffset": 3585, "endOffset": 3762, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateLibraryToken", - "ranges": [{ "startOffset": 3788, "endOffset": 4024, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "syncActiveMapToCampaign", - "ranges": [{ "startOffset": 4055, "endOffset": 4757, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addMap", - "ranges": [{ "startOffset": 4771, "endOffset": 5468, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "deleteMap", - "ranges": [{ "startOffset": 5485, "endOffset": 7020, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "switchMap", - "ranges": [{ "startOffset": 7037, "endOffset": 7808, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "renameMap", - "ranges": [{ "startOffset": 7825, "endOffset": 8122, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addToken", - "ranges": [{ "startOffset": 8191, "endOffset": 8256, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeToken", - "ranges": [{ "startOffset": 8275, "endOffset": 8352, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeTokens", - "ranges": [{ "startOffset": 8372, "endOffset": 8458, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateTokenPosition", - "ranges": [{ "startOffset": 8485, "endOffset": 8596, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateTokenTransform", - "ranges": [{ "startOffset": 8624, "endOffset": 8749, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateTokenProperties", - "ranges": [{ "startOffset": 8778, "endOffset": 8904, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addDrawing", - "ranges": [{ "startOffset": 8953, "endOffset": 9026, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeDrawing", - "ranges": [{ "startOffset": 9047, "endOffset": 9128, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeDrawings", - "ranges": [{ "startOffset": 9150, "endOffset": 9240, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateDrawingTransform", - "ranges": [{ "startOffset": 9270, "endOffset": 9399, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addDoor", - "ranges": [{ "startOffset": 9442, "endOffset": 9637, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeDoor", - "ranges": [{ "startOffset": 9655, "endOffset": 9730, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeDoors", - "ranges": [{ "startOffset": 9749, "endOffset": 9833, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "toggleDoor", - "ranges": [{ "startOffset": 9851, "endOffset": 10114, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateDoorState", - "ranges": [{ "startOffset": 10137, "endOffset": 10250, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateDoorLock", - "ranges": [{ "startOffset": 10272, "endOffset": 10389, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateAllDoorStates", - "ranges": [{ "startOffset": 10416, "endOffset": 10524, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateAllDoorLocks", - "ranges": [{ "startOffset": 10550, "endOffset": 10647, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addStairs", - "ranges": [{ "startOffset": 10694, "endOffset": 10761, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeStairs", - "ranges": [{ "startOffset": 10781, "endOffset": 10858, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeMultipleStairs", - "ranges": [{ "startOffset": 10886, "endOffset": 10972, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setGridSize", - "ranges": [{ "startOffset": 11023, "endOffset": 11056, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setGridType", - "ranges": [{ "startOffset": 11075, "endOffset": 11108, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setMap", - "ranges": [{ "startOffset": 11122, "endOffset": 11143, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateMapPosition", - "ranges": [{ "startOffset": 11168, "endOffset": 11256, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateMapScale", - "ranges": [{ "startOffset": 11278, "endOffset": 11368, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateMapTransform", - "ranges": [{ "startOffset": 11394, "endOffset": 11496, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setIsCalibrating", - "ranges": [{ "startOffset": 11551, "endOffset": 11592, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addExploredRegion", - "ranges": [{ "startOffset": 11617, "endOffset": 11898, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "clearExploredRegions", - "ranges": [{ "startOffset": 11926, "endOffset": 11960, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setActiveVisionPolygons", - "ranges": [{ "startOffset": 11991, "endOffset": 12044, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setDaylightMode", - "ranges": [{ "startOffset": 12067, "endOffset": 12112, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setTokens", - "ranges": [{ "startOffset": 12129, "endOffset": 12156, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setState", - "ranges": [{ "startOffset": 12172, "endOffset": 12193, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "showToast", - "ranges": [{ "startOffset": 12210, "endOffset": 12262, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "clearToast", - "ranges": [{ "startOffset": 12280, "endOffset": 12306, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "showConfirmDialog", - "ranges": [{ "startOffset": 12331, "endOffset": 12427, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "clearConfirmDialog", - "ranges": [{ "startOffset": 12453, "endOffset": 12487, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setShowResourceMonitor", - "ranges": [{ "startOffset": 12517, "endOffset": 12561, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "showDungeonDialog", - "ranges": [{ "startOffset": 12586, "endOffset": 12620, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "clearDungeonDialog", - "ranges": [{ "startOffset": 12646, "endOffset": 12681, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "setIsGamePaused", - "ranges": [{ "startOffset": 12704, "endOffset": 12749, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setMobileSidebarOpen", - "ranges": [{ "startOffset": 12777, "endOffset": 12825, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setCommandPaletteOpen", - "ranges": [{ "startOffset": 12854, "endOffset": 12903, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setActiveMeasurement", - "ranges": [{ "startOffset": 12966, "endOffset": 13022, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setBroadcastMeasurement", - "ranges": [{ "startOffset": 13053, "endOffset": 13108, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setDmMeasurement", - "ranges": [{ "startOffset": 13132, "endOffset": 13184, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 13294, "endOffset": 13322, "count": 40 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1734", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/utils/systemMessages.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 46982, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 46982, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "rollForMessage", - "ranges": [ - { "startOffset": 14659, "endOffset": 15306, "count": 52 }, - { "startOffset": 14794, "endOffset": 14953, "count": 0 }, - { "startOffset": 15088, "endOffset": 15278, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 15131, "endOffset": 15272, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 15409, "endOffset": 15439, "count": 52 }], - "isBlockCoverage": true - } - ] - } - ] -} diff --git a/coverage/.tmp/coverage-3.json b/coverage/.tmp/coverage-3.json deleted file mode 100644 index daa48715..00000000 --- a/coverage/.tmp/coverage-3.json +++ /dev/null @@ -1,1151 +0,0 @@ -{ - "result": [ - { - "scriptId": "1196", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/test/setup.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "HTMLCanvasElement.getContext", - "ranges": [{ "startOffset": 1405, "endOffset": 2722, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "HTMLCanvasElement.toDataURL", - "ranges": [{ "startOffset": 2766, "endOffset": 2819, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2930, "endOffset": 2964, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 3071, "endOffset": 3102, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1371", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/store/gameStore.test.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 109239, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 109239, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 341, "endOffset": 405, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "rollForMessage", - "ranges": [{ "startOffset": 368, "endOffset": 402, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 517, "endOffset": 32941, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 538, "endOffset": 1618, "count": 58 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1652, "endOffset": 5935, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1708, "endOffset": 2090, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2131, "endOffset": 2536, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2586, "endOffset": 3213, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2890, "endOffset": 2922, "count": 3 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3255, "endOffset": 3669, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3733, "endOffset": 4214, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4285, "endOffset": 4832, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4895, "endOffset": 5605, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5671, "endOffset": 5929, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5753, "endOffset": 5829, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5971, "endOffset": 8971, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6029, "endOffset": 6451, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6494, "endOffset": 6959, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7011, "endOffset": 7778, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7435, "endOffset": 7473, "count": 3 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7823, "endOffset": 8344, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8409, "endOffset": 8965, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9004, "endOffset": 14329, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9059, "endOffset": 9492, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9532, "endOffset": 10005, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10051, "endOffset": 10652, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10711, "endOffset": 11194, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 11241, "endOffset": 11653, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 11696, "endOffset": 12109, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 12163, "endOffset": 12894, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 12612, "endOffset": 12641, "count": 3 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 12944, "endOffset": 13518, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13282, "endOffset": 13311, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13560, "endOffset": 14323, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 14010, "endOffset": 14039, "count": 3 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 14364, "endOffset": 16186, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 14419, "endOffset": 14852, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 14892, "endOffset": 15367, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 15410, "endOffset": 16180, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 15843, "endOffset": 15878, "count": 3 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 16218, "endOffset": 19378, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 16264, "endOffset": 16619, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 16675, "endOffset": 17095, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 17135, "endOffset": 17563, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 17600, "endOffset": 17982, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 18044, "endOffset": 18516, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 18550, "endOffset": 18726, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 18760, "endOffset": 18944, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 18982, "endOffset": 19372, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 19415, "endOffset": 24409, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 19479, "endOffset": 20416, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 20481, "endOffset": 20940, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 20621, "endOffset": 20636, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 20986, "endOffset": 21494, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 21570, "endOffset": 22106, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 22153, "endOffset": 22681, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 22735, "endOffset": 23158, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 23225, "endOffset": 23768, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 23499, "endOffset": 23520, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 23816, "endOffset": 24403, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 24451, "endOffset": 26693, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 24503, "endOffset": 25152, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 25204, "endOffset": 25790, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 25833, "endOffset": 26687, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 26733, "endOffset": 27726, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 26781, "endOffset": 27216, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 27263, "endOffset": 27720, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 27767, "endOffset": 30608, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 27822, "endOffset": 28205, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 28255, "endOffset": 28756, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 28800, "endOffset": 29189, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 29233, "endOffset": 29522, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 29572, "endOffset": 29955, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 29997, "endOffset": 30265, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 30315, "endOffset": 30602, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 30643, "endOffset": 31110, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 30695, "endOffset": 31104, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 31150, "endOffset": 32937, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 31198, "endOffset": 31601, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 31646, "endOffset": 32140, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 32191, "endOffset": 32483, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 32537, "endOffset": 32931, "count": 1 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1372", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/store/gameStore.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 63542, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 13, "endOffset": 63542, "count": 1 }, - { "startOffset": 13397, "endOffset": 13444, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "createDefaultMap", - "ranges": [{ "startOffset": 499, "endOffset": 715, "count": 6 }], - "isBlockCoverage": true - }, - { - "functionName": "createDefaultCampaign", - "ranges": [ - { "startOffset": 747, "endOffset": 969, "count": 1 }, - { "startOffset": 786, "endOffset": 820, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1021, "endOffset": 13191, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "loadCampaign", - "ranges": [ - { "startOffset": 2011, "endOffset": 2763, "count": 2 }, - { "startOffset": 2118, "endOffset": 2374, "count": 1 }, - { "startOffset": 2374, "endOffset": 2379, "count": 0 }, - { "startOffset": 2418, "endOffset": 2423, "count": 0 }, - { "startOffset": 2456, "endOffset": 2461, "count": 0 }, - { "startOffset": 2496, "endOffset": 2501, "count": 0 }, - { "startOffset": 2540, "endOffset": 2545, "count": 0 }, - { "startOffset": 2584, "endOffset": 2594, "count": 0 }, - { "startOffset": 2623, "endOffset": 2630, "count": 0 }, - { "startOffset": 2683, "endOffset": 2688, "count": 0 }, - { "startOffset": 2739, "endOffset": 2747, "count": 1 } - ], - "isBlockCoverage": true - }, - { - "functionName": "resetToNewCampaign", - "ranges": [{ "startOffset": 2789, "endOffset": 3375, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addTokenToLibrary", - "ranges": [{ "startOffset": 3400, "endOffset": 3555, "count": 3 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 3414, "endOffset": 3554, "count": 3 }, - { "startOffset": 3527, "endOffset": 3532, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "removeTokenFromLibrary", - "ranges": [{ "startOffset": 3585, "endOffset": 3762, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 3597, "endOffset": 3761, "count": 1 }, - { "startOffset": 3707, "endOffset": 3712, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3721, "endOffset": 3745, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "updateLibraryToken", - "ranges": [{ "startOffset": 3788, "endOffset": 4024, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 3809, "endOffset": 4023, "count": 1 }, - { "startOffset": 3919, "endOffset": 3924, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 3941, "endOffset": 3998, "count": 1 }, - { "startOffset": 3992, "endOffset": 3998, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "syncActiveMapToCampaign", - "ranges": [{ "startOffset": 4055, "endOffset": 4757, "count": 7 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4564, "endOffset": 4749, "count": 7 }], - "isBlockCoverage": true - }, - { - "functionName": "addMap", - "ranges": [{ "startOffset": 4771, "endOffset": 5468, "count": 5 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4889, "endOffset": 5460, "count": 5 }], - "isBlockCoverage": true - }, - { - "functionName": "deleteMap", - "ranges": [ - { "startOffset": 5485, "endOffset": 7020, "count": 3 }, - { "startOffset": 5618, "endOffset": 5741, "count": 1 }, - { "startOffset": 5741, "endOffset": 5775, "count": 2 }, - { "startOffset": 5775, "endOffset": 6697, "count": 1 }, - { "startOffset": 5925, "endOffset": 5952, "count": 0 }, - { "startOffset": 6697, "endOffset": 7019, "count": 2 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 5966, "endOffset": 6687, "count": 1 }, - { "startOffset": 6078, "endOffset": 6124, "count": 0 }, - { "startOffset": 6401, "endOffset": 6406, "count": 0 }, - { "startOffset": 6443, "endOffset": 6448, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6708, "endOffset": 7012, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6838, "endOffset": 6860, "count": 5 }], - "isBlockCoverage": true - }, - { - "functionName": "switchMap", - "ranges": [ - { "startOffset": 7037, "endOffset": 7808, "count": 1 }, - { "startOffset": 7125, "endOffset": 7132, "count": 0 }, - { "startOffset": 7172, "endOffset": 7179, "count": 0 }, - { "startOffset": 7477, "endOffset": 7482, "count": 0 }, - { "startOffset": 7518, "endOffset": 7523, "count": 0 }, - { "startOffset": 7553, "endOffset": 7558, "count": 0 }, - { "startOffset": 7590, "endOffset": 7595, "count": 0 }, - { "startOffset": 7740, "endOffset": 7745, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "renameMap", - "ranges": [{ "startOffset": 7825, "endOffset": 8122, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addToken", - "ranges": [{ "startOffset": 8191, "endOffset": 8256, "count": 11 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8206, "endOffset": 8255, "count": 11 }], - "isBlockCoverage": true - }, - { - "functionName": "removeToken", - "ranges": [{ "startOffset": 8275, "endOffset": 8352, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8287, "endOffset": 8351, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8329, "endOffset": 8347, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "removeTokens", - "ranges": [{ "startOffset": 8372, "endOffset": 8458, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8385, "endOffset": 8457, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8427, "endOffset": 8453, "count": 3 }], - "isBlockCoverage": true - }, - { - "functionName": "updateTokenPosition", - "ranges": [{ "startOffset": 8485, "endOffset": 8596, "count": 3 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8503, "endOffset": 8595, "count": 3 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 8548, "endOffset": 8587, "count": 2 }, - { "startOffset": 8584, "endOffset": 8587, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "updateTokenTransform", - "ranges": [{ "startOffset": 8624, "endOffset": 8749, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8649, "endOffset": 8748, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 8694, "endOffset": 8740, "count": 1 }, - { "startOffset": 8737, "endOffset": 8740, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "updateTokenProperties", - "ranges": [{ "startOffset": 8778, "endOffset": 8904, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8802, "endOffset": 8903, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 8847, "endOffset": 8895, "count": 1 }, - { "startOffset": 8892, "endOffset": 8895, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "addDrawing", - "ranges": [{ "startOffset": 8953, "endOffset": 9026, "count": 7 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8970, "endOffset": 9025, "count": 7 }], - "isBlockCoverage": true - }, - { - "functionName": "removeDrawing", - "ranges": [{ "startOffset": 9047, "endOffset": 9128, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9059, "endOffset": 9127, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9105, "endOffset": 9123, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "removeDrawings", - "ranges": [{ "startOffset": 9150, "endOffset": 9240, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9163, "endOffset": 9239, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9209, "endOffset": 9235, "count": 3 }], - "isBlockCoverage": true - }, - { - "functionName": "updateDrawingTransform", - "ranges": [{ "startOffset": 9270, "endOffset": 9399, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9295, "endOffset": 9398, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 9344, "endOffset": 9390, "count": 2 }, - { "startOffset": 9387, "endOffset": 9390, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "addDoor", - "ranges": [{ "startOffset": 9442, "endOffset": 9637, "count": 14 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 9456, "endOffset": 9636, "count": 14 }, - { "startOffset": 9551, "endOffset": 9582, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9507, "endOffset": 9530, "count": 7 }], - "isBlockCoverage": true - }, - { - "functionName": "removeDoor", - "ranges": [{ "startOffset": 9655, "endOffset": 9730, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9667, "endOffset": 9729, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9707, "endOffset": 9725, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "removeDoors", - "ranges": [{ "startOffset": 9749, "endOffset": 9833, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9762, "endOffset": 9832, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9802, "endOffset": 9828, "count": 3 }], - "isBlockCoverage": true - }, - { - "functionName": "toggleDoor", - "ranges": [{ "startOffset": 9851, "endOffset": 10114, "count": 3 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 9863, "endOffset": 10113, "count": 3 }, - { "startOffset": 9950, "endOffset": 9963, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9912, "endOffset": 9930, "count": 3 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 10012, "endOffset": 10064, "count": 3 }, - { "startOffset": 10061, "endOffset": 10064, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "updateDoorState", - "ranges": [{ "startOffset": 10137, "endOffset": 10250, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10157, "endOffset": 10249, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 10200, "endOffset": 10241, "count": 1 }, - { "startOffset": 10238, "endOffset": 10241, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "updateDoorLock", - "ranges": [{ "startOffset": 10272, "endOffset": 10389, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10294, "endOffset": 10388, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 10337, "endOffset": 10380, "count": 1 }, - { "startOffset": 10377, "endOffset": 10380, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "updateAllDoorStates", - "ranges": [{ "startOffset": 10416, "endOffset": 10524, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10432, "endOffset": 10523, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 10475, "endOffset": 10515, "count": 3 }, - { "startOffset": 10493, "endOffset": 10496, "count": 1 }, - { "startOffset": 10497, "endOffset": 10515, "count": 2 } - ], - "isBlockCoverage": true - }, - { - "functionName": "updateAllDoorLocks", - "ranges": [{ "startOffset": 10550, "endOffset": 10647, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10568, "endOffset": 10646, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10611, "endOffset": 10638, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "addStairs", - "ranges": [{ "startOffset": 10694, "endOffset": 10761, "count": 5 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10710, "endOffset": 10760, "count": 5 }], - "isBlockCoverage": true - }, - { - "functionName": "removeStairs", - "ranges": [{ "startOffset": 10781, "endOffset": 10858, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10793, "endOffset": 10857, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10835, "endOffset": 10853, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "removeMultipleStairs", - "ranges": [{ "startOffset": 10886, "endOffset": 10972, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10899, "endOffset": 10971, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10941, "endOffset": 10967, "count": 3 }], - "isBlockCoverage": true - }, - { - "functionName": "setGridSize", - "ranges": [{ "startOffset": 11023, "endOffset": 11056, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "setGridType", - "ranges": [{ "startOffset": 11075, "endOffset": 11108, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "setMap", - "ranges": [{ "startOffset": 11122, "endOffset": 11143, "count": 6 }], - "isBlockCoverage": true - }, - { - "functionName": "updateMapPosition", - "ranges": [{ "startOffset": 11168, "endOffset": 11256, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 11182, "endOffset": 11255, "count": 1 }, - { "startOffset": 11242, "endOffset": 11248, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "updateMapScale", - "ranges": [{ "startOffset": 11278, "endOffset": 11368, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 11293, "endOffset": 11367, "count": 1 }, - { "startOffset": 11354, "endOffset": 11360, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "updateMapTransform", - "ranges": [{ "startOffset": 11394, "endOffset": 11496, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 11415, "endOffset": 11495, "count": 1 }, - { "startOffset": 11482, "endOffset": 11488, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "setIsCalibrating", - "ranges": [{ "startOffset": 11551, "endOffset": 11592, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "addExploredRegion", - "ranges": [{ "startOffset": 11617, "endOffset": 11898, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 11633, "endOffset": 11897, "count": 2 }, - { "startOffset": 11759, "endOffset": 11845, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "clearExploredRegions", - "ranges": [{ "startOffset": 11926, "endOffset": 11960, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "setActiveVisionPolygons", - "ranges": [{ "startOffset": 11991, "endOffset": 12044, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "setDaylightMode", - "ranges": [{ "startOffset": 12067, "endOffset": 12112, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "setTokens", - "ranges": [{ "startOffset": 12129, "endOffset": 12156, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setState", - "ranges": [{ "startOffset": 12172, "endOffset": 12193, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "showToast", - "ranges": [{ "startOffset": 12210, "endOffset": 12262, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "clearToast", - "ranges": [{ "startOffset": 12280, "endOffset": 12306, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "showConfirmDialog", - "ranges": [{ "startOffset": 12331, "endOffset": 12427, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "clearConfirmDialog", - "ranges": [{ "startOffset": 12453, "endOffset": 12487, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "setShowResourceMonitor", - "ranges": [{ "startOffset": 12517, "endOffset": 12561, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "showDungeonDialog", - "ranges": [{ "startOffset": 12586, "endOffset": 12620, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "clearDungeonDialog", - "ranges": [{ "startOffset": 12646, "endOffset": 12681, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "setIsGamePaused", - "ranges": [{ "startOffset": 12704, "endOffset": 12749, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "setMobileSidebarOpen", - "ranges": [{ "startOffset": 12777, "endOffset": 12825, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "setCommandPaletteOpen", - "ranges": [{ "startOffset": 12854, "endOffset": 12903, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setActiveMeasurement", - "ranges": [{ "startOffset": 12966, "endOffset": 13022, "count": 3 }], - "isBlockCoverage": true - }, - { - "functionName": "setBroadcastMeasurement", - "ranges": [{ "startOffset": 13053, "endOffset": 13108, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "setDmMeasurement", - "ranges": [{ "startOffset": 13132, "endOffset": 13184, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 13294, "endOffset": 13322, "count": 211 }], - "isBlockCoverage": true - } - ] - } - ] -} diff --git a/coverage/.tmp/coverage-4.json b/coverage/.tmp/coverage-4.json deleted file mode 100644 index 856684be..00000000 --- a/coverage/.tmp/coverage-4.json +++ /dev/null @@ -1,217 +0,0 @@ -{ - "result": [ - { - "scriptId": "1196", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/test/setup.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "HTMLCanvasElement.getContext", - "ranges": [ - { "startOffset": 1405, "endOffset": 2722, "count": 53 }, - { "startOffset": 2701, "endOffset": 2721, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1611, "endOffset": 1653, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1762, "endOffset": 1804, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2525, "endOffset": 2545, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "HTMLCanvasElement.toDataURL", - "ranges": [{ "startOffset": 2766, "endOffset": 2819, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2930, "endOffset": 2964, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 3071, "endOffset": 3102, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1371", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/Canvas/PaperNoiseOverlay.test.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 58784, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 58784, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 960, "endOffset": 28558, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1041, "endOffset": 1319, "count": 13 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1210, "endOffset": 1225, "count": 13 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1300, "endOffset": 1313, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1356, "endOffset": 1449, "count": 13 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1538, "endOffset": 2743, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2812, "endOffset": 4129, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4209, "endOffset": 6571, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6639, "endOffset": 9012, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9077, "endOffset": 11450, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 11523, "endOffset": 13936, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 14022, "endOffset": 16387, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 16462, "endOffset": 18033, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 16566, "endOffset": 16579, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 18114, "endOffset": 19508, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 19595, "endOffset": 22021, "count": 1 }, - { "startOffset": 20752, "endOffset": 21914, "count": 10 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 22111, "endOffset": 23685, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 23759, "endOffset": 26116, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 26185, "endOffset": 28554, "count": 1 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1801", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/Canvas/PaperNoiseOverlay.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 7421, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 7421, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "PaperNoiseOverlay", - "ranges": [ - { "startOffset": 608, "endOffset": 2286, "count": 37 }, - { "startOffset": 1701, "endOffset": 1723, "count": 23 }, - { "startOffset": 1723, "endOffset": 2285, "count": 14 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 799, "endOffset": 1673, "count": 13 }], - "isBlockCoverage": true - }, - { - "functionName": "img.onload", - "ranges": [{ "startOffset": 1412, "endOffset": 1453, "count": 7 }], - "isBlockCoverage": true - }, - { - "functionName": "img.onerror", - "ranges": [{ "startOffset": 1473, "endOffset": 1568, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1604, "endOffset": 1668, "count": 13 }], - "isBlockCoverage": true - } - ] - } - ] -} diff --git a/coverage/.tmp/coverage-5.json b/coverage/.tmp/coverage-5.json deleted file mode 100644 index 752ec9a5..00000000 --- a/coverage/.tmp/coverage-5.json +++ /dev/null @@ -1,356 +0,0 @@ -{ - "result": [ - { - "scriptId": "1196", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/test/setup.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "HTMLCanvasElement.getContext", - "ranges": [ - { "startOffset": 1405, "endOffset": 2722, "count": 138 }, - { "startOffset": 2701, "endOffset": 2721, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1611, "endOffset": 1653, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1762, "endOffset": 1804, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2525, "endOffset": 2545, "count": 100 }], - "isBlockCoverage": true - }, - { - "functionName": "HTMLCanvasElement.toDataURL", - "ranges": [{ "startOffset": 2766, "endOffset": 2819, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2930, "endOffset": 2964, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 3071, "endOffset": 3102, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1371", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/Canvas/MeasurementOverlay.test.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 103690, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 103690, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 329, "endOffset": 495, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "formatDistance", - "ranges": [{ "startOffset": 356, "endOffset": 378, "count": 16 }], - "isBlockCoverage": true - }, - { - "functionName": "formatRadius", - "ranges": [{ "startOffset": 396, "endOffset": 426, "count": 10 }], - "isBlockCoverage": true - }, - { - "functionName": "formatCone", - "ranges": [{ "startOffset": 442, "endOffset": 492, "count": 6 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 958, "endOffset": 49000, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1041, "endOffset": 2034, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2069, "endOffset": 11955, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2280, "endOffset": 3320, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3375, "endOffset": 4415, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4469, "endOffset": 5668, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5722, "endOffset": 6902, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6946, "endOffset": 8169, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8211, "endOffset": 9430, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9472, "endOffset": 10691, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10736, "endOffset": 11949, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 11990, "endOffset": 20572, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 12189, "endOffset": 13232, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13285, "endOffset": 14328, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 14380, "endOffset": 15584, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 15630, "endOffset": 16831, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 16877, "endOffset": 18081, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 18126, "endOffset": 19323, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 19371, "endOffset": 20566, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 20606, "endOffset": 29307, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 21003, "endOffset": 22045, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 22092, "endOffset": 23340, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 23385, "endOffset": 24748, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 24791, "endOffset": 26148, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 26213, "endOffset": 27901, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 26452, "endOffset": 27893, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 27945, "endOffset": 29301, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 29345, "endOffset": 33372, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 29548, "endOffset": 30719, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 30774, "endOffset": 31964, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 32024, "endOffset": 33366, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 33400, "endOffset": 42268, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 33453, "endOffset": 34681, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 34731, "endOffset": 35949, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 35999, "endOffset": 37241, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 37283, "endOffset": 38497, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 38545, "endOffset": 39760, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 39808, "endOffset": 41025, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 41085, "endOffset": 42262, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 42309, "endOffset": 48996, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 42382, "endOffset": 45040, "count": 1 }, - { "startOffset": 43667, "endOffset": 45039, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 45103, "endOffset": 48990, "count": 1 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1801", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/Canvas/MeasurementOverlay.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 20120, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 20120, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "MeasurementOverlay", - "ranges": [ - { "startOffset": 652, "endOffset": 7280, "count": 34 }, - { "startOffset": 871, "endOffset": 893, "count": 1 }, - { "startOffset": 893, "endOffset": 7078, "count": 33 }, - { "startOffset": 7078, "endOffset": 7130, "count": 16 }, - { "startOffset": 7135, "endOffset": 7187, "count": 10 }, - { "startOffset": 7192, "endOffset": 7242, "count": 6 }, - { "startOffset": 7247, "endOffset": 7274, "count": 1 } - ], - "isBlockCoverage": true - }, - { - "functionName": "renderRuler", - "ranges": [{ "startOffset": 916, "endOffset": 2613, "count": 16 }], - "isBlockCoverage": true - }, - { - "functionName": "renderBlast", - "ranges": [{ "startOffset": 2637, "endOffset": 4756, "count": 10 }], - "isBlockCoverage": true - }, - { - "functionName": "renderCone", - "ranges": [{ "startOffset": 4779, "endOffset": 7042, "count": 6 }], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 7388, "endOffset": 7422, "count": 34 }], - "isBlockCoverage": true - } - ] - } - ] -} diff --git a/coverage/.tmp/coverage-6.json b/coverage/.tmp/coverage-6.json deleted file mode 100644 index 995bda8f..00000000 --- a/coverage/.tmp/coverage-6.json +++ /dev/null @@ -1,357 +0,0 @@ -{ - "result": [ - { - "scriptId": "1196", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/test/setup.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "HTMLCanvasElement.getContext", - "ranges": [{ "startOffset": 1405, "endOffset": 2722, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "HTMLCanvasElement.toDataURL", - "ranges": [{ "startOffset": 2766, "endOffset": 2819, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2930, "endOffset": 2964, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 3071, "endOffset": 3102, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1371", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/utils/fuzzySearch.test.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 38402, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 38402, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 530, "endOffset": 12708, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1707, "endOffset": 8693, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1806, "endOffset": 2137, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2226, "endOffset": 2377, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2436, "endOffset": 2658, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2725, "endOffset": 2947, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3023, "endOffset": 3256, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3327, "endOffset": 3749, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3523, "endOffset": 3536, "count": 3 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3611, "endOffset": 3624, "count": 3 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3700, "endOffset": 3713, "count": 3 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3802, "endOffset": 4026, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4083, "endOffset": 4307, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4369, "endOffset": 4520, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4587, "endOffset": 4827, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4915, "endOffset": 5152, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5235, "endOffset": 5923, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6004, "endOffset": 6482, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6565, "endOffset": 6724, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6787, "endOffset": 6932, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7015, "endOffset": 7720, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7813, "endOffset": 8687, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8758, "endOffset": 10265, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8830, "endOffset": 9093, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9035, "endOffset": 9073, "count": 3 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9161, "endOffset": 9322, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9404, "endOffset": 9560, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9642, "endOffset": 9795, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9880, "endOffset": 10044, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10107, "endOffset": 10259, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10327, "endOffset": 12704, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10421, "endOffset": 10595, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10665, "endOffset": 11563, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 11626, "endOffset": 11769, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 11842, "endOffset": 12698, "count": 1 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1372", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/utils/fuzzySearch.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 12908, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 12908, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "scoreMatch", - "ranges": [ - { "startOffset": 185, "endOffset": 1317, "count": 289 }, - { "startOffset": 234, "endOffset": 243, "count": 0 }, - { "startOffset": 358, "endOffset": 369, "count": 16 }, - { "startOffset": 369, "endOffset": 435, "count": 273 }, - { "startOffset": 435, "endOffset": 462, "count": 1841 }, - { "startOffset": 464, "endOffset": 549, "count": 1829 }, - { "startOffset": 512, "endOffset": 533, "count": 203 }, - { "startOffset": 549, "endOffset": 582, "count": 273 }, - { "startOffset": 582, "endOffset": 591, "count": 254 }, - { "startOffset": 591, "endOffset": 664, "count": 19 }, - { "startOffset": 664, "endOffset": 676, "count": 6 }, - { "startOffset": 676, "endOffset": 715, "count": 19 }, - { "startOffset": 715, "endOffset": 727, "count": 13 }, - { "startOffset": 727, "endOffset": 834, "count": 19 }, - { "startOffset": 834, "endOffset": 1248, "count": 93 }, - { "startOffset": 945, "endOffset": 974, "count": 83 }, - { "startOffset": 975, "endOffset": 1004, "count": 80 }, - { "startOffset": 1005, "endOffset": 1034, "count": 80 }, - { "startOffset": 1036, "endOffset": 1062, "count": 13 }, - { "startOffset": 1097, "endOffset": 1123, "count": 72 }, - { "startOffset": 1123, "endOffset": 1220, "count": 21 }, - { "startOffset": 1162, "endOffset": 1214, "count": 12 }, - { "startOffset": 1248, "endOffset": 1316, "count": 19 } - ], - "isBlockCoverage": true - }, - { - "functionName": "fuzzySearch", - "ranges": [ - { "startOffset": 1318, "endOffset": 2189, "count": 17 }, - { "startOffset": 1368, "endOffset": 1396, "count": 16 }, - { "startOffset": 1398, "endOffset": 1468, "count": 2 }, - { "startOffset": 1468, "endOffset": 1653, "count": 15 }, - { "startOffset": 1653, "endOffset": 1657, "count": 0 }, - { "startOffset": 1658, "endOffset": 1661, "count": 15 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1427, "endOffset": 1462, "count": 8 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 1690, "endOffset": 2077, "count": 58 }, - { "startOffset": 1746, "endOffset": 1846, "count": 0 }, - { "startOffset": 1988, "endOffset": 2045, "count": 173 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2103, "endOffset": 2127, "count": 58 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2134, "endOffset": 2161, "count": 11 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2167, "endOffset": 2185, "count": 23 }], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2289, "endOffset": 2316, "count": 17 }], - "isBlockCoverage": true - }, - { - "functionName": "filterByCategory", - "ranges": [ - { "startOffset": 2320, "endOffset": 2526, "count": 6 }, - { "startOffset": 2381, "endOffset": 2402, "count": 5 }, - { "startOffset": 2404, "endOffset": 2427, "count": 2 }, - { "startOffset": 2427, "endOffset": 2525, "count": 4 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2455, "endOffset": 2519, "count": 15 }], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2631, "endOffset": 2663, "count": 6 }], - "isBlockCoverage": true - }, - { - "functionName": "getCategories", - "ranges": [{ "startOffset": 2667, "endOffset": 2806, "count": 4 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2738, "endOffset": 2761, "count": 11 }], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2908, "endOffset": 2937, "count": 4 }], - "isBlockCoverage": true - } - ] - } - ] -} diff --git a/coverage/.tmp/coverage-7.json b/coverage/.tmp/coverage-7.json deleted file mode 100644 index 28d8b330..00000000 --- a/coverage/.tmp/coverage-7.json +++ /dev/null @@ -1,408 +0,0 @@ -{ - "result": [ - { - "scriptId": "1196", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/test/setup.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "HTMLCanvasElement.getContext", - "ranges": [{ "startOffset": 1405, "endOffset": 2722, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "HTMLCanvasElement.toDataURL", - "ranges": [{ "startOffset": 2766, "endOffset": 2819, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2930, "endOffset": 2964, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 3071, "endOffset": 3102, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1371", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/utils/globalErrorHandler.test.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 38199, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 38199, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 670, "endOffset": 13177, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 713, "endOffset": 796, "count": 14 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 833, "endOffset": 870, "count": 14 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 925, "endOffset": 2112, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1013, "endOffset": 1144, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1207, "endOffset": 1825, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1908, "endOffset": 2106, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2162, "endOffset": 7063, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2224, "endOffset": 2813, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2887, "endOffset": 3832, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 3915, "endOffset": 4504, "count": 1 }, - { "startOffset": 3958, "endOffset": 4361, "count": 15 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4596, "endOffset": 5813, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5888, "endOffset": 7057, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7120, "endOffset": 8898, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7193, "endOffset": 7770, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7836, "endOffset": 8892, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8677, "endOffset": 8700, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8734, "endOffset": 8757, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8955, "endOffset": 9552, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9026, "endOffset": 9546, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9611, "endOffset": 10656, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9685, "endOffset": 10650, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10719, "endOffset": 12110, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10800, "endOffset": 12104, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 12173, "endOffset": 13173, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 12268, "endOffset": 13167, "count": 1 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1372", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/utils/globalErrorHandler.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 26575, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 26575, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "generateErrorId", - "ranges": [{ "startOffset": 412, "endOffset": 515, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "generateErrorHash", - "ranges": [ - { "startOffset": 516, "endOffset": 919, "count": 134 }, - { "startOffset": 622, "endOffset": 627, "count": 121 }, - { "startOffset": 780, "endOffset": 889, "count": 2380 } - ], - "isBlockCoverage": true - }, - { - "functionName": "getStoredErrors", - "ranges": [ - { "startOffset": 920, "endOffset": 1158, "count": 47 }, - { "startOffset": 1033, "endOffset": 1073, "count": 35 }, - { "startOffset": 1078, "endOffset": 1143, "count": 1 }, - { "startOffset": 1143, "endOffset": 1157, "count": 13 } - ], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 1262, "endOffset": 1293, "count": 12 }], - "isBlockCoverage": true - }, - { - "functionName": "storeError", - "ranges": [ - { "startOffset": 1297, "endOffset": 2114, "count": 31 }, - { "startOffset": 1579, "endOffset": 1785, "count": 1 }, - { "startOffset": 1785, "endOffset": 1827, "count": 30 }, - { "startOffset": 2046, "endOffset": 2112, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1485, "endOffset": 1541, "count": 103 }], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2213, "endOffset": 2239, "count": 31 }], - "isBlockCoverage": true - }, - { - "functionName": "markErrorReported", - "ranges": [ - { "startOffset": 2243, "endOffset": 2576, "count": 2 }, - { "startOffset": 2509, "endOffset": 2574, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 2365, "endOffset": 2427, "count": 3 }, - { "startOffset": 2393, "endOffset": 2421, "count": 2 }, - { "startOffset": 2422, "endOffset": 2427, "count": 1 } - ], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2682, "endOffset": 2715, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "clearStoredErrors", - "ranges": [ - { "startOffset": 2719, "endOffset": 2874, "count": 1 }, - { "startOffset": 2810, "endOffset": 2872, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2980, "endOffset": 3013, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "clearReportedErrors", - "ranges": [ - { "startOffset": 3017, "endOffset": 3301, "count": 1 }, - { "startOffset": 3235, "endOffset": 3299, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3133, "endOffset": 3155, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 3409, "endOffset": 3444, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "getUnreportedErrorCount", - "ranges": [{ "startOffset": 3448, "endOffset": 3577, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3544, "endOffset": 3566, "count": 3 }], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 3689, "endOffset": 3728, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "handleGlobalError", - "ranges": [{ "startOffset": 3732, "endOffset": 4466, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "onGlobalError", - "ranges": [{ "startOffset": 4467, "endOffset": 4595, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "onUnhandledRejection", - "ranges": [{ "startOffset": 4596, "endOffset": 4771, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "onMainProcessError", - "ranges": [{ "startOffset": 4772, "endOffset": 5492, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "initGlobalErrorHandlers", - "ranges": [{ "startOffset": 5493, "endOffset": 6016, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5762, "endOffset": 6013, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 6128, "endOffset": 6167, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "captureError", - "ranges": [{ "startOffset": 6171, "endOffset": 6271, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 6372, "endOffset": 6400, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1373", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/utils/errorSanitizer.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 23518, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 23518, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "sanitizePII", - "ranges": [{ "startOffset": 1247, "endOffset": 1575, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "sanitizeStack", - "ranges": [{ "startOffset": 1576, "endOffset": 2703, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2805, "endOffset": 2834, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "generateReportBody", - "ranges": [{ "startOffset": 2838, "endOffset": 3954, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 4061, "endOffset": 4095, "count": 0 }], - "isBlockCoverage": false - } - ] - } - ] -} diff --git a/coverage/.tmp/coverage-8.json b/coverage/.tmp/coverage-8.json deleted file mode 100644 index 510b0b2e..00000000 --- a/coverage/.tmp/coverage-8.json +++ /dev/null @@ -1,348 +0,0 @@ -{ - "result": [ - { - "scriptId": "1196", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/test/setup.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "HTMLCanvasElement.getContext", - "ranges": [{ "startOffset": 1405, "endOffset": 2722, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "HTMLCanvasElement.toDataURL", - "ranges": [{ "startOffset": 2766, "endOffset": 2819, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2930, "endOffset": 2964, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 3071, "endOffset": 3102, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1371", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/utils/pathOptimization.test.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 36989, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 36989, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 521, "endOffset": 4693, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 576, "endOffset": 1291, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 658, "endOffset": 791, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 863, "endOffset": 1035, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1105, "endOffset": 1285, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1359, "endOffset": 1948, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1450, "endOffset": 1655, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1732, "endOffset": 1942, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2015, "endOffset": 3040, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2102, "endOffset": 2302, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2383, "endOffset": 2576, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2657, "endOffset": 3034, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3100, "endOffset": 4336, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3178, "endOffset": 3909, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3995, "endOffset": 4330, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4402, "endOffset": 4689, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4502, "endOffset": 4683, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4747, "endOffset": 12247, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4838, "endOffset": 5711, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4927, "endOffset": 5253, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5342, "endOffset": 5705, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5776, "endOffset": 7330, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5864, "endOffset": 6334, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6415, "endOffset": 6821, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6902, "endOffset": 7324, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7398, "endOffset": 7832, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7486, "endOffset": 7826, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7886, "endOffset": 9127, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7980, "endOffset": 8544, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8637, "endOffset": 9121, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9196, "endOffset": 10624, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9266, "endOffset": 9618, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9686, "endOffset": 10087, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10175, "endOffset": 10618, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10697, "endOffset": 11610, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10787, "endOffset": 11176, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 11252, "endOffset": 11604, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 11672, "endOffset": 12243, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 11754, "endOffset": 12237, "count": 1 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1372", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/utils/pathOptimization.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 17483, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 17483, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "simplifyPath", - "ranges": [ - { "startOffset": 185, "endOffset": 586, "count": 12 }, - { "startOffset": 252, "endOffset": 276, "count": 4 }, - { "startOffset": 276, "endOffset": 349, "count": 8 }, - { "startOffset": 349, "endOffset": 413, "count": 42 }, - { "startOffset": 413, "endOffset": 527, "count": 8 }, - { "startOffset": 527, "endOffset": 567, "count": 19 }, - { "startOffset": 567, "endOffset": 585, "count": 8 } - ], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 687, "endOffset": 715, "count": 12 }], - "isBlockCoverage": true - }, - { - "functionName": "rdpRecursive", - "ranges": [ - { "startOffset": 719, "endOffset": 1414, "count": 14 }, - { "startOffset": 786, "endOffset": 810, "count": 3 }, - { "startOffset": 810, "endOffset": 968, "count": 11 }, - { "startOffset": 968, "endOffset": 1133, "count": 30 }, - { "startOffset": 1071, "endOffset": 1129, "count": 11 }, - { "startOffset": 1133, "endOffset": 1163, "count": 11 }, - { "startOffset": 1163, "endOffset": 1376, "count": 3 }, - { "startOffset": 1376, "endOffset": 1412, "count": 8 } - ], - "isBlockCoverage": true - }, - { - "functionName": "perpendicularDistance", - "ranges": [ - { "startOffset": 1415, "endOffset": 1830, "count": 30 }, - { "startOffset": 1566, "endOffset": 1577, "count": 1 }, - { "startOffset": 1579, "endOffset": 1623, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "distance", - "ranges": [{ "startOffset": 1831, "endOffset": 1951, "count": 17 }], - "isBlockCoverage": true - }, - { - "functionName": "pointToSegmentDistanceWithPoint", - "ranges": [ - { "startOffset": 1952, "endOffset": 2546, "count": 17 }, - { "startOffset": 2162, "endOffset": 2259, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "findClosestPointOnPath", - "ranges": [ - { "startOffset": 2547, "endOffset": 3329, "count": 17 }, - { "startOffset": 2629, "endOffset": 2651, "count": 1 }, - { "startOffset": 2651, "endOffset": 2794, "count": 16 }, - { "startOffset": 3169, "endOffset": 3199, "count": 16 }, - { "startOffset": 3199, "endOffset": 3221, "count": 0 }, - { "startOffset": 3221, "endOffset": 3328, "count": 16 } - ], - "isBlockCoverage": true - }, - { - "functionName": "snapPointToPaths", - "ranges": [ - { "startOffset": 3330, "endOffset": 3871, "count": 15 }, - { "startOffset": 3545, "endOffset": 3814, "count": 17 }, - { "startOffset": 3653, "endOffset": 3685, "count": 16 }, - { "startOffset": 3687, "endOffset": 3810, "count": 11 } - ], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 3976, "endOffset": 4008, "count": 15 }], - "isBlockCoverage": true - } - ] - } - ] -} diff --git a/coverage/.tmp/coverage-9.json b/coverage/.tmp/coverage-9.json deleted file mode 100644 index 7333d199..00000000 --- a/coverage/.tmp/coverage-9.json +++ /dev/null @@ -1,1222 +0,0 @@ -{ - "result": [ - { - "scriptId": "1196", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/test/setup.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 8557, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "HTMLCanvasElement.getContext", - "ranges": [{ "startOffset": 1405, "endOffset": 2722, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "HTMLCanvasElement.toDataURL", - "ranges": [{ "startOffset": 2766, "endOffset": 2819, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 2930, "endOffset": 2964, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 3071, "endOffset": 3102, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1371", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/HomeScreen.test.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 41635, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 41635, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 337, "endOffset": 370, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 409, "endOffset": 525, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1124, "endOffset": 16297, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1251, "endOffset": 2085, "count": 17 }], - "isBlockCoverage": true - }, - { - "functionName": "getPlatform", - "ranges": [{ "startOffset": 1842, "endOffset": 1853, "count": 12 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2112, "endOffset": 4614, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2170, "endOffset": 2677, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2727, "endOffset": 3447, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3511, "endOffset": 3998, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4056, "endOffset": 4608, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "getPlatform", - "ranges": [{ "startOffset": 4147, "endOffset": 4163, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4650, "endOffset": 6820, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4720, "endOffset": 5488, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5557, "endOffset": 5979, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6040, "endOffset": 6814, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "getPlatform", - "ranges": [{ "startOffset": 6342, "endOffset": 6358, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6854, "endOffset": 10714, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 6909, "endOffset": 7866, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 7934, "endOffset": 8352, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 8427, "endOffset": 9438, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9212, "endOffset": 9430, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 9504, "endOffset": 10708, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10503, "endOffset": 10700, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10749, "endOffset": 11362, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 10816, "endOffset": 11356, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 11398, "endOffset": 14725, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 11473, "endOffset": 12810, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "getPlatform", - "ranges": [{ "startOffset": 11790, "endOffset": 11801, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 12362, "endOffset": 12802, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 12863, "endOffset": 13780, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "getPlatform", - "ranges": [{ "startOffset": 13046, "endOffset": 13057, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13618, "endOffset": 13772, "count": 2 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13842, "endOffset": 14719, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "getPlatform", - "ranges": [{ "startOffset": 14005, "endOffset": 14016, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 14577, "endOffset": 14711, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 14756, "endOffset": 16293, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 14816, "endOffset": 15515, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 15589, "endOffset": 16287, "count": 1 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1726", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/HomeScreen.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 102715, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 102715, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "HomeScreen", - "ranges": [ - { "startOffset": 1967, "endOffset": 41667, "count": 53 }, - { "startOffset": 20394, "endOffset": 20402, "count": 49 }, - { "startOffset": 20403, "endOffset": 20420, "count": 2 }, - { "startOffset": 20421, "endOffset": 24016, "count": 2 }, - { "startOffset": 30989, "endOffset": 36426, "count": 8 }, - { "startOffset": 40535, "endOffset": 40546, "count": 4 }, - { "startOffset": 40547, "endOffset": 40554, "count": 49 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2548, "endOffset": 2602, "count": 17 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2849, "endOffset": 3524, "count": 17 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3585, "endOffset": 3614, "count": 141 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 3672, "endOffset": 3698, "count": 141 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 3735, "endOffset": 4422, "count": 17 }, - { "startOffset": 4103, "endOffset": 4113, "count": 0 }, - { "startOffset": 4165, "endOffset": 4170, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4463, "endOffset": 4772, "count": 17 }], - "isBlockCoverage": true - }, - { - "functionName": "handleResize", - "ranges": [{ "startOffset": 4496, "endOffset": 4594, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4705, "endOffset": 4761, "count": 17 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 4813, "endOffset": 5264, "count": 17 }], - "isBlockCoverage": true - }, - { - "functionName": "handleKeyPress", - "ranges": [{ "startOffset": 4848, "endOffset": 5131, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [{ "startOffset": 5200, "endOffset": 5259, "count": 17 }], - "isBlockCoverage": true - }, - { - "functionName": "handleNewCampaign", - "ranges": [{ "startOffset": 5310, "endOffset": 5342, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "handleLoadCampaign", - "ranges": [ - { "startOffset": 5373, "endOffset": 6093, "count": 3 }, - { "startOffset": 5507, "endOffset": 5528, "count": 2 }, - { "startOffset": 5528, "endOffset": 5878, "count": 1 }, - { "startOffset": 5885, "endOffset": 6089, "count": 1 } - ], - "isBlockCoverage": true - }, - { - "functionName": "handleLoadRecent", - "ranges": [{ "startOffset": 6122, "endOffset": 6300, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "handleRemoveRecent", - "ranges": [{ "startOffset": 6331, "endOffset": 6480, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "handleDismissMacBanner", - "ranges": [{ "startOffset": 6515, "endOffset": 6605, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 6664, "endOffset": 12964, "count": 34 }, - { "startOffset": 6709, "endOffset": 6741, "count": 17 }, - { "startOffset": 6743, "endOffset": 12963, "count": 17 } - ], - "isBlockCoverage": true - }, - { - "functionName": "getRandomName", - "ranges": [{ "startOffset": 9819, "endOffset": 9874, "count": 85 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 11384, "endOffset": 12753, "count": 85 }, - { "startOffset": 11526, "endOffset": 12640, "count": 292 }, - { "startOffset": 11840, "endOffset": 11876, "count": 252 }, - { "startOffset": 11877, "endOffset": 11893, "count": 211 }, - { "startOffset": 11894, "endOffset": 11927, "count": 183 }, - { "startOffset": 11953, "endOffset": 11984, "count": 150 }, - { "startOffset": 11984, "endOffset": 12068, "count": 142 }, - { "startOffset": 12068, "endOffset": 12121, "count": 17 }, - { "startOffset": 12121, "endOffset": 12425, "count": 125 }, - { "startOffset": 12173, "endOffset": 12415, "count": 347 }, - { "startOffset": 12346, "endOffset": 12403, "count": 210 }, - { "startOffset": 12425, "endOffset": 12473, "count": 142 }, - { "startOffset": 12473, "endOffset": 12564, "count": 125 }, - { "startOffset": 12564, "endOffset": 12604, "count": 142 }, - { "startOffset": 12604, "endOffset": 12632, "count": 85 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 12807, "endOffset": 12899, "count": 85 }], - "isBlockCoverage": true - }, - { - "functionName": "handleTokenPositionChange", - "ranges": [{ "startOffset": 13054, "endOffset": 13166, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13228, "endOffset": 13269, "count": 95 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 14312, "endOffset": 15064, "count": 180 }], - "isBlockCoverage": true - }, - { - "functionName": "onClick", - "ranges": [{ "startOffset": 29236, "endOffset": 29339, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [{ "startOffset": 31568, "endOffset": 36064, "count": 10 }], - "isBlockCoverage": true - }, - { - "functionName": "onClick", - "ranges": [{ "startOffset": 32125, "endOffset": 32155, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "onClick", - "ranges": [{ "startOffset": 34723, "endOffset": 34758, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "onClick", - "ranges": [{ "startOffset": 38002, "endOffset": 38102, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "onClick", - "ranges": [{ "startOffset": 39675, "endOffset": 39779, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "onClose", - "ranges": [{ "startOffset": 41234, "endOffset": 41261, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 41766, "endOffset": 41792, "count": 17 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1729", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/store/gameStore.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 63542, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 13, "endOffset": 63542, "count": 1 }, - { "startOffset": 13397, "endOffset": 13444, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "createDefaultMap", - "ranges": [{ "startOffset": 499, "endOffset": 715, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "createDefaultCampaign", - "ranges": [ - { "startOffset": 747, "endOffset": 969, "count": 1 }, - { "startOffset": 786, "endOffset": 820, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1021, "endOffset": 13191, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "loadCampaign", - "ranges": [{ "startOffset": 2011, "endOffset": 2763, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "resetToNewCampaign", - "ranges": [{ "startOffset": 2789, "endOffset": 3375, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addTokenToLibrary", - "ranges": [{ "startOffset": 3400, "endOffset": 3555, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeTokenFromLibrary", - "ranges": [{ "startOffset": 3585, "endOffset": 3762, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateLibraryToken", - "ranges": [{ "startOffset": 3788, "endOffset": 4024, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "syncActiveMapToCampaign", - "ranges": [{ "startOffset": 4055, "endOffset": 4757, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addMap", - "ranges": [{ "startOffset": 4771, "endOffset": 5468, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "deleteMap", - "ranges": [{ "startOffset": 5485, "endOffset": 7020, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "switchMap", - "ranges": [{ "startOffset": 7037, "endOffset": 7808, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "renameMap", - "ranges": [{ "startOffset": 7825, "endOffset": 8122, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addToken", - "ranges": [{ "startOffset": 8191, "endOffset": 8256, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeToken", - "ranges": [{ "startOffset": 8275, "endOffset": 8352, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeTokens", - "ranges": [{ "startOffset": 8372, "endOffset": 8458, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateTokenPosition", - "ranges": [{ "startOffset": 8485, "endOffset": 8596, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateTokenTransform", - "ranges": [{ "startOffset": 8624, "endOffset": 8749, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateTokenProperties", - "ranges": [{ "startOffset": 8778, "endOffset": 8904, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addDrawing", - "ranges": [{ "startOffset": 8953, "endOffset": 9026, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeDrawing", - "ranges": [{ "startOffset": 9047, "endOffset": 9128, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeDrawings", - "ranges": [{ "startOffset": 9150, "endOffset": 9240, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateDrawingTransform", - "ranges": [{ "startOffset": 9270, "endOffset": 9399, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addDoor", - "ranges": [{ "startOffset": 9442, "endOffset": 9637, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeDoor", - "ranges": [{ "startOffset": 9655, "endOffset": 9730, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeDoors", - "ranges": [{ "startOffset": 9749, "endOffset": 9833, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "toggleDoor", - "ranges": [{ "startOffset": 9851, "endOffset": 10114, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateDoorState", - "ranges": [{ "startOffset": 10137, "endOffset": 10250, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateDoorLock", - "ranges": [{ "startOffset": 10272, "endOffset": 10389, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateAllDoorStates", - "ranges": [{ "startOffset": 10416, "endOffset": 10524, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateAllDoorLocks", - "ranges": [{ "startOffset": 10550, "endOffset": 10647, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addStairs", - "ranges": [{ "startOffset": 10694, "endOffset": 10761, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeStairs", - "ranges": [{ "startOffset": 10781, "endOffset": 10858, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "removeMultipleStairs", - "ranges": [{ "startOffset": 10886, "endOffset": 10972, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setGridSize", - "ranges": [{ "startOffset": 11023, "endOffset": 11056, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setGridType", - "ranges": [{ "startOffset": 11075, "endOffset": 11108, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setMap", - "ranges": [{ "startOffset": 11122, "endOffset": 11143, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateMapPosition", - "ranges": [{ "startOffset": 11168, "endOffset": 11256, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateMapScale", - "ranges": [{ "startOffset": 11278, "endOffset": 11368, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "updateMapTransform", - "ranges": [{ "startOffset": 11394, "endOffset": 11496, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setIsCalibrating", - "ranges": [{ "startOffset": 11551, "endOffset": 11592, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "addExploredRegion", - "ranges": [{ "startOffset": 11617, "endOffset": 11898, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "clearExploredRegions", - "ranges": [{ "startOffset": 11926, "endOffset": 11960, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setActiveVisionPolygons", - "ranges": [{ "startOffset": 11991, "endOffset": 12044, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setDaylightMode", - "ranges": [{ "startOffset": 12067, "endOffset": 12112, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setTokens", - "ranges": [{ "startOffset": 12129, "endOffset": 12156, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setState", - "ranges": [{ "startOffset": 12172, "endOffset": 12193, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "showToast", - "ranges": [{ "startOffset": 12210, "endOffset": 12262, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "clearToast", - "ranges": [{ "startOffset": 12280, "endOffset": 12306, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "showConfirmDialog", - "ranges": [{ "startOffset": 12331, "endOffset": 12427, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "clearConfirmDialog", - "ranges": [{ "startOffset": 12453, "endOffset": 12487, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setShowResourceMonitor", - "ranges": [{ "startOffset": 12517, "endOffset": 12561, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "showDungeonDialog", - "ranges": [{ "startOffset": 12586, "endOffset": 12620, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "clearDungeonDialog", - "ranges": [{ "startOffset": 12646, "endOffset": 12681, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setIsGamePaused", - "ranges": [{ "startOffset": 12704, "endOffset": 12749, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setMobileSidebarOpen", - "ranges": [{ "startOffset": 12777, "endOffset": 12825, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setCommandPaletteOpen", - "ranges": [{ "startOffset": 12854, "endOffset": 12903, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setActiveMeasurement", - "ranges": [{ "startOffset": 12966, "endOffset": 13022, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setBroadcastMeasurement", - "ranges": [{ "startOffset": 13053, "endOffset": 13108, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "setDmMeasurement", - "ranges": [{ "startOffset": 13132, "endOffset": 13184, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 13294, "endOffset": 13322, "count": 157 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1733", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/utils/systemMessages.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 46982, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 46982, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "rollForMessage", - "ranges": [ - { "startOffset": 14659, "endOffset": 15306, "count": 2 }, - { "startOffset": 14794, "endOffset": 14953, "count": 0 }, - { "startOffset": 15088, "endOffset": 15278, "count": 1 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 15131, "endOffset": 15272, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 15409, "endOffset": 15439, "count": 2 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1735", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/HomeScreen/BackgroundCanvas.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 12072, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 12072, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "BackgroundCanvas", - "ranges": [ - { "startOffset": 875, "endOffset": 4980, "count": 35 }, - { "startOffset": 2107, "endOffset": 2131, "count": 0 }, - { "startOffset": 2132, "endOffset": 4774, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1114, "endOffset": 1499, "count": 17 }], - "isBlockCoverage": true - }, - { - "functionName": "updateDimensions", - "ranges": [{ "startOffset": 1151, "endOffset": 1340, "count": 17 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 1434, "endOffset": 1494, "count": 17 }], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 5085, "endOffset": 5117, "count": 53 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1811", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/Canvas/PaperNoiseOverlay.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 7421, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 7421, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "PaperNoiseOverlay", - "ranges": [{ "startOffset": 608, "endOffset": 2286, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1812", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/Canvas/GridOverlay.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 17886, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 17886, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "GridOverlay", - "ranges": [{ "startOffset": 552, "endOffset": 4789, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1813", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/HomeScreen/PlaygroundToken.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 29439, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 29439, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "PlaygroundToken", - "ranges": [{ "startOffset": 1005, "endOffset": 10461, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 10565, "endOffset": 10596, "count": 180 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1814", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/Canvas/URLImage.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 8112, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 8112, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 791, "endOffset": 2426, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1817", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/hooks/useThemeColor.ts", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 4269, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 4269, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "useThemeColor", - "ranges": [{ "startOffset": 319, "endOffset": 1179, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 1281, "endOffset": 1310, "count": 0 }], - "isBlockCoverage": false - } - ] - }, - { - "scriptId": "1818", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/HomeScreen/PlaygroundDrawings.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 69903, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 69903, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "getRandomColor", - "ranges": [{ "startOffset": 833, "endOffset": 900, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "DrawTree", - "ranges": [{ "startOffset": 942, "endOffset": 2148, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "DrawRock", - "ranges": [{ "startOffset": 2167, "endOffset": 2681, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "DrawDoor", - "ranges": [{ "startOffset": 2700, "endOffset": 4267, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "DrawCrown", - "ranges": [{ "startOffset": 4287, "endOffset": 4960, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "DrawSkull", - "ranges": [{ "startOffset": 4980, "endOffset": 6703, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "DrawZzz", - "ranges": [{ "startOffset": 6721, "endOffset": 7971, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "DrawChest", - "ranges": [{ "startOffset": 7991, "endOffset": 9548, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "DrawSparkles", - "ranges": [{ "startOffset": 9571, "endOffset": 11422, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "DrawQuestion", - "ranges": [{ "startOffset": 11445, "endOffset": 12683, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "DrawExclamation", - "ranges": [{ "startOffset": 12709, "endOffset": 13804, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "DrawTracks", - "ranges": [{ "startOffset": 13825, "endOffset": 15948, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "DrawSword", - "ranges": [{ "startOffset": 15968, "endOffset": 17335, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "DrawPotion", - "ranges": [{ "startOffset": 17356, "endOffset": 18848, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "DrawScroll", - "ranges": [{ "startOffset": 18869, "endOffset": 20317, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "DrawFire", - "ranges": [{ "startOffset": 20336, "endOffset": 20877, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "PlaygroundDrawings2", - "ranges": [{ "startOffset": 20933, "endOffset": 30769, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 30878, "endOffset": 30912, "count": 53 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1819", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/HomeScreen/VignetteOverlay.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 2815, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 2815, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "VignetteOverlay", - "ranges": [{ "startOffset": 315, "endOffset": 949, "count": 35 }], - "isBlockCoverage": true - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 1053, "endOffset": 1084, "count": 53 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1820", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/AboutModal.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 60020, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 60020, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "AboutModal", - "ranges": [ - { "startOffset": 1510, "endOffset": 32644, "count": 35 }, - { "startOffset": 2842, "endOffset": 6789, "count": 0 }, - { "startOffset": 6790, "endOffset": 6794, "count": 0 }, - { "startOffset": 7435, "endOffset": 7445, "count": 0 }, - { "startOffset": 7446, "endOffset": 7450, "count": 0 }, - { "startOffset": 8098, "endOffset": 8108, "count": 0 }, - { "startOffset": 8109, "endOffset": 8113, "count": 0 }, - { "startOffset": 9187, "endOffset": 17557, "count": 0 }, - { "startOffset": 17600, "endOffset": 23810, "count": 0 }, - { "startOffset": 23854, "endOffset": 30728, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 1744, "endOffset": 1811, "count": 17 }, - { "startOffset": 1768, "endOffset": 1807, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [ - { "startOffset": 1870, "endOffset": 2802, "count": 17 }, - { "startOffset": 1902, "endOffset": 2296, "count": 0 } - ], - "isBlockCoverage": true - }, - { - "functionName": "handleTabKey", - "ranges": [{ "startOffset": 2325, "endOffset": 2675, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "", - "ranges": [{ "startOffset": 2741, "endOffset": 2797, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "onClick", - "ranges": [{ "startOffset": 4337, "endOffset": 4363, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "onClick", - "ranges": [{ "startOffset": 6829, "endOffset": 6856, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "onClick", - "ranges": [{ "startOffset": 7485, "endOffset": 7515, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "onClick", - "ranges": [{ "startOffset": 8148, "endOffset": 8179, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 32743, "endOffset": 32769, "count": 53 }], - "isBlockCoverage": true - } - ] - }, - { - "scriptId": "1821", - "url": "file:///Users/kocheck/Documents/GitHub/Hyle/src/components/LogoIcon.tsx", - "functions": [ - { - "functionName": "", - "ranges": [{ "startOffset": 0, "endOffset": 18292, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "", - "ranges": [{ "startOffset": 13, "endOffset": 18292, "count": 1 }], - "isBlockCoverage": true - }, - { - "functionName": "LogoIcon", - "ranges": [{ "startOffset": 458, "endOffset": 7668, "count": 0 }], - "isBlockCoverage": false - }, - { - "functionName": "get", - "ranges": [{ "startOffset": 7765, "endOffset": 7789, "count": 0 }], - "isBlockCoverage": false - } - ] - } - ] -} diff --git a/docs/architecture/DECISIONS.md b/docs/architecture/DECISIONS.md index 0c974c75..513cac9d 100644 --- a/docs/architecture/DECISIONS.md +++ b/docs/architecture/DECISIONS.md @@ -901,3 +901,74 @@ Decisions should be revisited when: **Last updated:** 2025-01-XX **Document version:** 1.0 + +--- + +## Modular Architecture Refactor ADRs (Sessions 1-14, Feb 2026) + +### ADR-R1: Zustand Store Split (UI vs Domain) + +**Decision:** Split gameStore into gameStore (domain) + uiStore (UI ephemeral). + +**Context:** gameStore mixed Toast/Dialog/Sidebar state with Token/Drawing/Campaign +state. UI state changes triggered IPC sync in SyncManager unnecessarily. + +**Consequences:** Two stores to import from. Backward-compat re-exports ease migration. +SyncManager watches only gameStore, reducing unnecessary IPC traffic. + +--- + +### ADR-R2: CSS Custom Properties over Tailwind for Theming + +**Decision:** Keep theme tokens as CSS custom properties in theme.css, not as Tailwind +theme config. Use Tailwind for layout/spacing utilities only. + +**Context:** theme.css already has a comprehensive token system. Duplicating into +tailwind.config.js would create two sources of truth. CSS custom properties support +runtime theming (dark mode toggle) which Tailwind's JIT doesn't. + +**Consequences:** Components use `var(--app-*)` for colors, Tailwind for layout. +Brand swapping works by overriding CSS properties in `src/styles/brand.css`. + +--- + +### ADR-R3: UI Primitives as Plain Components (No Library) + +**Decision:** Build primitives as local components in src/components/primitives/, not +using an external component library (Radix UI, Headless UI, etc.). + +**Context:** Bundle size is critical for Chromebook target (4GB RAM, Intel Celeron). +Radix UI Primitives add ~30-50KB gzipped. Primitive needs are small: Button, Dialog, +Input, Card, Toggle. + +**Consequences:** We own the accessibility implementation and must test it thoroughly. +Bundle stays minimal. Zero external dependency risk. + +--- + +### ADR-R4: Vision Logic as Pure Functions + +**Decision:** Extract raycasting/vision from FogOfWarLayer into pure utility functions +with no React or Konva dependency (src/utils/vision.ts). + +**Context:** Vision calculation is the most CPU-intensive operation. Pure functions +enable unit testing with geometric assertions, Web Worker offloading (future), and +sharing between components without React coupling. + +**Consequences:** FogOfWarLayer is a thin renderer. Vision logic is testable with +mathematical assertions (100% statement coverage achieved). Future path: move to +Web Worker for off-thread calculation. + +--- + +### ADR-R5: Incremental File Moves with Re-Exports + +**Decision:** When moving files (types, components, hooks), always add re-exports at +the old path to prevent breaking changes. Remove re-exports only after all consumers +are migrated. + +**Context:** The codebase has 100+ source files with complex import graphs. Moving a +file without re-exports would require updating every consumer atomically. + +**Consequences:** Migrations happen file-by-file. Temporary duplication of export paths +is acceptable. Clean up re-exports in a dedicated pass after all consumers migrate. diff --git a/IPC_SYNC_VERIFICATION.md b/docs/architecture/IPC_SYNC_VERIFICATION.md similarity index 99% rename from IPC_SYNC_VERIFICATION.md rename to docs/architecture/IPC_SYNC_VERIFICATION.md index 103d2d22..6a030918 100644 --- a/IPC_SYNC_VERIFICATION.md +++ b/docs/architecture/IPC_SYNC_VERIFICATION.md @@ -311,4 +311,4 @@ committedPositions.forEach((pos, id) => { - **IPC Sync Code:** `CanvasManager.tsx:780-1003` - **Test Suite:** `tests/functional/dm-world-sync.spec.ts` - **Original Sync Implementation:** `door-sync.spec.ts` (door sync example) -- **Touch Support Migration:** `TOUCH_SUPPORT_MIGRATION.md` +- **Touch Support Migration:** `../features/TOUCH_SUPPORT_MIGRATION.md` diff --git a/AUTO_UPDATER.md b/docs/features/AUTO_UPDATER.md similarity index 100% rename from AUTO_UPDATER.md rename to docs/features/AUTO_UPDATER.md diff --git a/docs/DUNGEON_GENERATOR.md b/docs/features/DUNGEON_GENERATOR.md similarity index 100% rename from docs/DUNGEON_GENERATOR.md rename to docs/features/DUNGEON_GENERATOR.md diff --git a/TOUCH_SUPPORT_MIGRATION.md b/docs/features/TOUCH_SUPPORT_MIGRATION.md similarity index 99% rename from TOUCH_SUPPORT_MIGRATION.md rename to docs/features/TOUCH_SUPPORT_MIGRATION.md index cbf6c236..a0af3416 100644 --- a/TOUCH_SUPPORT_MIGRATION.md +++ b/docs/features/TOUCH_SUPPORT_MIGRATION.md @@ -389,7 +389,7 @@ If issues arise, rollback is straightforward: ## Extended Manual Testing Checklist -For comprehensive device compatibility testing, see [DEVICE_COMPATIBILITY.md](./DEVICE_COMPATIBILITY.md). +For comprehensive device compatibility testing, see [DEVICE_COMPATIBILITY.md](../guides/DEVICE_COMPATIBILITY.md). ### Physical Device Testing @@ -561,4 +561,4 @@ For comprehensive device compatibility testing, see [DEVICE_COMPATIBILITY.md](./ - [Konva.js Documentation](https://konvajs.org/docs/) - [React-Konva Events](https://konvajs.org/docs/react/) - [CSS touch-action](https://developer.mozilla.org/en-US/docs/Web/CSS/touch-action) -- [Device Compatibility Guide](./DEVICE_COMPATIBILITY.md) +- [Device Compatibility Guide](../guides/DEVICE_COMPATIBILITY.md) diff --git a/DEVICE_COMPATIBILITY.md b/docs/guides/DEVICE_COMPATIBILITY.md similarity index 100% rename from DEVICE_COMPATIBILITY.md rename to docs/guides/DEVICE_COMPATIBILITY.md diff --git a/docs/ENABLE_CI_TESTING.md b/docs/guides/ENABLE_CI_TESTING.md similarity index 100% rename from docs/ENABLE_CI_TESTING.md rename to docs/guides/ENABLE_CI_TESTING.md diff --git a/docs/ERROR_BOUNDARY_DEBUGGING.md b/docs/guides/ERROR_BOUNDARY_DEBUGGING.md similarity index 100% rename from docs/ERROR_BOUNDARY_DEBUGGING.md rename to docs/guides/ERROR_BOUNDARY_DEBUGGING.md diff --git a/FONT_SETUP.md b/docs/guides/FONT_SETUP.md similarity index 100% rename from FONT_SETUP.md rename to docs/guides/FONT_SETUP.md diff --git a/docs/HYBRID_TESTING_WORKFLOW.md b/docs/guides/HYBRID_TESTING_WORKFLOW.md similarity index 98% rename from docs/HYBRID_TESTING_WORKFLOW.md rename to docs/guides/HYBRID_TESTING_WORKFLOW.md index 95d73b82..38f3b950 100644 --- a/docs/HYBRID_TESTING_WORKFLOW.md +++ b/docs/guides/HYBRID_TESTING_WORKFLOW.md @@ -210,7 +210,7 @@ on: ``` **Add branch protection:** -Follow `docs/ENABLE_CI_TESTING.md` +Follow `docs/guides/ENABLE_CI_TESTING.md` --- diff --git a/LINTING.md b/docs/guides/LINTING.md similarity index 100% rename from LINTING.md rename to docs/guides/LINTING.md diff --git a/LINTING_MIGRATION_GUIDE.md b/docs/guides/LINTING_MIGRATION_GUIDE.md similarity index 98% rename from LINTING_MIGRATION_GUIDE.md rename to docs/guides/LINTING_MIGRATION_GUIDE.md index 2ca720e2..4e38b109 100644 --- a/LINTING_MIGRATION_GUIDE.md +++ b/docs/guides/LINTING_MIGRATION_GUIDE.md @@ -178,7 +178,7 @@ After running `npm run lint:fix`, the following issues remain: #### 🔴 Critical Issues (Errors) 1. **Files Not in TSConfig** - - `diagnose-dungeon.ts` + - `tests/helpers/diagnose-dungeon.ts` - `docs/aoe-templates-concept.tsx` - `docs/movement-range-concept.tsx` @@ -247,7 +247,7 @@ After running `npm run lint:fix`, the following issues remain: ```json // tsconfig.json { - "include": ["src", "electron", "docs", "diagnose-dungeon.ts"] + "include": ["src", "electron", "docs", "tests/helpers/diagnose-dungeon.ts"] } ``` @@ -465,7 +465,7 @@ Even without fixing all errors, you now have: ## Getting Help -- **Common errors:** See [LINTING.md](LINTING.md) "Common Errors and Fixes" +- **Common errors:** See [LINTING.md](./LINTING.md) "Common Errors and Fixes" - **AI development:** See [.ai-rules.md](.ai-rules.md) - **Rule explanations:** Comments in `.eslintrc.cjs` - **TypeScript errors:** [TypeScript Handbook](https://www.typescriptlang.org/docs/) diff --git a/docs/LOCAL_TESTING_WORKFLOW.md b/docs/guides/LOCAL_TESTING_WORKFLOW.md similarity index 100% rename from docs/LOCAL_TESTING_WORKFLOW.md rename to docs/guides/LOCAL_TESTING_WORKFLOW.md diff --git a/docs/planning/REFACTOR_SESSIONS.md b/docs/planning/REFACTOR_SESSIONS.md new file mode 100644 index 00000000..26ddfc07 --- /dev/null +++ b/docs/planning/REFACTOR_SESSIONS.md @@ -0,0 +1,871 @@ +# Graphium Modular Architecture Refactor — Historical Archive + +> **Branch:** `claude/refactor-modular-architecture-GUfVC` +> **Created:** 2026-02-09 +> **Completed:** 2026-02-10 (14 sessions) +> **Status:** Complete — All 14 Sessions Finished + +This document is the historical archive of the modular architecture refactor. +It preserves the full game plan, session task specs, running checklist, session notes, +and architecture decision records from the refactor. + +--- + +## Project Vision + +Graphium is being refactored from a working monolithic React+Konva application into a +modular architecture where **presentation is fully separable from business logic**. The +end state: a designer can swap the entire visual identity — theme, components, layout — +without touching game logic, state management, or canvas rendering. Every module has a +defined boundary, a typed interface, and test coverage. The application runs smoothly on +a Chromebook (4GB RAM, Intel Celeron) and meets WCAG 2.2 AA accessibility standards. + +This was an **incremental refactor**, not a rewrite. At every session boundary, the app +remained fully functional. No big-bang changes. + +--- + +## Architecture End-State + +``` +src/ +├── types/ # All domain types (Token, Drawing, Door, Campaign, etc.) +│ ├── domain.ts # Core game entity types (extracted from gameStore) +│ ├── geometry.ts # Point, WallSegment, etc. (exists) +│ ├── grid.ts # Grid types (exists) +│ └── measurement.ts # Measurement types (exists) +│ +├── styles/ # Visual Framework (importable without app logic) +│ ├── tokens/ # Design tokens +│ │ ├── theme.css # Semantic CSS custom properties (exists, hardened) +│ │ └── brand.css # Brand-specific overrides (logo, accent, font) +│ ├── primitives.css # Styles for UI primitive components +│ ├── home-screen.css # Extracted from HomeScreen.tsx inline styles +│ ├── fonts.css # Font declarations (exists) +│ └── app.css # App-level utility classes (exists, cleaned) +│ +├── components/ +│ ├── primitives/ # UI Primitives (design system layer) +│ │ ├── Button.tsx # All button variants +│ │ ├── Dialog.tsx # Modal/dialog wrapper with a11y +│ │ ├── Input.tsx # Text input with theme tokens +│ │ ├── Card.tsx # Surface/panel component +│ │ └── ToggleSwitch.tsx # Moved from root, integrated with tokens +│ │ +│ ├── Canvas/ # Canvas rendering (exists, decomposed) +│ │ ├── CanvasManager.tsx # Slim compositor (~300 lines) +│ │ ├── ContextMenu.tsx # Extracted from CanvasManager +│ │ ├── hooks/ # Canvas-specific interaction hooks +│ │ │ ├── useCanvasKeyboard.ts +│ │ │ ├── useCanvasDrop.ts +│ │ │ ├── useCanvasSelection.ts +│ │ │ ├── useCanvasDrawing.ts +│ │ │ ├── useCanvasInteraction.ts (exists) +│ │ │ └── useTokenDrag.ts (exists) +│ │ └── [rendering layers - FogOfWarLayer, GridOverlay, etc.] +│ │ +│ ├── Dialogs/ # Modal/dialog components +│ │ ├── ConfirmDialog.tsx +│ │ ├── PreferencesDialog.tsx +│ │ ├── AboutModal.tsx +│ │ └── DungeonGeneratorDialog.tsx +│ │ +│ ├── ErrorBoundaries/ # Error boundary components +│ │ ├── PrivacyErrorBoundary.tsx +│ │ ├── AssetProcessingErrorBoundary.tsx +│ │ ├── DungeonGeneratorErrorBoundary.tsx +│ │ └── [other error boundaries] +│ │ +│ ├── Managers/ # Non-visual coordination components +│ │ ├── SyncManager.tsx +│ │ ├── ThemeManager.tsx +│ │ ├── AutoSaveManager.tsx +│ │ ├── PauseManager.tsx +│ │ └── UpdateManager.tsx +│ │ +│ ├── Mobile/ # Mobile-specific components +│ │ ├── MobileToolbar.tsx +│ │ ├── MobileBottomSheet.tsx +│ │ └── MobileSidebarDrawer.tsx +│ │ +│ ├── AssetLibrary/ # Token library (exists) +│ └── DesignSystemPlayground/ # Component showcase (exists) +│ +├── store/ # State management +│ ├── gameStore.ts # Domain-only state (tokens, drawings, campaign) +│ └── uiStore.ts # UI ephemeral state (toast, dialogs, sidebar) +│ ├── touchSettingsStore.ts # Touch preferences (exists, clean) +│ └── preferencesStore.ts # Tool preferences (exists, clean) +│ +├── services/ # Platform abstraction (exists, clean) +│ ├── IStorageService.ts +│ ├── ElectronStorageService.ts +│ ├── WebStorageService.ts +│ ├── campaignService.ts # Campaign I/O orchestration (new) +│ └── storage.ts # Service locator (exists) +│ +├── hooks/ # App-wide custom hooks +│ ├── useToolState.ts # Tool selection, color, drawing mode +│ ├── useMenuCommands.ts # IPC menu handler registration +│ ├── useRecentCampaigns.ts # localStorage recent files +│ ├── usePlatformDetection.ts +│ ├── useCommandPalette.ts # (exists) +│ ├── useMediaQuery.ts # (exists) +│ ├── useThemeColor.ts # (exists) +│ └── useTokenData.ts # (exists) +│ +├── utils/ # Pure utility functions +│ ├── vision.ts # Raycasting, wall collision, vision polygons +│ └── [existing utils] +│ +└── workers/ # Web Workers (exists) +``` + +--- + +## Design System Contract + +This is the **seam** between visual framework and application logic. The designer +operates above this line; the developer operates below it. + +### Visual Layer (Designer Domain) + +- `src/styles/**` — All CSS, tokens, brand config +- `src/components/primitives/**` — UI primitive components +- `src/styles/home-screen.css` — Landing page styles +- Tailwind utility classes in component JSX +- Any file whose primary purpose is visual presentation + +### Logic Layer (Developer Domain) + +- `src/store/**` — State management +- `src/services/**` — Platform abstraction, I/O +- `src/utils/**` — Pure business logic, algorithms +- `src/hooks/**` — State composition, side effects +- `src/workers/**` — Background processing +- `src/types/**` — Type definitions + +### Contract Rules + +1. **Primitives import from styles/ and types/ only** — never from store or services +2. **Store imports from types/ only** — never from components +3. **Services import from types/ only** — never from components or store +4. **Hooks may import from store, services, and types** — never from components +5. **Feature components compose primitives + hooks** — they are the integration layer +6. **Vision utils are pure functions** — no React, no Zustand, no side effects + +### Enforcement + +Enforced via ESLint `import/no-restricted-paths` rules (added Session 12). + +--- + +## Execution Order Table + +All 30 recommendations accepted. Ordered by dependency graph with cleanup first. + +| Order | ID | Title | Effort | Session | +| ----- | ---- | ----------------------------------------- | ------ | ------- | +| 1 | [1] | Delete dead Vite boilerplate files | S | 1 | +| 2 | [5] | Clean FogOfWarLayer diagnostic logging | S | 1 | +| 3 | [25] | Optimize static assets (icon.png) | S | 1 | +| 4 | [21] | Generate test coverage baseline | S | 1 | +| 5 | [2] | Consolidate root documentation sprawl | M | 2 | +| 6 | [3] | Reorganize component directory structure | M | 2 | +| 7 | [4] | Extract domain types from gameStore | S | 2 | +| 8 | [6] | Harden theme token system | M | 3 | +| 9 | [30] | Optimize Radix color CSS imports | S | 3 | +| 10 | [7] | Scope global transition rule | S | 3 | +| 11 | [28] | Add prefers-contrast support | S | 3 | +| 12 | [12] | Add brand configuration layer | S | 3 | +| 13 | [8] | Create UI Primitive: Button | M | 4 | +| 14 | [10] | Create UI Primitives: Input, Card, Toggle | M | 4 | +| 15 | [9] | Create UI Primitive: Dialog/Modal | M | 5 | +| 16 | [11] | Extract HomeScreen inline CSS | L | 5 | +| 17 | [19] | Install eslint-plugin-jsx-a11y | S | 6 | +| 18 | [20] | Upgrade ESLint warns → errors | S | 6 | +| 19 | [23] | Add import boundary linting rules | S | 6 | +| 20 | [13] | Separate UI/domain state in gameStore | M | 7 | +| 21 | [14] | Extract vision/raycasting module | M | 8 | +| 22 | [17] | Extract HomeScreen business logic | M | 8 | +| 23 | [16] | Extract App.tsx coordination hooks | M | 9 | +| 24 | [18] | Create campaign service module | M | 9 | +| 25 | [15] | Split CanvasManager into focused modules | XL | 10 | +| 26 | [24] | Add code splitting with React.lazy | M | 11 | +| 27 | [26] | Konva performance budget for low-end | M | 11 | +| 28 | [27] | Add canvas accessibility layer | L | 12 | +| 29 | [29] | Complete keyboard navigation coverage | M | 12 | +| 30 | [22] | Unit tests for all extracted modules | L | 13 | + +--- + +## Session Breakdowns (Task Specs) + +### Session 1: Cleanup & Quick Wins + +**Goal:** Remove dead weight, establish quality baseline, zero-risk changes. + +#### Task 1.1 — Delete Dead Vite Boilerplate Files [1] + +Files deleted: `src/App.css`, `src/assets/react.svg`, `public/electron-vite.svg`, +`public/electron-vite.animate.svg`, `public/vite.svg` + +#### Task 1.2 — Clean FogOfWarLayer Diagnostic Logging [5] + +Replaced ~40 lines of console.log with a single `const DEBUG_VISION = false` flag. + +#### Task 1.3 — Optimize Static Assets [25] + +Compressed icon.png: 927KB → 72KB (92% reduction). + +#### Task 1.4 — Generate Test Coverage Baseline [21] + +Documented baseline coverage numbers. + +--- + +### Session 2: Repo Organization & Type Extraction + +**Goal:** Clean directory structure, consolidate docs, extract types. + +#### Task 2.1 — Consolidate Root Documentation [2] + +Moved 8 docs to docs/ subdirectories. Root reduced to 5 markdown files. + +#### Task 2.2 — Reorganize Component Directory Structure [3] + +Created 4 new directories: ErrorBoundaries/, Dialogs/, Managers/, Mobile/ +Moved 17+ files with updated imports. + +#### Task 2.3 — Extract Domain Types from gameStore [4] + +Created `src/types/domain.ts` with 14 types + 2 constants. +gameStore.ts re-exports everything for backward compatibility. + +--- + +### Session 3: Theme System Foundation + +**Goal:** Make the token system airtight. Every color flows through tokens. + +#### Task 3.1 — Harden Theme Token System [6] + +Added ~120 CSS custom properties to theme.css. Swept 20+ component files. +For Konva components: created `*_COLORS` constant objects with JSDoc references. + +#### Task 3.2 — Optimize Radix Color CSS Imports [30] + +Removed 7 redundant dark-mode Radix CSS imports. + +#### Task 3.3 — Scope Global Transition Rule [7] + +Replaced `*` selector with scoped selectors. Canvas elements no longer have transitions. + +#### Task 3.4 — Add prefers-contrast Support [28] + +Added `@media (prefers-contrast: more)` block with enhanced visibility. + +#### Task 3.5 — Add Brand Configuration Layer [12] + +Created `src/styles/brand.css`. Single file controls visual brand identity. + +--- + +### Session 4: UI Primitives — Button, Input, Card + +**Goal:** Create the first reusable design system components. + +#### Task 4.1 — Create Button Primitive [8] + +`src/components/primitives/Button.tsx` — 5 variants, 3 sizes, isActive/isLoading states. + +#### Task 4.2 — Create Input, Card, ToggleSwitch Primitives [10] + +Input with label/error/helper. Card with 3 variants. ToggleSwitch moved to primitives/. + +--- + +### Session 5: UI Primitives — Dialog + HomeScreen CSS + +**Goal:** Standardize modal pattern, extract the biggest inline CSS blob. + +#### Task 5.1 — Create Dialog Primitive [9] + +`src/components/primitives/Dialog.tsx` — focus trap, Escape, overlay click, scroll lock, +full ARIA (role=dialog, aria-modal, aria-labelledby, aria-describedby). + +#### Task 5.2 — Extract HomeScreen Inline CSS [11] + +Moved 1,032 lines of ` + {/* Styles extracted to src/styles/home-screen.css — see CLAUDE.md Task 5.2 */} ); } diff --git a/src/components/LoadingOverlay.tsx b/src/components/LoadingOverlay.tsx index 98f83330..4d5340f5 100644 --- a/src/components/LoadingOverlay.tsx +++ b/src/components/LoadingOverlay.tsx @@ -29,7 +29,7 @@ * - Smooth fade-in animation (via Tailwind animate-fade-in) * * **State Management:** - * - Reads `isGamePaused` from Zustand gameStore + * - Reads `isGamePaused` from Zustand uiStore * - PauseManager keeps this state synchronized with main process * - Re-renders automatically when pause state changes * @@ -65,22 +65,22 @@ * 8. LoadingOverlay disappears, players see updated state * ``` * - * @returns {JSX.Element | null} Full-screen overlay or null if not paused + * @returns {React.JSX.Element | null} Full-screen overlay or null if not paused * * @see {@link PauseManager} Synchronizes pause state via IPC * @see {@link App.tsx} Contains pause toggle button and conditional rendering - * @see {@link gameStore.ts} Contains isGamePaused state + * @see {@link uiStore.ts} Contains isGamePaused state * @see {@link electron/main.ts} Main process IPC handlers for pause state */ import { useMemo } from 'react'; -import { useGameStore } from '../store/gameStore'; +import { useUiStore } from '../store/uiStore'; import { rollForMessage } from '../utils/systemMessages'; -export function LoadingOverlay() { - // Subscribe to pause state from Zustand store - const isGamePaused = useGameStore((state) => state.isGamePaused); +export function LoadingOverlay(): React.JSX.Element | null { + // Subscribe to pause state from Zustand uiStore + const isGamePaused = useUiStore((state) => state.isGamePaused); // Roll for a random loading message; stable during a pause, re-rolls when pause state changes // eslint-disable-next-line react-hooks/exhaustive-deps diff --git a/src/components/LogoIcon.tsx b/src/components/LogoIcon.tsx index a6193ec8..e6472aea 100644 --- a/src/components/LogoIcon.tsx +++ b/src/components/LogoIcon.tsx @@ -1,3 +1,4 @@ +import type React from 'react'; import { useState, useEffect } from 'react'; import iconUrl from '../assets/branding/icon.png'; @@ -22,7 +23,7 @@ export function LogoIcon({ animate = false, onAnimationComplete, className = '', -}: LogoIconProps) { +}: LogoIconProps): React.JSX.Element { const [isRolling, setIsRolling] = useState(false); const [rotation, setRotation] = useState(0); diff --git a/src/components/LogoLockup.tsx b/src/components/LogoLockup.tsx index f282f326..045b8303 100644 --- a/src/components/LogoLockup.tsx +++ b/src/components/LogoLockup.tsx @@ -1,3 +1,4 @@ +import type React from 'react'; import { useEffect, useState } from 'react'; import logoDarkUrl from '../assets/branding/logo-dark.svg'; @@ -19,8 +20,13 @@ interface LogoLockupProps { * Automatically switches between light and dark versions based on * the current application theme or provided prop. */ -export function LogoLockup({ theme, className = '', width = 'auto', style = {} }: LogoLockupProps) { - const [currentTheme, setCurrentTheme] = useState<'light' | 'dark'>(theme || 'light'); +export function LogoLockup({ + theme, + className = '', + width = 'auto', + style = {}, +}: LogoLockupProps): React.JSX.Element { + const [currentTheme, setCurrentTheme] = useState<'light' | 'dark'>(theme ?? 'light'); useEffect(() => { // If theme is manually provided, stick with it @@ -30,7 +36,7 @@ export function LogoLockup({ theme, className = '', width = 'auto', style = {} } } // Otherwise, detect from HTML data-theme attribute - const updateTheme = () => { + const updateTheme = (): void => { const htmlTheme = document.documentElement.getAttribute('data-theme'); setCurrentTheme(htmlTheme === 'dark' ? 'dark' : 'light'); }; diff --git a/src/components/Managers/AutoSaveManager.tsx b/src/components/Managers/AutoSaveManager.tsx new file mode 100644 index 00000000..0b435615 --- /dev/null +++ b/src/components/Managers/AutoSaveManager.tsx @@ -0,0 +1,75 @@ +import { useEffect } from 'react'; + +import { getStorage } from '../../services/storage'; +import { useGameStore } from '../../store/gameStore'; +import { useUiStore } from '../../store/uiStore'; + +/** + * AutoSaveManager Component + * + * Automatically saves the campaign state at a regular interval (every 60 seconds). + * + * **Platform Behavior:** + * - Electron: Saves to last known file path (atomic write) + * - Web: Saves to IndexedDB (no file download) + * + * **Note:** This only runs if auto-save feature is available on the platform. + * Check storage.isFeatureAvailable('auto-save') for availability. + */ +function AutoSaveManager(): null { + useEffect(() => { + // Check if auto-save is supported on this platform + const storage = getStorage(); + if (!storage.isFeatureAvailable('auto-save')) { + // eslint-disable-next-line no-console + console.log('[AutoSave] Auto-save not available on this platform'); + return; + } + + let isSaving = false; + + const intervalId = setInterval( + () => + void (async () => { + if (isSaving) { + return; + } + isSaving = true; + try { + // Ensure latest map state is in campaign object + useGameStore.getState().syncActiveMapToCampaign(); + + // Get latest campaign data + const campaign = useGameStore.getState().campaign; + + // Attempt auto-save + // Returns true if saved, false if error + const saved = await storage.autoSaveCampaign(campaign); + + if (saved) { + // eslint-disable-next-line no-console + console.log('[AutoSave] Campaign saved successfully'); + } else { + useUiStore + .getState() + .showToast('Auto-save failed — your progress may not be saved', 'error'); + } + } catch (err) { + console.error('[AutoSave] Failed:', err); + useUiStore + .getState() + .showToast('Auto-save failed — your progress may not be saved', 'error'); + } finally { + isSaving = false; + } + })(), + 60 * 1000, + ); // 60 seconds + + return () => clearInterval(intervalId); + }, []); + + return null; // Invisible component +} + +export default AutoSaveManager; diff --git a/src/components/PauseManager.tsx b/src/components/Managers/PauseManager.tsx similarity index 90% rename from src/components/PauseManager.tsx rename to src/components/Managers/PauseManager.tsx index 78b8944d..72529335 100644 --- a/src/components/PauseManager.tsx +++ b/src/components/Managers/PauseManager.tsx @@ -47,17 +47,17 @@ * @see {@link electron/main.ts} Main process IPC handlers (TOGGLE_PAUSE, GET_PAUSE_STATE) * @see {@link LoadingOverlay} Component that displays when paused (World View only) * @see {@link App.tsx} Contains pause toggle button (Architect View only) - * @see {@link gameStore.ts} Contains isGamePaused state + * @see {@link uiStore.ts} Contains isGamePaused state */ import { useEffect } from 'react'; -import { useGameStore } from '../store/gameStore'; -import { rollForMessage } from '../utils/systemMessages'; +import { useUiStore } from '../../store/uiStore'; +import { rollForMessage } from '../../utils/systemMessages'; -export function PauseManager() { - const setIsGamePaused = useGameStore((state) => state.setIsGamePaused); - const showToast = useGameStore((state) => state.showToast); +export function PauseManager(): null { + const setIsGamePaused = useUiStore((state) => state.setIsGamePaused); + const showToast = useUiStore((state) => state.showToast); useEffect(() => { // Early return if IPC is not available (e.g., running in browser mode for tests) @@ -86,7 +86,7 @@ export function PauseManager() { * @param _event - IPC event object (unused) * @param isPaused - New pause state from main process */ - const handlePauseStateChanged = (_event: unknown, isPaused: boolean) => { + const handlePauseStateChanged = (_event: unknown, isPaused: boolean): void => { setIsGamePaused(isPaused); }; diff --git a/src/components/SyncManager.tsx b/src/components/Managers/SyncManager.tsx similarity index 71% rename from src/components/SyncManager.tsx rename to src/components/Managers/SyncManager.tsx index c7f1ddf7..c82779cf 100644 --- a/src/components/SyncManager.tsx +++ b/src/components/Managers/SyncManager.tsx @@ -1,12 +1,15 @@ import { useEffect, useRef } from 'react'; -import { useGameStore } from '../store/gameStore'; -import { isEqual, detectChanges } from '../utils/syncUtils'; +import { useGameStore } from '../../store/gameStore'; +import { isEqual, detectChanges, isSyncActionType } from '../../utils/syncUtils'; -import type { SyncAction, SyncableGameState } from '../utils/syncUtils'; +import type { GameState } from '../../store/gameStore'; +import type { Token, HexColor, PixelSize } from '../../types/domain'; +import type { SyncAction, SyncableGameState } from '../../utils/syncUtils'; // Basic throttle implementation to limit IPC frequency // Ensures leading edge execution and trailing edge (so final state is always sent) +// eslint-disable-next-line @typescript-eslint/no-explicit-any function throttle void>(func: T, limit: number): T { let lastFunc: ReturnType; let lastRan: number | undefined; @@ -19,7 +22,7 @@ function throttle void>(func: T, limit: number): T clearTimeout(lastFunc); lastFunc = setTimeout( () => { - if (Date.now() - lastRan! >= limit) { + if (lastRan !== undefined && Date.now() - lastRan >= limit) { func.apply(this, args); lastRan = Date.now(); } @@ -38,16 +41,18 @@ function throttle void>(func: T, limit: number): T * * ... (Comments preserved) */ -function SyncManager() { +// eslint-disable-next-line max-lines-per-function +function SyncManager(): null { // Track previous state for diffing - const prevStateRef = useRef(null); + const prevStateRef = useRef | null>(null); // Track previous state for World View changes (bidirectional sync) - const worldViewPrevStateRef = useRef(null); + const worldViewPrevStateRef = useRef | null>(null); // Use a ref to track if IPC listener is already set up const listenerSetupRef = useRef(false); + // eslint-disable-next-line max-lines-per-function useEffect(() => { // Detect platform: Electron vs Web const ipcRenderer = window.ipcRenderer; @@ -55,7 +60,7 @@ function SyncManager() { const isWeb = !isElectron; // Store IPC listener reference for cleanup - let ipcListener: ((event: any, action: SyncAction) => void) | null = null; + let ipcListener: ((event: unknown, action: SyncAction) => void) | null = null; // Detect window type from URL parameter const params = new URLSearchParams(window.location.search); @@ -64,7 +69,7 @@ function SyncManager() { // Transport Setup let channel: BroadcastChannel | null = null; - const sendSyncActionDirectly = (action: SyncAction) => { + const sendSyncActionDirectly = (action: SyncAction): void => { if (isWeb && channel) { channel.postMessage(action); } else if (isElectron && ipcRenderer) { @@ -86,7 +91,8 @@ function SyncManager() { // WORLD VIEW (CONSUMER) // ============================================================ - const handleSyncAction = (_event: any, action: SyncAction) => { + // eslint-disable-next-line complexity + const handleSyncAction = (_event: unknown, action: SyncAction): void => { const store = useGameStore.getState(); switch (action.type) { @@ -105,11 +111,12 @@ function SyncManager() { worldViewPrevStateRef.current = { tokens: action.payload.tokens ? [...action.payload.tokens] : [], tokenLibrary: fullLib ? [...fullLib] : [], // Initialize library for diffing - drawings: [...(action.payload.drawings || [])], - doors: [...(action.payload.doors || [])], - stairs: [...(action.payload.stairs || [])], - gridSize: action.payload.gridSize ?? 50, + drawings: [...(action.payload.drawings ?? [])], + doors: [...(action.payload.doors ?? [])], + stairs: [...(action.payload.stairs ?? [])], + gridSize: (action.payload.gridSize ?? 50) as PixelSize, gridType: action.payload.gridType ?? 'LINES', + gridColor: (action.payload.gridColor ?? '#333333') as HexColor, map: action.payload.map ? { ...action.payload.map } : null, isDaylightMode: action.payload.isDaylightMode ?? false, }; @@ -215,7 +222,7 @@ function SyncManager() { break; case 'GRID_UPDATE': - useGameStore.setState(action.payload as any); + useGameStore.setState(action.payload); break; case 'MEASUREMENT_UPDATE': @@ -229,17 +236,17 @@ function SyncManager() { if (isWeb && channel) { channel.onmessage = (event) => { - const message = event.data; + const message = event.data as { type?: string }; if (message?.type === 'REQUEST_INITIAL_STATE') { // Ignore (World View doesn't have initial state to give) - } else if (message?.type) { - handleSyncAction(null, message); + } else if (message?.type && isSyncActionType(message.type)) { + handleSyncAction(null, message as SyncAction); } }; // Request initial state channel.postMessage({ type: 'REQUEST_INITIAL_STATE' }); } else if (isElectron && ipcRenderer) { - ipcListener = (event: any, action: SyncAction) => { + ipcListener = (event: unknown, action: SyncAction) => { handleSyncAction(event, action); }; @@ -252,23 +259,26 @@ function SyncManager() { } // BIDIRECTIONAL: Sync from World View to Architect - const detectWorldViewChanges = (prevState: any, currentState: any): SyncAction[] => { + const detectWorldViewChanges = ( + prevState: Partial | null, + currentState: Partial, + ): SyncAction[] => { const actions: SyncAction[] = []; if (!prevState) { return actions; } - const prevTokenMap = new Map(prevState.tokens.map((t: any) => [t.id, t])); + const prevTokenMap = new Map((prevState.tokens ?? []).map((t) => [t.id, t])); - currentState.tokens.forEach((token: any) => { - const prev: any = prevTokenMap.get(token.id); + (currentState.tokens ?? []).forEach((token) => { + const prev = prevTokenMap.get(token.id); if (prev) { - const changes: Record = {}; + const changes: Partial = {}; if (!isEqual(token.x, prev.x)) { - changes['x'] = token.x; + changes.x = token.x; } if (!isEqual(token.y, prev.y)) { - changes['y'] = token.y; + changes.y = token.y; } if (Object.keys(changes).length > 0) { actions.push({ type: 'TOKEN_UPDATE', payload: { id: token.id, changes } }); @@ -278,8 +288,20 @@ function SyncManager() { return actions; }; - const handleWorldViewUpdate = (state: any) => { - const actions = detectWorldViewChanges(worldViewPrevStateRef.current, state); + const handleWorldViewUpdate = (state: GameState): void => { + const syncable: Partial = { + tokens: state.tokens, + tokenLibrary: state.campaign.tokenLibrary, + drawings: state.drawings, + doors: state.doors, + stairs: state.stairs, + gridSize: state.gridSize, + gridType: state.gridType, + gridColor: state.gridColor, + map: state.map, + isDaylightMode: state.isDaylightMode, + }; + const actions = detectWorldViewChanges(worldViewPrevStateRef.current, syncable); actions.forEach((action) => { if (isWeb && channel) { channel.postMessage(action); @@ -290,12 +312,13 @@ function SyncManager() { worldViewPrevStateRef.current = { tokens: [...state.tokens], - tokenLibrary: [...(state.campaign?.tokenLibrary || [])], // This usually won't change from WV, but good for completeness + tokenLibrary: [...(state.campaign.tokenLibrary ?? [])], // This usually won't change from WV, but good for completeness drawings: [...state.drawings], - doors: [...(state.doors || [])], - stairs: [...(state.stairs || [])], + doors: [...(state.doors ?? [])], + stairs: [...(state.stairs ?? [])], gridSize: state.gridSize, gridType: state.gridType, + gridColor: state.gridColor, map: state.map ? { ...state.map } : null, isDaylightMode: state.isDaylightMode, }; @@ -319,7 +342,7 @@ function SyncManager() { // ARCHITECT VIEW (PRODUCER) // ============================================================ - const handleInitialStateRequest = (_event: any) => { + const handleInitialStateRequest = (_event: unknown): void => { const state = useGameStore.getState(); const initialAction: SyncAction = { type: 'FULL_SYNC', @@ -327,10 +350,11 @@ function SyncManager() { tokens: state.tokens, tokenLibrary: state.campaign.tokenLibrary, // Pass library drawings: state.drawings, - doors: state.doors || [], - stairs: state.stairs || [], + doors: state.doors ?? [], + stairs: state.stairs ?? [], gridSize: state.gridSize, gridType: state.gridType, + gridColor: state.gridColor, map: state.map, exploredRegions: state.exploredRegions, isDaylightMode: state.isDaylightMode, @@ -346,22 +370,30 @@ function SyncManager() { if (isWeb && channel) { channel.onmessage = (event) => { - if (event.data?.type === 'REQUEST_INITIAL_STATE') { + const msg = event.data as { type?: string } | null; + if (msg?.type === 'REQUEST_INITIAL_STATE') { handleInitialStateRequest(event); } }; - } else if (isElectron && ipcRenderer) { - ipcRenderer.on('REQUEST_INITIAL_STATE', handleInitialStateRequest); } - const handleStoreUpdate = (state: any) => { + const handleStoreUpdate = (state: GameState): void => { // Create a syncable state object including tokenLibrary from campaign const syncableState: Partial = { - ...state, + tokens: state.tokens, tokenLibrary: state.campaign.tokenLibrary, + drawings: state.drawings, + doors: state.doors, + stairs: state.stairs, + gridSize: state.gridSize, + gridType: state.gridType, + gridColor: state.gridColor, + map: state.map, + exploredRegions: state.exploredRegions, + isDaylightMode: state.isDaylightMode, }; - const actions = detectChanges(prevStateRef.current, syncableState); + const actions = detectChanges(prevStateRef.current ?? {}, syncableState); actions.forEach((action) => { if (isWeb && channel) { channel.postMessage(action); @@ -374,10 +406,11 @@ function SyncManager() { tokens: [...state.tokens], tokenLibrary: [...state.campaign.tokenLibrary], drawings: [...state.drawings], - doors: [...(state.doors || [])], - stairs: [...(state.stairs || [])], + doors: [...(state.doors ?? [])], + stairs: [...(state.stairs ?? [])], gridSize: state.gridSize, gridType: state.gridType, + gridColor: state.gridColor, map: state.map ? { ...state.map } : null, exploredRegions: state.exploredRegions ? [...state.exploredRegions] : [], isDaylightMode: state.isDaylightMode, @@ -388,18 +421,22 @@ function SyncManager() { const unsub = useGameStore.subscribe(throttledSync); // Listen for updates FROM world view - if (isElectron && ipcRenderer) { - ipcRenderer.on('SYNC_FROM_WORLD_VIEW', (_event, action) => { - if (action.type === 'TOKEN_UPDATE') { - const { id, changes } = action.payload; - const store = useGameStore.getState(); - const currentToken = store.tokens.find((t) => t.id === id); - if (currentToken) { - const newTokens = store.tokens.map((t) => (t.id === id ? { ...t, ...changes } : t)); - useGameStore.setState({ tokens: newTokens }); - } + const syncFromWorldViewListener = (_event: unknown, action: SyncAction): void => { + if (action.type === 'TOKEN_UPDATE') { + const { id, changes } = action.payload; + const store = useGameStore.getState(); + const currentToken = store.tokens.find((t) => t.id === id); + if (currentToken) { + const newTokens = store.tokens.map((t) => (t.id === id ? { ...t, ...changes } : t)); + useGameStore.setState({ tokens: newTokens }); } - }); + } + }; + + if (isElectron && ipcRenderer && !listenerSetupRef.current) { + ipcRenderer.on('SYNC_FROM_WORLD_VIEW', syncFromWorldViewListener); + ipcRenderer.on('REQUEST_INITIAL_STATE', handleInitialStateRequest); + listenerSetupRef.current = true; } return () => { @@ -408,8 +445,9 @@ function SyncManager() { channel.close(); } if (isElectron && ipcRenderer) { - ipcRenderer.removeAllListeners('REQUEST_INITIAL_STATE'); - ipcRenderer.removeAllListeners('SYNC_FROM_WORLD_VIEW'); + ipcRenderer.off('REQUEST_INITIAL_STATE', handleInitialStateRequest); + ipcRenderer.off('SYNC_FROM_WORLD_VIEW', syncFromWorldViewListener); + listenerSetupRef.current = false; } // @ts-expect-error - graphiumSync is dynamically added delete window.graphiumSync; diff --git a/src/components/ThemeManager.tsx b/src/components/Managers/ThemeManager.tsx similarity index 83% rename from src/components/ThemeManager.tsx rename to src/components/Managers/ThemeManager.tsx index dbcef4a7..0d7189a7 100644 --- a/src/components/ThemeManager.tsx +++ b/src/components/Managers/ThemeManager.tsx @@ -21,7 +21,7 @@ import { useEffect } from 'react'; -import { getStorage } from '../services/storage'; +import { getStorage } from '../../services/storage'; // Note: window.themeAPI types are defined in vite-env.d.ts @@ -33,7 +33,7 @@ import { getStorage } from '../services/storage'; * * @param theme - 'light' or 'dark' */ -function applyTheme(theme: 'light' | 'dark') { +function applyTheme(theme: 'light' | 'dark'): void { document.documentElement.setAttribute('data-theme', theme); } @@ -42,7 +42,7 @@ function applyTheme(theme: 'light' | 'dark') { * * Mount this once at the app root. It has no visible UI. */ -export function ThemeManager() { +export function ThemeManager(): null { useEffect(() => { let cleanup: (() => void) | undefined; @@ -66,7 +66,7 @@ export function ThemeManager() { * 3. Subscribe to theme changes (platform-specific) * 4. Remove 'theme-loading' class to enable transitions */ - async function initializeTheme() { + async function initializeTheme(): Promise { try { const storage = getStorage(); const isElectron = storage.getPlatform() === 'electron'; @@ -88,12 +88,14 @@ export function ThemeManager() { // Subscribe to system theme changes (for 'system' mode) const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)'); - const handleSystemThemeChange = async () => { - const currentMode = await storage.getThemeMode(); - if (currentMode === 'system') { - const newTheme = resolveEffectiveTheme('system'); - applyTheme(newTheme); - } + const handleSystemThemeChange = (): void => { + void (async () => { + const currentMode = await storage.getThemeMode(); + if (currentMode === 'system') { + const newTheme = resolveEffectiveTheme('system'); + applyTheme(newTheme); + } + })(); }; // Always listen for system theme changes @@ -104,10 +106,17 @@ export function ThemeManager() { if (typeof BroadcastChannel !== 'undefined') { themeChannel = new BroadcastChannel('graphium-theme-sync'); - const handleCrossTabThemeChange = (event: MessageEvent) => { - if (event.data?.type === 'THEME_CHANGED') { - const newMode = event.data.mode as 'light' | 'dark' | 'system'; - const newTheme = resolveEffectiveTheme(newMode); + + /** Shape of the cross-tab theme sync message */ + interface ThemeSyncMessage { + type: string; + mode: 'light' | 'dark' | 'system'; + } + + const handleCrossTabThemeChange = (event: MessageEvent): void => { + const data = event.data as ThemeSyncMessage | null; + if (data && data.type === 'THEME_CHANGED') { + const newTheme = resolveEffectiveTheme(data.mode); applyTheme(newTheme); } }; diff --git a/src/components/UpdateManager.test.tsx b/src/components/Managers/UpdateManager.test.tsx similarity index 100% rename from src/components/UpdateManager.test.tsx rename to src/components/Managers/UpdateManager.test.tsx diff --git a/src/components/UpdateManager.tsx b/src/components/Managers/UpdateManager.tsx similarity index 92% rename from src/components/UpdateManager.tsx rename to src/components/Managers/UpdateManager.tsx index f03f47d5..344da44a 100644 --- a/src/components/UpdateManager.tsx +++ b/src/components/Managers/UpdateManager.tsx @@ -22,7 +22,7 @@ * 5. User clicks "Restart & Install" → App restarts with new version * * @component - * @returns {JSX.Element | null} Update dialog or null if not active + * @returns {React.JSX.Element | null} Update dialog or null if not active */ import { useEffect, useState, useRef, useCallback } from 'react'; @@ -132,6 +132,7 @@ const updateMessages = { * Randomly selects a message from an array */ const rollForMessage = (messages: string[]): string => { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion return messages[Math.floor(Math.random() * messages.length)]!; }; @@ -169,7 +170,8 @@ interface DownloadProgress { total: number; } -function UpdateManager({ isOpen, onClose }: UpdateManagerProps) { +// eslint-disable-next-line max-lines-per-function, complexity +function UpdateManager({ isOpen, onClose }: UpdateManagerProps): React.JSX.Element | null { const [status, setStatus] = useState('idle'); const [currentVersion, setCurrentVersion] = useState(''); const [updateInfo, setUpdateInfo] = useState(null); @@ -312,47 +314,53 @@ function UpdateManager({ isOpen, onClose }: UpdateManagerProps) { return null; } - const handleCheckForUpdates = async () => { + const handleCheckForUpdates = (): void => { if (!window.autoUpdater) { return; } - try { - setStatus('checking'); - setErrorMessage(''); - await window.autoUpdater.checkForUpdates(); - } catch (error) { - setStatus('error'); - setErrorMessage(error instanceof Error ? error.message : 'Failed to check for updates'); - } + void (async () => { + try { + setStatus('checking'); + setErrorMessage(''); + await window.autoUpdater?.checkForUpdates(); + } catch (error) { + setStatus('error'); + setErrorMessage(error instanceof Error ? error.message : 'Failed to check for updates'); + } + })(); }; - const handleDownload = async () => { + const handleDownload = (): void => { if (!window.autoUpdater) { return; } - try { - setStatus('downloading'); - setErrorMessage(''); - await window.autoUpdater.downloadUpdate(); - } catch (error) { - setStatus('error'); - setErrorMessage(error instanceof Error ? error.message : 'Failed to download update'); - } + void (async () => { + try { + setStatus('downloading'); + setErrorMessage(''); + await window.autoUpdater?.downloadUpdate(); + } catch (error) { + setStatus('error'); + setErrorMessage(error instanceof Error ? error.message : 'Failed to download update'); + } + })(); }; - const handleInstall = async () => { + const handleInstall = (): void => { if (!window.autoUpdater) { return; } - try { - await window.autoUpdater.quitAndInstall(); - } catch (error) { - setStatus('error'); - setErrorMessage(error instanceof Error ? error.message : 'Failed to install update'); - } + void (async () => { + try { + await window.autoUpdater?.quitAndInstall(); + } catch (error) { + setStatus('error'); + setErrorMessage(error instanceof Error ? error.message : 'Failed to install update'); + } + })(); }; const formatBytes = (bytes: number): string => { @@ -373,7 +381,9 @@ function UpdateManager({ isOpen, onClose }: UpdateManagerProps) {
+ {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions -- stopPropagation prevents overlay close */}
e.stopPropagation()} diff --git a/src/components/MapNavigator.tsx b/src/components/MapNavigator.tsx index bddeb4c0..7d00bde3 100644 --- a/src/components/MapNavigator.tsx +++ b/src/components/MapNavigator.tsx @@ -1,7 +1,8 @@ import type React from 'react'; -import { useState } from 'react'; +import { useState, useRef, useEffect } from 'react'; import { useGameStore } from '../store/gameStore'; +import { useUiStore } from '../store/uiStore'; import { rollForMessage } from '../utils/systemMessages'; /** @@ -10,6 +11,7 @@ import { rollForMessage } from '../utils/systemMessages'; * Provides UI for managing maps within the current campaign. * Allows switching active map, creating new maps, and deleting maps. */ +// eslint-disable-next-line max-lines-per-function function MapNavigator(): React.ReactElement | null { const campaign = useGameStore((state) => state.campaign); const activeMapId = useGameStore((state) => state.campaign.activeMapId); @@ -17,17 +19,25 @@ function MapNavigator(): React.ReactElement | null { const switchMap = useGameStore((state) => state.switchMap); const deleteMap = useGameStore((state) => state.deleteMap); const renameMap = useGameStore((state) => state.renameMap); - const showConfirmDialog = useGameStore((state) => state.showConfirmDialog); + const showConfirmDialog = useUiStore((state) => state.showConfirmDialog); const [editingMapId, setEditingMapId] = useState(null); const [editName, setEditName] = useState(''); + const editInputRef = useRef(null); - const handleStartEdit = (id: string, currentName: string) => { + // Focus the rename input when editing starts (replaces autoFocus for a11y) + useEffect(() => { + if (editingMapId) { + editInputRef.current?.focus(); + } + }, [editingMapId]); + + const handleStartEdit = (id: string, currentName: string): void => { setEditingMapId(id); setEditName(currentName); }; - const handleFinishEdit = () => { + const handleFinishEdit = (): void => { if (!editingMapId) { return; } @@ -37,7 +47,7 @@ function MapNavigator(): React.ReactElement | null { // Prevent renaming to an empty or whitespace-only name. if (!newName) { // Revert to the original name if available. - const originalMap = campaign && campaign.maps ? campaign.maps[editingMapId] : undefined; + const originalMap = campaign?.maps ? campaign.maps[editingMapId] : undefined; if (originalMap) { setEditName(originalMap.name); } @@ -49,7 +59,7 @@ function MapNavigator(): React.ReactElement | null { setEditingMapId(null); }; - const handleKeyDown = (e: React.KeyboardEvent) => { + const handleKeyDown = (e: React.KeyboardEvent): void => { if (e.key === 'Enter') { handleFinishEdit(); } else if (e.key === 'Escape') { @@ -57,7 +67,7 @@ function MapNavigator(): React.ReactElement | null { } }; - const handleDelete = (e: React.MouseEvent, id: string, name: string) => { + const handleDelete = (e: React.MouseEvent, id: string, name: string): void => { e.stopPropagation(); showConfirmDialog( rollForMessage('CONFIRM_MAP_DELETE', { mapName: name }), @@ -114,8 +124,9 @@ function MapNavigator(): React.ReactElement | null { onChange={(e) => setEditName(e.target.value)} onBlur={handleFinishEdit} onKeyDown={handleKeyDown} + ref={editInputRef} className="bg-[var(--app-bg-base)] text-[var(--app-text-primary)] px-1 rounded w-full border border-[var(--app-border-default)] text-sm" - autoFocus + aria-label={`Rename ${map.name}`} onClick={(e) => e.stopPropagation()} /> ) : ( @@ -132,7 +143,7 @@ function MapNavigator(): React.ReactElement | null { )} -
+
- + +
diff --git a/src/components/MobileBottomSheet.tsx b/src/components/Mobile/MobileBottomSheet.tsx similarity index 92% rename from src/components/MobileBottomSheet.tsx rename to src/components/Mobile/MobileBottomSheet.tsx index d64c1371..f0bf45be 100644 --- a/src/components/MobileBottomSheet.tsx +++ b/src/components/Mobile/MobileBottomSheet.tsx @@ -26,12 +26,16 @@ interface MobileBottomSheetProps { children: React.ReactNode; } -function MobileBottomSheet({ isOpen, onClose, children }: MobileBottomSheetProps) { +function MobileBottomSheet({ + isOpen, + onClose, + children, +}: MobileBottomSheetProps): React.JSX.Element | null { const sheetRef = useRef(null); // Close on Escape key useEffect(() => { - const handleEscape = (e: KeyboardEvent) => { + const handleEscape = (e: KeyboardEvent): void => { if (e.key === 'Escape' && isOpen) { onClose(); } @@ -64,7 +68,7 @@ function MobileBottomSheet({ isOpen, onClose, children }: MobileBottomSheetProps {/* Backdrop */}
{ + onClick={(e): void => { e.stopPropagation(); onClose(); }} diff --git a/src/components/MobileSidebarDrawer.tsx b/src/components/Mobile/MobileSidebarDrawer.tsx similarity index 92% rename from src/components/MobileSidebarDrawer.tsx rename to src/components/Mobile/MobileSidebarDrawer.tsx index bfb33bd5..0e24c717 100644 --- a/src/components/MobileSidebarDrawer.tsx +++ b/src/components/Mobile/MobileSidebarDrawer.tsx @@ -25,12 +25,16 @@ interface MobileSidebarDrawerProps { children: React.ReactNode; } -function MobileSidebarDrawer({ isOpen, onClose, children }: MobileSidebarDrawerProps) { +function MobileSidebarDrawer({ + isOpen, + onClose, + children, +}: MobileSidebarDrawerProps): React.JSX.Element | null { const drawerRef = useRef(null); // Close on Escape key useEffect(() => { - const handleEscape = (e: KeyboardEvent) => { + const handleEscape = (e: KeyboardEvent): void => { if (e.key === 'Escape' && isOpen) { onClose(); } diff --git a/src/components/MobileToolbar.tsx b/src/components/Mobile/MobileToolbar.tsx similarity index 93% rename from src/components/MobileToolbar.tsx rename to src/components/Mobile/MobileToolbar.tsx index 4df5cb0d..9937667f 100644 --- a/src/components/MobileToolbar.tsx +++ b/src/components/Mobile/MobileToolbar.tsx @@ -40,19 +40,22 @@ import { RiMoreLine, } from '@remixicon/react'; -import { useGameStore } from '../store/gameStore'; +import { useUiStore } from '../../store/uiStore'; + +import type { HexColor } from '../../types/domain'; interface MobileToolbarProps { tool: 'select' | 'marker' | 'eraser' | 'wall' | 'door' | 'measure'; setTool: (tool: 'select' | 'marker' | 'eraser' | 'wall' | 'door' | 'measure') => void; - color: string; - setColor: (color: string) => void; + color: HexColor; + setColor: (color: HexColor) => void; doorOrientation?: 'horizontal' | 'vertical'; setDoorOrientation?: (orientation: 'horizontal' | 'vertical') => void; isGamePaused: boolean; onPauseToggle: () => void; } +// eslint-disable-next-line max-lines-per-function, complexity function MobileToolbar({ tool, setTool, @@ -62,21 +65,21 @@ function MobileToolbar({ setDoorOrientation, isGamePaused, onPauseToggle, -}: MobileToolbarProps) { +}: MobileToolbarProps): React.JSX.Element { const [showMoreMenu, setShowMoreMenu] = useState(false); const colorInputRef = useRef(null); // Close menu when clicking outside - const handleMoreClick = () => { + const handleMoreClick = (): void => { setShowMoreMenu(!showMoreMenu); }; - const handleDungeonGen = () => { - useGameStore.getState().showDungeonDialog(); + const handleDungeonGen = (): void => { + useUiStore.getState().showDungeonDialog(); setShowMoreMenu(false); }; - const handleWorldView = () => { + const handleWorldView = (): void => { const ipcRenderer = window.ipcRenderer; if (ipcRenderer) { // Electron: Use IPC to create separate window @@ -89,7 +92,7 @@ function MobileToolbar({ setShowMoreMenu(false); }; - const handleColorPicker = () => { + const handleColorPicker = (): void => { colorInputRef.current?.click(); setShowMoreMenu(false); }; @@ -100,7 +103,11 @@ function MobileToolbar({ {showMoreMenu && ( <> {/* Backdrop */} -
setShowMoreMenu(false)} /> +
setShowMoreMenu(false)} + role="presentation" + /> {/* Menu */}
setColor(e.target.value)} + onChange={(e) => setColor(e.target.value as HexColor)} className="hidden" /> diff --git a/src/components/PreferencesDialog.tsx b/src/components/PreferencesDialog.tsx deleted file mode 100644 index 65d887be..00000000 --- a/src/components/PreferencesDialog.tsx +++ /dev/null @@ -1,675 +0,0 @@ -/** - * Preferences Dialog Component - * - * Displays a modal dialog for configuring application preferences. - * Currently includes Wall Tool settings for path smoothing and geometry fusing. - * - * **Features:** - * - Modal overlay with focus trap - * - Real-time preference updates - * - Reset to defaults button - * - Keyboard support (Escape to close) - * - Accessible with ARIA attributes - * - Persists settings to localStorage via Zustand - * - * **Wall Tool Preferences:** - * - Path Smoothing (RDP algorithm) - Enable/disable and adjust epsilon - * - Geometry Snapping/Fusing - Enable/disable and adjust snap threshold - * - * @component - * @returns {JSX.Element | null} Preferences dialog or null if not active - */ - -import { useEffect } from 'react'; - -import { usePreferencesStore } from '../store/preferencesStore'; -import { useTouchSettingsStore } from '../store/touchSettingsStore'; - -import type { PressureCurve, PalmRejectionMode } from '../store/touchSettingsStore'; - -interface PreferencesDialogProps { - isOpen: boolean; - onClose: () => void; -} - -function PreferencesDialog({ isOpen, onClose }: PreferencesDialogProps) { - const { wallTool, setWallToolPreference, resetWallToolPreferences } = usePreferencesStore(); - const touchSettings = useTouchSettingsStore(); - - // Handle keyboard events - useEffect(() => { - if (!isOpen) { - return; - } - - const handleKeyDown = (e: KeyboardEvent) => { - if (e.key === 'Escape') { - onClose(); - } - }; - - window.addEventListener('keydown', handleKeyDown); - return () => window.removeEventListener('keydown', handleKeyDown); - }, [isOpen, onClose]); - - if (!isOpen) { - return null; - } - - const handleReset = () => { - resetWallToolPreferences(); - touchSettings.resetToDefaults(); - }; - - return ( -
-
e.stopPropagation()} - > -
-

- Preferences -

- -
- - {/* Wall Tool Section */} -
-

- Wall Tool -

- - {/* Path Smoothing */} -
-
- - setWallToolPreference('enableSmoothing', e.target.checked)} - className="w-5 h-5 cursor-pointer" - /> -
-

- Automatically smooths hand-drawn walls to eliminate jitter and improve Line of Sight - calculations. Uses the Ramer-Douglas-Peucker algorithm. -

- - {wallTool.enableSmoothing && ( -
-
- - - {wallTool.smoothingEpsilon.toFixed(1)}px - -
- - setWallToolPreference('smoothingEpsilon', parseFloat(e.target.value)) - } - className="w-full cursor-pointer" - /> -
- Subtle (0.5) - Aggressive (10) -
-
- )} -
- - {/* Geometry Snapping */} -
-
- - setWallToolPreference('enableSnapping', e.target.checked)} - className="w-5 h-5 cursor-pointer" - /> -
-

- Automatically snaps new wall endpoints to existing walls when drawn nearby, creating - clean, connected wall networks. -

- - {wallTool.enableSnapping && ( -
-
- - - {wallTool.snapThreshold}px - -
- setWallToolPreference('snapThreshold', parseInt(e.target.value))} - className="w-full cursor-pointer" - /> -
- Precise (5px) - Loose (30px) -
-
- )} -
-
- - {/* Touch & Stylus Section */} -
-

- Touch & Stylus -

- - {/* Desktop-Only Mode */} -
-
- - - touchSettings.updateSettings({ desktopOnlyMode: e.target.checked }) - } - className="w-5 h-5 cursor-pointer" - /> -
-

- Disable all touch input (useful for hybrid laptops to prevent accidental touches). - Only mouse and trackpad input will work. -

-
- - {/* Pressure Sensitivity */} -
-
- - - touchSettings.updateSettings({ pressureSensitivityEnabled: e.target.checked }) - } - className="w-5 h-5 cursor-pointer" - disabled={touchSettings.desktopOnlyMode} - /> -
-

- Vary stroke width based on stylus pressure (requires pressure-capable pen or stylus). - Lighter touch = thin lines, heavier touch = thick lines. -

- - {touchSettings.pressureSensitivityEnabled && !touchSettings.desktopOnlyMode && ( -
-
- - - {touchSettings.pressureCurve} - -
- -

- Light = More dramatic variation • Heavy = Subtle variation -

-
- )} -
- - {/* Palm Rejection */} -
-
- - -
-

- Prevent accidental palm touches when using a stylus on tablets. -

- - {touchSettings.palmRejectionMode === 'touchSize' && !touchSettings.desktopOnlyMode && ( -
-
- - - {touchSettings.palmRejectionThreshold}px - -
- - touchSettings.updateSettings({ - palmRejectionThreshold: parseInt(e.target.value), - }) - } - className="w-full cursor-pointer" - /> -
- Lenient (20px) - Strict (80px) -
-
- )} - - {touchSettings.palmRejectionMode === 'smartDelay' && !touchSettings.desktopOnlyMode && ( -
-
- - - {touchSettings.palmRejectionDelay}ms - -
- - touchSettings.updateSettings({ palmRejectionDelay: parseInt(e.target.value) }) - } - className="w-full cursor-pointer" - /> -
- Quick (100ms) - Conservative (1000ms) -
-
- )} -
- - {/* Gesture Configuration */} -
-
- - - touchSettings.updateSettings({ twoFingerPanEnabled: e.target.checked }) - } - className="w-5 h-5 cursor-pointer" - disabled={touchSettings.desktopOnlyMode} - /> -
-

- Enable two-finger panning alongside pinch-zoom. When disabled, only pinch-zoom works. -

-
- - {/* Advanced Stylus Features */} -
-

- Advanced Stylus Features -

- -
-
- - - touchSettings.updateSettings({ tiltSensitivityEnabled: e.target.checked }) - } - className="w-4 h-4 cursor-pointer" - disabled={touchSettings.desktopOnlyMode} - /> -
- -
- - - touchSettings.updateSettings({ hoverPreviewEnabled: e.target.checked }) - } - className="w-4 h-4 cursor-pointer" - disabled={touchSettings.desktopOnlyMode} - /> -
- -
- - - touchSettings.updateSettings({ barrelButtonEnabled: e.target.checked }) - } - className="w-4 h-4 cursor-pointer" - disabled={touchSettings.desktopOnlyMode} - /> -
-
-
- - {/* Visual Feedback */} -
-

- Visual Feedback -

- -
-
- - - touchSettings.updateSettings({ showPressureIndicator: e.target.checked }) - } - className="w-4 h-4 cursor-pointer" - disabled={touchSettings.desktopOnlyMode} - /> -
- -
- - - touchSettings.updateSettings({ showTouchPointIndicators: e.target.checked }) - } - className="w-4 h-4 cursor-pointer" - disabled={touchSettings.desktopOnlyMode} - /> -
- -
- - - touchSettings.updateSettings({ showGestureFeedback: e.target.checked }) - } - className="w-4 h-4 cursor-pointer" - disabled={touchSettings.desktopOnlyMode} - /> -
-
-
- - {/* Tutorial & Hints */} -
-

- Tutorial & Hints -

- -
-
- - - touchSettings.updateSettings({ showGestureTutorial: e.target.checked }) - } - className="w-4 h-4 cursor-pointer" - disabled={touchSettings.desktopOnlyMode} - /> -
- -
- - - touchSettings.updateSettings({ showGestureHints: e.target.checked }) - } - className="w-4 h-4 cursor-pointer" - disabled={touchSettings.desktopOnlyMode} - /> -
-
-
-
- - {/* Footer Buttons */} -
- - -
-
-
- ); -} - -export default PreferencesDialog; diff --git a/src/components/QuickTokenSidebar.test.tsx b/src/components/QuickTokenSidebar.test.tsx index 1256c9fb..8efa390f 100644 --- a/src/components/QuickTokenSidebar.test.tsx +++ b/src/components/QuickTokenSidebar.test.tsx @@ -1,7 +1,7 @@ import { describe, it, expect, vi, beforeEach } from 'vitest'; import { render, screen, fireEvent } from '@testing-library/react'; import QuickTokenSidebar from './QuickTokenSidebar'; -import { TokenLibraryItem } from '../store/gameStore'; +import type { TokenLibraryItem } from '../types/domain'; describe('QuickTokenSidebar', () => { const mockOnDragStart = vi.fn(); diff --git a/src/components/QuickTokenSidebar.tsx b/src/components/QuickTokenSidebar.tsx index e40e28b6..18bf6096 100644 --- a/src/components/QuickTokenSidebar.tsx +++ b/src/components/QuickTokenSidebar.tsx @@ -20,12 +20,14 @@ import { RiUser3Line } from '@remixicon/react'; import Tooltip from './Tooltip'; -import type { TokenLibraryItem } from '../store/gameStore'; +import type { TokenLibraryItem } from '../types/domain'; interface QuickTokenSidebarProps { recentTokens: TokenLibraryItem[]; playerTokens: TokenLibraryItem[]; onDragStart: (e: React.DragEvent, type: string, src: string, libraryItemId?: string) => void; + /** Optional callback when a token is activated via keyboard (Enter/Space) */ + onTokenActivate?: (type: string, src: string, libraryItemId?: string) => void; } /** @@ -35,12 +37,13 @@ function QuickTokenSidebar({ recentTokens, playerTokens, onDragStart, + onTokenActivate, }: QuickTokenSidebarProps): React.ReactElement { /** * Handles drag start for the generic token placeholder * Creates a special payload with a placeholder type */ - const handleGenericTokenDragStart = (e: React.DragEvent) => { + const handleGenericTokenDragStart = (e: React.DragEvent): void => { // Create a generic token payload with a placeholder identifier const genericTokenData = { type: 'GENERIC_TOKEN', @@ -76,6 +79,7 @@ function QuickTokenSidebar({ document.body.removeChild(div); } catch (error) { // Safe no-op: drag helper is already gone or cannot be removed + // eslint-disable-next-line no-console console.debug('Drag helper cleanup failed:', error); } } @@ -99,7 +103,16 @@ function QuickTokenSidebar({
onDragStart(e, 'LIBRARY_TOKEN', token.src, token.id)} + onKeyDown={(e) => { + if (e.key === 'Enter' || e.key === ' ') { + e.preventDefault(); + onTokenActivate?.('LIBRARY_TOKEN', token.src, token.id); + } + }} > { + if (e.key === 'Enter' || e.key === ' ') { + e.preventDefault(); + onTokenActivate?.('GENERIC_TOKEN', ''); + } + }} > onDragStart(e, 'LIBRARY_TOKEN', token.src, token.id)} + onKeyDown={(e) => { + if (e.key === 'Enter' || e.key === ' ') { + e.preventDefault(); + onTokenActivate?.('LIBRARY_TOKEN', token.src, token.id); + } + }} > */ -function ResourceMonitor() { +// eslint-disable-next-line max-lines-per-function, complexity +function ResourceMonitor(): React.JSX.Element { const [metrics, setMetrics] = useState({ fps: 0, memory: null, @@ -72,7 +74,7 @@ function ResourceMonitor() { // FPS tracking const frameCountRef = useRef(0); const lastFrameTimeRef = useRef(Date.now()); - const fpsUpdateIntervalRef = useRef(); + const fpsUpdateIntervalRef = useRef | undefined>(undefined); // IPC tracking const ipcMessageCountRef = useRef(0); @@ -90,7 +92,7 @@ function ResourceMonitor() { useEffect(() => { let animationFrameId: number; - const countFrame = () => { + const countFrame = (): void => { frameCountRef.current++; animationFrameId = requestAnimationFrame(countFrame); }; @@ -122,11 +124,20 @@ function ResourceMonitor() { * Updates every 500ms */ useEffect(() => { - const updateMetrics = () => { + const updateMetrics = (): void => { // Memory API (Chrome/Edge only) + interface ChromeMemory { + usedJSHeapSize: number; + totalJSHeapSize: number; + jsHeapSizeLimit: number; + } + interface ChromePerformance extends Performance { + memory?: ChromeMemory; + } let memory = null; - if ('memory' in performance && (performance as any).memory) { - const mem = (performance as any).memory; + const chromePerf = performance as ChromePerformance; + if ('memory' in performance && chromePerf.memory) { + const mem = chromePerf.memory; memory = { used: mem.usedJSHeapSize, total: mem.totalJSHeapSize, @@ -199,8 +210,12 @@ function ResourceMonitor() { return; } - let originalSend: any; - let originalOn: any; + type IpcSendFn = (channel: string, ...args: unknown[]) => void; + type IpcListenerFn = (event: unknown, ...args: unknown[]) => void; + type IpcOnFn = (channel: string, listener: IpcListenerFn) => void; + + let originalSend: IpcSendFn | undefined; + let originalOn: IpcOnFn | undefined; let isTracking = true; try { @@ -210,7 +225,7 @@ function ResourceMonitor() { originalOn = window.ipcRenderer.on; // Intercept send (outgoing messages) - window.ipcRenderer.send = function (channel: string, ...args: any[]) { + window.ipcRenderer.send = function (channel: string, ...args: unknown[]): void { if (isTracking) { try { ipcMessageCountRef.current++; @@ -222,7 +237,7 @@ function ResourceMonitor() { console.warn('[ResourceMonitor] Failed to track IPC send:', err); } } - return originalSend.call(this, channel, ...args); + originalSend?.call(this, channel, ...args); }; // Intercept on (incoming messages) @@ -238,8 +253,8 @@ function ResourceMonitor() { // To fix this, implement a WeakMap to maintain original-to-wrapped listener mappings: // const listenerMap = new WeakMap(); // Then store the mapping and use it for proper cleanup in the `off()` interceptor. - window.ipcRenderer.on = function (channel: string, listener: any) { - const wrappedListener = (...args: any[]) => { + window.ipcRenderer.on = function (channel: string, listener: IpcListenerFn): void { + const wrappedListener = (event: unknown, ...args: unknown[]): void => { if (isTracking) { try { ipcMessageCountRef.current++; @@ -250,9 +265,9 @@ function ResourceMonitor() { console.warn('[ResourceMonitor] Failed to track IPC receive:', err); } } - listener(...args); + listener(event, ...args); }; - return originalOn.call(this, channel, wrappedListener); + originalOn?.call(this, channel, wrappedListener); }; } catch (err) { console.error('[ResourceMonitor] Failed to intercept IPC methods:', err); @@ -296,12 +311,12 @@ function ResourceMonitor() { */ const getFPSColor = (fps: number): string => { if (fps >= 55) { - return '#4CAF50'; + return 'var(--app-monitor-fps-good)'; } // Green if (fps >= 30) { - return '#FFC107'; + return 'var(--app-monitor-fps-medium)'; } // Yellow - return '#f44336'; // Red + return 'var(--app-monitor-fps-low)'; // Red }; /** @@ -320,8 +335,8 @@ function ResourceMonitor() { position: 'fixed', bottom: '20px', right: '20px', - backgroundColor: 'rgba(0, 0, 0, 0.85)', - color: '#fff', + backgroundColor: 'var(--app-monitor-bg)', + color: 'var(--app-monitor-text)', padding: '12px', borderRadius: '8px', fontFamily: 'monospace', @@ -329,7 +344,7 @@ function ResourceMonitor() { zIndex: 9999, minWidth: isExpanded ? '280px' : '120px', boxShadow: '0 4px 12px rgba(0,0,0,0.5)', - border: '1px solid rgba(255,255,255,0.1)', + border: '1px solid var(--app-monitor-border)', }} > {/* Header */} @@ -339,7 +354,7 @@ function ResourceMonitor() { justifyContent: 'space-between', alignItems: 'center', marginBottom: isExpanded ? '10px' : '0', - borderBottom: isExpanded ? '1px solid rgba(255,255,255,0.2)' : 'none', + borderBottom: isExpanded ? '1px solid var(--app-monitor-divider)' : 'none', paddingBottom: isExpanded ? '8px' : '0', }} > @@ -349,7 +364,7 @@ function ResourceMonitor() { style={{ background: 'none', border: 'none', - color: '#fff', + color: 'var(--app-monitor-text)', cursor: 'pointer', fontSize: '16px', padding: '0 4px', @@ -366,7 +381,15 @@ function ResourceMonitor() {
FPS: {metrics.fps} {metrics.fps < 55 && ( - ⚠️ Low + + ⚠️ Low + )}
@@ -374,14 +397,14 @@ function ResourceMonitor() { {metrics.memory && (
Memory: {formatBytes(metrics.memory.used)}
-
+
{getMemoryPercent()}% of {formatBytes(metrics.memory.limit)}
80 ? '#f44336' : '#4CAF50', + backgroundColor: + getMemoryPercent() > 80 + ? 'var(--app-monitor-memory-high)' + : 'var(--app-monitor-memory-ok)', transition: 'width 0.3s', }} /> @@ -410,14 +436,20 @@ function ResourceMonitor() { style={{ marginBottom: '8px', fontSize: '11px', - borderTop: '1px solid rgba(255,255,255,0.1)', + borderTop: '1px solid var(--app-monitor-border)', paddingTop: '8px', }} >
IPC Messages: {metrics.ipcMessageCount}/sec
IPC Bandwidth: {formatBytes(metrics.ipcBandwidth)}/s
{metrics.ipcBandwidth > 100000 && ( -
+
⚠️ High bandwidth (check delta sync)
)} @@ -427,7 +459,9 @@ function ResourceMonitor() {
Active Workers: {metrics.activeWorkers}
{metrics.activeWorkers > 2 && ( -
+
⚠️ Possible worker leak
)} @@ -439,10 +473,10 @@ function ResourceMonitor() { style={{ marginTop: '8px', padding: '6px', - backgroundColor: 'rgba(255, 193, 7, 0.2)', + backgroundColor: 'var(--app-monitor-warning-bg)', borderRadius: '4px', fontSize: '10px', - borderLeft: '2px solid #FFC107', + borderLeft: '2px solid var(--app-monitor-warning-accent)', }} > ⚠️ Performance Issues Detected: @@ -459,7 +493,7 @@ function ResourceMonitor() { style={{ marginTop: '8px', fontSize: '10px', - color: '#666', + color: 'var(--app-monitor-muted)', textAlign: 'right', }} > diff --git a/src/components/Sidebar.test.tsx b/src/components/Sidebar.test.tsx index f643f570..ecd7298b 100644 --- a/src/components/Sidebar.test.tsx +++ b/src/components/Sidebar.test.tsx @@ -2,6 +2,7 @@ import { describe, it, expect, vi, beforeEach } from 'vitest'; import { render, screen, fireEvent, waitFor } from '@testing-library/react'; import Sidebar from './Sidebar'; import { useGameStore } from '../store/gameStore'; +import { useUiStore } from '../store/uiStore'; import * as AssetProcessor from '../utils/AssetProcessor'; import { rollForMessage } from '../utils/systemMessages'; @@ -21,7 +22,6 @@ describe('Sidebar - Map Upload Error Handling', () => { vi.mocked(rollForMessage).mockReturnValue('Failed to upload map'); // Reset store useGameStore.setState({ - toast: null, map: null, gridType: 'LINES', isCalibrating: false, @@ -50,7 +50,7 @@ describe('Sidebar - Map Upload Error Handling', () => { fireEvent.change(fileInput, { target: { files: [file] } }); await waitFor(() => { - const state = useGameStore.getState(); + const state = useUiStore.getState(); expect(state.toast).not.toBeNull(); expect(state.toast?.type).toBe('error'); expect(state.toast?.message).toContain('Failed to upload map'); @@ -100,7 +100,7 @@ describe('Sidebar - Map Upload Error Handling', () => { fireEvent.change(fileInput, { target: { files: [file] } }); await waitFor(() => { - const state = useGameStore.getState(); + const state = useUiStore.getState(); expect(state.toast).not.toBeNull(); expect(state.toast?.type).toBe('error'); expect(state.toast?.message).toBe('Failed to upload map'); @@ -140,7 +140,6 @@ describe('Sidebar - Token Drag and Drop', () => { libraryItemId: 'token-1', }, ], - toast: null, }); }); diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx index c04d28bc..6ad25ed6 100644 --- a/src/components/Sidebar.tsx +++ b/src/components/Sidebar.tsx @@ -49,7 +49,8 @@ * @component */ -import React, { useRef, useState, useEffect } from 'react'; +import type React from 'react'; +import { useRef, useState, useEffect, useCallback, useMemo, memo } from 'react'; import { RiArrowLeftSLine, @@ -62,18 +63,20 @@ import { } from '@remixicon/react'; import { useGameStore } from '../store/gameStore'; +import { useUiStore } from '../store/uiStore'; import { processImage } from '../utils/AssetProcessor'; import AddToLibraryDialog from './AssetLibrary/AddToLibraryDialog'; import LibraryManager from './AssetLibrary/LibraryManager'; import CollapsibleSection from './CollapsibleSection'; import DoorControls from './DoorControls'; +import { QuickTokenSidebarErrorBoundary } from './ErrorBoundaries/QuickTokenSidebarErrorBoundary'; import MapSettingsSheet from './MapSettingsSheet'; -import MobileSidebarDrawer from './MobileSidebarDrawer'; +import MobileSidebarDrawer from './Mobile/MobileSidebarDrawer'; import QuickTokenSidebar from './QuickTokenSidebar'; -import { QuickTokenSidebarErrorBoundary } from './QuickTokenSidebarErrorBoundary'; import Tooltip from './Tooltip'; import { useCommandPalette } from '../hooks/useCommandPalette'; import { useIsMobile } from '../hooks/useMediaQuery'; +import { snapToGrid } from '../utils/grid'; import { rollForMessage } from '../utils/systemMessages'; import { getRecentTokens, getPlayerTokens, deduplicatePlayerTokens } from '../utils/tokenUtils'; @@ -82,27 +85,31 @@ import type { ProcessingHandle } from '../utils/AssetProcessor'; /** * Sidebar component provides map upload, grid settings, and token library */ -function Sidebar() { +// eslint-disable-next-line max-lines-per-function +function Sidebar(): React.JSX.Element { // Store selectors const campaign = useGameStore((state) => state.campaign); const activeMapId = useGameStore((state) => state.campaign.activeMapId); const switchMap = useGameStore((state) => state.switchMap); const tokenLibrary = useGameStore((state) => state.campaign.tokenLibrary); - const showToast = useGameStore((state) => state.showToast); const tokens = useGameStore((state) => state.tokens); + const gridSize = useGameStore((state) => state.gridSize); + const gridType = useGameStore((state) => state.gridType); + const addToken = useGameStore((state) => state.addToken); + const showToast = useUiStore((state) => state.showToast); // Get recent tokens (last 3 unique tokens placed on the map) - const recentTokens = React.useMemo(() => { + const recentTokens = useMemo(() => { return getRecentTokens(tokens, tokenLibrary); }, [tokens, tokenLibrary]); // Get player tokens from library (up to 5) - const playerTokens = React.useMemo(() => { + const playerTokens = useMemo(() => { return getPlayerTokens(tokenLibrary, 5); }, [tokenLibrary]); // Deduplicate player tokens (remove any that appear in recent history) - const deduplicatedPlayerTokens = React.useMemo(() => { + const deduplicatedPlayerTokens = useMemo(() => { return deduplicatePlayerTokens(playerTokens, recentTokens); }, [playerTokens, recentTokens]); @@ -132,8 +139,8 @@ function Sidebar() { // Mobile drawer state const isMobile = useIsMobile(); - const isMobileDrawerOpen = useGameStore((state) => state.isMobileSidebarOpen); - const setMobileDrawerOpen = useGameStore((state) => state.setMobileSidebarOpen); + const isMobileDrawerOpen = useUiStore((state) => state.isMobileSidebarOpen); + const setMobileDrawerOpen = useUiStore((state) => state.setMobileSidebarOpen); // Reset sidebar collapse state when switching to mobile useEffect(() => { @@ -156,7 +163,7 @@ function Sidebar() { type: string, src: string, libraryItemId?: string, - ) => { + ): void => { e.dataTransfer.setData('application/json', JSON.stringify({ type, src, libraryItemId })); // Create custom drag image @@ -187,10 +194,44 @@ function Sidebar() { document.body.removeChild(div); }, 100); }; + + /** + * Handles keyboard activation of tokens (Enter/Space on sidebar items). + * Places the token at the center of the visible canvas area. + */ + const handleTokenActivate = useCallback( + (type: string, src: string, libraryItemId?: string) => { + // Place token at canvas center (0, 0 world coords, snapped to grid) + const { x, y } = snapToGrid(0, 0, gridSize, gridType); + + if (type === 'LIBRARY_TOKEN' && libraryItemId) { + addToken({ + id: crypto.randomUUID(), + x, + y, + src, + libraryItemId, + }); + } else if (type === 'GENERIC_TOKEN') { + addToken({ + id: crypto.randomUUID(), + x, + y, + src: '', + name: 'Generic Token', + type: 'NPC', + scale: 1, + }); + } + showToast('Token placed at map origin', 'success'); + }, + [gridSize, gridType, addToken, showToast], + ); + /** * Handles token image upload and addition to library */ - const handleTokenUpload = async (e: React.ChangeEvent) => { + const handleTokenUpload = async (e: React.ChangeEvent): Promise => { const file = e.target.files?.[0]; if (!file) { return; @@ -219,7 +260,7 @@ function Sidebar() { setPendingLibraryImage({ src, blob, - name: file.name.split('.')[0] || 'New Token', + name: file.name.split('.')[0] ?? 'New Token', }); setIsAddToLibraryOpen(true); } catch (err) { @@ -233,10 +274,17 @@ function Sidebar() { const maps = Object.values(campaign.maps).sort((a, b) => a.name.localeCompare(b.name)); + let sidebarWidthClass = 'w-64 shrink-0'; + if (isMobile) { + sidebarWidthClass = 'w-full h-full'; + } else if (isSidebarCollapsed) { + sidebarWidthClass = 'w-16 shrink-0'; + } + // Sidebar content (same for mobile and desktop) const sidebarContent = (
{/* Header Section */}
@@ -316,7 +364,7 @@ function Sidebar() { setMapSettingsMode('EDIT'); setIsMapSettingsOpen(true); }} - className="p-1 opacity-0 group-hover:opacity-100 hover:text-[var(--app-accent-text)] transition-opacity" + className="p-1 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 focus:opacity-100 hover:text-[var(--app-accent-text)] transition-opacity" aria-label={`Edit ${map.name}`} > @@ -362,7 +410,7 @@ function Sidebar() { accept="image/*" ref={tokenInputRef} className="hidden" - onChange={handleTokenUpload} + onChange={(e) => void handleTokenUpload(e)} />
{/* Save to Library Button */} + {/* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */} {selectedTokens.length === 1 && selectedTokens[0]!.libraryItemId && (
)} diff --git a/src/components/Toolbar.tsx b/src/components/Toolbar.tsx new file mode 100644 index 00000000..18811821 --- /dev/null +++ b/src/components/Toolbar.tsx @@ -0,0 +1,231 @@ +import type React from 'react'; +/** + * Toolbar — Desktop floating toolbar for tool selection and game controls + * + * Renders the bottom-center toolbar with tool buttons, measurement controls, + * play/pause toggle, and floating color palette (when marker tool is active). + * Only rendered in Architect View on desktop (not mobile — see MobileToolbar). + * + * @see src/hooks/useToolState.ts for tool state management + * @see src/components/Mobile/MobileToolbar.tsx for mobile equivalent + */ + +import { + RiPlayFill, + RiPauseFill, + RiCursorLine, + RiPencilLine, + RiEraserLine, + RiLayoutMasonryLine, + RiDoorOpenLine, + RiRulerLine, +} from '@remixicon/react'; + +import Tooltip from './Tooltip'; + +import type { UseToolStateReturn } from '../hooks/useToolState'; +import type { HexColor } from '../types/domain'; + +interface ToolbarProps { + toolState: UseToolStateReturn; + isGamePaused: boolean; + onPauseToggle: () => void; +} + +// eslint-disable-next-line max-lines-per-function, complexity +function Toolbar({ toolState, isGamePaused, onPauseToggle }: ToolbarProps): React.JSX.Element { + const { + tool, + setTool, + color, + handleColorChange, + recentColors, + colorInputRef, + doorOrientation, + setDoorOrientation, + measurementMode, + setMeasurementMode, + broadcastMeasurement, + setBroadcastMeasurement, + } = toolState; + + return ( + <> + {/* Desktop Toolbar */} +
+ {/* Play/Pause Button */} + + + +
+ {/* Select Tool */} + + + + {/* Marker Tool */} + + + + {/* Eraser Tool */} + + + + {/* Wall Tool */} + + + + {/* Door Tool */} + + + + {/* Door Orientation Toggle (only visible when door tool active) */} + {tool === 'door' && ( + + + + )} +
+ {/* Measurement Tool with Mode Selector */} +
+ + + + {tool === 'measure' && ( +
+ + + +
+ +
+ )} +
+ {/* Hidden color picker input (triggered by clicking main color circle) */} + handleColorChange(e.target.value as HexColor)} + className="hidden" + /> +
+ + {/* Floating Color Palette (appears above toolbar when marker tool active) */} + {tool === 'marker' && ( +
+ {/* Current color - Large circle */} + +
+
+ )} + + ); +} + +export default Toolbar; diff --git a/src/components/Tooltip.tsx b/src/components/Tooltip.tsx index 02b77281..c738a42d 100644 --- a/src/components/Tooltip.tsx +++ b/src/components/Tooltip.tsx @@ -20,7 +20,7 @@ interface TooltipProps { offset?: number; // Vertical offset in pixels from element (default: 50) } -function Tooltip({ content, children, delay = 100, offset = 50 }: TooltipProps) { +function Tooltip({ content, children, delay = 100, offset = 50 }: TooltipProps): React.JSX.Element { const [isVisible, setIsVisible] = useState(false); const [position, setPosition] = useState({ top: 0, left: 0 }); const timeoutRef = useRef(null); @@ -37,14 +37,14 @@ function Tooltip({ content, children, delay = 100, offset = 50 }: TooltipProps) } }, [offset]); - const handleMouseEnter = () => { + const handleMouseEnter = (): void => { timeoutRef.current = setTimeout(() => { updatePosition(); setIsVisible(true); }, delay); }; - const handleMouseLeave = () => { + const handleMouseLeave = (): void => { if (timeoutRef.current) { clearTimeout(timeoutRef.current); } diff --git a/src/components/primitives/Button.tsx b/src/components/primitives/Button.tsx new file mode 100644 index 00000000..928ffea1 --- /dev/null +++ b/src/components/primitives/Button.tsx @@ -0,0 +1,104 @@ +/** + * Button Primitive — Design system button component + * + * Provides a consistent, accessible button with 5 visual variants and 3 sizes. + * Uses theme tokens from theme.css for all colors. + * + * Variants: + * - `primary` — Main action (accent blue) + * - `secondary` — Secondary action (surface background) + * - `ghost` — Minimal/cancel (transparent background) + * - `destructive` — Dangerous action (red) + * - `tool` — Toolbar toggle (dark background, border) + * + * @example + * + * + * + */ + +import { forwardRef, type ButtonHTMLAttributes, type ReactNode } from 'react'; + +export interface ButtonProps extends ButtonHTMLAttributes { + variant: 'primary' | 'secondary' | 'ghost' | 'destructive' | 'tool'; + size?: 'sm' | 'md' | 'lg'; + isActive?: boolean; + isLoading?: boolean; + leftIcon?: ReactNode; + rightIcon?: ReactNode; +} + +const sizeClasses = { + sm: 'px-2 py-1 text-xs gap-1', + md: 'px-3 py-1.5 text-sm gap-1.5', + lg: 'px-4 py-2 text-base gap-2', +} as const; + +const variantClasses = { + primary: 'btn-primitive btn-primitive--primary', + secondary: 'btn-primitive btn-primitive--secondary', + ghost: 'btn-primitive btn-primitive--ghost', + destructive: 'btn-primitive btn-primitive--destructive', + tool: 'btn-primitive btn-primitive--tool', +} as const; + +const Button = forwardRef( + ( + { + variant, + size = 'md', + isActive = false, + isLoading = false, + leftIcon, + rightIcon, + children, + className = '', + disabled, + type = 'button', + ...rest + }, + ref, + ) => { + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing + const isDisabled = disabled || isLoading; + + return ( + + ); + }, +); + +Button.displayName = 'Button'; + +export default Button; diff --git a/src/components/primitives/Card.tsx b/src/components/primitives/Card.tsx new file mode 100644 index 00000000..9f97fb6c --- /dev/null +++ b/src/components/primitives/Card.tsx @@ -0,0 +1,55 @@ +/** + * Card Primitive — Design system surface/panel component + * + * Provides a themed container with 3 visual variants and configurable padding. + * Uses theme tokens from theme.css for all colors. + * + * Variants: + * - `surface` — Flat surface background (default) + * - `elevated` — Raised with shadow + * - `outlined` — Surface with border + * + * @example + * Content here + * Important content + */ + +import { forwardRef, type HTMLAttributes } from 'react'; + +export interface CardProps extends HTMLAttributes { + variant?: 'surface' | 'elevated' | 'outlined'; + padding?: 'none' | 'sm' | 'md' | 'lg'; +} + +const paddingClasses = { + none: '', + sm: 'p-2', + md: 'p-4', + lg: 'p-6', +} as const; + +const variantClasses = { + surface: 'card-primitive card-primitive--surface', + elevated: 'card-primitive card-primitive--elevated', + outlined: 'card-primitive card-primitive--outlined', +} as const; + +const Card = forwardRef( + ({ variant = 'surface', padding = 'md', className = '', children, ...rest }, ref) => { + return ( +
+ {children} +
+ ); + }, +); + +Card.displayName = 'Card'; + +export default Card; diff --git a/src/components/primitives/Dialog.tsx b/src/components/primitives/Dialog.tsx new file mode 100644 index 00000000..94d5c739 --- /dev/null +++ b/src/components/primitives/Dialog.tsx @@ -0,0 +1,252 @@ +/** + * Dialog Primitive — Accessible modal dialog component + * + * Provides a fully accessible modal dialog with focus management, keyboard + * navigation, and ARIA attributes. Built without external dependencies + * (ADR-003: no component library). + * + * Features: + * - Focus trap: Tab/Shift+Tab cycle within the dialog + * - Escape key closes the dialog + * - Overlay click closes (configurable via `closeOnOverlayClick`) + * - Auto-focuses first focusable element on open + * - Returns focus to trigger element on close + * - Scroll lock on body while open + * - `role="dialog"`, `aria-modal`, `aria-labelledby`, `aria-describedby` + * - Reduced-motion safe (no animations when prefers-reduced-motion) + * + * @example + * + *

Are you sure?

+ * + * + * + * + *
+ */ + +import { + forwardRef, + useEffect, + useRef, + useCallback, + useId, + type ReactNode, + type MutableRefObject, + type KeyboardEvent, + type MouseEvent, +} from 'react'; + +export interface DialogProps { + isOpen: boolean; + onClose: () => void; + title: string; + description?: string; + size?: 'sm' | 'md' | 'lg' | 'full'; + children: ReactNode; + footer?: ReactNode; + closeOnOverlayClick?: boolean; +} + +const sizeClasses = { + sm: 'dialog-primitive--sm', + md: 'dialog-primitive--md', + lg: 'dialog-primitive--lg', + full: 'dialog-primitive--full', +} as const; + +const FOCUSABLE_SELECTOR = + 'a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"])'; + +const Dialog = forwardRef( + // eslint-disable-next-line max-lines-per-function + ( + { + isOpen, + onClose, + title, + description, + size = 'md', + children, + footer, + closeOnOverlayClick = true, + }, + ref, + ) => { + const generatedId = useId(); + const titleId = `${generatedId}-title`; + const descriptionId = description ? `${generatedId}-desc` : undefined; + const dialogRef = useRef(null); + const triggerRef = useRef(null); + + // Merge forwarded ref with internal ref + const setDialogRef = useCallback( + (node: HTMLDivElement | null) => { + (dialogRef as MutableRefObject).current = node; + if (typeof ref === 'function') { + ref(node); + } else if (ref) { + ref.current = node; + } + }, + [ref], + ); + + // Store trigger element on open, restore focus on close + useEffect(() => { + if (isOpen) { + triggerRef.current = document.activeElement; + } else if (triggerRef.current) { + const trigger = triggerRef.current as HTMLElement; + if (typeof trigger.focus === 'function') { + trigger.focus(); + } + triggerRef.current = null; + } + }, [isOpen]); + + // Auto-focus first focusable element on open + useEffect(() => { + if (!isOpen || !dialogRef.current) { + return; + } + + // Small delay to ensure DOM is painted + const timer = requestAnimationFrame(() => { + if (!dialogRef.current) { + return; + } + const firstFocusable = dialogRef.current.querySelector(FOCUSABLE_SELECTOR); + if (firstFocusable) { + firstFocusable.focus(); + } else { + // If no focusable element, focus the dialog panel itself + dialogRef.current.focus(); + } + }); + + return () => cancelAnimationFrame(timer); + }, [isOpen]); + + // Scroll lock on body + useEffect(() => { + if (!isOpen) { + return; + } + + const originalOverflow = document.body.style.overflow; + document.body.style.overflow = 'hidden'; + + return () => { + document.body.style.overflow = originalOverflow; + }; + }, [isOpen]); + + // Keyboard handling: Escape + focus trap + const handleKeyDown = useCallback( + (e: KeyboardEvent) => { + if (e.key === 'Escape') { + e.stopPropagation(); + onClose(); + return; + } + + // Focus trap + if (e.key === 'Tab' && dialogRef.current) { + const focusableElements = + dialogRef.current.querySelectorAll(FOCUSABLE_SELECTOR); + if (focusableElements.length === 0) { + // No focusable children — prevent Tab from escaping the dialog + e.preventDefault(); + return; + } + + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const first = focusableElements[0]!; + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const last = focusableElements[focusableElements.length - 1]!; + + if (e.shiftKey) { + if (document.activeElement === first) { + e.preventDefault(); + last.focus(); + } + } else { + if (document.activeElement === last) { + e.preventDefault(); + first.focus(); + } + } + } + }, + [onClose], + ); + + const handleOverlayClick = useCallback( + (e: MouseEvent) => { + if (closeOnOverlayClick && e.target === e.currentTarget) { + onClose(); + } + }, + [closeOnOverlayClick, onClose], + ); + + if (!isOpen) { + return null; + } + + /* eslint-disable jsx-a11y/no-noninteractive-element-interactions -- overlay click-to-close is intentional UX */ + return ( + + ); + }, +); + +Dialog.displayName = 'Dialog'; + +export default Dialog; diff --git a/src/components/primitives/Input.tsx b/src/components/primitives/Input.tsx new file mode 100644 index 00000000..1d180199 --- /dev/null +++ b/src/components/primitives/Input.tsx @@ -0,0 +1,62 @@ +/** + * Input Primitive — Design system text input component + * + * Provides a themed, accessible text input with optional label, error, and helper text. + * Uses theme tokens from theme.css for all colors. + * + * @example + * setName(e.target.value)} /> + * + * + */ + +import { forwardRef, useId, type InputHTMLAttributes } from 'react'; + +export interface InputProps extends InputHTMLAttributes { + label?: string; + error?: string; + helperText?: string; +} + +const Input = forwardRef( + ({ label, error, helperText, className = '', id, ...rest }, ref) => { + const generatedId = useId(); + const inputId = id ?? generatedId; + const errorId = error ? `${inputId}-error` : undefined; + const helperId = helperText && !error ? `${inputId}-helper` : undefined; + + return ( +
+ {label && ( + + )} + + {error && ( + + )} + {helperText && !error && ( +

+ {helperText} +

+ )} +
+ ); + }, +); + +Input.displayName = 'Input'; + +export default Input; diff --git a/src/components/ToggleSwitch.tsx b/src/components/primitives/ToggleSwitch.tsx similarity index 91% rename from src/components/ToggleSwitch.tsx rename to src/components/primitives/ToggleSwitch.tsx index 88bed131..58c8ee3c 100644 --- a/src/components/ToggleSwitch.tsx +++ b/src/components/primitives/ToggleSwitch.tsx @@ -1,3 +1,4 @@ +import type React from 'react'; /** * ToggleSwitch Component - Modern toggle switch with theme support * @@ -11,6 +12,8 @@ * @param disabled - Whether the toggle is disabled * @param id - Optional ID for the toggle (for accessibility) */ +import { type KeyboardEvent } from 'react'; + interface ToggleSwitchProps { checked: boolean; onChange: (checked: boolean) => void; @@ -27,21 +30,21 @@ function ToggleSwitch({ description, disabled = false, id, -}: ToggleSwitchProps) { - const handleToggle = () => { +}: ToggleSwitchProps): React.JSX.Element { + const handleToggle = (): void => { if (!disabled) { onChange(!checked); } }; - const handleKeyDown = (e: React.KeyboardEvent) => { + const handleKeyDown = (e: KeyboardEvent): void => { if (!disabled && (e.key === 'Enter' || e.key === ' ')) { e.preventDefault(); onChange(!checked); } }; - const toggleId = id || `toggle-${Math.random().toString(36).substr(2, 9)}`; + const toggleId = id ?? `toggle-${Math.random().toString(36).substr(2, 9)}`; return (
diff --git a/src/components/primitives/__tests__/Button.test.tsx b/src/components/primitives/__tests__/Button.test.tsx new file mode 100644 index 00000000..0e2f0ecf --- /dev/null +++ b/src/components/primitives/__tests__/Button.test.tsx @@ -0,0 +1,279 @@ +import { describe, it, expect, vi } from 'vitest'; +import { render, screen, fireEvent } from '@testing-library/react'; + +import Button from '../Button'; + +describe('Button', () => { + describe('rendering', () => { + it('renders with children text', () => { + render(); + expect(screen.getByText('Click me')).toBeInTheDocument(); + }); + + it('renders as a button element', () => { + render(); + expect(screen.getByRole('button')).toBeInTheDocument(); + }); + + it('defaults to type="button"', () => { + render(); + expect(screen.getByRole('button')).toHaveAttribute('type', 'button'); + }); + + it('allows overriding type', () => { + render( + , + ); + expect(screen.getByRole('button')).toHaveAttribute('type', 'submit'); + }); + }); + + describe('variants', () => { + it('applies primary variant class', () => { + render(); + expect(screen.getByRole('button')).toHaveClass('btn-primitive--primary'); + }); + + it('applies secondary variant class', () => { + render(); + expect(screen.getByRole('button')).toHaveClass('btn-primitive--secondary'); + }); + + it('applies ghost variant class', () => { + render(); + expect(screen.getByRole('button')).toHaveClass('btn-primitive--ghost'); + }); + + it('applies destructive variant class', () => { + render(); + expect(screen.getByRole('button')).toHaveClass('btn-primitive--destructive'); + }); + + it('applies tool variant class', () => { + render(); + expect(screen.getByRole('button')).toHaveClass('btn-primitive--tool'); + }); + }); + + describe('sizes', () => { + it('defaults to md size', () => { + render(); + expect(screen.getByRole('button')).toHaveClass('text-sm'); + }); + + it('applies sm size classes', () => { + render( + , + ); + expect(screen.getByRole('button')).toHaveClass('text-xs'); + }); + + it('applies lg size classes', () => { + render( + , + ); + expect(screen.getByRole('button')).toHaveClass('text-base'); + }); + }); + + describe('active state', () => { + it('adds active class when isActive is true', () => { + render( + , + ); + expect(screen.getByRole('button')).toHaveClass('active'); + }); + + it('does not add active class when isActive is false', () => { + render( + , + ); + expect(screen.getByRole('button')).not.toHaveClass('active'); + }); + }); + + describe('disabled state', () => { + it('disables the button when disabled prop is true', () => { + render( + , + ); + expect(screen.getByRole('button')).toBeDisabled(); + }); + + it('sets aria-disabled when disabled', () => { + render( + , + ); + expect(screen.getByRole('button')).toHaveAttribute('aria-disabled', 'true'); + }); + + it('adds disabled class when disabled', () => { + render( + , + ); + expect(screen.getByRole('button')).toHaveClass('btn-primitive--disabled'); + }); + }); + + describe('loading state', () => { + it('disables the button when loading', () => { + render( + , + ); + expect(screen.getByRole('button')).toBeDisabled(); + }); + + it('sets aria-busy when loading', () => { + render( + , + ); + expect(screen.getByRole('button')).toHaveAttribute('aria-busy', 'true'); + }); + + it('renders spinner when loading', () => { + const { container } = render( + , + ); + expect(container.querySelector('.btn-primitive__spinner')).toBeInTheDocument(); + }); + + it('hides left icon when loading', () => { + render( + , + ); + expect(screen.queryByTestId('icon')).not.toBeInTheDocument(); + }); + }); + + describe('icons', () => { + it('renders left icon', () => { + render( + , + ); + expect(screen.getByTestId('left-icon')).toBeInTheDocument(); + }); + + it('renders right icon', () => { + render( + , + ); + expect(screen.getByTestId('right-icon')).toBeInTheDocument(); + }); + + it('hides right icon when loading', () => { + render( + , + ); + expect(screen.queryByTestId('right-icon')).not.toBeInTheDocument(); + }); + + it('marks icons as aria-hidden', () => { + const { container } = render( + , + ); + const icons = container.querySelectorAll('.btn-primitive__icon'); + expect(icons).toHaveLength(2); + icons.forEach((icon) => { + expect(icon).toHaveAttribute('aria-hidden', 'true'); + }); + }); + }); + + describe('event handling', () => { + it('calls onClick when clicked', () => { + const onClick = vi.fn(); + render( + , + ); + fireEvent.click(screen.getByRole('button')); + expect(onClick).toHaveBeenCalledTimes(1); + }); + + it('does not call onClick when disabled', () => { + const onClick = vi.fn(); + render( + , + ); + fireEvent.click(screen.getByRole('button')); + expect(onClick).not.toHaveBeenCalled(); + }); + + it('does not call onClick when loading', () => { + const onClick = vi.fn(); + render( + , + ); + fireEvent.click(screen.getByRole('button')); + expect(onClick).not.toHaveBeenCalled(); + }); + }); + + describe('className merging', () => { + it('merges custom className with variant classes', () => { + render( + , + ); + const button = screen.getByRole('button'); + expect(button).toHaveClass('btn-primitive--primary'); + expect(button).toHaveClass('custom-class'); + }); + }); + + describe('ref forwarding', () => { + it('forwards ref to the button element', () => { + const ref = { current: null } as React.RefObject; + render( + , + ); + expect(ref.current).toBeInstanceOf(HTMLButtonElement); + }); + }); + + describe('displayName', () => { + it('has Button displayName', () => { + expect(Button.displayName).toBe('Button'); + }); + }); +}); diff --git a/src/components/primitives/__tests__/Dialog.test.tsx b/src/components/primitives/__tests__/Dialog.test.tsx new file mode 100644 index 00000000..ede4fdd3 --- /dev/null +++ b/src/components/primitives/__tests__/Dialog.test.tsx @@ -0,0 +1,438 @@ +import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; +import { render, screen, fireEvent, waitFor } from '@testing-library/react'; + +import Dialog from '../Dialog'; + +// Helper: the overlay has aria-hidden="true" (decorative backdrop) so we need +// { hidden: true } to query the dialog panel inside it. The dialog itself has +// role="dialog" + aria-modal="true" which screen readers respect independently. +const getDialog = () => screen.getByRole('dialog', { hidden: true }); + +describe('Dialog', () => { + beforeEach(() => { + document.body.style.overflow = ''; + }); + + afterEach(() => { + document.body.style.overflow = ''; + }); + + describe('rendering', () => { + it('renders nothing when isOpen is false', () => { + const { container } = render( + + Content + , + ); + expect(container.firstChild).toBeNull(); + }); + + it('renders dialog when isOpen is true', () => { + render( + + Dialog content + , + ); + expect(getDialog()).toBeInTheDocument(); + expect(screen.getByText('Dialog content')).toBeInTheDocument(); + }); + + it('renders title', () => { + render( + + Body + , + ); + expect(screen.getByText('My Title')).toBeInTheDocument(); + }); + + it('renders description when provided', () => { + render( + + Body + , + ); + expect(screen.getByText('A description')).toBeInTheDocument(); + }); + + it('does not render description when not provided', () => { + render( + + Body + , + ); + expect(screen.queryByText('A description')).not.toBeInTheDocument(); + }); + + it('renders footer when provided', () => { + render( + OK}> + Body + , + ); + expect(screen.getByText('OK')).toBeInTheDocument(); + }); + + it('renders close button', () => { + render( + + Body + , + ); + expect(screen.getByLabelText('Close dialog')).toBeInTheDocument(); + }); + }); + + describe('ARIA attributes', () => { + it('has role="dialog"', () => { + render( + + Body + , + ); + expect(getDialog()).toBeInTheDocument(); + }); + + it('has aria-modal="true"', () => { + render( + + Body + , + ); + expect(getDialog()).toHaveAttribute('aria-modal', 'true'); + }); + + it('has aria-labelledby pointing to title', () => { + render( + + Body + , + ); + const dialog = getDialog(); + const titleId = dialog.getAttribute('aria-labelledby'); + expect(titleId).toBeTruthy(); + expect(document.getElementById(titleId!)).toHaveTextContent('Dialog Title'); + }); + + it('has aria-describedby when description is provided', () => { + render( + + Body + , + ); + const dialog = getDialog(); + const descId = dialog.getAttribute('aria-describedby'); + expect(descId).toBeTruthy(); + expect(document.getElementById(descId!)).toHaveTextContent('Desc text'); + }); + + it('does not have aria-describedby when no description', () => { + render( + + Body + , + ); + expect(getDialog().getAttribute('aria-describedby')).toBeNull(); + }); + }); + + describe('size variants', () => { + it('defaults to md size', () => { + render( + + Body + , + ); + expect(getDialog()).toHaveClass('dialog-primitive--md'); + }); + + it('applies sm size class', () => { + render( + + Body + , + ); + expect(getDialog()).toHaveClass('dialog-primitive--sm'); + }); + + it('applies lg size class', () => { + render( + + Body + , + ); + expect(getDialog()).toHaveClass('dialog-primitive--lg'); + }); + + it('applies full size class', () => { + render( + + Body + , + ); + expect(getDialog()).toHaveClass('dialog-primitive--full'); + }); + }); + + describe('close behavior', () => { + it('calls onClose when close button clicked', () => { + const onClose = vi.fn(); + render( + + Body + , + ); + fireEvent.click(screen.getByLabelText('Close dialog')); + expect(onClose).toHaveBeenCalledTimes(1); + }); + + it('calls onClose when Escape key is pressed', () => { + const onClose = vi.fn(); + render( + + Body + , + ); + fireEvent.keyDown(getDialog(), { key: 'Escape' }); + expect(onClose).toHaveBeenCalledTimes(1); + }); + + it('calls onClose when overlay is clicked (default)', () => { + const onClose = vi.fn(); + const { container } = render( + + Body + , + ); + const overlay = container.querySelector('.dialog-primitive__overlay'); + expect(overlay).not.toBeNull(); + fireEvent.click(overlay!); + expect(onClose).toHaveBeenCalledTimes(1); + }); + + it('does not call onClose when overlay clicked with closeOnOverlayClick=false', () => { + const onClose = vi.fn(); + const { container } = render( + + Body + , + ); + const overlay = container.querySelector('.dialog-primitive__overlay'); + fireEvent.click(overlay!); + expect(onClose).not.toHaveBeenCalled(); + }); + + it('does not call onClose when dialog panel is clicked', () => { + const onClose = vi.fn(); + render( + + Body + , + ); + fireEvent.click(getDialog()); + expect(onClose).not.toHaveBeenCalled(); + }); + }); + + describe('scroll lock', () => { + it('sets body overflow to hidden when open', () => { + render( + + Body + , + ); + expect(document.body.style.overflow).toBe('hidden'); + }); + + it('restores body overflow when closed', () => { + document.body.style.overflow = 'auto'; + const { rerender } = render( + + Body + , + ); + expect(document.body.style.overflow).toBe('hidden'); + + rerender( + + Body + , + ); + expect(document.body.style.overflow).toBe('auto'); + }); + }); + + describe('focus trap', () => { + it('traps Tab at the end — wraps to first focusable element', async () => { + render( + + + + , + ); + + // Focus the last button in body + const lastButton = screen.getByText('Last'); + lastButton.focus(); + expect(document.activeElement).toBe(lastButton); + + // Tab should wrap to close button (first focusable in dialog) + fireEvent.keyDown(getDialog(), { key: 'Tab' }); + + await waitFor(() => { + const closeBtn = screen.getByLabelText('Close dialog'); + expect(document.activeElement).toBe(closeBtn); + }); + }); + + it('traps Shift+Tab at the beginning — wraps to last focusable element', async () => { + render( + + + + , + ); + + // Focus the close button (first focusable) + const closeBtn = screen.getByLabelText('Close dialog'); + closeBtn.focus(); + + // Shift+Tab should wrap to last button + fireEvent.keyDown(getDialog(), { key: 'Tab', shiftKey: true }); + + await waitFor(() => { + expect(document.activeElement).toBe(screen.getByText('Last')); + }); + }); + }); + + describe('auto-focus', () => { + let rafCallbacks: FrameRequestCallback[]; + let originalRaf: typeof requestAnimationFrame; + let originalCancelRaf: typeof cancelAnimationFrame; + + beforeEach(() => { + rafCallbacks = []; + originalRaf = globalThis.requestAnimationFrame; + originalCancelRaf = globalThis.cancelAnimationFrame; + // Capture rAF callbacks instead of executing them immediately + globalThis.requestAnimationFrame = vi.fn((cb: FrameRequestCallback) => { + rafCallbacks.push(cb); + return rafCallbacks.length; + }); + globalThis.cancelAnimationFrame = vi.fn(); + }); + + afterEach(() => { + globalThis.requestAnimationFrame = originalRaf; + globalThis.cancelAnimationFrame = originalCancelRaf; + }); + + const flushRaf = () => { + for (const cb of rafCallbacks) cb(0); + rafCallbacks = []; + }; + + it('auto-focuses first focusable element on open', () => { + render( + + + + , + ); + + // Before rAF fires, focus has not moved to the input + flushRaf(); + + // After rAF, the close button (first focusable in DOM order) should have focus + expect(document.activeElement).toBe(screen.getByLabelText('Close dialog')); + }); + + it('focuses the dialog panel when no focusable children exist', () => { + render( + +

Just text, no interactive elements

+
, + ); + + // Remove the close button to test the fallback path + // Actually, the close button IS a focusable element, so the dialog always + // has at least one focusable child. Let's verify it focuses the close button. + flushRaf(); + expect(document.activeElement).toBe(screen.getByLabelText('Close dialog')); + }); + + it('does not auto-focus when dialog is closed', () => { + const focusSpy = vi.fn(); + const originalFocus = HTMLElement.prototype.focus; + HTMLElement.prototype.focus = focusSpy; + + render( + + + , + ); + + flushRaf(); + // No rAF should have been scheduled for a closed dialog + expect(globalThis.requestAnimationFrame).not.toHaveBeenCalled(); + + HTMLElement.prototype.focus = originalFocus; + }); + }); + + describe('focus restoration', () => { + it('returns focus to trigger element on close', () => { + // Create and focus a trigger button + const trigger = document.createElement('button'); + trigger.textContent = 'Open Dialog'; + document.body.appendChild(trigger); + trigger.focus(); + expect(document.activeElement).toBe(trigger); + + try { + const { rerender } = render( + + + , + ); + + // Close the dialog + rerender( + + + , + ); + + // Focus should be restored to the trigger + expect(document.activeElement).toBe(trigger); + } finally { + document.body.removeChild(trigger); + } + }); + + it('does not error when trigger has no focus method', () => { + // Simulate a non-focusable trigger (e.g., document.body with no focus method override) + const { rerender } = render( + + Body + , + ); + + // Close — should not throw even if the stored trigger element is unusual + expect(() => { + rerender( + + Body + , + ); + }).not.toThrow(); + }); + }); + + describe('displayName', () => { + it('has Dialog displayName', () => { + expect(Dialog.displayName).toBe('Dialog'); + }); + }); +}); diff --git a/src/components/primitives/__tests__/Input.test.tsx b/src/components/primitives/__tests__/Input.test.tsx new file mode 100644 index 00000000..67e4e14e --- /dev/null +++ b/src/components/primitives/__tests__/Input.test.tsx @@ -0,0 +1,151 @@ +import { describe, it, expect, vi } from 'vitest'; +import { render, screen, fireEvent } from '@testing-library/react'; + +import Input from '../Input'; + +describe('Input', () => { + describe('rendering', () => { + it('renders an input element', () => { + render(); + expect(screen.getByRole('textbox')).toBeInTheDocument(); + }); + + it('renders with label', () => { + render(); + expect(screen.getByLabelText('Username')).toBeInTheDocument(); + }); + + it('renders without label', () => { + const { container } = render(); + expect(container.querySelector('label')).toBeNull(); + }); + + it('passes through HTML input attributes', () => { + render(); + const input = screen.getByPlaceholderText('Enter text'); + expect(input).toHaveAttribute('type', 'email'); + }); + }); + + describe('label association', () => { + it('associates label with input via htmlFor/id', () => { + render(); + const input = screen.getByLabelText('Email'); + expect(input).toBeInTheDocument(); + expect(input.tagName).toBe('INPUT'); + }); + + it('uses provided id for label association', () => { + render(); + const input = screen.getByLabelText('Name'); + expect(input).toHaveAttribute('id', 'custom-id'); + }); + + it('auto-generates id when not provided', () => { + render(); + const input = screen.getByLabelText('Auto ID'); + expect(input.id).toBeTruthy(); + }); + }); + + describe('error state', () => { + it('renders error message', () => { + render(); + expect(screen.getByText('Invalid email')).toBeInTheDocument(); + }); + + it('error message has role="alert"', () => { + render(); + expect(screen.getByRole('alert')).toHaveTextContent('Error!'); + }); + + it('sets aria-invalid when error is present', () => { + render(); + expect(screen.getByLabelText('Test')).toHaveAttribute('aria-invalid', 'true'); + }); + + it('does not set aria-invalid when no error', () => { + render(); + expect(screen.getByLabelText('Test')).not.toHaveAttribute('aria-invalid'); + }); + + it('associates error with input via aria-describedby', () => { + render(); + const input = screen.getByLabelText('Test'); + const describedBy = input.getAttribute('aria-describedby'); + expect(describedBy).toBeTruthy(); + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + expect(document.getElementById(describedBy!)).toHaveTextContent('Error text'); + }); + + it('adds error CSS class', () => { + render(); + expect(screen.getByRole('textbox')).toHaveClass('input-primitive--error'); + }); + }); + + describe('helper text', () => { + it('renders helper text', () => { + render(); + expect(screen.getByText('Enter your full name')).toBeInTheDocument(); + }); + + it('associates helper with input via aria-describedby', () => { + render(); + const input = screen.getByLabelText('Name'); + const describedBy = input.getAttribute('aria-describedby'); + expect(describedBy).toBeTruthy(); + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + expect(document.getElementById(describedBy!)).toHaveTextContent('Full name please'); + }); + + it('error takes priority over helper text', () => { + render(); + expect(screen.getByText('Error!')).toBeInTheDocument(); + expect(screen.queryByText('Helper')).not.toBeInTheDocument(); + }); + }); + + describe('event handling', () => { + it('calls onChange when value changes', () => { + const onChange = vi.fn(); + render(); + fireEvent.change(screen.getByLabelText('Test'), { target: { value: 'hello' } }); + expect(onChange).toHaveBeenCalledTimes(1); + }); + + it('calls onFocus and onBlur', () => { + const onFocus = vi.fn(); + const onBlur = vi.fn(); + render(); + const input = screen.getByLabelText('Test'); + fireEvent.focus(input); + expect(onFocus).toHaveBeenCalledTimes(1); + fireEvent.blur(input); + expect(onBlur).toHaveBeenCalledTimes(1); + }); + }); + + describe('className merging', () => { + it('merges custom className with base class', () => { + render(); + const input = screen.getByRole('textbox'); + expect(input).toHaveClass('input-primitive'); + expect(input).toHaveClass('custom-input'); + }); + }); + + describe('ref forwarding', () => { + it('forwards ref to the input element', () => { + const ref = { current: null } as React.RefObject; + render(); + expect(ref.current).toBeInstanceOf(HTMLInputElement); + }); + }); + + describe('displayName', () => { + it('has Input displayName', () => { + expect(Input.displayName).toBe('Input'); + }); + }); +}); diff --git a/src/components/primitives/index.ts b/src/components/primitives/index.ts new file mode 100644 index 00000000..af109d83 --- /dev/null +++ b/src/components/primitives/index.ts @@ -0,0 +1,25 @@ +/** + * UI Primitives — Design system components + * + * These components form the visual foundation of the app. + * They import only from styles/ and types/ — never from store or services. + * See CLAUDE.md "Design System Contract" for boundary rules. + */ +export { default as Button } from './Button'; +// eslint-disable-next-line import/no-unused-modules +export type { ButtonProps } from './Button'; + +export { default as Input } from './Input'; +// eslint-disable-next-line import/no-unused-modules +export type { InputProps } from './Input'; + +export { default as Card } from './Card'; +// eslint-disable-next-line import/no-unused-modules +export type { CardProps } from './Card'; + +// eslint-disable-next-line import/no-unused-modules +export { default as Dialog } from './Dialog'; +// eslint-disable-next-line import/no-unused-modules +export type { DialogProps } from './Dialog'; + +export { default as ToggleSwitch } from './ToggleSwitch'; diff --git a/src/hooks/__tests__/useMenuCommands.test.ts b/src/hooks/__tests__/useMenuCommands.test.ts new file mode 100644 index 00000000..da9a6769 --- /dev/null +++ b/src/hooks/__tests__/useMenuCommands.test.ts @@ -0,0 +1,151 @@ +import { describe, it, expect, beforeEach, vi, afterEach } from 'vitest'; +import { renderHook } from '@testing-library/react'; + +import { useMenuCommands } from '../useMenuCommands'; +import { useUiStore } from '../../store/uiStore'; + +// Mock campaignService +vi.mock('../../services/campaignService', () => ({ + saveCampaign: vi.fn().mockResolvedValue(true), + loadCampaign: vi.fn().mockResolvedValue(true), + startNewCampaign: vi.fn(), +})); + +import { saveCampaign, loadCampaign, startNewCampaign } from '../../services/campaignService'; + +const mockSaveCampaign = vi.mocked(saveCampaign); +const mockLoadCampaign = vi.mocked(loadCampaign); +const mockStartNewCampaign = vi.mocked(startNewCampaign); + +describe('useMenuCommands', () => { + // The test setup (src/test/setup.ts) already defines window.ipcRenderer + // as a mock with on/off/send/invoke. We use it directly. + let mockIpcOn: ReturnType; + let mockIpcOff: ReturnType; + const ipcHandlers: Record void> = {}; + + beforeEach(() => { + vi.clearAllMocks(); + + // Reset uiStore + useUiStore.setState({ + showResourceMonitor: false, + dungeonDialog: false, + }); + + // Get references to the existing mock ipcRenderer from test setup + const ipc = window.ipcRenderer!; + mockIpcOn = ipc.on as ReturnType; + mockIpcOff = ipc.off as ReturnType; + + // Capture handlers when on() is called + mockIpcOn.mockImplementation((channel: string, handler: (...args: unknown[]) => void) => { + ipcHandlers[channel] = handler; + }); + + // Clear captured handlers + for (const key of Object.keys(ipcHandlers)) { + delete ipcHandlers[key]; + } + }); + + afterEach(() => { + vi.restoreAllMocks(); + }); + + it('registers 6 IPC listeners on mount', () => { + renderHook(() => useMenuCommands({ onShowAbout: vi.fn() })); + + expect(mockIpcOn).toHaveBeenCalledTimes(6); + expect(mockIpcOn).toHaveBeenCalledWith('MENU_SAVE_CAMPAIGN', expect.any(Function)); + expect(mockIpcOn).toHaveBeenCalledWith('MENU_LOAD_CAMPAIGN', expect.any(Function)); + expect(mockIpcOn).toHaveBeenCalledWith('MENU_NEW_CAMPAIGN', expect.any(Function)); + expect(mockIpcOn).toHaveBeenCalledWith('MENU_TOGGLE_RESOURCE_MONITOR', expect.any(Function)); + expect(mockIpcOn).toHaveBeenCalledWith('MENU_GENERATE_DUNGEON', expect.any(Function)); + expect(mockIpcOn).toHaveBeenCalledWith('MENU_SHOW_ABOUT', expect.any(Function)); + }); + + it('unregisters all IPC listeners on unmount', () => { + const { unmount } = renderHook(() => useMenuCommands({ onShowAbout: vi.fn() })); + unmount(); + + expect(mockIpcOff).toHaveBeenCalledTimes(6); + expect(mockIpcOff).toHaveBeenCalledWith('MENU_SAVE_CAMPAIGN', expect.any(Function)); + expect(mockIpcOff).toHaveBeenCalledWith('MENU_LOAD_CAMPAIGN', expect.any(Function)); + expect(mockIpcOff).toHaveBeenCalledWith('MENU_NEW_CAMPAIGN', expect.any(Function)); + expect(mockIpcOff).toHaveBeenCalledWith('MENU_TOGGLE_RESOURCE_MONITOR', expect.any(Function)); + expect(mockIpcOff).toHaveBeenCalledWith('MENU_GENERATE_DUNGEON', expect.any(Function)); + expect(mockIpcOff).toHaveBeenCalledWith('MENU_SHOW_ABOUT', expect.any(Function)); + }); + + it('MENU_SAVE_CAMPAIGN triggers saveCampaign', () => { + renderHook(() => useMenuCommands({ onShowAbout: vi.fn() })); + + ipcHandlers['MENU_SAVE_CAMPAIGN'](); + expect(mockSaveCampaign).toHaveBeenCalledTimes(1); + }); + + it('MENU_LOAD_CAMPAIGN triggers loadCampaign', () => { + renderHook(() => useMenuCommands({ onShowAbout: vi.fn() })); + + ipcHandlers['MENU_LOAD_CAMPAIGN'](); + expect(mockLoadCampaign).toHaveBeenCalledTimes(1); + }); + + it('MENU_NEW_CAMPAIGN triggers startNewCampaign', () => { + renderHook(() => useMenuCommands({ onShowAbout: vi.fn() })); + + ipcHandlers['MENU_NEW_CAMPAIGN'](); + expect(mockStartNewCampaign).toHaveBeenCalledTimes(1); + }); + + it('MENU_TOGGLE_RESOURCE_MONITOR toggles resource monitor', () => { + renderHook(() => useMenuCommands({ onShowAbout: vi.fn() })); + + expect(useUiStore.getState().showResourceMonitor).toBe(false); + + ipcHandlers['MENU_TOGGLE_RESOURCE_MONITOR'](); + expect(useUiStore.getState().showResourceMonitor).toBe(true); + + ipcHandlers['MENU_TOGGLE_RESOURCE_MONITOR'](); + expect(useUiStore.getState().showResourceMonitor).toBe(false); + }); + + it('MENU_GENERATE_DUNGEON shows dungeon dialog', () => { + renderHook(() => useMenuCommands({ onShowAbout: vi.fn() })); + + ipcHandlers['MENU_GENERATE_DUNGEON'](); + expect(useUiStore.getState().dungeonDialog).toBe(true); + }); + + it('MENU_SHOW_ABOUT calls onShowAbout callback', () => { + const onShowAbout = vi.fn(); + renderHook(() => useMenuCommands({ onShowAbout })); + + ipcHandlers['MENU_SHOW_ABOUT'](); + expect(onShowAbout).toHaveBeenCalledTimes(1); + }); + + it('uses ref for onShowAbout to avoid re-registering', () => { + const onShowAbout1 = vi.fn(); + const onShowAbout2 = vi.fn(); + + const { rerender } = renderHook(({ onShowAbout }) => useMenuCommands({ onShowAbout }), { + initialProps: { onShowAbout: onShowAbout1 }, + }); + + // Should only register once (6 channels) + expect(mockIpcOn).toHaveBeenCalledTimes(6); + + // Rerender with different callback + rerender({ onShowAbout: onShowAbout2 }); + + // Should NOT re-register (still 6 — stable [] deps) + expect(mockIpcOn).toHaveBeenCalledTimes(6); + + // But calling MENU_SHOW_ABOUT should use the new callback via ref + ipcHandlers['MENU_SHOW_ABOUT'](); + expect(onShowAbout1).not.toHaveBeenCalled(); + expect(onShowAbout2).toHaveBeenCalledTimes(1); + }); +}); diff --git a/src/hooks/__tests__/useRecentCampaigns.test.ts b/src/hooks/__tests__/useRecentCampaigns.test.ts new file mode 100644 index 00000000..af2d60b6 --- /dev/null +++ b/src/hooks/__tests__/useRecentCampaigns.test.ts @@ -0,0 +1,104 @@ +import { describe, it, expect, beforeEach, vi } from 'vitest'; +import { renderHook, act } from '@testing-library/react'; + +import { useRecentCampaigns } from '../useRecentCampaigns'; + +// Mock the recentCampaigns utility with simple vi.fn() mocks +vi.mock('../../utils/recentCampaigns', () => ({ + getRecentCampaigns: vi.fn(() => []), + addRecentCampaignWithPlatform: vi.fn(), + removeRecentCampaign: vi.fn(), +})); + +// Import mocked functions for assertion and control +import { + getRecentCampaigns, + addRecentCampaignWithPlatform, + removeRecentCampaign, +} from '../../utils/recentCampaigns'; + +const mockGetRecent = vi.mocked(getRecentCampaigns); +const mockAddRecent = vi.mocked(addRecentCampaignWithPlatform); +const mockRemoveRecent = vi.mocked(removeRecentCampaign); + +describe('useRecentCampaigns', () => { + beforeEach(() => { + vi.clearAllMocks(); + // Default: return empty list + mockGetRecent.mockReturnValue([]); + }); + + it('returns initial empty list from storage', () => { + const { result } = renderHook(() => useRecentCampaigns()); + expect(result.current.recentCampaigns).toEqual([]); + }); + + it('returns campaigns from storage on mount', () => { + const campaigns = [{ id: '1', name: 'Campaign 1', lastOpened: 1000, platform: 'web' as const }]; + // Use mockReturnValue (not Once) — StrictMode double-invokes the useState + // initializer, so mockReturnValueOnce would be consumed on the first call + // and the second call would fall through to the default empty array. + mockGetRecent.mockReturnValue(campaigns); + + const { result } = renderHook(() => useRecentCampaigns()); + expect(result.current.recentCampaigns).toEqual(campaigns); + + // Restore default for subsequent tests + mockGetRecent.mockReturnValue([]); + }); + + it('addRecent calls utility and refreshes list', () => { + const { result } = renderHook(() => useRecentCampaigns()); + expect(result.current.recentCampaigns).toEqual([]); + + // After addRecent, getRecentCampaigns is called again for refresh + const updatedList = [ + { id: 'new-id', name: 'New Campaign', lastOpened: 2000, platform: 'web' as const }, + ]; + mockGetRecent.mockReturnValueOnce(updatedList); + + act(() => { + result.current.addRecent('new-id', 'New Campaign'); + }); + + expect(mockAddRecent).toHaveBeenCalledWith('new-id', 'New Campaign'); + expect(result.current.recentCampaigns).toEqual(updatedList); + }); + + it('removeRecent calls utility and refreshes list', () => { + // Use mockReturnValue (not Once) — StrictMode-resilient (see mount test comment) + mockGetRecent.mockReturnValue([ + { id: 'to-remove', name: 'Remove Me', lastOpened: 1000, platform: 'web' as const }, + ]); + + const { result } = renderHook(() => useRecentCampaigns()); + expect(result.current.recentCampaigns).toHaveLength(1); + + // After removal, return empty list + mockGetRecent.mockReturnValueOnce([]); + + act(() => { + result.current.removeRecent('to-remove'); + }); + + expect(mockRemoveRecent).toHaveBeenCalledWith('to-remove'); + expect(result.current.recentCampaigns).toHaveLength(0); + }); + + it('refresh reloads from storage', () => { + const { result } = renderHook(() => useRecentCampaigns()); + expect(result.current.recentCampaigns).toEqual([]); + + // Simulate external mutation by changing what getRecentCampaigns returns + mockGetRecent.mockReturnValueOnce([ + { id: 'ext', name: 'External', lastOpened: 2000, platform: 'web' as const }, + ]); + + act(() => { + result.current.refresh(); + }); + + expect(result.current.recentCampaigns).toHaveLength(1); + expect(result.current.recentCampaigns[0].id).toBe('ext'); + }); +}); diff --git a/src/hooks/__tests__/useToolState.test.ts b/src/hooks/__tests__/useToolState.test.ts new file mode 100644 index 00000000..ffc7f3c0 --- /dev/null +++ b/src/hooks/__tests__/useToolState.test.ts @@ -0,0 +1,318 @@ +import { describe, it, expect, beforeEach, vi, afterEach } from 'vitest'; +import { renderHook, act } from '@testing-library/react'; + +import { useToolState } from '../useToolState'; + +import type { ToolType } from '../useToolState'; + +// Stable mock references — hoisted outside factory so selectors always return +// the same function identity (prevents spurious useEffect re-fires). +const mockSetBroadcastMeasurement = vi.fn(); +const mockSetActiveMeasurement = vi.fn(); + +vi.mock('../../store/gameStore', () => ({ + useGameStore: vi.fn((selector: (s: Record) => unknown) => { + const state = { + broadcastMeasurement: false, + setBroadcastMeasurement: mockSetBroadcastMeasurement, + setActiveMeasurement: mockSetActiveMeasurement, + }; + return selector(state); + }), +})); + +describe('useToolState', () => { + beforeEach(() => { + vi.clearAllMocks(); + }); + + afterEach(() => { + vi.restoreAllMocks(); + }); + + describe('initial state', () => { + it('starts with select tool', () => { + const { result } = renderHook(() => useToolState({ isArchitectView: true })); + expect(result.current.tool).toBe('select'); + }); + + it('starts with default marker color', () => { + const { result } = renderHook(() => useToolState({ isArchitectView: true })); + expect(result.current.color).toBe('#df4b26'); + }); + + it('starts with 3 default recent colors', () => { + const { result } = renderHook(() => useToolState({ isArchitectView: true })); + expect(result.current.recentColors).toEqual(['#df4b26', '#3b82f6', '#22c55e']); + }); + + it('starts with horizontal door orientation', () => { + const { result } = renderHook(() => useToolState({ isArchitectView: true })); + expect(result.current.doorOrientation).toBe('horizontal'); + }); + + it('starts with ruler measurement mode', () => { + const { result } = renderHook(() => useToolState({ isArchitectView: true })); + expect(result.current.measurementMode).toBe('ruler'); + }); + }); + + describe('tool selection', () => { + it('setTool changes active tool', () => { + const { result } = renderHook(() => useToolState({ isArchitectView: true })); + + act(() => { + result.current.setTool('marker'); + }); + expect(result.current.tool).toBe('marker'); + + act(() => { + result.current.setTool('wall'); + }); + expect(result.current.tool).toBe('wall'); + }); + + it('supports all tool types', () => { + const { result } = renderHook(() => useToolState({ isArchitectView: true })); + const tools: ToolType[] = ['select', 'marker', 'eraser', 'wall', 'door', 'measure']; + + for (const tool of tools) { + act(() => { + result.current.setTool(tool); + }); + expect(result.current.tool).toBe(tool); + } + }); + }); + + describe('color management', () => { + it('setColor updates current color', () => { + const { result } = renderHook(() => useToolState({ isArchitectView: true })); + + act(() => { + result.current.setColor('#ff0000'); + }); + expect(result.current.color).toBe('#ff0000'); + }); + + it('handleColorChange updates color and recent colors', () => { + const { result } = renderHook(() => useToolState({ isArchitectView: true })); + + act(() => { + result.current.handleColorChange('#ff0000'); + }); + + expect(result.current.color).toBe('#ff0000'); + expect(result.current.recentColors[0]).toBe('#ff0000'); + expect(result.current.recentColors).toHaveLength(3); + }); + + it('handleColorChange deduplicates colors (case insensitive)', () => { + const { result } = renderHook(() => useToolState({ isArchitectView: true })); + + // Default colors: #df4b26, #3b82f6, #22c55e + act(() => { + result.current.handleColorChange('#DF4B26'); // Same as default, different case + }); + + // Should move to front, not create a duplicate + expect(result.current.recentColors).toHaveLength(3); + expect(result.current.recentColors[0]).toBe('#DF4B26'); + }); + + it('handleColorChange keeps max 3 recent colors', () => { + const { result } = renderHook(() => useToolState({ isArchitectView: true })); + + act(() => { + result.current.handleColorChange('#111111'); + }); + act(() => { + result.current.handleColorChange('#222222'); + }); + + expect(result.current.recentColors).toHaveLength(3); + expect(result.current.recentColors[0]).toBe('#222222'); + }); + }); + + describe('door orientation', () => { + it('setDoorOrientation changes orientation', () => { + const { result } = renderHook(() => useToolState({ isArchitectView: true })); + + act(() => { + result.current.setDoorOrientation('vertical'); + }); + expect(result.current.doorOrientation).toBe('vertical'); + }); + }); + + describe('measurement mode', () => { + it('setMeasurementMode changes mode', () => { + const { result } = renderHook(() => useToolState({ isArchitectView: true })); + + act(() => { + result.current.setMeasurementMode('blast'); + }); + expect(result.current.measurementMode).toBe('blast'); + + act(() => { + result.current.setMeasurementMode('cone'); + }); + expect(result.current.measurementMode).toBe('cone'); + }); + + it('clears active measurement when mode changes', () => { + const { result } = renderHook(() => useToolState({ isArchitectView: true })); + + mockSetActiveMeasurement.mockClear(); + + act(() => { + result.current.setMeasurementMode('blast'); + }); + + expect(mockSetActiveMeasurement).toHaveBeenCalledWith(null); + }); + }); + + describe('keyboard shortcuts (Architect View)', () => { + it('V key switches to select tool', () => { + const { result } = renderHook(() => useToolState({ isArchitectView: true })); + + act(() => { + result.current.setTool('marker'); + }); + expect(result.current.tool).toBe('marker'); + + act(() => { + window.dispatchEvent(new KeyboardEvent('keydown', { key: 'v' })); + }); + expect(result.current.tool).toBe('select'); + }); + + it('M key switches to marker tool', () => { + const { result } = renderHook(() => useToolState({ isArchitectView: true })); + + act(() => { + window.dispatchEvent(new KeyboardEvent('keydown', { key: 'm' })); + }); + expect(result.current.tool).toBe('marker'); + }); + + it('E key switches to eraser tool', () => { + const { result } = renderHook(() => useToolState({ isArchitectView: true })); + + act(() => { + window.dispatchEvent(new KeyboardEvent('keydown', { key: 'e' })); + }); + expect(result.current.tool).toBe('eraser'); + }); + + it('W key switches to wall tool', () => { + const { result } = renderHook(() => useToolState({ isArchitectView: true })); + + act(() => { + window.dispatchEvent(new KeyboardEvent('keydown', { key: 'w' })); + }); + expect(result.current.tool).toBe('wall'); + }); + + it('D key switches to door tool', () => { + const { result } = renderHook(() => useToolState({ isArchitectView: true })); + + act(() => { + window.dispatchEvent(new KeyboardEvent('keydown', { key: 'd' })); + }); + expect(result.current.tool).toBe('door'); + }); + + it('R key switches to measure tool when not on door', () => { + const { result } = renderHook(() => useToolState({ isArchitectView: true })); + + act(() => { + window.dispatchEvent(new KeyboardEvent('keydown', { key: 'r' })); + }); + expect(result.current.tool).toBe('measure'); + }); + + it('R key toggles door orientation when door tool active', () => { + const { result } = renderHook(() => useToolState({ isArchitectView: true })); + + act(() => { + result.current.setTool('door'); + }); + expect(result.current.doorOrientation).toBe('horizontal'); + + act(() => { + window.dispatchEvent(new KeyboardEvent('keydown', { key: 'r' })); + }); + expect(result.current.doorOrientation).toBe('vertical'); + }); + + it('arrow keys toggle door orientation when door tool active', () => { + const { result } = renderHook(() => useToolState({ isArchitectView: true })); + + act(() => { + result.current.setTool('door'); + }); + + act(() => { + window.dispatchEvent(new KeyboardEvent('keydown', { key: 'ArrowUp' })); + }); + expect(result.current.doorOrientation).toBe('vertical'); + + act(() => { + window.dispatchEvent(new KeyboardEvent('keydown', { key: 'ArrowDown' })); + }); + expect(result.current.doorOrientation).toBe('horizontal'); + }); + + it('does not respond to keyboard when not Architect View', () => { + const { result } = renderHook(() => useToolState({ isArchitectView: false })); + + act(() => { + window.dispatchEvent(new KeyboardEvent('keydown', { key: 'm' })); + }); + expect(result.current.tool).toBe('select'); // Unchanged + }); + + it('ignores keyboard when target is an input element', () => { + const { result } = renderHook(() => useToolState({ isArchitectView: true })); + + const input = document.createElement('input'); + document.body.appendChild(input); + + try { + act(() => { + input.dispatchEvent(new KeyboardEvent('keydown', { key: 'm', bubbles: true })); + }); + expect(result.current.tool).toBe('select'); // Unchanged + } finally { + document.body.removeChild(input); + } + }); + + it('ignores keyboard when target is a textarea', () => { + const { result } = renderHook(() => useToolState({ isArchitectView: true })); + + const textarea = document.createElement('textarea'); + document.body.appendChild(textarea); + + try { + act(() => { + textarea.dispatchEvent(new KeyboardEvent('keydown', { key: 'w', bubbles: true })); + }); + expect(result.current.tool).toBe('select'); // Unchanged + } finally { + document.body.removeChild(textarea); + } + }); + }); + + describe('ref access', () => { + it('provides colorInputRef', () => { + const { result } = renderHook(() => useToolState({ isArchitectView: true })); + expect(result.current.colorInputRef).toBeDefined(); + expect(result.current.colorInputRef.current).toBeNull(); + }); + }); +}); diff --git a/src/hooks/useCommandPalette.ts b/src/hooks/useCommandPalette.ts index e0b6c771..86708b0c 100644 --- a/src/hooks/useCommandPalette.ts +++ b/src/hooks/useCommandPalette.ts @@ -13,14 +13,14 @@ import { useEffect } from 'react'; -import { useGameStore } from '../store/gameStore'; +import { useUiStore } from '../store/uiStore'; export function useCommandPalette(): [boolean, (isOpen: boolean) => void] { - const isOpen = useGameStore((state) => state.isCommandPaletteOpen); - const setIsOpen = useGameStore((state) => state.setCommandPaletteOpen); + const isOpen = useUiStore((state) => state.isCommandPaletteOpen); + const setIsOpen = useUiStore((state) => state.setCommandPaletteOpen); useEffect(() => { - const handleKeyDown = (e: KeyboardEvent) => { + const handleKeyDown = (e: KeyboardEvent): void => { // Cmd+P or Cmd+K (Mac) / Ctrl+P or Ctrl+K (Windows/Linux) if ((e.metaKey || e.ctrlKey) && (e.key === 'p' || e.key === 'k')) { e.preventDefault(); // Prevent browser print dialog or other default actions diff --git a/src/hooks/useLibraryLoader.ts b/src/hooks/useLibraryLoader.ts new file mode 100644 index 00000000..8c3ce957 --- /dev/null +++ b/src/hooks/useLibraryLoader.ts @@ -0,0 +1,51 @@ +/** + * useLibraryLoader — Loads token library index on startup + * + * Fetches the library index from storage and merges it with the + * campaign's existing token library. Only runs in Architect View. + * + * @see src/services/IStorageService.ts for loadLibraryIndex() + */ + +import { useEffect } from 'react'; + +import { getStorage } from '../services/storage'; +import { useGameStore } from '../store/gameStore'; + +export function useLibraryLoader(isArchitectView: boolean): void { + useEffect(() => { + if (!isArchitectView) { + return; + } + + const loadLibrary = async (): Promise => { + try { + const storage = getStorage(); + const libraryItems = await storage.loadLibraryIndex(); + + if (libraryItems && Array.isArray(libraryItems)) { + useGameStore.setState((state) => { + const currentLibrary = state.campaign.tokenLibrary; + const existingIds = new Set(currentLibrary.map((item) => item.id)); + const newItems = libraryItems.filter((item) => !existingIds.has(item.id)); + + if (newItems.length === 0) { + return state; + } + + return { + campaign: { + ...state.campaign, + tokenLibrary: [...currentLibrary, ...newItems], + }, + }; + }); + } + } catch (error) { + console.error('[App] Failed to load library index:', error); + } + }; + + void loadLibrary(); + }, [isArchitectView]); +} diff --git a/src/hooks/useMediaQuery.ts b/src/hooks/useMediaQuery.ts index 5efa72cf..25fe85af 100644 --- a/src/hooks/useMediaQuery.ts +++ b/src/hooks/useMediaQuery.ts @@ -14,6 +14,7 @@ import { useState, useEffect } from 'react'; +// eslint-disable-next-line import/no-unused-modules export function useMediaQuery(query: string): boolean { // Initialize with current match state const [matches, setMatches] = useState(() => { @@ -31,7 +32,7 @@ export function useMediaQuery(query: string): boolean { setMatches(mediaQuery.matches); // Handler for media query changes - const handler = (e: MediaQueryListEvent) => { + const handler = (e: MediaQueryListEvent): void => { setMatches(e.matches); }; @@ -59,6 +60,7 @@ export function useIsMobile(): boolean { * Convenience hook: Tablet devices * Breakpoint: 768px - 1023px */ +// eslint-disable-next-line import/no-unused-modules export function useIsTablet(): boolean { return useMediaQuery('(min-width: 768px) and (max-width: 1023px)'); } @@ -67,6 +69,7 @@ export function useIsTablet(): boolean { * Convenience hook: Desktop devices * Breakpoint: 1024px and above */ +// eslint-disable-next-line import/no-unused-modules export function useIsDesktop(): boolean { return useMediaQuery('(min-width: 1024px)'); } @@ -75,6 +78,7 @@ export function useIsDesktop(): boolean { * Convenience hook: Touch-capable devices * Detects if device supports touch (not just screen size) */ +// eslint-disable-next-line import/no-unused-modules export function useIsTouchDevice(): boolean { const [isTouch] = useState(() => { if (typeof window === 'undefined' || typeof navigator === 'undefined') { diff --git a/src/hooks/useMenuCommands.ts b/src/hooks/useMenuCommands.ts new file mode 100644 index 00000000..ddd93a2b --- /dev/null +++ b/src/hooks/useMenuCommands.ts @@ -0,0 +1,81 @@ +/** + * useMenuCommands — Electron IPC menu command handler registration + * + * Centralizes the binding between Electron menu items and application actions. + * In web mode (no ipcRenderer), this hook is a no-op. + * + * @see electron/main.ts for menu item definitions + * @see src/services/campaignService.ts for save/load implementations + */ + +import { useEffect, useRef } from 'react'; + +import { saveCampaign, loadCampaign, startNewCampaign } from '../services/campaignService'; +import { useUiStore } from '../store/uiStore'; + +interface UseMenuCommandsOptions { + /** Callback to open the About modal (local App state) */ + onShowAbout: () => void; +} + +/** + * Registers IPC menu command handlers for Electron integration + * + * Handles: MENU_SAVE_CAMPAIGN, MENU_LOAD_CAMPAIGN, MENU_NEW_CAMPAIGN, + * MENU_TOGGLE_RESOURCE_MONITOR, MENU_GENERATE_DUNGEON, MENU_SHOW_ABOUT + * + * All handlers use Zustand getState() for store access, so the effect + * has stable dependencies and only runs once. + */ +export function useMenuCommands({ onShowAbout }: UseMenuCommandsOptions): void { + // Use ref to avoid re-registering IPC listeners when callback changes + const onShowAboutRef = useRef(onShowAbout); + onShowAboutRef.current = onShowAbout; + + useEffect(() => { + const ipcRenderer = window.ipcRenderer; + if (!ipcRenderer) { + return; + } + + const handleSave = (): void => { + void saveCampaign(); + }; + + const handleLoad = (): void => { + void loadCampaign(); + }; + + const handleToggleMonitor = (): void => { + useUiStore.getState().setShowResourceMonitor(!useUiStore.getState().showResourceMonitor); + }; + + const handleGenerateDungeon = (): void => { + useUiStore.getState().showDungeonDialog(); + }; + + const handleNewCampaign = (): void => { + startNewCampaign(); + }; + + const handleShowAbout = (): void => { + onShowAboutRef.current(); + }; + + ipcRenderer.on('MENU_SAVE_CAMPAIGN', handleSave); + ipcRenderer.on('MENU_LOAD_CAMPAIGN', handleLoad); + ipcRenderer.on('MENU_TOGGLE_RESOURCE_MONITOR', handleToggleMonitor); + ipcRenderer.on('MENU_GENERATE_DUNGEON', handleGenerateDungeon); + ipcRenderer.on('MENU_NEW_CAMPAIGN', handleNewCampaign); + ipcRenderer.on('MENU_SHOW_ABOUT', handleShowAbout); + + return () => { + ipcRenderer.off('MENU_SAVE_CAMPAIGN', handleSave); + ipcRenderer.off('MENU_LOAD_CAMPAIGN', handleLoad); + ipcRenderer.off('MENU_TOGGLE_RESOURCE_MONITOR', handleToggleMonitor); + ipcRenderer.off('MENU_GENERATE_DUNGEON', handleGenerateDungeon); + ipcRenderer.off('MENU_NEW_CAMPAIGN', handleNewCampaign); + ipcRenderer.off('MENU_SHOW_ABOUT', handleShowAbout); + }; + }, []); // Stable: all handlers use getState() or refs +} diff --git a/src/hooks/usePlatformDetection.ts b/src/hooks/usePlatformDetection.ts new file mode 100644 index 00000000..6f3754c7 --- /dev/null +++ b/src/hooks/usePlatformDetection.ts @@ -0,0 +1,58 @@ +/** + * usePlatformDetection — Hook for detecting the current platform/OS + * + * Checks navigator.userAgent and the storage service to determine: + * - Whether we're running in Electron or the browser + * - Which OS the user is on (for download banners, platform-specific UI) + * + * All navigator checks are centralized here so HomeScreen and other + * components don't need direct navigator access. + */ + +import { useState, useEffect } from 'react'; + +import { getStorage } from '../services/storage'; + +interface PlatformInfo { + /** Running inside Electron (desktop app) */ + isElectron: boolean; + /** macOS detected */ + isMac: boolean; + /** Windows detected */ + isWindows: boolean; + /** Linux detected */ + isLinux: boolean; +} + +export function usePlatformDetection(): PlatformInfo { + const [platform, setPlatform] = useState({ + isElectron: false, + isMac: false, + isWindows: false, + isLinux: false, + }); + + useEffect(() => { + const storage = getStorage(); + const isElectron = storage.getPlatform() === 'electron'; + + let isMac = false; + let isWindows = false; + let isLinux = false; + + if (typeof navigator !== 'undefined') { + const uaData = (navigator as Navigator & { userAgentData?: { platform?: string } }) + .userAgentData; + const platformHint = uaData?.platform ?? ''; + const userAgent = navigator.userAgent ?? ''; + + isMac = platformHint.toLowerCase().includes('mac') || /mac/i.test(userAgent); + isWindows = platformHint.toLowerCase().includes('win') || /win/i.test(userAgent); + isLinux = platformHint.toLowerCase().includes('linux') || /linux/i.test(userAgent); + } + + setPlatform({ isElectron, isMac, isWindows, isLinux }); + }, []); + + return platform; +} diff --git a/src/hooks/useRecentCampaigns.ts b/src/hooks/useRecentCampaigns.ts new file mode 100644 index 00000000..50c57674 --- /dev/null +++ b/src/hooks/useRecentCampaigns.ts @@ -0,0 +1,54 @@ +/** + * useRecentCampaigns — Hook for managing recent campaign list + * + * Wraps the localStorage-based recentCampaigns utility functions + * into a React hook with reactive state. HomeScreen uses this + * instead of directly calling localStorage. + * + * @see src/utils/recentCampaigns.ts for the underlying storage logic + */ + +import { useState, useCallback } from 'react'; + +import { + getRecentCampaigns, + addRecentCampaignWithPlatform, + removeRecentCampaign, +} from '../utils/recentCampaigns'; + +import type { RecentCampaign } from '../utils/recentCampaigns'; + +export type { RecentCampaign }; + +interface UseRecentCampaignsReturn { + /** List of recent campaigns, sorted newest first */ + recentCampaigns: RecentCampaign[]; + /** Add a campaign to the recent list (auto-detects platform) */ + addRecent: (id: string, name: string) => void; + /** Remove a campaign from the recent list */ + removeRecent: (campaignId: string) => void; + /** Reload the list from localStorage (e.g., after external mutation) */ + refresh: () => void; +} + +export function useRecentCampaigns(): UseRecentCampaignsReturn { + const [recentCampaigns, setRecentCampaigns] = useState(() => + getRecentCampaigns(), + ); + + const refresh = useCallback(() => { + setRecentCampaigns(getRecentCampaigns()); + }, []); + + const addRecent = useCallback((id: string, name: string) => { + addRecentCampaignWithPlatform(id, name); + setRecentCampaigns(getRecentCampaigns()); + }, []); + + const removeRecent = useCallback((campaignId: string) => { + removeRecentCampaign(campaignId); + setRecentCampaigns(getRecentCampaigns()); + }, []); + + return { recentCampaigns, addRecent, removeRecent, refresh }; +} diff --git a/src/hooks/useThemeColor.ts b/src/hooks/useThemeColor.ts index 03237493..390308bf 100644 --- a/src/hooks/useThemeColor.ts +++ b/src/hooks/useThemeColor.ts @@ -8,7 +8,7 @@ import { useState, useEffect } from 'react'; */ export function useThemeColor(variableName: string): string { // Helper to get current value - const getValue = () => { + const getValue = (): string => { if (typeof window === 'undefined') { return ''; } @@ -33,7 +33,7 @@ export function useThemeColor(variableName: string): string { }); // Also listen for any custom 'theme-change' events we might emit - const handleThemeChange = () => setColor(getValue()); + const handleThemeChange = (): void => setColor(getValue()); window.addEventListener('theme-change', handleThemeChange); return () => { diff --git a/src/hooks/useTokenData.test.ts b/src/hooks/useTokenData.test.ts index eced1633..9efbdc37 100644 --- a/src/hooks/useTokenData.test.ts +++ b/src/hooks/useTokenData.test.ts @@ -1,7 +1,7 @@ import { describe, it, expect } from 'vitest'; import { renderHook } from '@testing-library/react'; import { useTokenData, resolveTokenData, ResolvedTokenData } from './useTokenData'; -import { Token, TokenLibraryItem } from '../store/gameStore'; +import type { Token, TokenLibraryItem } from '../types/domain'; import { create } from 'zustand'; import { useGameStore } from '../store/gameStore'; diff --git a/src/hooks/useTokenData.ts b/src/hooks/useTokenData.ts index cf930d1c..d048f307 100644 --- a/src/hooks/useTokenData.ts +++ b/src/hooks/useTokenData.ts @@ -2,7 +2,7 @@ import { useMemo } from 'react'; import { useGameStore } from '../store/gameStore'; -import type { Token, TokenLibraryItem } from '../store/gameStore'; +import type { Token, TokenLibraryItem } from '../types/domain'; /** * ResolvedTokenData represents the fully resolved token data after merging @@ -11,6 +11,7 @@ import type { Token, TokenLibraryItem } from '../store/gameStore'; * All optional properties from Token are now required, as they've been resolved * to either the instance value, library default, or system default. */ +// eslint-disable-next-line import/no-unused-modules export interface ResolvedTokenData { id: string; x: number; @@ -51,6 +52,7 @@ export interface ResolvedTokenData { * // resolvedToken.scale is either token.scale or libraryItem.defaultScale or 1 * // resolvedToken.name is either token.name or libraryItem.name */ +// eslint-disable-next-line import/no-unused-modules export function useTokenData(token: Token): ResolvedTokenData { const tokenLibrary = useGameStore((state) => state.campaign.tokenLibrary); @@ -60,8 +62,11 @@ export function useTokenData(token: Token): ResolvedTokenData { /** * Default values for token properties */ +// eslint-disable-next-line import/no-unused-modules export const DEFAULT_SCALE = 1; +// eslint-disable-next-line import/no-unused-modules export const DEFAULT_NAME = 'Token'; +// eslint-disable-next-line import/no-unused-modules export const DEFAULT_MOVEMENT_SPEED = 30; // Standard D&D 5e movement speed /** @@ -72,6 +77,7 @@ export const DEFAULT_MOVEMENT_SPEED = 30; // Standard D&D 5e movement speed * @param tokenLibrary - The array of library items * @returns Fully resolved token data */ +// eslint-disable-next-line complexity export function resolveTokenData( token: Token, tokenLibrary: TokenLibraryItem[], diff --git a/src/hooks/useToolState.ts b/src/hooks/useToolState.ts new file mode 100644 index 00000000..637be774 --- /dev/null +++ b/src/hooks/useToolState.ts @@ -0,0 +1,176 @@ +/** + * useToolState — Tool selection, drawing mode, and tool keyboard shortcuts + * + * Manages the active tool (select/marker/eraser/wall/door/measure), + * marker colors, door orientation, wall color/thickness, and measurement mode. + * Registers keyboard shortcuts for tool switching (V, M, E, W, D, R, I, arrows). + * + * @see src/App.tsx for the consumer + * @see src/components/Canvas/CanvasManager.tsx for tool behavior + */ + +import { useState, useEffect, useRef } from 'react'; + +import { useGameStore } from '../store/gameStore'; + +import type { HexColor, PixelSize } from '../types/domain'; + +// eslint-disable-next-line import/no-unused-modules +export type ToolType = 'select' | 'marker' | 'eraser' | 'wall' | 'door' | 'measure'; +// eslint-disable-next-line import/no-unused-modules +export type MeasurementMode = 'ruler' | 'blast' | 'cone'; +// eslint-disable-next-line import/no-unused-modules +export type DoorOrientation = 'horizontal' | 'vertical'; + +interface UseToolStateOptions { + /** Whether the current window is the Architect (DM) view */ + isArchitectView: boolean; +} + +export interface UseToolStateReturn { + // Tool selection + tool: ToolType; + setTool: (tool: ToolType) => void; + + // Marker colors + color: HexColor; + setColor: (color: HexColor) => void; + handleColorChange: (newColor: HexColor) => void; + recentColors: HexColor[]; + colorInputRef: React.RefObject; + + // Door state + doorOrientation: DoorOrientation; + setDoorOrientation: React.Dispatch>; + + // Wall tool color and stroke width — applied to both manual canvas drawing + // and procedural dungeon generation (DungeonGeneratorDialog) + wallColor: HexColor; + setWallColor: (color: HexColor) => void; + wallSize: PixelSize; + setWallSize: (size: PixelSize) => void; + + // Measurement state + measurementMode: MeasurementMode; + setMeasurementMode: (mode: MeasurementMode) => void; + broadcastMeasurement: boolean; + setBroadcastMeasurement: (broadcast: boolean) => void; +} + +export function useToolState({ isArchitectView }: UseToolStateOptions): UseToolStateReturn { + // Active tool (controls CanvasManager behavior) + const [tool, setTool] = useState('select'); + + // Marker color state + const [color, setColor] = useState('#df4b26' as HexColor); + const [recentColors, setRecentColors] = useState([ + '#df4b26' as HexColor, + '#3b82f6' as HexColor, + '#22c55e' as HexColor, + ]); + const colorInputRef = useRef(null); + + const handleColorChange = (newColor: HexColor): void => { + setColor(newColor); + setRecentColors((prev) => { + const filtered = prev.filter((c) => c.toLowerCase() !== newColor.toLowerCase()); + return [newColor, ...filtered].slice(0, 3); + }); + }; + + // Door orientation + const [doorOrientation, setDoorOrientation] = useState('horizontal'); + + // Wall tool color and stroke width + const [wallColor, setWallColor] = useState('#ff0000' as HexColor); + const [wallSize, setWallSize] = useState(8 as PixelSize); + + // Measurement mode + const [measurementMode, setMeasurementMode] = useState('ruler'); + const broadcastMeasurement = useGameStore((state) => state.broadcastMeasurement); + const setBroadcastMeasurement = useGameStore((state) => state.setBroadcastMeasurement); + const setActiveMeasurement = useGameStore((state) => state.setActiveMeasurement); + + // Clear active measurement when mode changes to prevent confusion + useEffect(() => { + setActiveMeasurement(null); + }, [measurementMode, setActiveMeasurement]); + + // Tool keyboard shortcuts (Architect View only) + useEffect(() => { + if (!isArchitectView) { + return; + } + + const handleKeyDown = (e: KeyboardEvent): void => { + // Ignore if typing in an input + if (e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement) { + return; + } + + // Arrow keys toggle door orientation + if (['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'].includes(e.key)) { + if (tool === 'door') { + e.preventDefault(); + setDoorOrientation((prev) => (prev === 'horizontal' ? 'vertical' : 'horizontal')); + } + return; + } + + switch (e.key.toLowerCase()) { + case 'v': + setTool('select'); + break; + case 'm': + setTool('marker'); + break; + case 'e': + setTool('eraser'); + break; + case 'w': + setTool('wall'); + break; + case 'd': + setTool('door'); + break; + case 'r': + // If door tool is active, rotate door orientation + // Otherwise, switch to measure tool + if (tool === 'door') { + setDoorOrientation((prev) => (prev === 'horizontal' ? 'vertical' : 'horizontal')); + } else { + setTool('measure'); + } + break; + case 'i': + colorInputRef.current?.click(); + break; + default: + break; + } + }; + + window.addEventListener('keydown', handleKeyDown); + return () => window.removeEventListener('keydown', handleKeyDown); + }, [isArchitectView, tool]); + + return { + tool, + setTool, + color, + setColor, + handleColorChange, + recentColors, + colorInputRef, + doorOrientation, + setDoorOrientation, + wallColor, + setWallColor, + wallSize, + setWallSize, + measurementMode, + setMeasurementMode, + broadcastMeasurement, + setBroadcastMeasurement, + }; +} diff --git a/src/index.css b/src/index.css index d3f98164..bc38e31c 100644 --- a/src/index.css +++ b/src/index.css @@ -1,7 +1,5 @@ @import 'tailwindcss'; -@import './styles/fonts.css'; -@import './styles/theme.css'; -@import './styles/app.css'; +@import './styles/index.css'; /* Ensure html, body, and root fill viewport */ html, diff --git a/src/main.tsx b/src/main.tsx index 32b6c6d7..d79a97d3 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -3,8 +3,8 @@ import React from 'react'; import ReactDOM from 'react-dom/client'; import App from './App.tsx'; -import PendingErrorsIndicator from './components/PendingErrorsIndicator.tsx'; -import PrivacyErrorBoundary from './components/PrivacyErrorBoundary.tsx'; +import PendingErrorsIndicator from './components/ErrorBoundaries/PendingErrorsIndicator'; +import PrivacyErrorBoundary from './components/ErrorBoundaries/PrivacyErrorBoundary'; import { initStorage } from './services/storage.ts'; import { initGlobalErrorHandlers } from './utils/globalErrorHandler.ts'; import './index.css'; @@ -19,7 +19,8 @@ initGlobalErrorHandlers(); * Storage service must be initialized before React renders, * as components may call getStorage() during mount. */ -async function initApp() { + +async function initApp(): Promise { try { // Initialize storage service (detects Electron vs Web) await initStorage(); @@ -101,6 +102,7 @@ async function initApp() { return; } + // eslint-disable-next-line import/no-named-as-default-member ReactDOM.createRoot(rootElement).render( @@ -112,11 +114,13 @@ async function initApp() { } // Start app initialization -initApp().catch((error) => { +initApp().catch((error: unknown) => { console.error('[main] Fatal error during app initialization:', error); // Show error on screen const root = document.getElementById('root'); if (root) { + const errorMessage = error instanceof Error ? error.message : String(error); + const errorStack = error instanceof Error ? (error.stack ?? '') : ''; root.innerHTML = `
- ${error.toString()} - ${error.stack || ''} + ${errorMessage} + ${errorStack}