Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
feat: Use INFO_EMOJI for command approval previews
Maximilian Roosc35805e902a4
diff --git a/src/commands/command_approval.rs b/src/commands/command_approval.rsindex d7995f26f..f60fa8e62 100644--- a/src/commands/command_approval.rs+++ b/src/commands/command_approval.rs@@ -7,8 +7,8 @@ use anyhow::Context;use worktrunk::config::{Command, WorktrunkConfig};use worktrunk::git::not_interactive;use worktrunk::styling::{- AnstyleStyle, HINT_EMOJI, PROGRESS_EMOJI, WARNING, WARNING_BOLD, WARNING_EMOJI, eprint,- eprintln, format_bash_with_gutter, stderr,+ AnstyleStyle, HINT_EMOJI, INFO_EMOJI, WARNING, WARNING_BOLD, WARNING_EMOJI, eprint, eprintln,+ format_bash_with_gutter, stderr,};/// Batch approval helper used when multiple commands are queued for execution.@@ -94,10 +94,11 @@ fn prompt_for_batch_approval(commands: &[&Command], project_id: &str) -> anyhow:for cmd in commands {// Format as: {phase} {bold}{name}{bold:#}:// Phase comes from the command itself (e.g., "pre-commit", "pre-merge")+ // Uses INFO_EMOJI (βͺ) since this is a preview, not active executionlet phase = cmd.phase.to_string();let label = match &cmd.name {- Some(name) => format!("{PROGRESS_EMOJI} {phase} {bold}{name}{bold:#}:"),- None => format!("{PROGRESS_EMOJI} {phase}:"),+ Some(name) => format!("{INFO_EMOJI} {phase} {bold}{name}{bold:#}:"),+ None => format!("{INFO_EMOJI} {phase}:"),};eprintln!("{label}");eprint!("{}", format_bash_with_gutter(&cmd.expanded, ""));diff --git a/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_accept.snap b/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_accept.snapindex dea4fdc3b..522c21af9 100644--- a/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_accept.snap+++ b/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_accept.snap@@ -6,7 +6,7 @@ yπ‘ [33m[1m[33mtest-repo[0m[33m needs approval to execute [1m[33m1[0m[33m command:[0m-π post-create:+βͺ post-create:[107m [0m [1m[2m[34mecho[0m [2m[32m'test command'[0m[0mπ‘ Allow and remember? [1m[y/N][0mdiff --git a/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_decline.snap b/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_decline.snapindex 9a0288c70..90056fdf0 100644--- a/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_decline.snap+++ b/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_decline.snap@@ -6,7 +6,7 @@ nπ‘ [33m[1m[33mtest-repo[0m[33m needs approval to execute [1m[33m1[0m[33m command:[0m-π post-create:+βͺ post-create:[107m [0m [1m[2m[34mecho[0m [2m[32m'test command'[0m[0mπ‘ Allow and remember? [1m[y/N][0mdiff --git a/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_mixed_approved_unapproved_accept.snap b/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_mixed_approved_unapproved_accept.snapindex 3a2644db1..3d9f1f3aa 100644--- a/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_mixed_approved_unapproved_accept.snap+++ b/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_mixed_approved_unapproved_accept.snap@@ -6,10 +6,10 @@ yπ‘ [33m[1m[33mtest-repo[0m[33m needs approval to execute [1m[33m2[0m[33m commands:[0m-π post-create:+βͺ post-create:[107m [0m [1m[2m[34mecho[0m [2m[32m'First command'[0m[0m-π post-create:+βͺ post-create:[107m [0m [1m[2m[34mecho[0m [2m[32m'Third command'[0m[0mπ‘ Allow and remember? [1m[y/N][0mdiff --git a/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_mixed_approved_unapproved_decline.snap b/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_mixed_approved_unapproved_decline.snapindex e74e3ddce..8ea278474 100644--- a/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_mixed_approved_unapproved_decline.snap+++ b/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_mixed_approved_unapproved_decline.snap@@ -6,10 +6,10 @@ nπ‘ [33m[1m[33mtest-repo[0m[33m needs approval to execute [1m[33m2[0m[33m commands:[0m-π post-create:+βͺ post-create:[107m [0m [1m[2m[34mecho[0m [2m[32m'First command'[0m[0m-π post-create:+βͺ post-create:[107m [0m [1m[2m[34mecho[0m [2m[32m'Third command'[0m[0mπ‘ Allow and remember? [1m[y/N][0mdiff --git a/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_multiple_commands.snap b/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_multiple_commands.snapindex b6633e9d9..392fc8915 100644--- a/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_multiple_commands.snap+++ b/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_multiple_commands.snap@@ -6,13 +6,13 @@ yπ‘ [33m[1m[33mtest-repo[0m[33m needs approval to execute [1m[33m3[0m[33m commands:[0m-π post-create:+βͺ post-create:[107m [0m [1m[2m[34mecho[0m [2m[32m'First command'[0m[0m-π post-create:+βͺ post-create:[107m [0m [1m[2m[34mecho[0m [2m[32m'Second command'[0m[0m-π post-create:+βͺ post-create:[107m [0m [1m[2m[34mecho[0m [2m[32m'Third command'[0m[0mπ‘ Allow and remember? [1m[y/N][0mdiff --git a/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_named_commands.snap b/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_named_commands.snapindex 67841cf65..6cab82350 100644--- a/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_named_commands.snap+++ b/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_named_commands.snap@@ -6,13 +6,13 @@ yπ‘ [33m[1m[33mtest-repo[0m[33m needs approval to execute [1m[33m3[0m[33m commands:[0m-π post-create [1minstall[0m:+βͺ post-create [1minstall[0m:[107m [0m [1m[2m[34mecho[0m [2m[32m'Installing dependencies...'[0m[0m-π post-create [1mbuild[0m:+βͺ post-create [1mbuild[0m:[107m [0m [1m[2m[34mecho[0m [2m[32m'Building project...'[0m[0m-π post-create [1mtest[0m:+βͺ post-create [1mtest[0m:[107m [0m [1m[2m[34mecho[0m [2m[32m'Running tests...'[0m[0mπ‘ Allow and remember? [1m[y/N][0mdiff --git a/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_permission_error.snap b/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_permission_error.snapindex cff9a0d94..a5ad14ae3 100644--- a/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_permission_error.snap+++ b/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_permission_error.snap@@ -6,7 +6,7 @@ yπ‘ [33m[1m[33mtest-repo[0m[33m needs approval to execute [1m[33m1[0m[33m command:[0m-π post-create:+βͺ post-create:[107m [0m [1m[2m[34mecho[0m [2m[32m'test command'[0m[0mπ‘ Allow and remember? [1m[y/N][0mdiff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__readme_example_approval_prompt.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__readme_example_approval_prompt.snapindex 5933bb828..50caa42d0 100644--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__readme_example_approval_prompt.snap+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__readme_example_approval_prompt.snap@@ -1,17 +1,16 @@---source: tests/integration_tests/shell_wrapper.rs-assertion_line: 2396expression: prompt_only---π‘ test-repo needs approval to execute 3 commands:-π post-create install:+βͺ post-create install:echo 'Installing dependencies...'-π post-create build:+βͺ post-create build:echo 'Building project...'-π post-create test:+βͺ post-create test:echo 'Running tests...'π‘ Allow and remember? [y/N]diff --git a/tests/snapshots/integration__integration_tests__approval_ui__approval_fails_in_non_tty.snap b/tests/snapshots/integration__integration_tests__approval_ui__approval_fails_in_non_tty.snapindex 6363faa79..0f545e555 100644--- a/tests/snapshots/integration__integration_tests__approval_ui__approval_fails_in_non_tty.snap+++ b/tests/snapshots/integration__integration_tests__approval_ui__approval_fails_in_non_tty.snap@@ -29,5 +29,5 @@ exit_code: 1----- stderr -----π‘ [33m[1m[33mtest-repo[0m[33m needs approval to execute [1m[33m1[0m[33m command:[0m-π post-create:+βͺ post-create:[107m [0m [1m[2m[34mecho[0m [2m[32m'test command'[0m[0mdiff --git a/tests/snapshots/integration__integration_tests__approval_ui__approval_mixed_approved_unapproved.snap b/tests/snapshots/integration__integration_tests__approval_ui__approval_mixed_approved_unapproved.snapindex 2c2d170b7..dba5e575b 100644--- a/tests/snapshots/integration__integration_tests__approval_ui__approval_mixed_approved_unapproved.snap+++ b/tests/snapshots/integration__integration_tests__approval_ui__approval_mixed_approved_unapproved.snap@@ -11,8 +11,8 @@ exit_code: 1----- stderr -----π‘ [33m[1m[33mtest-repo[0m[33m needs approval to execute [1m[33m2[0m[33m commands:[0m-π post-create:+βͺ post-create:[107m [0m [1m[2m[34mecho[0m [2m[32m'First command'[0m[0m-π post-create:+βͺ post-create:[107m [0m [1m[2m[34mecho[0m [2m[32m'Third command'[0m[0mdiff --git a/tests/snapshots/integration__integration_tests__approval_ui__approval_multiple_commands.snap b/tests/snapshots/integration__integration_tests__approval_ui__approval_multiple_commands.snapindex 01ea3c48c..5c47fe18c 100644--- a/tests/snapshots/integration__integration_tests__approval_ui__approval_multiple_commands.snap+++ b/tests/snapshots/integration__integration_tests__approval_ui__approval_multiple_commands.snap@@ -11,14 +11,14 @@ exit_code: 1----- stderr -----π‘ [33m[1m[33mtest-repo[0m[33m needs approval to execute [1m[33m4[0m[33m commands:[0m-π post-create:+βͺ post-create:[107m [0m [1m[2m[34mecho[0m [2m[32m'Branch: test-nested-branch'[0m[0m-π post-create:+βͺ post-create:[107m [0m [1m[2m[34mecho[0m [2m[32m'Worktree: [REPO].test-nested-branch'[0m[0m-π post-create:+βͺ post-create:[107m [0m [1m[2m[34mecho[0m [2m[32m'Repo: test-repo'[0m[0m-π post-create:+βͺ post-create:[107m [0m [1m[2m[34mcd[0m [REPO].test-nested-branch [2m[36m&&[0m [1m[2m[34mpwd[0m[0mdiff --git a/tests/snapshots/integration__integration_tests__approval_ui__approval_named_commands.snap b/tests/snapshots/integration__integration_tests__approval_ui__approval_named_commands.snapindex 78e0ee843..b26322c75 100644--- a/tests/snapshots/integration__integration_tests__approval_ui__approval_named_commands.snap+++ b/tests/snapshots/integration__integration_tests__approval_ui__approval_named_commands.snap@@ -11,11 +11,11 @@ exit_code: 1----- stderr -----π‘ [33m[1m[33mtest-repo[0m[33m needs approval to execute [1m[33m3[0m[33m commands:[0m-π post-create [1minstall[0m:+βͺ post-create [1minstall[0m:[107m [0m [1m[2m[34mecho[0m [2m[32m'Installing dependencies...'[0m[0m-π post-create [1mbuild[0m:+βͺ post-create [1mbuild[0m:[107m [0m [1m[2m[34mecho[0m [2m[32m'Building project...'[0m[0m-π post-create [1mtest[0m:+βͺ post-create [1mtest[0m:[107m [0m [1m[2m[34mecho[0m [2m[32m'Running tests...'[0m[0mdiff --git a/tests/snapshots/integration__integration_tests__approval_ui__approval_single_command.snap b/tests/snapshots/integration__integration_tests__approval_ui__approval_single_command.snapindex 7e700b9a5..c54f6f87a 100644--- a/tests/snapshots/integration__integration_tests__approval_ui__approval_single_command.snap+++ b/tests/snapshots/integration__integration_tests__approval_ui__approval_single_command.snap@@ -11,5 +11,5 @@ exit_code: 1----- stderr -----π‘ [33m[1m[33mtest-repo[0m[33m needs approval to execute [1m[33m1[0m[33m command:[0m-π post-create:+βͺ post-create:[107m [0m [1m[2m[34mecho[0m [2m[32m'Worktree path: [REPO].feature-test-approval'[0m[0mdiff --git a/tests/snapshots/integration__integration_tests__approval_ui__decline_approval_skips_only_unapproved.snap b/tests/snapshots/integration__integration_tests__approval_ui__decline_approval_skips_only_unapproved.snapindex 2c2d170b7..dba5e575b 100644--- a/tests/snapshots/integration__integration_tests__approval_ui__decline_approval_skips_only_unapproved.snap+++ b/tests/snapshots/integration__integration_tests__approval_ui__decline_approval_skips_only_unapproved.snap@@ -11,8 +11,8 @@ exit_code: 1----- stderr -----π‘ [33m[1m[33mtest-repo[0m[33m needs approval to execute [1m[33m2[0m[33m commands:[0m-π post-create:+βͺ post-create:[107m [0m [1m[2m[34mecho[0m [2m[32m'First command'[0m[0m-π post-create:+βͺ post-create:[107m [0m [1m[2m[34mecho[0m [2m[32m'Third command'[0m[0mdiff --git a/tests/snapshots/integration__integration_tests__approval_ui__force_does_not_save_approvals_second_run.snap b/tests/snapshots/integration__integration_tests__approval_ui__force_does_not_save_approvals_second_run.snapindex 252978cfb..9ab9c3cd2 100644--- a/tests/snapshots/integration__integration_tests__approval_ui__force_does_not_save_approvals_second_run.snap+++ b/tests/snapshots/integration__integration_tests__approval_ui__force_does_not_save_approvals_second_run.snap@@ -11,5 +11,5 @@ exit_code: 1----- stderr -----π‘ [33m[1m[33mtest-repo[0m[33m needs approval to execute [1m[33m1[0m[33m command:[0m-π post-create:+βͺ post-create:[107m [0m [1m[2m[34mecho[0m [2m[32m'test command'[0m [2m[36m>[0m output.txt[0mdiff --git a/tests/snapshots/integration__integration_tests__approval_ui__run_hook_post_merge_requires_approval.snap b/tests/snapshots/integration__integration_tests__approval_ui__run_hook_post_merge_requires_approval.snapindex dc23fbff9..4fd3a8218 100644--- a/tests/snapshots/integration__integration_tests__approval_ui__run_hook_post_merge_requires_approval.snap+++ b/tests/snapshots/integration__integration_tests__approval_ui__run_hook_post_merge_requires_approval.snap@@ -11,5 +11,5 @@ exit_code: 1----- stderr -----π‘ [33m[1m[33mtest-repo[0m[33m needs approval to execute [1m[33m1[0m[33m command:[0m-π post-merge:+βͺ post-merge:[107m [0m [1m[2m[34mecho[0m [2m[32m'Post-merge cleanup for main'[0m[0mdiff --git a/tests/snapshots/integration__integration_tests__approval_ui__run_hook_pre_merge_requires_approval.snap b/tests/snapshots/integration__integration_tests__approval_ui__run_hook_pre_merge_requires_approval.snapindex deac852da..459cd7b79 100644--- a/tests/snapshots/integration__integration_tests__approval_ui__run_hook_pre_merge_requires_approval.snap+++ b/tests/snapshots/integration__integration_tests__approval_ui__run_hook_pre_merge_requires_approval.snap@@ -11,5 +11,5 @@ exit_code: 1----- stderr -----π‘ [33m[1m[33mtest-repo[0m[33m needs approval to execute [1m[33m1[0m[33m command:[0m-π pre-merge:+βͺ pre-merge:[107m [0m [1m[2m[34mecho[0m [2m[32m'Running pre-merge checks on main'[0m[0mdiff --git a/tests/snapshots/integration__integration_tests__approvals__add_approvals_all_none_approved.snap b/tests/snapshots/integration__integration_tests__approvals__add_approvals_all_none_approved.snapindex deaf5c9da..f3be3a7a2 100644--- a/tests/snapshots/integration__integration_tests__approvals__add_approvals_all_none_approved.snap+++ b/tests/snapshots/integration__integration_tests__approvals__add_approvals_all_none_approved.snap@@ -30,5 +30,5 @@ exit_code: 1----- stderr -----π‘ [33m[1m[33mtest-repo[0m[33m needs approval to execute [1m[33m1[0m[33m command:[0m-π post-create:+βͺ post-create:[107m [0m [1m[2m[34mecho[0m [2m[32m'test'[0m[0m