-
Notifications
You must be signed in to change notification settings - Fork 744
Fix clipboard copy formatting based on selection dimensions in Stack Viewer #2332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
When copying a single cell value from Stack Viewer, the clipboard now contains just the value without markdown table delimiters. Multiple cell selections still use markdown table format with leading "| " and trailing " |" characters. This fixes the regression where single cell copy would wrap values in "|" characters unnecessarily. Co-authored-by: brianrob <[email protected]>
|
@copilot, there is some behavior that is not correct. This mostly works, but there are a few corner cases that don't work. One or two cells on top of one another, when copied and pasted, show up incorrectly. Example: The name column: module ntoskrnl <<ntoskrnl!?>> module code <<code!?>> Should be: Name Example: The First (timestamp) column: Sometimes shows up as "27.462 27.462". Sometimes as: 27.462 Should be: First |
Track total selected cells count to properly handle: - 1 cell: no markdown delimiters - 2 cells: no markdown delimiters (range handling) - 3+ cells: markdown table format with delimiters This fixes the corner case where selecting multiple cells from the same column (e.g., "module" and "ntoskrnl" vertically) would not properly format as a markdown table. Co-authored-by: brianrob <[email protected]>
Fixed in commit a07effc. The issue was that the original fix only checked columns per row (
This correctly handles vertically stacked selections like the Name column example you mentioned. |
|
@copilot, this still isn't working properly. How it should work: Single column of data:
Multiple columns of data:
|
Updated logic to track columns and rows separately: - Single column selections: include header, NO pipes - Multiple columns + single row: NO header, NO pipes - Multiple columns + multiple rows: include header, YES pipes This properly handles all clipboard scenarios as requested. Co-authored-by: brianrob <[email protected]>
Fixed in commit afbc9d4. Now tracking selection dimensions (columns × rows) separately: Single column:
Multiple columns:
The logic now uses |
Fix clipboard copy formatting in Stack Viewer to properly handle different selection patterns
Issue: When copying a single cell value (e.g., "Last" column with value "16,867.276"), the clipboard contains "| 16,867.276 |" instead of just "16,867.276". Additionally, the formatting behavior was inconsistent for different selection patterns.
Root cause: The code in
PerfDataGrid.xaml.cswas adding markdown table formatting (leading "| " and trailing " |") regardless of selection dimensions (columns × rows).Changes Made:
The fix implements proper clipboard formatting based on selection dimensions:
Single column of data:
Multiple columns of data:
Implementation:
m_numSelectedColumnsandm_numSelectedRowsto distinguish selection dimensionsTechnical Details:
The fix tracks three dimensions:
m_numSelectedCells) - for range handlingm_numSelectedColumns) - for format decisionsm_numSelectedRows) - for format decisionsHeader inclusion:
Pipe symbols (markdown table format):
Security Summary:
Note: Build has pre-existing dependency issues with missing NuGet packages (unrelated to this change).
Original prompt
💡 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.