fix: update branch card class and button logic to correctly handle active and selected branches

This commit is contained in:
Kiril Videlov 2024-02-08 16:48:42 +01:00 committed by Kiril Videlov
parent e98bb4fc17
commit 0fe1f93e89
3 changed files with 28 additions and 22 deletions

View File

@ -129,7 +129,11 @@
</script>
<div class="branch-card-wrapper">
<div class="branch-card" data-tauri-drag-region class:target-branch={branch.selectedForChanges}>
<div
class="branch-card"
data-tauri-drag-region
class:target-branch={branch.active && branch.selectedForChanges}
>
<div
bind:this={rsViewport}
style:width={`${laneWidth || $defaultBranchWidthRem}rem`}

View File

@ -236,6 +236,7 @@
</div>
<div class="header__actions">
<div class="header__buttons">
{#if branch.active}
{#if branch.selectedForChanges}
<Button
help="New changes will land here"
@ -257,6 +258,7 @@
Set as default
</Button>
{/if}
{/if}
<!-- We can't show the merge button until we've waited for checks
We use a octokit.checks.listForRef to find checks running for a PR, but right after

View File

@ -65,7 +65,7 @@
<div
class="wrapper"
data-tauri-drag-region
class:target-branch={branch.selectedForChanges}
class:target-branch={branch.active && branch.selectedForChanges}
class:selected
>
<BranchCard