diff --git a/src/App.tsx b/src/App.tsx index a568c0c..97277d3 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,4 +1,4 @@ -import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react' +import { lazy, Suspense, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react' import { BookOpen, Building2, CalendarClock, Camera, Check, ChevronRight, CircleHelp, ClipboardCheck, FileText, FolderOpen, Hand, Image as ImageIcon, Images, Info, Link2, Minus, MousePointer2, Network, Newspaper, NotebookPen, Pencil, Plus, RotateCcw, Search, Trash2, Upload, UserRound, X, ZoomIn, ZoomOut } from 'lucide-react' import type { BriefConcept, CaseDocument, CaseReport, CaseReportSubmissionInput, CaseState, Connection, DocumentCaptureKind, DocumentSemanticAnalysis, EventExhibit, Evidence, EvidenceMatchRuleDefinition, Exhibit, ExhibitRelation, FolderExhibit, LevelBrief, LevelFlag, LevelGoal, OrganizationKind, PartyExhibit, PartyKind, SourceFileType, TimelineRange, TimelineView, UploadedCaseDocument } from './types' import { AdminPanel } from './admin' @@ -6,6 +6,9 @@ import { clampBoardZoom, containedIds, dateValue, discardExhibit, folderIsOpen, import { defaultConnectionLabel, documentCapture, documentCaptureRegistry, documentExhibits, documentWidget, evidenceExhibits, exhibitWidget, type ExhibitWidgetContext, type WidgetCommand } from './exhibitRegistry' import type { PlaythroughState } from './narrative' +// three.js stays out of the board bundle until the player opens the inventory. +const Inventory = lazy(() => import('./inventory').then(m => ({ default: m.Inventory }))) + const BOARD_W = 2400 const BOARD_H = 1500 const SOURCE_FILE_TYPES: { value: SourceFileType; label: string }[] = [ @@ -71,6 +74,7 @@ export function App() { const [recentlyCreatedConnectionId, setRecentlyCreatedConnectionId] = useState(null) const [threadDraft, setThreadDraft] = useState(null) const [flagsOpen, setFlagsOpen] = useState(false) + const [inventoryOpen, setInventoryOpen] = useState(false) const [matchRulesOpen, setMatchRulesOpen] = useState(false) const [arrivingExhibitIds, setArrivingExhibitIds] = useState([]) const [activePlaythroughId, setActivePlaythroughId] = useState(null) @@ -537,6 +541,9 @@ export function App() { }) const timelineView = caseState.views.find((view): view is TimelineView => view.type === 'timeline') return
+ {inventoryOpen && activePlaythroughId && + window.location.assign('/?resume=1') }} onClose={() => setInventoryOpen(false)} /> + }
GUOSINT BOARD / {requestedEditMode && caseState.editingAllowed ? 'LEVEL EDITOR' : 'CASE TERMINAL'}