Skip to content

refactor(workstation): migrate submodule/remote/issue/PR-triage cursors to id-based selection#1645

Open
gfargo-horizon-agent[bot] wants to merge 2 commits into
mainfrom
agent/coco-769-coco-1569-design-workstation-finish-id-b
Open

refactor(workstation): migrate submodule/remote/issue/PR-triage cursors to id-based selection#1645
gfargo-horizon-agent[bot] wants to merge 2 commits into
mainfrom
agent/coco-769-coco-1569-design-workstation-finish-id-b

Conversation

@gfargo-horizon-agent

@gfargo-horizon-agent gfargo-horizon-agent Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

What

Extends the id-based selection migration (#1452, dual-write + selector-flip) to the submodules (id = submodule path), remotes (id = remote name), issues (id = stringified issue number), and pull-request-triage (id = stringified PR number) views, replicating the pattern proven for worktrees in 4b641a9. Consolidates the scattered inline filtered*List[index] resolution in useWorkflowAction.ts and useYankActions.ts onto single selectors per view.

Why

Closes #1569
Plane: OSS-769

File-history and the history/diff/status-file trio are explicitly deferred to follow-up PRs per the item's suggested order (bigger surface, not a drop-in repeat of this pattern).

How

  • inkViewModel.ts: selectedSubmoduleId? / selectedRemoteId? / selectedIssueId? / selectedPullRequestTriageId? state fields; moveSubmodule/moveRemote/moveIssue/movePullRequestTriage actions dual-write the id alongside the index; all cleared on repo-frame push/pop and filter-preset cycling; navigateOpenDiffForPullRequest sets the PR id precisely (the PR number IS the target's id).
  • selection.ts: new getSelectedSubmodule/getSelectedSubmoduleId, getSelectedRemote/getSelectedRemoteId, getSelectedIssue/getSelectedIssueId, and getSelectedPullRequestTriage/getSelectedPullRequestTriageId selectors — id-first, index-fallback, with an unfiltered-list fallback tier (same shape as getSelectedWorktree). The issue/PR filter fields mirror buildFilteredLists.ts's promoted-filter arrays exactly.
  • inkInput.ts / useInputHandler.ts: thread submoduleListIds/remoteListIds/issueListIds/pullRequestTriageListIds through the input context so the move dispatch sites can resolve the post-move target id via resolveMoveTargetId.
  • useWorkflowAction.ts: the submodule-init/update/sync, remote-set-url/remove/prune, and all triage-issue-*/triage-pr-* call sites now resolve through the new selectors instead of inline filtered*List[Math.min(index, …)]; removed the now-dead filtered*List deps and type aliases; resolvePendingItemAction's triage-pr-checkout spinner target also routes through the selector.
  • useYankActions.ts: submodule, remote, issue, and PR-triage yank arms resolve through the same selectors; removed the now-dead filteredIssueList/filteredPullRequestTriageList deps.
  • Module doc comments updated to reflect submodules/remotes/issues/PR-triage moving from "future pass" to "done".

Testing

  • build passes
  • tests pass / added (selection.test.ts, inkViewModel.test.ts, inkInput.test.ts — id-first/index-fallback/unfiltered-fallback cases, reducer dual-write/push-pop-clear/filter-cycle-clear cases, and move-dispatch id resolution, mirroring the worktree/submodule/remote additions)
  • lint clean
  • CI: pending

🤖 Generated by the harbor agent loop. Reviewed by a human before merge.

Closes #1569

…election (#1452 phase 3)

Extends the #1452 dual-write + selector-flip migration to the submodules
(id: path) and remotes (id: name) views, replicating the pattern proven
for worktrees in 4b641a9. Consolidates the scattered inline
filteredSubmoduleList[index]/filteredRemoteList[index] resolution across
useWorkflowAction.ts and useYankActions.ts onto new getSelectedSubmodule/
getSelectedRemote selectors.
…lection (#1452 phase 3 continued)

Completes the dual-write + selector-flip migration for the issues and
pull-request-triage views, following the just-shipped submodule/remote
pattern (#1452). Action/yank target resolution now keys off the
stringified issue/PR number instead of the raw selected*Index, so a
background list refetch that reorders rows can't silently retarget an
in-flight triage action.

- Add getSelectedIssue/getSelectedIssueId and
  getSelectedPullRequestTriage/getSelectedPullRequestTriageId to
  selection.ts, matching the id-first/index-fallback/unfiltered-fallback
  shape of getSelectedSubmodule/getSelectedRemote.
- Add selectedIssueId/selectedPullRequestTriageId mirrors to LogInkState;
  moveIssue/movePullRequestTriage actions gain id?, and every reducer
  case that resets/rectifies the index also clears (or precisely sets,
  for navigateOpenDiffForPullRequest) the mirror.
- Flip all filteredIssueList/filteredPullRequestTriageList inline
  resolution in useWorkflowAction.ts and useYankActions.ts onto the new
  selectors; drop the now-dead filtered*List deps and type aliases.
- Thread issueListIds/pullRequestTriageListIds through useInputHandler.ts
  and inkInput.ts so moveIssue/movePullRequestTriage dispatch sites
  resolve the post-move id via resolveMoveTargetId.
@gfargo-horizon-agent gfargo-horizon-agent Bot changed the title refactor(workstation): migrate submodule/remote cursors to id-based selection refactor(workstation): migrate submodule/remote/issue/PR-triage cursors to id-based selection Jul 12, 2026

@gfargo-horizon-agent gfargo-horizon-agent Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔎 Agent review (sonnet→opus) — LGTM

REVIEW: LGTM
RESOLVES: full

PR #1645 cleanly completes the #1452 id-based selection flip for submodules, remotes, issues, and PR-triage — the new selectors replicate buildFilteredLists's filter-field arrays verbatim, the reducer writes/clears every id mirror at the required sites, and resolveMoveTargetId's clamping matches clampIndex so id and index never diverge. tsc, lint (only a pre-existing exhaustive-deps warning that also exists on main), and all 762 touched-suite tests pass; no correctness issues found.

  • 🧹 PR bundles submodule/remote with issue/PR-triage — The implementation plan scoped this PR to issues/PR-triage only, assuming submodule/remote id-based selection had already shipped separately — but no such PR is on main, so this one delivers both migrations together (two commits). It stays entirely within OSS-769's overall scope and touches only the relevant runtime files with no unrelated changes, so this is a scope-size observation rather than a defect.

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.

design(workstation): finish id-based selection migration for remaining views (#1452 phase 3 continued)

0 participants