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> </script>
<div class="branch-card-wrapper"> <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 <div
bind:this={rsViewport} bind:this={rsViewport}
style:width={`${laneWidth || $defaultBranchWidthRem}rem`} style:width={`${laneWidth || $defaultBranchWidthRem}rem`}

View File

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

View File

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