feat: add Ctrl+V shortcut for FileMaker paste#191
Merged
Conversation
Bind Ctrl+V at the Window level to PasteFileMakerClipData. Avalonia processes the focused control's KeyDown first and only routes to the Window's KeyBindings when the event is unhandled, so text inputs (TextBox, AvaloniaEdit) keep their normal text-paste behavior and the shortcut only fires when focus is outside an editable field. After paste, select the most recently added clip so the editor opens to it and the list scrolls to it (ListBox.AutoScrollToSelectedItem). Without this, a successful paste sent the clip to the bottom of the list with no visual confirmation. Improve MockClipboardService.GetFormatsAsync to surface the keys it holds, which unblocks paste-related tests.
8bf69f4 to
2e1e59c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Edit menu has long advertised Ctrl+V for "Paste from FileMaker" via
InputGesture, but no actual KeyBinding existed, so the shortcut didn't fire. Bind it at the Window level. Avalonia processes the focused control's KeyDown first and only routes to the Window's KeyBindings when the event is unhandled — so text inputs (TextBox, AvaloniaEditTextEditor) keep their normal Ctrl+V text-paste, and the shortcut only fires when focus is outside an editable field.PasteFileMakerClipDataalready gracefully no-ops with a "No FileMaker clips found on clipboard" status when the clipboard contains noMac-*formats, so misfires are harmless.Also auto-select the most recently pasted clip so the editor opens to it and the list scrolls to it (Avalonia's
ListBox.AutoScrollToSelectedItemis on by default). Before this, a successful paste appended the clip to the bottom of the list with no visual confirmation.MockClipboardService.GetFormatsAsyncwas hardcoded to returnArray.Empty<string>(), which made paste-related tests impossible. Now it surfaces the keys held inClipboardData— small change that unblocks the new test.