MCPcopy
hub / github.com/Adembc/lazyssh / addInputFieldWithHelp

Method addInputFieldWithHelp

internal/adapters/ui/server_form.go:965–982  ·  view source on GitHub ↗

addInputFieldWithHelp adds a regular input field with help support

(form *tview.Form, label, fieldName, defaultValue string, width int, placeholder string)

Source from the content-addressed store, hash-verified

963
964// addInputFieldWithHelp adds a regular input field with help support
965func (sf *ServerForm) addInputFieldWithHelp(form *tview.Form, label, fieldName, defaultValue string, width int, placeholder string) *tview.InputField {
966 field := tview.NewInputField().
967 SetLabel(label).
968 SetText(defaultValue).
969 SetFieldWidth(width)
970
971 if placeholder != "" {
972 field.SetPlaceholder(placeholder)
973 }
974
975 // Add focus handler to show help
976 field.SetFocusFunc(func() {
977 sf.updateHelp(fieldName)
978 })
979
980 form.AddFormItem(field)
981 return field
982}
983
984// addValidatedInputField adds an input field with real-time validation
985func (sf *ServerForm) addValidatedInputField(form *tview.Form, label, fieldName, defaultValue string, width int, placeholder string) *tview.InputField {

Callers 3

createConnectionFormMethod · 0.95
createAdvancedFormMethod · 0.95

Calls 1

updateHelpMethod · 0.95

Tested by

no test coverage detected