feat: add bordered slim fader density
Add a persisted Bordered slim size between Slim and Standard. It renders as a three-row bordered vertical card and a compact horizontal strip, and round-trips through config, IPC, the editor, and TUI. Tests: cargo test -p fader-config -p tui --all-targets --all-features --locked Tests: cargo clippy --workspace --all-targets --all-features --locked -- -D warnings Tests: cargo fmt --all -- --check
This commit is contained in:
parent
c7d2450efb
commit
a464735f54
|
|
@ -25,7 +25,8 @@ same profile can switch to a compact stacked layout for narrow terminals:
|
|||
control-surface LEDs, use pickup to prevent jumps, and
|
||||
keep independently identified controllers from colliding.
|
||||
- Arrange faders and named separators directly in the mixer. Choose Slim,
|
||||
Standard, or Thick faders, and hide detail faders behind a group when useful.
|
||||
Bordered slim, Standard, or Thick faders, and hide detail faders behind a
|
||||
group when useful.
|
||||
- Use horizontal or vertical layouts and six built-in terminal themes.
|
||||
- Run as one command, or keep a standalone server alive while reconnecting TUI
|
||||
clients come and go.
|
||||
|
|
|
|||
|
|
@ -478,7 +478,8 @@ line. Editing a fader presents domain fields rather than a serialized command:
|
|||
MIDI actions.
|
||||
- **Mute control:** separate controller selection, Learn MIDI, and Unlearn MIDI
|
||||
actions.
|
||||
- **Size:** Slim, Standard, or Thick vertical presentation for this fader.
|
||||
- **Size:** Slim, Bordered slim, Standard, or Thick vertical presentation for
|
||||
this fader.
|
||||
- **Visibility:** Hide from mixer or Show in mixer without changing routing.
|
||||
|
||||
Groups select application-targeting faders in a checked multi-select popup; the
|
||||
|
|
|
|||
|
|
@ -421,6 +421,7 @@ max_gain = 1.0
|
|||
})?;
|
||||
table["density"] = value(match density {
|
||||
FaderDensity::Slim => "slim",
|
||||
FaderDensity::BorderedSlim => "bordered_slim",
|
||||
FaderDensity::Standard => "standard",
|
||||
FaderDensity::Thick => "thick",
|
||||
});
|
||||
|
|
|
|||
|
|
@ -225,6 +225,7 @@ pub struct Fader {
|
|||
#[serde(rename_all = "snake_case")]
|
||||
pub enum FaderDensity {
|
||||
Slim,
|
||||
BorderedSlim,
|
||||
#[default]
|
||||
Standard,
|
||||
Thick,
|
||||
|
|
|
|||
|
|
@ -89,6 +89,18 @@ fn mixer_layout_defaults_to_declared_faders_and_validates_explicit_entries() {
|
|||
}
|
||||
));
|
||||
|
||||
let bordered_slim = explicit.replace(
|
||||
"hidden = true",
|
||||
"hidden = true\ndensity = \"bordered_slim\"",
|
||||
);
|
||||
assert!(matches!(
|
||||
&Profile::parse(&bordered_slim).unwrap().mixer_layout()[1],
|
||||
MixerLayoutEntry::Fader {
|
||||
density: fader_config::FaderDensity::BorderedSlim,
|
||||
..
|
||||
}
|
||||
));
|
||||
|
||||
let duplicate = explicit.replace(
|
||||
"kind = \"fader\"\nfader = \"media-fader\"\nhidden = true",
|
||||
"kind = \"fader\"\nfader = \"media-fader\"\nhidden = true\n\n[[mixer_layout]]\nkind = \"fader\"\nfader = \"media-fader\"",
|
||||
|
|
|
|||
|
|
@ -145,8 +145,9 @@ density = "slim"
|
|||
hidden = false
|
||||
```
|
||||
|
||||
Fader density is `slim`, `standard`, or `thick`. Hidden faders retain their
|
||||
place and routing and can be restored from the Config tab.
|
||||
Fader density is `slim`, `bordered_slim`, `standard`, or `thick`. Slim uses one
|
||||
terminal row; Bordered slim adds a border around one content row. Hidden faders
|
||||
retain their place and routing and can be restored from the Config tab.
|
||||
|
||||
### MIDI surfaces and bindings
|
||||
|
||||
|
|
|
|||
|
|
@ -200,6 +200,9 @@ impl ConfigurationEditor {
|
|||
&id,
|
||||
match density {
|
||||
crate::ipc::FaderDensity::Slim => fader_config::FaderDensity::Slim,
|
||||
crate::ipc::FaderDensity::BorderedSlim => {
|
||||
fader_config::FaderDensity::BorderedSlim
|
||||
}
|
||||
crate::ipc::FaderDensity::Standard => fader_config::FaderDensity::Standard,
|
||||
crate::ipc::FaderDensity::Thick => fader_config::FaderDensity::Thick,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -250,6 +250,7 @@ pub enum MixerLayoutEntry {
|
|||
#[serde(rename_all = "snake_case")]
|
||||
pub enum FaderDensity {
|
||||
Slim,
|
||||
BorderedSlim,
|
||||
Standard,
|
||||
Thick,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -193,6 +193,9 @@ pub(crate) fn configuration_snapshot(
|
|||
hidden: *hidden,
|
||||
density: match density {
|
||||
fader_config::FaderDensity::Slim => crate::ipc::FaderDensity::Slim,
|
||||
fader_config::FaderDensity::BorderedSlim => {
|
||||
crate::ipc::FaderDensity::BorderedSlim
|
||||
}
|
||||
fader_config::FaderDensity::Standard => crate::ipc::FaderDensity::Standard,
|
||||
fader_config::FaderDensity::Thick => crate::ipc::FaderDensity::Thick,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -182,6 +182,9 @@ impl IpcMixerClient {
|
|||
hidden,
|
||||
density: match density {
|
||||
crate::ipc::FaderDensity::Slim => tui::FaderDensity::Slim,
|
||||
crate::ipc::FaderDensity::BorderedSlim => {
|
||||
tui::FaderDensity::BorderedSlim
|
||||
}
|
||||
crate::ipc::FaderDensity::Standard => {
|
||||
tui::FaderDensity::Standard
|
||||
}
|
||||
|
|
@ -366,6 +369,7 @@ fn configuration_edit(edit: TuiConfigurationEdit) -> crate::ipc::ConfigurationEd
|
|||
id,
|
||||
density: match density {
|
||||
tui::FaderDensity::Slim => crate::ipc::FaderDensity::Slim,
|
||||
tui::FaderDensity::BorderedSlim => crate::ipc::FaderDensity::BorderedSlim,
|
||||
tui::FaderDensity::Standard => crate::ipc::FaderDensity::Standard,
|
||||
tui::FaderDensity::Thick => crate::ipc::FaderDensity::Thick,
|
||||
},
|
||||
|
|
|
|||
11
task.md
11
task.md
|
|
@ -411,11 +411,12 @@ Dependencies: M8, M2, M1.
|
|||
actions. Learning opens a modal prompt for a fader movement or button press;
|
||||
relearning atomically replaces only the chosen action, and validation
|
||||
conflicts retain the draft. Visibility uses the same form.
|
||||
The form also persists a per-fader Slim, Standard, or Thick size in the mixer
|
||||
layout. Existing profiles default to Standard. Slim renders in one terminal
|
||||
row for vertical cards and as a narrower strip for horizontal faders. Config
|
||||
stores a validated default controller; unassigned volume and mute learn actions
|
||||
inherit it while explicit bindings keep their selected surface.
|
||||
The form also persists a per-fader Slim, Bordered slim, Standard, or Thick
|
||||
size in the mixer layout. Existing profiles default to Standard. Slim renders
|
||||
in one terminal row; Bordered slim uses a three-row bordered card; both are
|
||||
narrower strips for horizontal faders. Config stores a validated default
|
||||
controller; unassigned volume and mute learn actions inherit it while explicit
|
||||
bindings keep their selected surface.
|
||||
- [ ] **M9.6 Single-screen configuration workflow:** remove the normalized
|
||||
Config table browser once all its operations are reachable from the mixer,
|
||||
keep Save and draft/durable status visible, and expose hidden-item
|
||||
|
|
|
|||
|
|
@ -136,6 +136,7 @@ pub enum MixerLayoutEntry {
|
|||
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
|
||||
pub enum FaderDensity {
|
||||
Slim,
|
||||
BorderedSlim,
|
||||
#[default]
|
||||
Standard,
|
||||
Thick,
|
||||
|
|
@ -145,6 +146,7 @@ impl FaderDensity {
|
|||
const fn label(self) -> &'static str {
|
||||
match self {
|
||||
Self::Slim => "Slim",
|
||||
Self::BorderedSlim => "Bordered slim",
|
||||
Self::Standard => "Standard",
|
||||
Self::Thick => "Thick",
|
||||
}
|
||||
|
|
@ -152,7 +154,8 @@ impl FaderDensity {
|
|||
|
||||
const fn next(self) -> Self {
|
||||
match self {
|
||||
Self::Slim => Self::Standard,
|
||||
Self::Slim => Self::BorderedSlim,
|
||||
Self::BorderedSlim => Self::Standard,
|
||||
Self::Standard => Self::Thick,
|
||||
Self::Thick => Self::Slim,
|
||||
}
|
||||
|
|
@ -997,6 +1000,10 @@ impl MixerRow<'_> {
|
|||
density: FaderDensity::Slim,
|
||||
..
|
||||
} => 1,
|
||||
Self::Fader {
|
||||
density: FaderDensity::BorderedSlim,
|
||||
..
|
||||
} => 3,
|
||||
Self::Fader {
|
||||
density: FaderDensity::Standard,
|
||||
..
|
||||
|
|
@ -3166,6 +3173,10 @@ impl<C: MixerClient> LiveTui<C> {
|
|||
density: FaderDensity::Slim,
|
||||
..
|
||||
} => 10,
|
||||
MixerRow::Fader {
|
||||
density: FaderDensity::BorderedSlim,
|
||||
..
|
||||
} => 13,
|
||||
MixerRow::Fader {
|
||||
density: FaderDensity::Standard,
|
||||
..
|
||||
|
|
@ -4441,7 +4452,9 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn fader_density_cycles_and_slim_rows_use_one_terminal_line() {
|
||||
fn fader_density_cycles_and_compact_rows_render_at_their_exact_heights() {
|
||||
assert_eq!(FaderDensity::Slim.next(), FaderDensity::BorderedSlim);
|
||||
assert_eq!(FaderDensity::BorderedSlim.next(), FaderDensity::Standard);
|
||||
let mut snapshot = DemoClient::default().view();
|
||||
snapshot.items[0].id.id = "music".into();
|
||||
snapshot.items[0].label = "Music".into();
|
||||
|
|
@ -4498,6 +4511,23 @@ mod tests {
|
|||
.collect::<String>();
|
||||
assert!(rendered.contains("Music"));
|
||||
assert!(rendered.contains("65%"));
|
||||
|
||||
if let MixerLayoutEntry::Fader { density, .. } =
|
||||
&mut app.snapshot.configuration.mixer_layout[0]
|
||||
{
|
||||
*density = FaderDensity::BorderedSlim;
|
||||
}
|
||||
let area = Rect::new(0, 0, 80, 3);
|
||||
let mut buffer = Buffer::empty(area);
|
||||
app.render_streams(area, &mut buffer);
|
||||
let rendered = buffer
|
||||
.content
|
||||
.iter()
|
||||
.map(|cell| cell.symbol())
|
||||
.collect::<String>();
|
||||
assert!(rendered.contains('┌'));
|
||||
assert!(rendered.contains("Music"));
|
||||
assert!(rendered.contains("65%"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
Loading…
Reference in New Issue