refactor(pickers): extract shared entity picker builder #546

Closed
opened 2026-04-29 18:29:56 +00:00 by barrettruth · 0 comments
barrettruth commented 2026-04-29 18:29:56 +00:00

Problem

lua/forge/picker/pr.lua, lua/forge/picker/issue.lua, and lua/forge/picker/release.lua still repeat the same entity-picker scaffolding:

  • limit selection and list slicing
  • cached row rendering into picker entries
  • placeholder/load-more entry construction
  • cached-first stream emission followed by JSON fetch/update
  • stale refresh/rerender state handling

The earlier picker splits (#527, #528, #529) created good module boundaries, but the repeated builder flow still makes these picker surfaces harder to navigate and maintain than they need to be.

Target seam

Extract a shared entity-picker builder module that owns the common entry-building and stream/update flow for PR, issue, and release pickers, while keeping:

  • per-entity wrapper modules in place
  • entity-specific actions and labels explicit
  • current picker UX and backend semantics unchanged

Constraints

  • behavior-preserving refactor only
  • preserve current picker actions, refresh behavior, caching, and load-more behavior
  • preserve backend-specific differences honestly
  • do not change public picker entrypoints or user-facing keybindings/text unless required to preserve current behavior

Non-goals

  • no fzf transport changes
  • no backend adapter changes
  • no action-gating bug fixes folded into this refactor
  • no CI/check picker unification in this issue

Why now

This follows the earlier picker decomposition work and should leave the remaining picker wrappers thinner and more obvious, while setting up a later CI/check picker follow-up on the same pattern.

## Problem `lua/forge/picker/pr.lua`, `lua/forge/picker/issue.lua`, and `lua/forge/picker/release.lua` still repeat the same entity-picker scaffolding: - limit selection and list slicing - cached row rendering into picker entries - placeholder/load-more entry construction - cached-first stream emission followed by JSON fetch/update - stale refresh/rerender state handling The earlier picker splits (#527, #528, #529) created good module boundaries, but the repeated builder flow still makes these picker surfaces harder to navigate and maintain than they need to be. ## Target seam Extract a shared entity-picker builder module that owns the common entry-building and stream/update flow for PR, issue, and release pickers, while keeping: - per-entity wrapper modules in place - entity-specific actions and labels explicit - current picker UX and backend semantics unchanged ## Constraints - behavior-preserving refactor only - preserve current picker actions, refresh behavior, caching, and load-more behavior - preserve backend-specific differences honestly - do not change public picker entrypoints or user-facing keybindings/text unless required to preserve current behavior ## Non-goals - no fzf transport changes - no backend adapter changes - no action-gating bug fixes folded into this refactor - no CI/check picker unification in this issue ## Why now This follows the earlier picker decomposition work and should leave the remaining picker wrappers thinner and more obvious, while setting up a later CI/check picker follow-up on the same pattern.
Sign in to join this conversation.
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
barrettruth/forge.nvim#546
No description provided.