routes/+layout.svelte — Navigation Bar
The layout wraps every page in the application. It renders the persistent navigation bar at the top and then the current page's content via {@render children()}.
Navigation bar
Task dropdown — lists the four task routes (Science, Navigation, Maintenance, Probing). Selecting one navigates to that route and updates the displayed task name.
Drive Control Mode dropdown — toggles between Manual and Automatic drive. Calls set_state with DriveManual to sync the mode to the backend.
Arm Control Mode dropdown — toggles between Manual and Automatic arm control. Calls set_state with ArmManual to sync the mode to the backend.
Start / Pause / Resume Task button — controls a task timer. Displays the elapsed time next to the label. The button label cycles through ▶︎ Start Task → ❚❚ Pause <task> → ▶︎ Resume <task> depending on state.
Mode icon — a centred icon that shows either a driving icon or an arm icon depending on the current pickup_mode state. Polled from the backend every 250ms.
Settings / Home icons — navigation shortcuts in the top right.
Task file naming
When a task ends, the layout reads the existing task files and finds the highest existing prefix number for that task type, then increments it. This ensures task files are always uniquely numbered in order (e.g. 0000_science.json, 0001_science.json).
Camera health
initCameraHealthListener() from state.svelte.js is called directly in the layout's <script> (outside onMount) so it is initialised as early as possible.
No comments to display
No comments to display