Fix: Update focus when dragging file over image panel #46
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.

Problem
When dragging and dropping an image file onto a specific image panel, the focus was not being updated to that panel before the drop occurred. This made it unclear which panel would receive the dropped file, especially when multiple image panels were present.
Solution
Added a
dragenterevent listener to the canvas element that automatically updates the focus when a user drags a file over a specific image panel. This provides immediate visual feedback (via the panel border highlight) indicating which panel will receive the file.Changes
imgkit/index.jsbuild()method of theImageLayerclassThe new event handler:
Parameter.numto point to that panelupdateFocus()to add a visual border to the focused panelupdateSio()to ensure UI elements are properly displayedThis follows the same pattern as the existing
clickevent handler, ensuring consistency throughout the codebase.Benefits
Example
Before: Dragging a file over Panel B while Panel A is focused → file drops on Panel A (confusing)
After: Dragging a file over Panel B → Panel B immediately becomes focused with visible border → file drops on Panel B (intuitive)
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.