Repository navigation
Expand file tree
/
Copy pathApp.tsx
More file actions
143 lines (134 loc) · 6.73 KB
/
Copy pathApp.tsx
File metadata and controls
143 lines (134 loc) · 6.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
import { lazy, Suspense } from 'react';
import { Navigate, Routes, Route, useLocation, useParams } from 'react-router-dom';
import { HotkeysProvider } from '@blueprintjs/core';
import { Layout } from './components/Layout';
import { GlobalExperimentProvider } from './components/experiments/GlobalExperimentContext';
import NgsMolBioProjectHub from './components/molbio-ngs/NgsMolBioProjectHub';
import { useResolvedBmsFeatures } from './runtime/installFeatures';
const Dashboard = lazy(() => import('./components/Dashboard').then((module) => ({ default: module.Dashboard })));
const ProjectManager = lazy(() => import('./pages/ProjectManager').then((module) => ({ default: module.ProjectManager })));
const JobSubmission = lazy(() => import('./components/JobSubmission').then((module) => ({ default: module.JobSubmission })));
const ResultsViewer = lazy(() => import('./components/ResultsViewer').then((module) => ({ default: module.ResultsViewer })));
const JobDetailPage = lazy(() => import('./components/JobDetailPage').then((module) => ({ default: module.JobDetailPage })));
const MolBioToolkitV2 = lazy(() => import('./components/MolBioToolkit/indexV2').then((module) => ({ default: module.MolBioToolkitV2 })));
const NGSToolkit = lazy(() => import('./components/NGSToolkit').then((module) => ({ default: module.NGSToolkit })));
const BioXpCockpit = lazy(() => import('./components/BioXpCockpit').then((module) => ({ default: module.BioXpCockpit })));
const StatsToolkitLauncher = lazy(() => import('./components/StatsToolkitLauncher').then((module) => ({ default: module.StatsToolkitLauncher })));
function RouteLoadingFallback() {
return (
<div className="flex min-h-[24rem] items-center justify-center px-6 text-sm text-content-secondary">
Loading BioModStack workspace…
</div>
);
}
function HistoricalMolBioReopenRoute() {
const location = useLocation();
const query = new URLSearchParams(location.search);
const sequenceId = query.get('sequence_id')?.trim();
const revisionId = query.get('revision_id')?.trim();
const primerId = query.get('primer_id')?.trim();
const pcrExperimentId = query.get('experiment_id')?.trim();
if (sequenceId && revisionId) {
if (!query.has('molbio_sequence_id')) query.set('molbio_sequence_id', sequenceId);
if (!query.has('molbio_revision_id')) query.set('molbio_revision_id', revisionId);
}
if (pcrExperimentId && revisionId) {
if (!query.has('pcr_experiment_id')) query.set('pcr_experiment_id', pcrExperimentId);
if (!query.has('pcr_revision_id')) query.set('pcr_revision_id', revisionId);
}
if (primerId && revisionId && !query.has('primer_revision_id')) {
query.set('primer_revision_id', revisionId);
}
const search = query.toString();
return <Navigate replace to={`/designer${search ? `?${search}` : ''}`} />;
}
function HistoricalDomainExperimentReopenRoute() {
const location = useLocation();
const { domainExperimentId } = useParams<{ domainExperimentId: string }>();
const query = new URLSearchParams(location.search);
if (domainExperimentId) query.set('domain_experiment_id', domainExperimentId);
const search = query.toString();
return <Navigate replace to={`/ngs${search ? `?${search}` : ''}`} />;
}
function App() {
const { features: bmsFeatures, resolved: bmsFeaturesResolved, known: bmsFeaturesKnown } = useResolvedBmsFeatures();
return (
<HotkeysProvider>
<GlobalExperimentProvider>
<Layout>
<Suspense fallback={<RouteLoadingFallback />}>
<Routes>
<Route path="/" element={<Dashboard />} />
<Route path="/projects" element={<ProjectManager />} />
<Route path="/projects/:projectId" element={<ProjectManager />} />
<Route path="/projects/:projectId/experiments/:experimentId" element={<ProjectManager />} />
<Route path="/projects/:projectId/experiments/:experimentId/domains/:domainId" element={<ProjectManager />} />
<Route path="/submit" element={<JobSubmission />} />
<Route path="/results" element={<ResultsViewer />} />
<Route path="/designs" element={<ResultsViewer />} />
<Route path="/designs/:jobId" element={<ResultsViewer />} />
<Route path="/jobs" element={<Navigate replace to="/designs" />} />
<Route path="/jobs/:jobId" element={<JobDetailPage />} />
<Route path="/molbio" element={<HistoricalMolBioReopenRoute />} />
<Route
path="/molbio-ngs/domain-experiments/:domainExperimentId"
element={<HistoricalDomainExperimentReopenRoute />}
/>
{/* Molecular Biology Toolkit - Seqviz-based sequence editor */}
<Route
path="/designer"
element={(
<div className="w-full max-w-none">
<NgsMolBioProjectHub />
<MolBioToolkitV2 />
</div>
)}
/>
{/* NGS Data Visualization Toolkit - Nanopore-focused orchestration surface */}
<Route
path="/ngs"
element={(
<div className="w-full max-w-none">
<NGSToolkit />
</div>
)}
/>
{/* Isolated Stats Toolkit rendered inside the BioModStack workspace. */}
<Route path="/stats" element={<StatsToolkitLauncher />} />
{/* Historical analytics route now resolves to Dashboard telemetry. */}
<Route path="/infra" element={<Navigate replace to="/" />} />
{/* Saved workflows live inside the BioXP Handler workspace. */}
<Route
path="/bioxp/workflows"
element={!bmsFeaturesResolved
? <RouteLoadingFallback />
: bmsFeatures.bioxp || !bmsFeaturesKnown
? <BioXpCockpit initialTab="workflows" />
: <Navigate replace to="/" />}
/>
{/* Live travel stays within the same robot workspace. */}
<Route
path="/bioxp/live-deck"
element={!bmsFeaturesResolved
? <RouteLoadingFallback />
: bmsFeatures.bioxp || !bmsFeaturesKnown
? <BioXpCockpit initialTab="live-deck" />
: <Navigate replace to="/" />}
/>
{/* BioXP Handler Controls */}
<Route
path="/bioxp"
element={!bmsFeaturesResolved
? <RouteLoadingFallback />
: bmsFeatures.bioxp || !bmsFeaturesKnown
? <BioXpCockpit />
: <Navigate replace to="/" />}
/>
</Routes>
</Suspense>
</Layout>
</GlobalExperimentProvider>
</HotkeysProvider>
);
}
export default App