Skip to content

feat: show defaults in input form#2341

Merged
snakster merged 2 commits into
mainfrom
snk-show-default-inputs
Apr 15, 2026
Merged

feat: show defaults in input form#2341
snakster merged 2 commits into
mainfrom
snk-show-default-inputs

Conversation

@snakster

@snakster snakster commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

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?

no, changes were only in RC

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 ui now 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() into NewCreateChange/NewReconfigChange/NewPromoteChange so 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-input Validate hooks (used to enforce .tm.yml/.tm.yaml output paths), and tweaks boolean display to Yes/No.

Reviewed by Cursor Bugbot for commit 19b4bd4. Bugbot is set up for automated code reviews on this repo. Configure here.

@snakster snakster requested a review from a team as a code owner April 14, 2026 14:56
@snakster snakster force-pushed the snk-show-default-inputs branch from 9730570 to b57b5b8 Compare April 14, 2026 15:02

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Create PR

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 -1

This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

Comment thread commands/ui/inputs_form.go
@github-actions

github-actions Bot commented Apr 14, 2026

Copy link
Copy Markdown

Preview of ubuntu/go tests in 19b4bd4

🔍 View Details on Terramate Cloud

.
commands/ui
config

@github-actions

github-actions Bot commented Apr 14, 2026

Copy link
Copy Markdown
## Package: benchmarks/changed
metric: time/op
ChangeDetection-4: old 1.52ms ±12%: new 1.48ms ± 7%: delta: 0.00%
ChangeDetectionTFAndTG-4: old 1.42ms ±11%: new 1.47ms ± 7%: delta: 2.98%
metric: alloc/op
ChangeDetection-4: old 356kB ± 0%: new 356kB ± 0%: delta: 0.00%
ChangeDetectionTFAndTG-4: old 248kB ± 0%: new 248kB ± 1%: delta: 0.00%
metric: allocs/op
ChangeDetection-4: old 2.40k ± 0%: new 2.40k ± 0%: delta: 0.00%
ChangeDetectionTFAndTG-4: old 1.70k ± 1%: new 1.70k ± 2%: delta: 0.00%

---

## Package: cloud
metric: time/op
CloudReadLines-4: old 621µs ± 4%: new 621µs ± 8%: delta: 0.00%
CloudReadLine-4: old 3.42ms ± 6%: new 3.31ms ± 3%: delta: -3.34%
metric: alloc/op
CloudReadLines-4: old 3.12MB ± 0%: new 3.12MB ± 0%: delta: -0.00%
CloudReadLine-4: old 3.37MB ± 0%: new 3.37MB ± 0%: delta: 0.00%
metric: allocs/op
CloudReadLines-4: old 5.54k ± 0%: new 5.54k ± 0%: delta: 0.00%
CloudReadLine-4: old 60.0k ± 0%: new 60.0k ± 0%: delta: 0.00%

---

## Package: fs
metric: time/op
ListFiles-4: old 39.8µs ±25%: new 43.7µs ±29%: delta: 0.00%
metric: alloc/op
ListFiles-4: old 27.6kB ± 0%: new 27.6kB ± 0%: delta: 0.00%
metric: allocs/op
ListFiles-4: old 335 ± 0%: new 335 ± 0%: delta: 0.00%

---

## Package: generate
metric: time/op
Generate-4: old 684ms ±10%: new 662ms ± 8%: delta: 0.00%
GenerateRegex-4: old 407ms ±13%: new 397ms ±11%: delta: 0.00%
metric: alloc/op
Generate-4: old 2.23GB ± 0%: new 2.23GB ± 0%: delta: 0.00%
GenerateRegex-4: old 922MB ± 0%: new 922MB ± 0%: delta: 0.00%
metric: allocs/op
Generate-4: old 25.7M ± 0%: new 25.7M ± 0%: delta: 0.00%
GenerateRegex-4: old 18.1M ± 0%: new 18.1M ± 0%: delta: 0.00%

---

