Repository navigation
refactor(picker): unify worktree and PR rows into one PickerRow - #3259
Merged
Merged
Conversation
Collapse the picker's two SkimItem types — WorktreeSkimItem (a checked-out worktree row) and PrSkimItem (a listed --prs row) — into one PickerRow whose only branching axis is `local: Option<LocalCheckout>` (Some = worktree row, None = listed PR). This is the type-level completion of #3252, which made the two row kinds behave identically: they now share one text(), display(), output(), preview(), PR-pane renderer, and pr_status slot plus preview cache. PrSkimItem and its standalone SkimItem impl are gone; a shared `listed_pr_row` constructor (used by fetch_and_stream and the row tests) builds listed PRs from a static pr_status slot. The worktree-only fields move into a new LocalCheckout, and the frozen ListItem handle is replaced by a precomputed output_token. A --prs row's pr pane is memoized in the session-long shared preview cache; listed_pr_row drops the prior (pr:N, Pr) entry on each build so an alt-r reload re-renders the freshly fetched metadata, the worktree-row analog of on_update's invalidation. A worktree row tracking a draft PR now shows a draft line in its pr pane, falling out of both kinds sharing render_pr_pane_body.
worktrunk-bot
approved these changes
Jun 26, 2026
Collaborator
|
Approved. The three red checks are all the same pre-existing PTY test timing out, not a regression from this refactor — leaving the approval in place and re-running the failed jobs.
Why this reads as a timing flake, not a logic break
No existing flake-tracking issue for this test. If it recurs on |
max-sixty
added a commit
that referenced
this pull request
Jun 27, 2026
#3259 renamed WorktreeSkimItem to PickerRow (and the morphed flag moved to LocalCheckout); four doc comments still linked the old type, failing `cargo doc -Dwarnings` on the branch's first CI run. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This was referenced Jun 27, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Collapse the picker's two
SkimItemtypes into one.WorktreeSkimItem(a checked-out worktree row) andPrSkimItem(a listed--prsrow) become a singlePickerRowwhose only branching axis islocal: Option<LocalCheckout>—Somefor a worktree row,Nonefor a listed PR. This is the type-level completion of #3252, which made the two row kinds behave identically; they now share onetext(),display(),output(),preview(), and PR-pane renderer instead of two parallel implementations.What changed
PrSkimItemand its standaloneimpl SkimItemare deleted. Listed--prsrows are built byprs::listed_pr_row(shared byfetch_and_streamand the row tests) asPickerRow { local: None, … }with a staticpr_statusslot pre-filled by the newPrEntry::display_status().has_upstream,summaries_enabled,local_content) move into aLocalCheckoutsub-struct behindlocal. The frozenArc<ListItem>handle is gone, replaced by a precomputedoutput_token.pr_statusand the preview cache are shared by both row kinds, keyed byPickerRow::preview_key()— the branch for a worktree row,pr:N/mr:Nfor a listed PR. A--prsrow'sprpane is memoized in that session-long cache, solisted_pr_rowdrops the prior(pr:N, Pr)entry on each build; analt-rreload then re-renders the freshly fetched PR metadata instead of the pre-reload pane (the worktree-row analog ofon_update's invalidation).Behavior change
A worktree row tracking a draft PR now shows a
state: draftline in itsprpane. Previously only--prsrows surfaced draft state. This falls out of both kinds sharingrender_pr_pane_body.Reviewer orientation
src/commands/picker/items.rs— the unifiedPickerRow/LocalCheckout,preview_key(),render_pr_pane_body(),render_listed_pr_mode().src/commands/picker/prs.rs—PrSkimItemremoved;PrEntry::display_status()and thelisted_pr_rowconstructor (with its cache invalidation).src/commands/picker/progressive_handler.rs— worktree-row construction withlocal: Some(LocalCheckout { … }).Rendered output is unchanged — the integration snapshots still pass, and the
loading_placeholdersnapshots change only theirexpression:metadata line. Rebased on main's #3253 (the↳loading-placeholder glyph), which is preserved.