Improve app drag areas

- drag from lane gutters (but not over scrollbar)
- drag from empty space in new branch dropzone
- drag from empty space
This commit is contained in:
Mattias Granlund 2024-08-21 11:43:28 +01:00
parent be4ddb1fe1
commit 191dc073e8
3 changed files with 6 additions and 8 deletions

View File

@ -107,11 +107,7 @@
</div>
{:else}
<div class="resizer-wrapper" bind:this={scrollViewport}>
<div
class="branch-card hide-native-scrollbar"
data-tauri-drag-region
class:target-branch={branch.selectedForChanges}
>
<div class="branch-card hide-native-scrollbar" class:target-branch={branch.selectedForChanges}>
<ScrollableContainer
wide
padding={{
@ -123,6 +119,7 @@
bind:this={rsViewport}
style:width={`${laneWidth || $defaultBranchWidthRem}rem`}
class="branch-card__contents"
data-tauri-drag-region
>
<BranchHeader {isLaneCollapsed} onGenerateBranchName={generateBranchName} />
<PullRequestCard />
@ -171,7 +168,7 @@
</Dropzones>
{:else}
<Dropzones>
<div class="no-changes" data-dnd-ignore>
<div class="no-changes">
<EmptyStatePlaceholder image={noChangesSvg} width="11rem" hasBottomMargin={false}>
<svelte:fragment slot="caption"
>No uncommitted changes on this branch</svelte:fragment

View File

@ -31,10 +31,10 @@
}
</script>
<div class="canvas-dropzone">
<div class="canvas-dropzone" data-tauri-drag-region>
<Dropzone {accepts} ondrop={onDrop}>
{#snippet overlay({ hovered, activated })}
<div class="new-virtual-branch" class:activated class:hovered>
<div class="new-virtual-branch" class:activated class:hovered data-tauri-drag-region>
<div class="new-virtual-branch__content">
<div class="stimg">
<div class="stimg__hand">

View File

@ -85,6 +85,7 @@
<div
class="board"
role="group"
data-tauri-drag-region
on:drop={(e) => {
e.preventDefault();
if (!dragged) {