## Package: hcl/ast
metric: time/op
TokensForExpressionComplex-4: old 704µs ± 3%: new 715µs ± 3%: delta: 1.60%
TokensForExpressionPlainStringNoNewline-4: old 364ns ± 2%: new 368ns ± 5%: delta: 0.00%
TokensForExpressionStringWith100Newlines-4: old 10.2µs ± 4%: new 10.0µs ± 5%: delta: -1.85%
TokensForExpressionObjectWith100KeysWithNumberValues-4: old 827µs ± 2%: new 832µs ± 3%: delta: 0.00%
TokensForExpression-4: old 712µs ± 4%: new 714µs ± 2%: delta: 0.00%
metric: alloc/op
TokensForExpressionComplex-4: old 393kB ± 0%: new 393kB ± 0%: delta: 0.00%
TokensForExpressionPlainStringNoNewline-4: old 512B ± 0%: new 512B ± 0%: delta: 0.00%
TokensForExpressionStringWith100Newlines-4: old 12.5kB ± 0%: new 12.5kB ± 0%: delta: 0.00%
TokensForExpressionObjectWith100KeysWithNumberValues-4: old 393kB ± 0%: new 393kB ± 0%: delta: 0.00%
TokensForExpression-4: old 393kB ± 0%: new 393kB ± 0%: delta: 0.00%
metric: allocs/op
TokensForExpressionComplex-4: old 4.75k ± 0%: new 4.75k ± 0%: delta: 0.00%
TokensForExpressionPlainStringNoNewline-4: old 20.0 ± 0%: new 20.0 ± 0%: delta: 0.00%
TokensForExpressionStringWith100Newlines-4: old 227 ± 0%: new 227 ± 0%: delta: 0.00%
TokensForExpressionObjectWith100KeysWithNumberValues-4: old 3.09k ± 0%: new 3.09k ± 0%: delta: 0.00%
TokensForExpression-4: old 4.75k ± 0%: new 4.75k ± 0%: delta: 0.00%

---

## Package: hcl/eval
metric: time/op
PartialEvalComplex-4: old 230µs ± 5%: new 233µs ±10%: delta: 0.00%
PartialEvalSmallString-4: old 1.66µs ± 3%: new 1.67µs ± 3%: delta: 0.00%
PartialEvalHugeString-4: old 839µs ± 2%: new 855µs ± 4%: delta: 1.89%
PartialEvalHugeInterpolatedString-4: old 2.20ms ±13%: new 1.97ms ± 6%: delta: -10.80%
PartialEvalObject-4: old 12.0µs ± 7%: new 12.6µs ±11%: delta: 4.44%
metric: alloc/op
PartialEvalComplex-4: old 360kB ± 0%: new 360kB ± 0%: delta: 0.00%
PartialEvalSmallString-4: old 1.94kB ± 0%: new 1.94kB ± 0%: delta: 0.00%
PartialEvalHugeString-4: old 196kB ± 0%: new 196kB ± 0%: delta: 0.00%
PartialEvalHugeInterpolatedString-4: old 4.30MB ± 0%: new 4.30MB ± 0%: delta: -0.00%
PartialEvalObject-4: old 19.4kB ± 0%: new 19.4kB ± 0%: delta: 0.00%
metric: allocs/op
PartialEvalComplex-4: old 3.72k ± 0%: new 3.72k ± 0%: delta: 0.00%
PartialEvalSmallString-4: old 25.0 ± 0%: new 25.0 ± 0%: delta: 0.00%
PartialEvalHugeString-4: old 38.0 ± 0%: new 38.0 ± 0%: delta: 0.00%
PartialEvalHugeInterpolatedString-4: old 25.1k ± 0%: new 25.1k ± 0%: delta: 0.00%
PartialEvalObject-4: old 179 ± 0%: new 179 ± 0%: delta: 0.00%

---

