feat(ui): file browser and connection string builder dialogs #50

Merged
warkanum merged 1 commits from issue-44-tui-input-dialogs into master 2026-10-03 18:11:29 +00:00
Member

Closes issue 44 (wdevs/relspecgo issue 44).

Summary

  • File browser (pkg/ui/filebrowser*.go): Enter on File Path inputs (load, save, import) opens it. Up/Down, Enter opens dir or selects file, Backspace/[..]/Left = parent, h hidden toggle, f extension filter toggle, s select, Esc/b cancel, circular Tab. Starts at the input value or working dir. Save mode has a file name field and overwrite confirmation. Directory formats (gorm, bun, drizzle, typeorm) can select a directory.
  • Connection string builder (pkg/ui/connstring*.go): Enter on Connection String inputs (load, import) opens it. PostgreSQL/MSSQL/SQLite fields with defaults (5432/1433), masked password, live masked preview, parsing of existing value, optional Test (F3, 5s timeout, password scrubbed from errors), Save (F2) writes back. SQLite path reuses the file browser. Esc leaves the input unchanged.
  • ui_rules.md updated.

Verification

  • gofmt -l pkg/ui: clean
  • go build ./...: ok
  • go vet ./pkg/ui/: ok
  • go test -race ./pkg/ui/: ok
  • New tests: connstring build/parse/mask/round-trip, extension filter/hidden/sort/start-path, headless smoke tests that both dialogs construct.

Caveats

  • Not exercised in a real terminal; key handling untested beyond construction smoke tests.
  • Test connection only unit-tested for SQLite error paths; PostgreSQL/MSSQL need a live server.
  • Load/save/import format dropdowns still only list existing formats (pgsql is the only one using a connection string), so MSSQL/SQLite builder output is not yet consumable by those screens.
  • PostgreSQL key=value DSNs are not parsed (URL form only); unknown query params are preserved.
  • Save screen has no connection string input, so the builder is wired to load and import only.
  • Full repo go test ./... not run.

Generated with Claude Code (https://claude.com/claude-code)

Closes issue 44 (wdevs/relspecgo issue 44). **Summary** - File browser (pkg/ui/filebrowser*.go): Enter on File Path inputs (load, save, import) opens it. Up/Down, Enter opens dir or selects file, Backspace/[..]/Left = parent, h hidden toggle, f extension filter toggle, s select, Esc/b cancel, circular Tab. Starts at the input value or working dir. Save mode has a file name field and overwrite confirmation. Directory formats (gorm, bun, drizzle, typeorm) can select a directory. - Connection string builder (pkg/ui/connstring*.go): Enter on Connection String inputs (load, import) opens it. PostgreSQL/MSSQL/SQLite fields with defaults (5432/1433), masked password, live masked preview, parsing of existing value, optional Test (F3, 5s timeout, password scrubbed from errors), Save (F2) writes back. SQLite path reuses the file browser. Esc leaves the input unchanged. - ui_rules.md updated. **Verification** - gofmt -l pkg/ui: clean - go build ./...: ok - go vet ./pkg/ui/: ok - go test -race ./pkg/ui/: ok - New tests: connstring build/parse/mask/round-trip, extension filter/hidden/sort/start-path, headless smoke tests that both dialogs construct. **Caveats** - Not exercised in a real terminal; key handling untested beyond construction smoke tests. - Test connection only unit-tested for SQLite error paths; PostgreSQL/MSSQL need a live server. - Load/save/import format dropdowns still only list existing formats (pgsql is the only one using a connection string), so MSSQL/SQLite builder output is not yet consumable by those screens. - PostgreSQL key=value DSNs are not parsed (URL form only); unknown query params are preserved. - Save screen has no connection string input, so the builder is wired to load and import only. - Full repo go test ./... not run. Generated with Claude Code (https://claude.com/claude-code)
sgcommand added 1 commit 2026-10-03 09:35:39 +00:00
Enter on File Path inputs opens a file browser (load/save, extension
filter, hidden toggle, overwrite confirm). Enter on Connection String
inputs opens a builder for PostgreSQL, MSSQL and SQLite with masked
password/preview, parsing and optional connection test.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
warkanum merged commit bb671c3680 into master 2026-10-03 18:11:29 +00:00
warkanum deleted branch issue-44-tui-input-dialogs 2026-10-03 18:11:29 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: wdevs/relspecgo#50