pre-fill canonical label names in editor template #22

Merged
heiko merged 5 commits from fix/20-autocomplete-label-create into master 2026-05-17 22:05:20 +02:00
Owner

Fixes #20.

Summary

  • Add resolveLabelsToNames helper that maps raw --label input to canonical names using the existing fuzzy matching logic
  • Call it in issue create and pr create before building the editor template, so --label bu shows Bug in the editor instead of bu
  • Ambiguous or unknown inputs are kept as-is and handled by the existing post-edit resolveLabels call

Test plan

  • fj issue create --label bu — editor opens with label: Bug
  • fj pr create --label enh — editor opens with label: Enhancement
  • fj issue create --label xyz — editor opens with label: xyz, error surfaces fast
  • go test ./... passes
Fixes #20. ## Summary - Add `resolveLabelsToNames` helper that maps raw `--label` input to canonical names using the existing fuzzy matching logic - Call it in `issue create` and `pr create` before building the editor template, so `--label bu` shows `Bug` in the editor instead of `bu` - Ambiguous or unknown inputs are kept as-is and handled by the existing post-edit `resolveLabels` call ## Test plan - [x] `fj issue create --label bu` — editor opens with `label: Bug` - [x] `fj pr create --label enh` — editor opens with `label: Enhancement` - [x] `fj issue create --label xyz` — editor opens with `label: xyz`, error surfaces fast - [x] `go test ./...` passes
fix: pre-fill canonical label names in editor template
Some checks failed
mod-nag (Push) / mod-nag (push) Has been cancelled
b8d5045193
When --label is passed to issue/pr create, resolve the raw input to
its canonical name before opening the editor, so the template shows
"Bug" instead of "bu". Ambiguous or unknown inputs are kept as-is and
resolved (or rejected) after the editor closes as before.

Fixes #20.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
heiko force-pushed fix/20-autocomplete-label-create from b8d5045193
Some checks failed
mod-nag (Push) / mod-nag (push) Has been cancelled
to 99553f48d9
Some checks failed
mod-nag (Push) / mod-nag (push) Has been cancelled
2026-05-17 21:42:00 +02:00
Compare
refactor: extract labelNames helper to avoid duplicate slice building
Some checks failed
mod-nag (Push) / mod-nag (push) Has been cancelled
29863681e3
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Author
Owner

looks good. checkLabels before the editor is the right call — fail fast on typos. labelNames helper avoids the duplicate slice build in resolveLabels. TDD structure is clean.

looks good. `checkLabels` before the editor is the right call — fail fast on typos. `labelNames` helper avoids the duplicate slice build in `resolveLabels`. TDD structure is clean.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix: error on unknown --label before opening editor
Some checks failed
mod-nag (Push) / mod-nag (push) Has been cancelled
7f1e06bcac
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
heiko merged commit 4442e363af into master 2026-05-17 22:05:20 +02:00
heiko deleted branch fix/20-autocomplete-label-create 2026-05-17 22:05:20 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
heiko/fj!22
No description provided.