Skip to main content

Module config_editor

Module config_editor 

Source
Expand description

State for the integrated TUI config editor (Phase 1+).

What: Lives in state so both the renderer (ui::modals::config_editor) and the key handler (events::modals::config_editor) can read and mutate it without re-deriving fuzzy-match results or popup buffers per frame.

The editor reuses Pacsea’s three-pane mental model:

  • Top pane: file list (default) or matching-keys list (when a query is typed, or when a file has been selected and the key list is shown).
  • Middle pane: the search query input.
  • Bottom pane: details for the selected key (current value, summary, reload behavior).

settings.conf, keybinds.conf, and theme.conf are editable end-to-end; repos.conf appears in the file list as a disabled row so users can see the roadmap without being able to open it yet.

Structs§

ConfigEditorState
Top-level editor state held by crate::state::AppState::config_editor_state.
EditPopupState
State for the harmonized edit popup.

Enums§

ConfigEditorFocus
Which control inside the editor currently consumes typed characters.
ConfigEditorSearchFocus
Which sub-panel inside the config-editor search pane is active.
ConfigEditorView
Which top-pane view is active in the config editor.
EditPopupKind
Editable popup variant.

Functions§

bool_to_canonical
Canonical on-disk representation for a boolean.
chord_to_canonical_string
What: Serialize a KeyChord into the canonical string format understood by theme::parsing::parse_key_chord.
color_to_config_string
What: Serialize a ratatui color into the #rrggbb form accepted by theme.conf parsing.
current_value_string
What: Read the current value for entry from Settings::settings(), returning the canonical string the popup should pre-populate.
key_event_to_canonical_chord_string
What: Serialize a raw key event into the canonical chord string used by the keybind parser, for the popup’s capture mode.
keybind_chords_for_key
What: Look up the in-memory chord list for a canonical keybind action key.
lookup_setting
Convenience wrapper used by tests and helpers.
theme_color_value_string
What: Look up the effective in-memory color for a theme schema key.