## Package: ls
metric: time/op
FindDefinition/10_files-4: old 15.2µs ±10%: new 13.9µs ± 6%: delta: -8.47%
FindDefinition/50_files-4: old 22.4µs ±13%: new 20.0µs ± 8%: delta: -10.94%
FindDefinition/100_files-4: old 30.4µs ±10%: new 28.4µs ± 5%: delta: -6.67%
FindDefinition/500_files-4: old 108µs ± 2%: new 108µs ± 3%: delta: 0.00%
FindReferences/10_files_5_refs-4: old 84.0µs ± 7%: new 119.8µs ±54%: delta: 42.61%
FindReferences/50_files_10_refs-4: old 325µs ± 7%: new 480µs ±49%: delta: 47.83%
FindReferences/100_files_20_refs-4: old 586µs ± 6%: new 639µs ±14%: delta: 9.15%
FindReferences/500_files_50_refs-4: old 3.14ms ± 3%: new 3.10ms ±12%: delta: 0.00%
Rename/10_files_5_refs-4: old 102µs ± 1%: new 101µs ±12%: delta: 0.00%
Rename/50_files_10_refs-4: old 340µs ± 9%: new 335µs ± 6%: delta: 0.00%
Rename/100_files_20_refs-4: old 619µs ± 9%: new 715µs ±22%: delta: 15.42%
SearchWorkspace/flat_100_files-4: old 579µs ±11%: new 592µs ±12%: delta: 0.00%
SearchWorkspace/flat_500_files-4: old 2.84ms ± 9%: new 2.90ms ± 9%: delta: 0.00%
SearchWorkspace/nested_100_files_5_deep-4: old 635µs ±13%: new 611µs ± 7%: delta: -3.72%
SearchWorkspace/nested_500_files_5_deep-4: old 3.31ms ±17%: new 2.96ms ±11%: delta: -10.66%
ParseFile/small_file_10_lines-4: old 23.3µs ±13%: new 21.3µs ± 8%: delta: -8.39%
ParseFile/medium_file_50_lines-4: old 91.5µs ±12%: new 90.9µs ± 9%: delta: 0.00%
ParseFile/large_file_200_lines-4: old 377µs ±13%: new 383µs ±10%: delta: 0.00%
ParseFile/huge_file_1000_lines-4: old 1.92ms ± 9%: new 1.92ms ± 6%: delta: 0.00%
check failed: time/op=+20%
metric: alloc/op
FindDefinition/10_files-4: old 15.2kB ± 0%: new 15.2kB ± 0%: delta: -0.01%
FindDefinition/50_files-4: old 20.1kB ± 0%: new 20.1kB ± 0%: delta: -0.01%
FindDefinition/100_files-4: old 26.4kB ± 0%: new 26.4kB ± 0%: delta: -0.01%
FindDefinition/500_files-4: old 72.8kB ± 0%: new 72.8kB ± 0%: delta: 0.00%
FindReferences/10_files_5_refs-4: old 87.0kB ± 0%: new 87.0kB ± 0%: delta: 0.02%
FindReferences/50_files_10_refs-4: old 336kB ± 0%: new 336kB ± 0%: delta: 0.03%
FindReferences/100_files_20_refs-4: old 646kB ± 0%: new 646kB ± 0%: delta: 0.00%
FindReferences/500_files_50_refs-4: old 3.13MB ± 0%: new 3.13MB ± 0%: delta: 0.00%
Rename/10_files_5_refs-4: old 105kB ± 0%: new 105kB ± 0%: delta: 0.00%
Rename/50_files_10_refs-4: old 359kB ± 0%: new 359kB ± 0%: delta: 0.01%
Rename/100_files_20_refs-4: old 677kB ± 0%: new 677kB ± 0%: delta: 0.02%
SearchWorkspace/flat_100_files-4: old 628kB ± 0%: new 628kB ± 0%: delta: 0.00%
SearchWorkspace/flat_500_files-4: old 3.09MB ± 0%: new 3.09MB ± 0%: delta: 0.01%
SearchWorkspace/nested_100_files_5_deep-4: old 636kB ± 0%: new 636kB ± 0%: delta: -0.01%
SearchWorkspace/nested_500_files_5_deep-4: old 3.13MB ± 0%: new 3.13MB ± 0%: delta: -0.03%
ParseFile/small_file_10_lines-4: old 34.7kB ± 0%: new 34.7kB ± 0%: delta: 0.00%
ParseFile/medium_file_50_lines-4: old 151kB ± 0%: new 151kB ± 0%: delta: 0.00%
ParseFile/large_file_200_lines-4: old 733kB ± 0%: new 733kB ± 0%: delta: 0.00%
ParseFile/huge_file_1000_lines-4: old 4.06MB ± 0%: new 4.06MB ± 0%: delta: 0.00%
metric: allocs/op
FindDefinition/10_files-4: old 209 ± 0%: new 209 ± 0%: delta: 0.00%
FindDefinition/50_files-4: old 291 ± 0%: new 291 ± 0%: delta: 0.00%
FindDefinition/100_files-4: old 392 ± 0%: new 392 ± 0%: delta: 0.00%
FindDefinition/500_files-4: old 1.19k ± 0%: new 1.19k ± 0%: delta: 0.00%
FindReferences/10_files_5_refs-4: old 960 ± 0%: new 960 ± 0%: delta: 0.00%
FindReferences/50_files_10_refs-4: old 3.81k ± 0%: new 3.81k ± 0%: delta: 0.00%
FindReferences/100_files_20_refs-4: old 7.34k ± 0%: new 7.34k ± 0%: delta: 0.00%
FindReferences/500_files_50_refs-4: old 35.9k ± 0%: new 35.9k ± 0%: delta: 0.00%
Rename/10_files_5_refs-4: old 1.15k ± 0%: new 1.15k ± 0%: delta: 0.00%
Rename/50_files_10_refs-4: old 4.09k ± 0%: new 4.09k ± 0%: delta: 0.00%
Rename/100_files_20_refs-4: old 7.74k ± 0%: new 7.74k ± 0%: delta: 0.00%
SearchWorkspace/flat_100_files-4: old 7.13k ± 0%: new 7.13k ± 0%: delta: 0.00%
SearchWorkspace/flat_500_files-4: old 35.1k ± 0%: new 35.1k ± 0%: delta: 0.00%
SearchWorkspace/nested_100_files_5_deep-4: old 7.18k ± 0%: new 7.18k ± 0%: delta: 0.00%
SearchWorkspace/nested_500_files_5_deep-4: old 35.2k ± 0%: new 35.2k ± 0%: delta: -0.00%
ParseFile/small_file_10_lines-4: old 315 ± 0%: new 315 ± 0%: delta: 0.00%
ParseFile/medium_file_50_lines-4: old 1.39k ± 0%: new 1.39k ± 0%: delta: 0.00%
ParseFile/large_file_200_lines-4: old 5.46k ± 0%: new 5.46k ± 0%: delta: 0.00%
ParseFile/huge_file_1000_lines-4: old 26.2k ± 0%: new 26.2k ± 0%: delta: 0.00%

