Skip to content

442: opskit go picker — aligned columns, no timeout - #443

Merged
growlf merged 3 commits into
mainfrom
442-opskit-go-picker-has-no-column-layout-and-times-ou
Oct 13, 2026
Merged

growlf merged 3 commits into
mainfrom
442-opskit-go-picker-has-no-column-layout-and-times-ou

Conversation

@growlf

@growlf growlf commented Oct 13, 2026

Copy link
Copy Markdown
Owner

Closes #442

What & why

opskit go's fzf picker was hard to read and could self-terminate:

  • No columns — it fed fzf f"{rel}\t{path}" with no header and no fixed widths, so the tab expanded to a tab stop and the long absolute path dominated each line.
  • 60s timeout — fzf was invoked with timeout=60; waiting longer killed it, printed "fzf not found or timed out", and exited 1.

Changes (bin/opskit-go.py)

  • Added pure helpers: _picker_header(), _picker_row(proj, git_lookup), build_picker(projects, git_lookup=_git_info). Rows are space-padded to fixed widths with a header: NAME | BRANCH | STATUS | RESUME; long values truncate with ….
  • Rewrote run_fzf_selection to use --delimiter=\t --with-nth=2 --accept-nth=1 --header=<header>: display the aligned columns, return the hidden path (field 1). The path is parsed with a .split("\t")[0] fallback so it works even on a build that ignores --accept-nth.
  • Removed the timeout — Esc/Ctrl+C cancels (nonzero fzf exit → None). fzf-missing still errors clearly.
  • Branch/dirty are computed lazily via _git_info for the displayed (enabled) rows only, so the scan stays cheap.

Verification

  • New tests/test_tui_picker.py: header names the columns; header/row column offsets align; [resume] only when present; long names truncate to width; each line's field 1 is the path; run_fzf_selection passes no timeout and passes the column options; cancel/empty selection return None.
  • make test → 1685 passed, 1 skipped.
  • Rendered the real picker block and confirmed aligned columns; smoke-tested fzf accepts the options.

Plan: plans/442-opskit-go-picker-columns.md.

@growlf growlf linked an issue Oct 13, 2026 that may be closed by this pull request
@growlf growlf self-assigned this Oct 13, 2026
@growlf

growlf commented Oct 13, 2026

Copy link
Copy Markdown
Owner Author

Reviewed. Reproduced both defects against the current code and confirmed the fix.

  • Columns. Rendered the real picker block — NAME | BRANCH | STATUS | RESUME line up under a header and the absolute path is hidden. fzf's --with-nth scopes the fuzzy search to the visible columns, so you search NAME (the rel selector), not the hidden path. That's the right behaviour and the plan says so.
  • Timeout. The timeout=60 is gone; Esc/Ctrl+C cancels via fzf's nonzero exit and returns None. fzf-missing still errors clearly.
  • Selection value. --accept-nth=1 returns the path, with a .split("\t")[0] fallback so an older fzf that ignores --accept-nth still yields the path.

Tests cover the header, column alignment (offsets match), the [resume] flag, truncation to width, path-as-field-1, the no-timeout assertion, and cancel/empty → None. make test → 1685 passed, 1 skipped. CI green.

No blocking issues. Nit only: branch/dirty are recomputed for the selected row on the confirmation screen — negligible for an enabled list. Merging.

@growlf
growlf merged commit e60acc7 into main Oct 13, 2026
9 checks passed
@growlf
growlf deleted the 442-opskit-go-picker-has-no-column-layout-and-times-ou branch October 13, 2026 22:03
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.

opskit go: picker has no column layout and times out after 60s

1 participant