Add Ctrl+Enter/Esc and drag-handle reorder to LET to LAMBDA editor#102
Merged
Conversation
Ctrl+Enter saves (when validation passes) and Esc cancels via a window-level PreviewKeyDown handler. The ▲/▼ move buttons are replaced with a drag handle (⋮⋮) on the left of each kept row. A minimal in-window drag/drop initiates on the handle and only allows drops between kept rows, so the kept-rows-first invariant is preserved without extra bookkeeping. Alt+Up / Alt+Down keyboard reorder still works. Closes #101 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replace the custom mouse handlers + DragOver/Drop wiring with gong-wpf-dragdrop's attached properties on the InputsList ItemsControl. The library provides the drag preview ghost and insertion-line adorner out of the box, which were noticeably absent in the custom implementation. KeptRowReorderHandler enforces the kept-rows-only constraint by implementing IDragSource (refuses to start drag on unchecked rows) and overriding DefaultDropHandler.DragOver (refuses drop unless both source and target are kept). DefaultDropHandler.Drop already does the correct ObservableCollection.Move for same-collection reorders. DragSourceIgnore on the TextBox / CheckBoxes preserves text selection and click-to-toggle on those controls. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
Switched to Changes in 90c5698:
Net diff: −95 lines, +72 lines including the handler class and a single new import. Build clean, 433/433 unit tests pass. Same manual test plan as the original PR description. |
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
PreviewKeyDownhandler inLetToLambdaWindow.⋮⋮) on the left of each kept row.Took the custom approach (~80 lines) rather than adding
gong-wpf-dragdropas a dependency — happy to switch if the UX falls short.Test plan
Unit tests pass (433 / 433). Drag/drop and the new shortcuts are WPF UI behaviour that needs Excel + a real STA window, so manual checks:
Closes #101
🤖 Generated with Claude Code