feat(site/src/pages/TemplateBuilder): remove redundant optional field labels/placeholders - #28928
Merged
Merged
Conversation
Remove the '(optional)' indicator from optional template builder fields and stop writing 'Optional' into placeholders. Add a per-module placeholder override table (getModuleFieldPlaceholder) with precedence override -> default -> 'Required'/'', and dim placeholder text via content-disabled. Isolated slice of #27077 (item 4). DEVEX-830.
…placeholder # Conflicts: # site/src/pages/TemplateBuilder/BaseTemplateParametersStep.tsx
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
removes "optional" labels and placeholder text from optional fields in Template Builder, because they're already marked as optional by being tucked into the "Additional settings" accordion
What
Resolves DEVEX-830. This is an isolated slice of #27077 (its item 4), rebased onto current
main; nothing else from that PR is included.Changes
Remove the
(optional)indicator from optional fields. Non-required select/radio/switch-group labels and the module-variable label no longer append "(optional)" (the required*marker is unchanged).Stop writing
"Optional"into placeholders. The fallback is now"Required"for required fields and an empty string otherwise, in bothModuleSettingsStepandBaseTemplateParametersStep.Per-module placeholder overrides. New
moduleFieldPlaceholders.tsexposesgetModuleFieldPlaceholder(moduleId, varName)backed by an override table (locked bymoduleFieldPlaceholders.test.ts). Precedence in the module step: override →defaultPlaceholder(variable.default)→"Required"/"".codexmodel_reasoning_effortnone, minimal, low, medium, high, or xhighclaude-codeanthropic_api_keysk-ant-...claude-codemodele.g. claude-sonnet-5git-clonebase_dir$HOMEgit-clonebranch_nameDefault branchdotfilesdescriptione.g https://dotfiles.github.io or an SSH URL git@host:user/repoDim placeholder text to
content-disabledviaplaceholder:!text-content-disabledon the module/base text fields.Before / After
Storybook:
pages/TemplateBuilder/ModuleConfiguration→Default, with "Additional settings" expanded.One more example (optional); empty placeholders use the defaultcontent-secondarytone.One more example(no "(optional)"); placeholder text is dimmed tocontent-disabled.(Before/after screenshots are attached in the Coder chat that produced this PR; drop them here when publishing.)
Testing
pnpm check(biome) cleanpnpm lint:types(tsc) cleanpnpm vitest run --project=unit src/pages/TemplateBuilder/moduleFieldPlaceholders— 4 passpnpm vitest run --project=storybook src/pages/TemplateBuilder— 41 passContext: remaining #27077 items
Per Tracy's summary, #27077's items 5 (scroll fix) and 6 (customizations layout) are already effectively handled on
mainby later PRs (#27437, #27797). Item 7 (required-field miss highlight) is tracked separately (DEVEX-832). This PR is item 4.Coder Agents generated, on behalf of @aqandrew.