diff --git a/.Jules/palette.md b/.Jules/palette.md index 2aba9c39..c8aa26d7 100644 --- a/.Jules/palette.md +++ b/.Jules/palette.md @@ -38,6 +38,9 @@ **Learning:** Inconsistent usage of UI themes (like `dialoguer`'s `ColorfulTheme`) and missing semantic icons in password prompts breaks the visual consistency of the CLI. Using standard themes and icons (e.g., 🔐 for secrets) makes the tool feel more polished and trustworthy. **Action:** Always use `ColorfulTheme::default()` for `dialoguer` prompts and include appropriate semantic emojis in prompt text to match the rest of the application. +## 2026-06-14 - [Interactive Input Feedback] +**Learning:** When asking users for multiple inputs in a loop (like variables or tags), they often lose track of what they've already entered. Providing a running list of entered items and immediate success feedback ("✔ Added...") significantly reduces cognitive load and increases confidence. +**Action:** In `dialoguer` loops, always print the current state of accumulated items before prompting for the next one. ## 2024-03-22 - [Hybrid Output Strategies] **Learning:** Commands that support both human-readable text and machine-readable JSON often fail to produce valid JSON if they print text incrementally during execution. Interleaved text breaks the JSON structure. **Action:** For commands supporting `--output json`, collect all data into a structured object first, then decide whether to print it as JSON or iterate over it for formatted text output. Avoid immediate `println!` during data gathering. diff --git a/src/cli/interactive.rs b/src/cli/interactive.rs index d3aa2ef9..c26ecc8b 100644 --- a/src/cli/interactive.rs +++ b/src/cli/interactive.rs @@ -202,6 +202,14 @@ impl InteractiveSession { let mut vars = Vec::new(); loop { + if !vars.is_empty() { + println!("{}", "Current variables:".dimmed()); + for var in &vars { + println!(" {} {}", "•".green(), var); + } + println!(); + } + let var: String = Input::with_theme(&self.theme) .with_prompt("✏️ Enter variable (key=value, or empty to finish)") .allow_empty(true) @@ -212,6 +220,7 @@ impl InteractiveSession { } if var.contains('=') || var.starts_with('@') { + println!("{} Added '{}'", "✔".green(), var); vars.push(var); } else { println!("{}", "Invalid format. Use key=value or @file.yml".yellow());