Skip to content

sp tui — interactive full-screen scratch browser (#26) - #31

Merged
rwrife merged 1 commit into
mainfrom
issue-26-sp-tui
Jul 13, 2026
Merged

sp tui — interactive full-screen scratch browser (#26)#31
rwrife merged 1 commit into
mainfrom
issue-26-sp-tui

Conversation

@rwrife

@rwrife rwrife commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Closes #26

Adds sp tui: an optional, full-screen Bubble Tea browser over the same store the CLI already uses. Strictly additive — no --json/scripting path changes, no new source of truth. The model reads scratches through a small Backend interface (satisfied by *store.Store) and drives the existing MoveToMorgue/Resurrect/open-in-$EDITOR operations, so it can never hard-delete or diverge from sp ls.

What changed

  • internal/tui/ — new isolated package: Model (Bubble Tea) with live/morgue panes, expiry-tinted list, side preview pane, live filter, and two-step y/N confirmation for any file move. Content/logic seam behind Backend + injected Now/OpenEditor for deterministic tests.
  • internal/cli/tui.gosp tui command; refuses to launch when stdout/stdin isn't a TTY (clear pointer to sp ls); reuses the exact $EDITOR launcher sp open uses; alt-screen program.
  • Wired into root; go get bubbletea v1.3.4 + bubbles v0.20.0.
  • README documents sp tui and its keybindings.

Acceptance criteria

  • Full-screen browser of live scratches (id, name, age, expires-in, size context, 🔑 secret marker), color-coded by expiry like sp ls.
  • Toggle to the morgue view (tab/m) with purge countdowns.
  • Preview pane for the selection; secret scratches show a redaction notice, never raw credentials.
  • Key-bound open ($EDITOR suspend/restore), rm→morgue, resurrect, each through existing store ops with a confirmation for file moves; never hard-deletes from the TUI.
  • Live filter by name/id/tag.
  • Graceful, clear error when not attached to a TTY.
  • Help/keybinding footer; q/esc quits and restores the terminal (alt-screen).
  • No --json/plain-command output changes; TUI isolated in internal/tui.
  • Model update/transition unit tests (fake backend, no real TTY); go build/vet/test ./.../gofmt clean.
  • README updated.

Notes: promote-from-TUI was scoped out to keep the interactive surface to the reversible ops (open/rm/resurrect); promote stays a deliberate CLI action. Preview is height-bounded so huge scratches don't blow the frame.

@rwrife
rwrife merged commit 5317597 into main Jul 13, 2026
1 check passed
@rwrife
rwrife deleted the issue-26-sp-tui branch July 13, 2026 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature] sp tui — interactive full-screen scratch browser

1 participant