diff --git a/README.md b/README.md index 669c335..779f087 100644 --- a/README.md +++ b/README.md @@ -69,10 +69,11 @@ upgrade was unavailable. The `validate` command remains read-only. The mixer arrow keys follow its orientation. In Vertical mode, use Up/Down to select a configured fader or separator and Left/Right to change its volume. In Horizontal mode, use Left/Right to select and Up/Down to change volume. J/K -remain selection aliases in either mode, and Shift plus the selection arrows -reorders an entry. M toggles mute, Shift+H hides the selected fader, and `h` or -`?` opens detailed keyboard help. T cycles the profile's theme draft, and Q opens -the quit confirmation. Escape cancels the active editor or dialog and +remain selection aliases in either mode; Shift plus the selection arrows, or +Shift+J/K, reorders an entry. The J/K binding avoids terminals that do not +report Shift+Arrow distinctly. M toggles mute, Shift+H hides the selected fader, +and `h` or `?` opens detailed keyboard help. T cycles the profile's theme draft, +and Q opens the quit confirmation. Escape cancels the active editor or dialog and does not quit from the main screen. Pass `--theme dracula`, `nord`, `gruvbox-dark`, `catppuccin-mocha`, or `solarized-dark` to choose an initial session theme. Save from Config to persist a theme selected with T. Offline diff --git a/architecture.md b/architecture.md index 8b52a7b..8f75bf5 100644 --- a/architecture.md +++ b/architecture.md @@ -451,7 +451,8 @@ Arrow-key controls follow that spatial model: vertical mode selects entries with Up/Down and changes volume with Left/Right, while horizontal mode selects with Left/Right and changes volume with Up/Down. Holding Shift reorders entries along the active selection axis; J/K remain orientation-independent selection -aliases. +aliases, and Shift+J/K provides an orientation-independent reorder path for +terminals that do not distinguish Shift+Arrow. Lowercase `h` and `?` open an orientation-aware keyboard-help popup with mixer, configuration, and global controls. Hiding is deliberately assigned to Shift+H so the common help key does not perform a destructive presentation edit. diff --git a/tui/src/lib.rs b/tui/src/lib.rs index 5a66c38..feaf318 100644 --- a/tui/src/lib.rs +++ b/tui/src/lib.rs @@ -1225,6 +1225,8 @@ impl LiveTui { if key_event.modifiers.contains(KeyModifiers::SHIFT) { match (horizontal, key_event.code) { (_, KeyCode::Char('H' | 'h')) => self.toggle_selected_visibility(), + (_, KeyCode::Char('K' | 'k')) => self.move_selected_layout(-1), + (_, KeyCode::Char('J' | 'j')) => self.move_selected_layout(1), (true, KeyCode::Left) | (false, KeyCode::Up) => { self.move_selected_layout(-1); } @@ -2281,7 +2283,7 @@ impl Widget for &LiveTui { "config".fg(theme.secondary), " Q ".fg(theme.foreground), "quit".fg(theme.secondary), - " ⇧←→ ".fg(theme.foreground), + " ⇧←→/⇧JK ".fg(theme.foreground), "move".fg(theme.secondary), " A/E/D ".fg(theme.foreground), "separator".fg(theme.secondary), @@ -2305,7 +2307,7 @@ impl Widget for &LiveTui { "config".fg(theme.secondary), " Q ".fg(theme.foreground), "quit".fg(theme.secondary), - " ⇧↑↓ ".fg(theme.foreground), + " ⇧↑↓/⇧JK ".fg(theme.foreground), "move".fg(theme.secondary), " A/E/D ".fg(theme.foreground), "separator".fg(theme.secondary), @@ -2935,8 +2937,10 @@ impl LiveTui { fn render_help(&self, area: Rect, buf: &mut Buffer) { let theme = self.theme.palette(); let (selection, volume, movement) = match self.snapshot.configuration.mixer_orientation { - MixerOrientation::Horizontal => ("Left/Right", "Up/Down", "Shift+Left/Right"), - MixerOrientation::Vertical => ("Up/Down", "Left/Right", "Shift+Up/Down"), + MixerOrientation::Horizontal => { + ("Left/Right", "Up/Down", "Shift+Left/Right or Shift+J/K") + } + MixerOrientation::Vertical => ("Up/Down", "Left/Right", "Shift+Up/Down or Shift+J/K"), }; let popup = centered_rect(area, 78, 22); Clear.render(popup, buf); @@ -3829,6 +3833,28 @@ mod tests { ConfigurationEdit::MoveLayoutEntry { id, position: 1 } if id == "music-fader" ))); + assert_eq!( + app.mixer_rows() + .iter() + .map(|row| row.id()) + .collect::>(), + ["browser-fader", "music-fader"] + ); + + app.handle_key_event(shift(KeyCode::Char('k'))); + assert!(matches!( + edits.lock().unwrap().last(), + Some(ConfigurationEdit::MoveLayoutEntry { id, position: 0 }) + if id == "music-fader" + )); + assert_eq!(app.selected, 0); + assert_eq!( + app.mixer_rows() + .iter() + .map(|row| row.id()) + .collect::>(), + ["music-fader", "browser-fader"] + ); } #[test]