Documentation
¶
Overview ¶
Package servicefieldsstep is the two-field step every "make a service" flow needs: a name and an image, then out to the existing YAML editor rather than a form with a field for every compose key - docs/DESIGN.md §Editing services rejects that outright.
It is shared, not copied, between createcomposefilemodal (the bootstrap flow's optional first service) and addservicemodal (`n` on the Services page) precisely so a later feature added here - Docker Hub search, a tag picker - lands in both flows at once instead of leaving the bootstrap flow behind. See D2 in docs/plans/image-search.md.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is not a tea.Model in its own right - it has no Init and its Update/View take and return the concrete type, not the interface - because it is always embedded inside a modal that owns the surrounding chrome (title text, what else the modal shows before or after this step) rather than run standalone.
func New ¶
New builds the step. title is shown as the step's heading; onSubmit turns the validated (name, image) pair into the command the embedding modal should run once it closes - cmds.CreateComposeFile for the bootstrap flow, cmds.AddService for the Services page. That is deliberately the whole contract: a third parameter is the signal to stop sharing this component and copy the step instead (D2).
The returned command focuses the service-name field; embed it in whatever command the caller already returns from the keypress that opens this step.