Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 11, 2026

When using RegenPreview.ps1 -Select, displayed library numbers didn't correlate to actual selections. Selecting index 62 would regenerate a different library than shown at position 62.

Root Cause

Libraries were displayed grouped by generator type (Azure SDK, Unbranded, Management Plane) with sequential numbering, but selection indexed into the original ungrouped array.

# Display showed:
[1-10]  Azure SDK Libraries
[11-20] Unbranded Libraries  
[21-75] Management Libraries

# But selection used original array order which could be:
# Mgmt, Azure, Unbranded, Mgmt, Azure, ... (interleaved)

Changes

  • Reorder $Libraries array to match display order before user selection
  • Replace all selection references from $Libraries to $orderedLibraries
  • Ensure display index N maps to orderedLibraries[N-1]

6 lines modified, 11 lines added in Select-LibrariesToRegenerate function.

Original prompt

This section details on the original issue you should resolve

<issue_title>Number selection is inaccurate in RegenPreview</issue_title>
<issue_description>When running RegenPreview.ps1 -Select, the numbers displayed don't correlate to the actual library that is used.

Image

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

The Select-LibrariesToRegenerate function was displaying libraries grouped by generator type (Azure, Unbranded, Management) with sequential numbering, but was selecting from the original ungrouped array. This caused the displayed numbers to not correlate with the actual libraries selected.

Fixed by reordering the libraries array to match the display order before user selection, ensuring that display index N always corresponds to orderedLibraries[N-1].

Co-authored-by: JoshLove-msft <[email protected]>
Copilot AI changed the title [WIP] Fix inaccurate number selection in RegenPreview Fix library selection index mismatch in RegenPreview.ps1 interactive mode Jan 11, 2026
Copilot AI requested a review from JoshLove-msft January 11, 2026 20:08
@JoshLove-msft JoshLove-msft marked this pull request as ready for review January 11, 2026 20:11
@JoshLove-msft JoshLove-msft added this pull request to the merge queue Jan 12, 2026
Merged via the queue into main with commit a378f3a Jan 12, 2026
22 checks passed
@JoshLove-msft JoshLove-msft deleted the copilot/fix-number-selection-issue branch January 12, 2026 20:50
@microsoft-github-policy-service microsoft-github-policy-service bot added the emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp label Jan 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Number selection is inaccurate in RegenPreview

3 participants