feat(ui): hide AUR Helper field when Chaotic-AUR is disabled
The AUR Helper selection is now in a separate group that's hidden when Chaotic-AUR is set to "No", since AUR helpers require Chaotic-AUR to be enabled.
- commit
- 9e30cffffae8b5480ae92df698c480a9fbaf2a1f
- author
- bnema · · 2025-10-31 06:15 UTC
- parent
- 16f57b5
- signature
- GPG Unverified
2B82207D370127A0The key is unknown
1 file · +8 -1
M internal/ui/installer_forms.go +8 -1
| @@ -145,14 +145,21 @@ func CreateOptionsForm(cfg *config.Config, fb *components.FormBuilder) *huh.Form | |||
| 145 | 145 | Description(DescMultilib), | |
| 146 | 146 | fb.Confirm("Enable Chaotic-AUR?", "Yes", "No", &cfg.EnableChaotic). | |
| 147 | 147 | Description(DescChaoticAUR), | |
| 148 | + | ) | |
| 149 | + | ||
| 150 | + | // AUR Helper group (only shown when Chaotic-AUR is enabled) | |
| 151 | + | aurHelperGroup := huh.NewGroup( | |
| 148 | 152 | fb.SelectWithOptions("AUR Helper", aurOptions, &cfg.AURHelper). | |
| 149 | 153 | Description(DescAURHelper), | |
| 150 | - | ) | |
| 154 | + | ).WithHideFunc(func() bool { | |
| 155 | + | return !cfg.EnableChaotic | |
| 156 | + | }) | |
| 151 | 157 | ||
| 152 | 158 | // Build form groups list | |
| 153 | 159 | groups := []*huh.Group{ | |
| 154 | 160 | systemBaseGroup, | |
| 155 | 161 | packageManagementGroup, | |
| 162 | + | aurHelperGroup, | |
| 156 | 163 | } | |
| 157 | 164 | ||
| 158 | 165 | // Add AMD P-State tuning group (conditional - only for AMD CPUs) | |
| @@ -145,14 +145,21 @@ func CreateOptionsForm(cfg *config.Config, fb *components.FormBuilder) *huh.Form | |||||
| 145 | Description(DescMultilib), | 145 | Description(DescMultilib), | ||
| 146 | fb.Confirm("Enable Chaotic-AUR?", "Yes", "No", &cfg.EnableChaotic). | 146 | fb.Confirm("Enable Chaotic-AUR?", "Yes", "No", &cfg.EnableChaotic). | ||
| 147 | Description(DescChaoticAUR), | 147 | Description(DescChaoticAUR), | ||
| 148 | + | ) | |||
| 149 | + | ||||
| 150 | + | // AUR Helper group (only shown when Chaotic-AUR is enabled) | |||
| 151 | + | aurHelperGroup := huh.NewGroup( | |||
| 148 | fb.SelectWithOptions("AUR Helper", aurOptions, &cfg.AURHelper). | 152 | fb.SelectWithOptions("AUR Helper", aurOptions, &cfg.AURHelper). | ||
| 149 | Description(DescAURHelper), | 153 | Description(DescAURHelper), | ||
| 150 | - | ) | 154 | + | ).WithHideFunc(func() bool { |
| 155 | + | return !cfg.EnableChaotic | |||
| 156 | + | }) | |||
| 151 | 157 | ||||
| 152 | // Build form groups list | 158 | // Build form groups list | ||
| 153 | groups := []*huh.Group{ | 159 | groups := []*huh.Group{ | ||
| 154 | systemBaseGroup, | 160 | systemBaseGroup, | ||
| 155 | packageManagementGroup, | 161 | packageManagementGroup, | ||
| 162 | + | aurHelperGroup, | |||
| 156 | } | 163 | } | ||
| 157 | 164 | ||||
| 158 | // Add AMD P-State tuning group (conditional - only for AMD CPUs) | 165 | // Add AMD P-State tuning group (conditional - only for AMD CPUs) | ||