feat: multi-field forward form with Tab cycling

Replace single-line prompt with form-based forward input:
- Separate Type/Host/Port fields
- Tab/Shift+Tab cycles focus, Tab on Type field cycles mode values
- Address auto-split into host+port for edit
- COM port excludes port field
- Form render with focused field indicator

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
JiXieShi
2026-05-24 02:13:18 +08:00
parent 341476f10a
commit a4996ba3e7
2 changed files with 192 additions and 43 deletions
+11
View File
@@ -61,6 +61,13 @@ type Model struct {
promptInput textinput.Model
promptSubmit func(string)
formActive bool
formTitle string
formFields []textinput.Model
formLabels []string
formFocus int
formSubmit func([]string)
completionActive bool
completionBase string
completionCandidates []string
@@ -262,6 +269,10 @@ func (m *Model) View() string {
return fillScreen(m.width, m.height, base)
}
if m.formActive {
return renderCenteredModalContent(m.width, m.height, m.renderForm())
}
if m.promptActive {
return renderCenteredModalContent(m.width, m.height, m.renderPrompt())
}