feat: show defaults in input form#2341
Merged
Merged
Conversation
9730570 to
b57b5b8
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Autofix Details
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Filter toggle cursor lands on invisible filtered-out item
- Updated
firstSelectableCursor()to also skip required-only filtered defaulted inputs so cursor fallback and wrap targets always remain visible/selectable.
- Updated
Or push these changes by commenting:
@cursor push e335c874cf
Preview (e335c874cf)
diff --git a/commands/ui/inputs_form.go b/commands/ui/inputs_form.go
--- a/commands/ui/inputs_form.go
+++ b/commands/ui/inputs_form.go
@@ -434,8 +434,8 @@
return 1
}
-// firstSelectableCursor returns the first cursor index that is not immutable or disabled.
-// Returns -1 if no selectable item exists (all inputs are immutable/disabled).
+// firstSelectableCursor returns the first cursor index that is selectable.
+// Returns -1 if no selectable item exists.
func (f *InputsForm) firstSelectableCursor() int {
diffMode := f.reconfiguring || f.promoting
visible := f.allVisibleIndices()
@@ -444,6 +444,9 @@
if (def.Immutable && diffMode) || f.hasPendingDependencies(def) {
continue
}
+ if f.requiredOnly && idx != f.activeIdx && !f.userModified[def.Name] && def.HasDefault() {
+ continue
+ }
return i
}
return -1This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
Preview of ubuntu/go tests in 19b4bd4🔍 View Details on Terramate Cloud .
commands/ui
config
|
|
Preview of macos-15/go tests in 19b4bd4🔍 View Details on Terramate Cloud .
commands/ui
config
|
b57b5b8 to
192dfd6
Compare
b728c07 to
e6ecae1
Compare
e6ecae1 to
fc7da44
Compare
fc7da44 to
5f39f86
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5f39f86. Configure here.
5f39f86 to
19b4bd4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


What this PR does / why we need it:
This PR changes how required and optional inputs are handled by
terramate ui. We now show all the default values in the input form from the start and allow to create the bundle once all required values are set. Before, this required to go through all values to at least confirm the defaults.Required values are marked with a * and the input panel supports filtering for them.
This is only applied to the create panel, not reconfigure, since once a bundle has been created, all required values are provided.
Related issues
Fixes #2325.
Does this PR introduce a user-facing change?
Note
Medium Risk
Moderate risk because it changes how input values are tracked, validated, and written back to YAML for create/reconfig/promote flows, which could affect config diffs and runtime default evaluation.
Overview
terramate uinow seeds and displays default input values up front during bundle creation, marks truly required fields with*, and adds a left/right toggle to filter the list to required-only inputs.The form now tracks user-modified vs default-seeded values, shows defaulted values dimmed, supports delete-to-reset semantics, and passes only
UserValues()intoNewCreateChange/NewReconfigChange/NewPromoteChangeso generated YAML omits defaults while validation still uses the fully re-evaluated value set.Adds
rawInputKeys()to preserve which inputs were explicitly set in existing YAML for reconfig/promote reset behavior, introduces per-inputValidatehooks (used to enforce.tm.yml/.tm.yamloutput paths), and tweaks boolean display toYes/No.Reviewed by Cursor Bugbot for commit 19b4bd4. Bugbot is set up for automated code reviews on this repo. Configure here.