State struct and pure navigation logic for the dala_dev TUI.
All state transitions are pure functions: handle_key(state, key) -> state.
No side effects, no processes — just data transformation.
Summary
Functions
Returns the breadcrumb trail for the current view.
Returns the items for the currently active detail tab.
Processes a key press and returns the updated state.
Returns the items shown in the navigation panel.
Creates a new state with loaded devices, tasks, and remote info.
Types
@type t() :: %DalaDev.Tui.State{ current_tab: :devices | :tasks | :output | :debug, detail_selected: non_neg_integer(), devices: [DalaDev.Tui.Devices.t()], focus: :nav | :detail, last_run_output: String.t() | nil, loading: boolean(), nav_selected: non_neg_integer(), refreshing: boolean(), remotes: [DalaDev.Tui.Remote.t()], selected_device: DalaDev.Tui.Devices.t() | nil, selected_remote: DalaDev.Tui.Remote.t() | nil, selected_task: DalaDev.Tui.Tasks.t() | nil, show_help: boolean(), status_message: String.t() | nil, tasks: [DalaDev.Tui.Tasks.t()], version_info: map() | nil }
Functions
Returns the breadcrumb trail for the current view.
Returns the items for the currently active detail tab.
@spec device_detail(DalaDev.Tui.Devices.t()) :: [String.t()]
Processes a key press and returns the updated state.
@spec new([DalaDev.Tui.Devices.t()], [DalaDev.Tui.Tasks.t()], [DalaDev.Tui.Remote.t()]) :: t()
Creates a new state with loaded devices, tasks, and remote info.
@spec remote_detail(DalaDev.Tui.Remote.t()) :: [String.t()]
@spec task_detail(DalaDev.Tui.Tasks.t()) :: [String.t()]