Skip to content

Fix five review issues: shortcut hints, ItemsDictionary duplicates, null ItemsSource, duplicate chip handlers, Freeform key hint#629

Merged
TheJoeFin merged 2 commits intograb-templatesfrom
copilot/sub-pr-620
Mar 7, 2026
Merged

Fix five review issues: shortcut hints, ItemsDictionary duplicates, null ItemsSource, duplicate chip handlers, Freeform key hint#629
TheJoeFin merged 2 commits intograb-templatesfrom
copilot/sub-pr-620

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 7, 2026

Five correctness issues flagged in code review of the grab-templates PR, covering misleading UI hints, data duplication, and defensive null/event-handler handling.

Changes

  • FullscreenGrab.xaml.csAddPostGrabActionMenuItem: Cap InputGestureText to Ctrl+1Ctrl+9; omit for indices > 9 since no keyboard handler exists beyond Key.D9.

    InputGestureText = shortcutIndex <= 9 ? $"Ctrl+{shortcutIndex}" : string.Empty
  • QuickSimpleLookup.xaml.csLoadDataGridContent: Add ItemsDictionary.Clear() before AddRange; without it, re-invoking the method (e.g. via "Import from CSV") duplicates all rows, history, and templates.

  • InlinePickerRichTextBox.csItemsSource getter: Guard against the DP returning null before the property is ever set — previously threw NullReferenceException.

    get => (IEnumerable<InlinePickerItem>?)GetValue(ItemsSourceProperty) ?? [];
  • InlineChipElement.csOnApplyTemplate: Store PART_RemoveButton in a field and detach the previous Click handler before re-attaching via a named method. Lambda-per-call caused multiple RemoveRequested fires on a single click after theme/template switches.

  • FullscreenGrab.xaml – Freeform menu item: Correct InputGestureText from "P" to "D" to match GetSelectionStyleKey returning Key.D for FsgSelectionStyle.Freeform.


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

…sSource, duplicate handlers, Freeform key hint

Co-authored-by: TheJoeFin <7809853+TheJoeFin@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix overlapping buttons in Post Grab Actions window Fix five review issues: shortcut hints, ItemsDictionary duplicates, null ItemsSource, duplicate chip handlers, Freeform key hint Mar 7, 2026
@TheJoeFin TheJoeFin marked this pull request as ready for review March 7, 2026 02:02
@TheJoeFin TheJoeFin merged commit 27df35c into grab-templates Mar 7, 2026
@TheJoeFin TheJoeFin deleted the copilot/sub-pr-620 branch March 7, 2026 02:02
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