This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Helium Framework is a Rust editor framework for Bevy using egui. It provides a modular architecture for building editor-like applications with docking, hotkeys, and menu systems.
- Build:
cargo build - Run example:
cargo run --example basic - Check:
cargo check - Test:
cargo test - Lint:
cargo clippy - Format:
cargo fmt
The framework consists of 5 main plugins that can be used independently or together:
-
ActionPlugin (
reflect_system.rs) - Reflective system registry- Registers systems as actions with type-safe input/output
- Provides
Actionssystem parameter for running actions - Core concept:
ActionId(alias forIdentifier)
-
HotkeyPlugin (
hotkeys.rs) - Global hotkey management- Supports multi-key combinations with different trigger types
- Prevents hotkey activation during text input (unless modifiers used)
- API:
app.register_hotkey("action_id", [Hotkey::new_global([KeyCode::Ctrl, KeyCode::KeyM])])
-
TabPlugin (
tab_system.rs) - Docking tab system- Uses
egui_dockfor window docking - Tabs are registered with
register_tab()and rendered via systems - Manages tab availability through conditions
- Uses
-
MenuPlugin (
menu.rs) - Hierarchical menu system- Supports buttons, custom widgets, submenus, and categories
- Priority-based ordering with
IndexMap - API:
app.menu_context(|ctx| ctx.with_sub_menu("file", "File", 0, |ctx| ...))
-
NotificationPlugin (
notifications.rs) - Toast notifications- Uses
egui-notifyfor in-app notifications
- Uses
ActionId/TabId:Identifiertype for action/tab registrationInMut<'a, T>: Wrapper for mutable references in tab systemsHeDockState: Wrapper forDockState<TabId>for serializationIdentifier: String-based ID type inutils/identifier.rs
// Setup
app.add_plugins(HeliumFramework)
.insert_resource(HeDockState(DockState::new(vec!["tab1".into()])));
// Register systems as actions
app.reflect_system("my_action", "description", my_system);
// Register tabs
app.register_tab("tab1", "My Tab", tab_ui, || true);
// Register hotkeys
app.register_hotkey("my_action", [Hotkey::new_global([KeyCode::KeyA])]);
// Setup menu
app.menu_context(|ctx| {
ctx.with_sub_menu("file", "File", 0, |ctx| {
ctx.add("quit", "Quit", Button::new("quit"), 0);
});
});- Bevy 0.16 - Game engine
- bevy_egui 0.34 - egui integration
- egui_dock 0.16 - Docking system
- egui-notify 0.19 - Notifications
- rust-i18n 3 - Internationalization
- snafu 0.8 - Error handling
The basic.rs example demonstrates all features:
- Tab registration and docking
- Hotkey system
- Menu system
- Action system with typed inputs/outputs