Skip to content

Commit f763d30

Browse files
Flatten choptima steps for readability for now
1 parent c5d04d7 commit f763d30

5 files changed

Lines changed: 75 additions & 64 deletions

File tree

app/entry.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ export default function Entry() {
2323

2424
return (
2525
<>
26-
{showStorybook ? <StorybookEntry /> : <FullAppEntry />}
27-
2826
{/* Collapsible header */}
2927
{collapsed ? (
3028
<View style={styles.collapsedContainer} pointerEvents="box-none">
@@ -33,7 +31,7 @@ export default function Entry() {
3331
onPress={() => setCollapsed(false)}
3432
accessibilityLabel="Expand header"
3533
>
36-
<Text style={styles.chevron}>{'˅'}</Text>
34+
<Text style={styles.chevron}>Open Debug</Text>
3735
</TouchableOpacity>
3836
</View>
3937
) : (
@@ -45,7 +43,7 @@ export default function Entry() {
4543
onPress={() => setCollapsed(true)}
4644
accessibilityLabel="Collapse header"
4745
>
48-
<Text style={styles.collapseText}>{'˄'}</Text>
46+
<Text style={styles.collapseText}>Close</Text>
4947
</TouchableOpacity>
5048
</View>
5149

@@ -68,6 +66,7 @@ export default function Entry() {
6866
</View>
6967
</View>
7068
)}
69+
{showStorybook ? <StorybookEntry /> : <FullAppEntry />}
7170
</>
7271
)
7372
}
@@ -92,10 +91,10 @@ const styles = StyleSheet.create({
9291
fontSize: 12,
9392
},
9493
headerContainer: {
95-
position: 'absolute',
96-
top: 0,
97-
left: 0,
98-
right: 0,
94+
// position: 'absolute',
95+
// top: 0,
96+
// left: 0,
97+
// right: 0,
9998
backgroundColor: 'rgba(0,0,0,0.7)',
10099
paddingTop: 36,
101100
paddingBottom: 12,

components/Choptima/ChoptimaAssembly.tsx

Lines changed: 32 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -28,76 +28,64 @@ const sampleSteps: AssemblyStep[] = [
2828
id: '3',
2929
step: '3',
3030
title: 'Canister Assembly',
31-
content: '## Canister assembly\n\nPerform the following canister tasks:',
32-
children: [
33-
{ id: '3a', step: '3a', title: 'Inspect canister, head & lid', content: 'Inspect canister, head, and lid for damage, debris, or missing hardware.' },
34-
{ id: '3b', step: '3b', title: 'Inspect scrubber media', content: 'Inspect scrubber media/cartridges (EAC or other sorb) and note type; if using EAC, inspect cartridges for damage and orientation.' },
35-
{ id: '3c', step: '3c', title: 'Pack scrubber', content: 'Pack scrubber canister, install cartridges as required and confirm orientation.' },
36-
{ id: '3d', step: '3d', title: 'Inspect bore plug', content: 'Inspect bore plug and confirm correct orientation.' },
37-
{ id: '3e', step: '3e', title: 'Lube O-rings & install head', content: 'Lube head O-rings and flat seals; confirm O-rings on premix/purge tube and install head onto canister.' },
38-
{ id: '3f', step: '3f', title: 'Water trap & lid', content: 'Confirm water trap is installed in lid; lube lid O-rings and flat seals and secure the lid.' },
39-
],
31+
content: '## Canister assembly\n\nPerform the following canister tasks:'
4032
},
33+
{ id: '3a', step: '3a', title: 'Inspect canister, head & lid', content: 'Inspect canister, head, and lid for damage, debris, or missing hardware.' },
34+
{ id: '3b', step: '3b', title: 'Inspect scrubber media', content: 'Inspect scrubber media/cartridges (EAC or other sorb) and note type; if using EAC, inspect cartridges for damage and orientation.' },
35+
{ id: '3c', step: '3c', title: 'Pack scrubber', content: 'Pack scrubber canister, install cartridges as required and confirm orientation.' },
36+
{ id: '3d', step: '3d', title: 'Inspect bore plug', content: 'Inspect bore plug and confirm correct orientation.' },
37+
{ id: '3e', step: '3e', title: 'Lube O-rings & install head', content: 'Lube head O-rings and flat seals; confirm O-rings on premix/purge tube and install head onto canister.' },
38+
{ id: '3f', step: '3f', title: 'Water trap & lid', content: 'Confirm water trap is installed in lid; lube lid O-rings and flat seals and secure the lid.' },
4139
{
4240
id: '4',
4341
step: '4',
4442
title: 'Calibration & Sensor Setup',
45-
content: '## Calibration & sensor setup\n\nCalibration and sensor checks for controller and HUD.',
46-
children: [
47-
{ id: '4a', step: '4a', title: 'Install calibration caps', content: 'Install calibration caps if required.' },
48-
{ id: '4b', step: '4b', title: 'Flush with O2', content: 'Connect O2 hose to controller, turn on controller, and flush with oxygen until PPO2 readings stabilize.' },
49-
{ id: '4c', step: '4c', title: 'Calibrate controller & HUD', content: 'Calibrate controller and HUD following manufacturer instructions.' },
50-
{ id: '4d', step: '4d', title: 'Record O2 sensor readings', content: 'With scrubber filled and flushed with O2, check and record O2 sensor mV readings and verify they are within expected ranges.' },
51-
],
43+
content: '## Calibration & sensor setup\n\nCalibration and sensor checks for controller and HUD.'
5244
},
45+
{ id: '4a', step: '4a', title: 'Install calibration caps', content: 'Install calibration caps if required.' },
46+
{ id: '4b', step: '4b', title: 'Flush with O2', content: 'Connect O2 hose to controller, turn on controller, and flush with oxygen until PPO2 readings stabilize.' },
47+
{ id: '4c', step: '4c', title: 'Calibrate controller & HUD', content: 'Calibrate controller and HUD following manufacturer instructions.' },
48+
{ id: '4d', step: '4d', title: 'Record O2 sensor readings', content: 'With scrubber filled and flushed with O2, check and record O2 sensor mV readings and verify they are within expected ranges.' },
5349
{
5450
id: '5',
5551
step: '5',
5652
title: 'Bag / Loop Setup',
57-
content: '## Bag and loop setup\n\nSetup bag, hoses and routing.',
58-
children: [
59-
{ id: '5a', step: '5a', title: 'Install water trap tubes', content: 'Install both water trap tubes into counterlungs (note black machined tube for exhale side).' },
60-
{ id: '5b', step: '5b', title: 'Mount scrubber', content: 'Position assembled scrubber canister into unit and secure into counterlungs/seat.' },
61-
{ id: '5c', step: '5c', title: 'Inspect valves & hoses', content: 'Inspect DSV, mushroom valves, mouthpiece, loop hoses, fittings and O-rings for condition.' },
62-
{ id: '5d', step: '5d', title: 'Stereo check', content: 'Connect DSV to loop hoses and perform stereo check to confirm flow direction.' },
63-
{ id: '5e', step: '5e', title: 'Connect loop hoses', content: 'Connect loop hoses to counterlungs and double-check fittings for tightness.' },
64-
{ id: '5f', step: '5f', title: 'Route electronics cables', content: 'Route controller and HUD cables, plug into electronics canister, and stow excess cable.' },
65-
],
53+
content: '## Bag and loop setup\n\nSetup bag, hoses and routing.'
6654
},
55+
{ id: '5a', step: '5a', title: 'Install water trap tubes', content: 'Install both water trap tubes into counterlungs (note black machined tube for exhale side).' },
56+
{ id: '5b', step: '5b', title: 'Mount scrubber', content: 'Position assembled scrubber canister into unit and secure into counterlungs/seat.' },
57+
{ id: '5c', step: '5c', title: 'Inspect valves & hoses', content: 'Inspect DSV, mushroom valves, mouthpiece, loop hoses, fittings and O-rings for condition.' },
58+
{ id: '5d', step: '5d', title: 'Stereo check', content: 'Connect DSV to loop hoses and perform stereo check to confirm flow direction.' },
59+
{ id: '5e', step: '5e', title: 'Connect loop hoses', content: 'Connect loop hoses to counterlungs and double-check fittings for tightness.' },
60+
{ id: '5f', step: '5f', title: 'Route electronics cables', content: 'Route controller and HUD cables, plug into electronics canister, and stow excess cable.' },
6761
{
6862
id: '6',
6963
step: '6',
7064
title: 'Oxygen Cylinder & Regulator',
71-
content: '## Oxygen & regulator\n\nInstall oxygen supply and regulator.',
72-
children: [
73-
{ id: '6a', step: '6a', title: 'Attach oxygen hose & manual add', content: 'Attach oxygen supply hose to head fitting and attach manual add/override feed to MAV. Ensure inline shutoff is turned on and locked open with clip.' },
74-
{ id: '6b', step: '6b', title: 'Mount cylinder', content: 'Clip and tighten canister cover and mount oxygen cylinder.' },
75-
{ id: '6c', step: '6c', title: 'Attach regulator', content: 'Attach regulator and connect oxygen hose to the Y-block.' },
76-
],
65+
content: '## Oxygen & regulator\n\nInstall oxygen supply and regulator.'
7766
},
67+
{ id: '6a', step: '6a', title: 'Attach oxygen hose & manual add', content: 'Attach oxygen supply hose to head fitting and attach manual add/override feed to MAV. Ensure inline shutoff is turned on and locked open with clip.' },
68+
{ id: '6b', step: '6b', title: 'Mount cylinder', content: 'Clip and tighten canister cover and mount oxygen cylinder.' },
69+
{ id: '6c', step: '6c', title: 'Attach regulator', content: 'Attach regulator and connect oxygen hose to the Y-block.' },
7870
{
7971
id: '7',
8072
step: '7',
8173
title: 'Leak & Pressure Tests',
82-
content: '## Leak and pressure tests\n\nPerform pressure and leak checks.',
83-
children: [
84-
{ id: '7a', step: '7a', title: 'Negative pressure test', content: 'Ensure ADV is off and perform a negative pressure test for minimum 30s (no inward leaks).' },
85-
{ id: '7b', step: '7b', title: 'Positive pressure test', content: 'Ensure counterlung exhaust valve is closed and perform a positive pressure test for minimum 2 minutes (no outward leaks).' },
86-
{ id: '7c', step: '7c', title: 'Record cylinder pressure', content: 'Turn on oxygen and record cylinder pressure (bar).' },
87-
{ id: '7d', step: '7d', title: 'Leak-down check', content: 'Turn off oxygen cylinder and perform leak-down check to confirm system holds pressure.' },
88-
],
74+
content: '## Leak and pressure tests\n\nPerform pressure and leak checks.'
8975
},
76+
{ id: '7a', step: '7a', title: 'Negative pressure test', content: 'Ensure ADV is off and perform a negative pressure test for minimum 30s (no inward leaks).' },
77+
{ id: '7b', step: '7b', title: 'Positive pressure test', content: 'Ensure counterlung exhaust valve is closed and perform a positive pressure test for minimum 2 minutes (no outward leaks).' },
78+
{ id: '7c', step: '7c', title: 'Record cylinder pressure', content: 'Turn on oxygen and record cylinder pressure (bar).' },
79+
{ id: '7d', step: '7d', title: 'Leak-down check', content: 'Turn off oxygen cylinder and perform leak-down check to confirm system holds pressure.' },
9080
{
9181
id: '8',
9282
step: '8',
9383
title: 'Pre-breathe & Final Checks',
94-
content: '## Pre-breathe & final checks\n\nComplete final pre-breathe and system checks.',
95-
children: [
96-
{ id: '8a', step: '8a', title: 'Pre-breathe', content: 'Turn oxygen back on, open counterlung exhaust valve, set setpoint (example 0.5) and perform a 5-minute pre-breathe while confirming solenoid operation and system stability.' },
97-
{ id: '8b', step: '8b', title: 'Confirm computers & bailout', content: 'Confirm onboard and bailout gases are configured and selected in dive computers and set to CC mode.' },
98-
{ id: '8c', step: '8c', title: 'Bailout checks', content: 'Check bailout regulator hoses, mouthpieces and fittings for tightness; install bailout regulators and verify operation.' },
99-
],
84+
content: '## Pre-breathe & final checks\n\nComplete final pre-breathe and system checks.'
10085
},
86+
{ id: '8a', step: '8a', title: 'Pre-breathe', content: 'Turn oxygen back on, open counterlung exhaust valve, set setpoint (example 0.5) and perform a 5-minute pre-breathe while confirming solenoid operation and system stability.' },
87+
{ id: '8b', step: '8b', title: 'Confirm computers & bailout', content: 'Confirm onboard and bailout gases are configured and selected in dive computers and set to CC mode.' },
88+
{ id: '8c', step: '8c', title: 'Bailout checks', content: 'Check bailout regulator hoses, mouthpieces and fittings for tightness; install bailout regulators and verify operation.' },
10189
]
10290

10391
export const ChoptimaAssembly: React.FC<{ steps?: AssemblyStep[] }> = ({ steps = sampleSteps }) => {
@@ -120,7 +108,6 @@ export const ChoptimaAssembly: React.FC<{ steps?: AssemblyStep[] }> = ({ steps =
120108
title={s.title}
121109
content={s.content}
122110
images={s.images}
123-
substeps={s.children}
124111
expanded={expandAll}
125112
initiallyCollapsed={!expandAll}
126113
/>

components/Choptima/ChoptimaStep.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,16 @@ export const ChoptimaStep: React.FC<Props> = ({ step, title, content, images = [
107107

108108
const parsedContent = useMemo(() => renderMarkdown(content), [content])
109109

110+
const isChild = useMemo(() => Number.isNaN(Number(step)), [step])
111+
110112
return (
113+
<View>
111114
<View style={styles.stepContainer}>
112115
<TouchableOpacity
113116
onPress={() => setCollapsed((s) => !s)}
114117
style={styles.header}
115118
activeOpacity={0.7}
116-
>
119+
>
117120
<Text style={styles.title}>{step ? `${step}. ${title}` : title}</Text>
118121
<Text style={styles.chev}>{collapsed ? '+' : '-'}</Text>
119122
</TouchableOpacity>
@@ -127,9 +130,10 @@ export const ChoptimaStep: React.FC<Props> = ({ step, title, content, images = [
127130
))}
128131

129132
{/* Render substeps if present */}
130-
{substeps.length > 0 && (
131-
<View style={styles.substeps}>
132-
{substeps.map((ss) => (
133+
</View>
134+
</Collapsible>
135+
</View>
136+
{substeps.length > 0 && substeps.map((ss) => (
133137
<ChoptimaStep
134138
key={ss.id}
135139
step={ss.step}
@@ -139,11 +143,7 @@ export const ChoptimaStep: React.FC<Props> = ({ step, title, content, images = [
139143
initiallyCollapsed={true}
140144
/>
141145
))}
142-
</View>
143-
)}
144-
</View>
145-
</Collapsible>
146-
</View>
146+
</View>
147147
)
148148
}
149149

0 commit comments

Comments
 (0)