jesseduffield.lazygit/pkg/gui/services/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
..
client.go Add commandMenu property to custom commands 2025-02-28 10:11:30 +01:00
handler_creator.go Add condition field to custom command prompts 2026-04-06 19:14:51 +02:00
keybinding_creator.go Extract a method CustomCommand.GetDescription 2025-02-28 10:00:59 +01:00
menu_generator.go Modernize all codes 2025-11-15 10:46:23 +01:00
menu_generator_test.go Move NewDummyCommon to pkg/common 2025-05-06 09:43:26 +02:00
models.go Add SelectedSubmodule to SessionState 2025-11-12 08:54:34 +01:00
resolver.go feat: support custom keybinds in custom command prompt menus 2025-12-22 13:43:52 +01:00
session_state_loader.go Add SelectedSubmodule to SessionState 2025-11-12 08:54:34 +01:00