jesseduffield.lazygit/pkg/integration/tests/custom_commands
Martin T. 4cb6fafb08 Add condition field to custom command prompts
When building multi-step custom command forms, some prompts are only
relevant depending on earlier answers. Without conditional logic,
users must dismiss irrelevant prompts manually.

Prompts now accept a `condition` field with a template expression
evaluated against prior form values. Skipped prompts default to
an empty string.

The template expression is a string pre- and suffixed with double curly
braces - {{}}.

Form keys can be reused, a guard ensures that skipped prompts do not
reset already set form keys with an empty string. This allows the
conditional flow to remind a user to set a key that was left empty
because additional conditions want that key to be set. This removes the
need to have additional if checks in the command that uses the form
keys.
2026-04-06 19:14:51 +02:00
..
access_commit_properties.go Use getters for AppState and UserConfig instead of accessing the fields directly 2024-08-18 10:24:52 +02:00
basic_command.go Use getters for AppState and UserConfig instead of accessing the fields directly 2024-08-18 10:24:52 +02:00
check_for_conflicts.go Move LocalBranchSortOrder and RemoteBranchSortOrder to user config 2025-07-09 13:15:03 +02:00
conditional_prompt_false_string.go Add condition field to custom command prompts 2026-04-06 19:14:51 +02:00
conditional_prompt_false_value.go Add condition field to custom command prompts 2026-04-06 19:14:51 +02:00
conditional_prompts.go Add condition field to custom command prompts 2026-04-06 19:14:51 +02:00
custom_commands_submenu.go Add a root item ("/") if files at top level have changed 2025-03-21 08:04:58 +01:00
custom_commands_submenu_with_special_keybindings.go Make menu keybindings take precedence over builtin ones, except for confirm/esc 2025-12-22 09:37:06 +01:00
form_prompts.go Use getters for AppState and UserConfig instead of accessing the fields directly 2024-08-18 10:24:52 +02:00
global_context.go Don't set showOutput explicitly 2025-02-28 10:00:59 +01:00
menu_from_command.go Use getters for AppState and UserConfig instead of accessing the fields directly 2024-08-18 10:24:52 +02:00
menu_from_commands_output.go Use getters for AppState and UserConfig instead of accessing the fields directly 2024-08-18 10:24:52 +02:00
menu_prompt_with_keys.go feat: support custom keybinds in custom command prompt menus 2025-12-22 13:43:52 +01:00
multiple_contexts.go Don't set showOutput explicitly 2025-02-28 10:00:59 +01:00
multiple_prompts.go Use getters for AppState and UserConfig instead of accessing the fields directly 2024-08-18 10:24:52 +02:00
run_command.go Add runCommand function to Go template syntax 2025-04-09 10:44:36 +02:00
selected_commit.go Use getters for AppState and UserConfig instead of accessing the fields directly 2024-08-18 10:24:52 +02:00
selected_commit_range.go Expose {{.SelectedCommitRange}} to custom commands 2025-01-27 08:53:50 +01:00
selected_path.go Use getters for AppState and UserConfig instead of accessing the fields directly 2024-08-18 10:24:52 +02:00
selected_submodule.go Add SelectedSubmodule to SessionState 2025-11-12 08:54:34 +01:00
show_output_in_panel.go Combine customCommand's subprocess, stream, and showOutput fields into a single output enum 2025-05-01 15:46:06 +02:00
suggestions_command.go Fix more unstable tests 2025-07-10 08:59:01 +02:00
suggestions_preset.go Fix more unstable tests 2025-07-10 08:59:01 +02:00