fix(tui): click selection sync + 2-page site form #132

Merged
lerko merged 2 commits from fix/click-selection-sync into main 2026-06-16 23:45:26 +00:00
Owner

Summary

  • Fix click-to-select bug where clicking a site snapped cursor back to previous selection (missing syncSelectedID call in handleClick)
  • Restructure site monitor form from 4 paginated pages (17 fields for HTTP) to 2 type-aware pages
    • Page 1: Name, Type, Alert + type-specific target (URL/Hostname/Port)
    • Page 2: Configuration with pre-filled defaults (hidden for Group type)
  • Form rebuilds dynamically on monitor type change, preserving entered values
  • Fix form width not being set on rebuild (caused placeholder truncation)

Test plan

  • Click sites in list — selected site stays highlighted, no snap-back
  • Add HTTP monitor — 2 pages: Setup (name/type/alert/URL), Config (method/codes/defaults/SSL)
  • Add Ping monitor — 2 pages: Setup (name/type/alert/hostname), Config (defaults)
  • Add Group — 1 page only (name/type/alert)
  • Change type mid-form — fields rebuild, focus stays on Type select, values preserved
  • Edit existing monitor — correct values loaded, type-appropriate fields shown
  • Placeholder text fully visible (not truncated)
## Summary - Fix click-to-select bug where clicking a site snapped cursor back to previous selection (missing `syncSelectedID` call in `handleClick`) - Restructure site monitor form from 4 paginated pages (17 fields for HTTP) to 2 type-aware pages - Page 1: Name, Type, Alert + type-specific target (URL/Hostname/Port) - Page 2: Configuration with pre-filled defaults (hidden for Group type) - Form rebuilds dynamically on monitor type change, preserving entered values - Fix form width not being set on rebuild (caused placeholder truncation) ## Test plan - [x] Click sites in list — selected site stays highlighted, no snap-back - [x] Add HTTP monitor — 2 pages: Setup (name/type/alert/URL), Config (method/codes/defaults/SSL) - [x] Add Ping monitor — 2 pages: Setup (name/type/alert/hostname), Config (defaults) - [x] Add Group — 1 page only (name/type/alert) - [x] Change type mid-form — fields rebuild, focus stays on Type select, values preserved - [x] Edit existing monitor — correct values loaded, type-appropriate fields shown - [x] Placeholder text fully visible (not truncated)
lerko added 2 commits 2026-06-16 23:40:14 +00:00
handleClick set m.cursor but returned without calling syncSelectedID,
causing the next refreshLive tick to snap the cursor back to the
previously selected site.
refactor(tui): restructure site form to 2 type-aware pages
CI / test (pull_request) Successful in 2m2s
CI / lint (pull_request) Successful in 1m17s
CI / vulncheck (pull_request) Successful in 56s
2e07e16b45
Replace 4-page paginated form (17 fields for HTTP) with a 2-page
type-aware layout. Page 1 shows core fields + type-specific target
(URL for HTTP, Hostname for ping, etc). Page 2 shows configuration
with pre-filled defaults. Group type gets 1 page.

Form rebuilds dynamically when monitor type changes, preserving
all entered values via pointer-bound siteFormData. Focus returns
to the Type select after rebuild so users can continue forward.
WithWidth set explicitly on rebuild to prevent placeholder truncation.
lerko merged commit 2e07e16b45 into main 2026-06-16 23:45:26 +00:00
lerko deleted branch fix/click-selection-sync 2026-06-16 23:45:26 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: lerkolabs/uptop#132