Skip to content

Use unique ID as rawvalue for dropdown, instead of display value#53

Closed
Copilot wants to merge 2 commits into
dropdown-pipesfrom
copilot/sub-pr-52
Closed

Use unique ID as rawvalue for dropdown, instead of display value#53
Copilot wants to merge 2 commits into
dropdown-pipesfrom
copilot/sub-pr-52

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 4, 2025

Dropdowns, checkbox lists, and radio button lists previously used display values as raw values, causing issues when multiple options share the same display text or when display values change.

Changes

  • New mapping infrastructure: Added RawValueMapping<T> and OneToOneMapping<Ta, Tb> to maintain bidirectional mappings between GUID-based raw values and display values
  • Updated widget implementations: Modified DropDown, CheckBoxList, RadioButtonList and their generic counterparts to generate unique GUIDs for each option instead of using display values directly
  • Enhanced debugging: Added logging in LoadResult to track raw value to display value resolution

Example

var dropdown = new DropDown(new[] { "Option A", "Option A", "Option B" });
// Previously: Raw values were "Option A", "Option A", "Option B" - ambiguous
// Now: Raw values are unique GUIDs, display values remain as shown

This ensures stable value tracking even when display text duplicates or changes.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: TomW-Skyline <97225679+TomW-Skyline@users.noreply.github.com>
Copilot AI changed the title [WIP] Use unique ID as rawvalue for dropdown Use unique ID as rawvalue for dropdown, instead of display value Dec 4, 2025
Copilot AI requested a review from TomW-Skyline December 4, 2025 15:54
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.

2 participants