---

## Package: stdlib
metric: time/op
TmAllTrueLiteralList-4: old 314µs ± 1%: new 326µs ± 4%: delta: 3.67%
TmAllTrueFuncall-4: old 9.17µs ± 2%: new 9.63µs ± 6%: delta: 5.05%
TmAnyTrueLiteralList-4: old 2.43ms ± 1%: new 2.63ms ±11%: delta: 8.42%
TmAnyTrueFuncall-4: old 9.35µs ± 1%: new 11.68µs ±29%: delta: 24.90%
TmTernary-4: old 1.07µs ± 1%: new 1.99µs ±18%: delta: 85.99%
TmTryUnknownFunc-4: old 946ns ± 2%: new 1815ns ±15%: delta: 91.85%
TmTryUnknownVariable-4: old 923ns ± 2%: new 1732ns ±14%: delta: 87.65%
TmTryUnknownObjectKey-4: old 1.06µs ± 2%: new 2.01µs ±11%: delta: 90.11%
SlugifyLargeList-4: old 1.15ms ± 2%: new 1.93ms ±12%: delta: 67.91%
check failed: time/op=+20%
metric: alloc/op
TmAllTrueLiteralList-4: old 320kB ± 0%: new 320kB ± 0%: delta: 0.00%
TmAllTrueFuncall-4: old 10.4kB ± 0%: new 10.4kB ± 0%: delta: 0.00%
TmAnyTrueLiteralList-4: old 2.09MB ± 0%: new 2.09MB ± 0%: delta: 0.00%
TmAnyTrueFuncall-4: old 10.5kB ± 0%: new 10.5kB ± 0%: delta: 0.00%
TmTernary-4: old 1.18kB ± 0%: new 1.18kB ± 0%: delta: 0.00%
TmTryUnknownFunc-4: old 784B ± 0%: new 784B ± 0%: delta: 0.00%
TmTryUnknownVariable-4: old 768B ± 0%: new 768B ± 0%: delta: 0.00%
TmTryUnknownObjectKey-4: old 952B ± 0%: new 952B ± 0%: delta: 0.00%
SlugifyLargeList-4: old 614kB ± 0%: new 614kB ± 0%: delta: 0.04%
metric: allocs/op
TmAllTrueLiteralList-4: old 5.93k ± 0%: new 5.93k ± 0%: delta: 0.00%
TmAllTrueFuncall-4: old 265 ± 0%: new 265 ± 0%: delta: 0.00%
TmAnyTrueLiteralList-4: old 59.6k ± 0%: new 59.6k ± 0%: delta: 0.00%
TmAnyTrueFuncall-4: old 267 ± 0%: new 267 ± 0%: delta: 0.00%
TmTernary-4: old 27.0 ± 0%: new 27.0 ± 0%: delta: 0.00%
TmTryUnknownFunc-4: old 21.0 ± 0%: new 21.0 ± 0%: delta: 0.00%
TmTryUnknownVariable-4: old 20.0 ± 0%: new 20.0 ± 0%: delta: 0.00%
TmTryUnknownObjectKey-4: old 23.0 ± 0%: new 23.0 ± 0%: delta: 0.00%
SlugifyLargeList-4: old 18.0k ± 0%: new 18.0k ± 0%: delta: 0.00%

