Improve Gitea config menu UX #36

Closed
opened 2026-07-02 01:26:25 -05:00 by jcwalker3 · 1 comment
Owner

Context

The interactive menu (python gitea_config.py menu / ./scripts/gitea-config-menu, added in #31/#34) works but is clunky: every choice needs a number and Enter, profiles must be typed by hand, Enter doesn't consistently cancel/back out, the screen never clears, and repeated profile/auth/reviewer checks feel slow.

Desired UX

  1. Single-key menu actions — in an interactive TTY, pressing 1/2/… selects immediately (no Enter). Keep a line-input fallback for non-TTY/tests.
  2. Enter backs out — Enter on the main menu quits; Enter on any submenu/prompt cancels back. Consistent across profile selection, auth test, launcher generation, eligibility.
  3. Profile chooser — anywhere a profile is needed, show a numbered list; pick by key; Enter cancels. No manual typing of prgs-author/prgs-reviewer/mdcps except an explicit manual-entry path (e.g. naming a new profile when adding).
  4. Clear screen — clear the terminal before redrawing the main menu and profile-selection screens; TTY-only; never emit raw clear codes in non-TTY/test runs.
  5. Status + pause — after validate/test-auth/whoami/eligibility, show a concise result, then Press any key to continue in TTY mode; never block in non-TTY/test mode.

Implementation guidance

  • Files: gitea_config_menu.py, tests/test_config_menu.py, README/runbook if UX text changes. Leave scripts/gitea-config-menu unchanged unless a tiny update is truly needed.
  • Small helpers: read_key(), choose_menu_option(), choose_profile(), clear_screen(), pause_for_key().
  • Detect TTY via sys.stdin.isatty() + sys.stdout.isatty(). Single-key via stdlib termios/tty on macOS/Linux, with a line-input fallback. Make menu IO injectable so tests need no real terminal.

Safety (unchanged)

No tokens/passwords printed; no raw config dumps; no .env.personal; no change to auth behavior or secret storage.

Tests

Single-key select (TTY abstraction), main-menu Enter exits, submenu Enter cancels, chooser lists profiles, chooser selects by key, chooser handles no profiles, non-TTY line fallback, clear-screen called only when appropriate, pause never hangs non-TTY, no secrets in output.

Non-goals

No MCP runtime behavior change; no new Gitea API ops; no credential-storage change; no bypass of the canonical profile model.

Refs #31, #34.

## Context The interactive menu (`python gitea_config.py menu` / `./scripts/gitea-config-menu`, added in #31/#34) works but is clunky: every choice needs a number **and** Enter, profiles must be typed by hand, Enter doesn't consistently cancel/back out, the screen never clears, and repeated profile/auth/reviewer checks feel slow. ## Desired UX 1. **Single-key menu actions** — in an interactive TTY, pressing `1`/`2`/… selects immediately (no Enter). Keep a line-input fallback for non-TTY/tests. 2. **Enter backs out** — Enter on the main menu quits; Enter on any submenu/prompt cancels back. Consistent across profile selection, auth test, launcher generation, eligibility. 3. **Profile chooser** — anywhere a profile is needed, show a numbered list; pick by key; Enter cancels. No manual typing of `prgs-author`/`prgs-reviewer`/`mdcps` except an explicit manual-entry path (e.g. naming a *new* profile when adding). 4. **Clear screen** — clear the terminal before redrawing the main menu and profile-selection screens; TTY-only; never emit raw clear codes in non-TTY/test runs. 5. **Status + pause** — after validate/test-auth/whoami/eligibility, show a concise result, then `Press any key to continue` in TTY mode; never block in non-TTY/test mode. ## Implementation guidance - Files: `gitea_config_menu.py`, `tests/test_config_menu.py`, README/runbook if UX text changes. Leave `scripts/gitea-config-menu` unchanged unless a tiny update is truly needed. - Small helpers: `read_key()`, `choose_menu_option()`, `choose_profile()`, `clear_screen()`, `pause_for_key()`. - Detect TTY via `sys.stdin.isatty()` + `sys.stdout.isatty()`. Single-key via stdlib `termios`/`tty` on macOS/Linux, with a line-input fallback. Make menu IO injectable so tests need no real terminal. ## Safety (unchanged) No tokens/passwords printed; no raw config dumps; no `.env.personal`; no change to auth behavior or secret storage. ## Tests Single-key select (TTY abstraction), main-menu Enter exits, submenu Enter cancels, chooser lists profiles, chooser selects by key, chooser handles no profiles, non-TTY line fallback, clear-screen called only when appropriate, pause never hangs non-TTY, no secrets in output. ## Non-goals No MCP runtime behavior change; no new Gitea API ops; no credential-storage change; no bypass of the canonical profile model. Refs #31, #34.
jcwalker3 added the status:in-progress label 2026-07-02 01:26:33 -05:00
Author
Owner

Claimed. Starting implementation.

Branch: fix/issue-36-config-menu-ux.

Adding injectable menu IO (MenuIO) + helpers read_key / choose_menu_option / choose_profile / clear_screen / pause_for_key: single-key nav in a TTY (termios/tty, line-input fallback for non-TTY/tests), Enter quits/backs-out, numbered profile chooser, TTY-only clear + pause. No auth/secret-storage changes; no secrets printed.

Claimed. Starting implementation. Branch: `fix/issue-36-config-menu-ux`. Adding injectable menu IO (`MenuIO`) + helpers `read_key` / `choose_menu_option` / `choose_profile` / `clear_screen` / `pause_for_key`: single-key nav in a TTY (termios/tty, line-input fallback for non-TTY/tests), Enter quits/backs-out, numbered profile chooser, TTY-only clear + pause. No auth/secret-storage changes; no secrets printed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Scaled-Tech-Consulting/Gitea-Tools#36