Appendix: Common Tasks
Add a new file parser — see the I/O Pipelines chapter, §6.1. Not summarised here: this entry used to give four steps that left out registering the
FormatHandler, which is what actually makes a file load.Add a keyboard shortcut
- Define the key mapping in
ui/shell/src/keyboard.rs. - Handle the action inside
viewer_loop/key_actions/(updateKeyActionContextif new state is required). - Update the User Guide’s shortcut tables.
- Define the key mapping in
Create a new viewer panel
- Add a module under
ui/shell/src/panels/. - Expose actions via enums in the
panels/modules and wire them throughViewerLoop. - Persist any new state in
UiStateand update serialisation logic if applicable.
- Add a module under
Expose a new CLI subcommand
- Update
automation/cli/src/cli.rswith the Clap definition (enum Commands). - Implement the logic using
OrbitronServicesinstead of re-implementing loaders. - Add user-facing documentation and tests (ideally under
automation/cli/testsor as integration binaries).
- Update
Expose functionality in the Python bridge
- Add public methods to the
OrbitronorScenepyclass (RustPyOrbitron/PyScene) inextensions/python-bridge/src/python/(orbitron.rs,scene.rs). - Reuse existing service helpers; avoid duplicating logic already present in the CLI.
- Update docstrings and provide a short example in the User Guide or Python README.
- Rebuild through the PEP 517 wrapper so viewer assets are staged:
conda run --no-capture-output -n orbitron-dev python -m pip install -e extensions/python-bridge. Add a focused test underextensions/python-bridge/tests.
- Add public methods to the
Add an analysis module shared by CLI/TUI
- Implement the core logic under
automation/cli/src/handlers/(the analyze handler lives athandlers/commands/analyze.rs; follow existing modules for geometry/orbitals). - Expose the module through the
AnalyzeCommandsenum and handler. - If the TUI should display the data, add a helper in
automation/tui/src/analysis.rsand render it inside the appropriate panel. - Capture representative fixtures in regression tests.
- Implement the core logic under
By following the patterns described in this guide and reusing existing abstractions, new features remain consistent with the rest of the Orbitron workspace while minimising regressions.