---

## Package: tg
metric: time/op
ModuleDiscovery-4: old 28.9ms ± 6%: new 27.6ms ± 4%: delta: -4.38%
metric: alloc/op
ModuleDiscovery-4: old 36.8MB ± 0%: new 36.8MB ± 0%: delta: 0.00%
metric: allocs/op
ModuleDiscovery-4: old 451k ± 0%: new 451k ± 0%: delta: -0.00%

---

@github-actions

github-actions Bot commented Apr 14, 2026

Copy link
Copy Markdown

Preview of macos-15/go tests in 19b4bd4

🔍 View Details on Terramate Cloud

.
commands/ui
config

@snakster snakster force-pushed the snk-show-default-inputs branch from b57b5b8 to 192dfd6 Compare April 14, 2026 16:24
Comment thread commands/ui/inputs_form.go
Comment thread commands/ui/inputs_form.go Outdated
Comment thread commands/ui/inputs_form.go
@snakster snakster force-pushed the snk-show-default-inputs branch from e6ecae1 to fc7da44 Compare April 15, 2026 08:31
Comment thread commands/ui/inputs_form.go Outdated
Comment thread commands/ui/inputs_form.go Outdated
@snakster snakster force-pushed the snk-show-default-inputs branch from fc7da44 to 5f39f86 Compare April 15, 2026 08:57

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ 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.

Comment thread commands/ui/inputs_form.go
Comment thread commands/ui/inputs_form.go
@snakster snakster force-pushed the snk-show-default-inputs branch from 5f39f86 to 19b4bd4 Compare April 15, 2026 09:14
@snakster snakster merged commit 2336057 into main Apr 15, 2026
17 checks passed
@snakster snakster deleted the snk-show-default-inputs branch April 15, 2026 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Terramate UI should not write unset inputs into the yaml files if they have "empty" default values

1 participant