Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .Jules/palette.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
9 changes: 9 additions & 0 deletions src/cli/interactive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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());
Expand Down
Loading