Remove dead stashed branches code

This commit is contained in:
Mattias Granlund 2024-01-24 15:51:34 +01:00
parent b4d56e191f
commit 8c72a6b7f3
3 changed files with 4 additions and 52 deletions

View File

@ -11,7 +11,6 @@
export let includePrs: Writable<boolean | undefined>;
export let includeRemote: Writable<boolean | undefined>;
export let includeStashed: Writable<boolean | undefined>;
export let hideBots: Writable<boolean | undefined>;
export let hideInactive: Writable<boolean | undefined>;
</script>
@ -27,10 +26,6 @@
<ContextMenuItem label="Remote" on:click={() => ($includeRemote = !$includeRemote)}>
<Checkbox small bind:checked={$includeRemote} slot="control" />
</ContextMenuItem>
<ContextMenuItem label="Stashed" on:click={() => ($includeStashed = !$includeStashed)}>
<Checkbox small bind:checked={$includeStashed} slot="control" />
</ContextMenuItem>
</ContextMenuSection>
<ContextMenuSection>

View File

@ -31,14 +31,13 @@
let includePrs = persisted(true, 'includePrs_' + projectId);
let includeRemote = persisted(true, 'includeRemote_' + projectId);
let includeStashed = persisted(true, 'includeStashed_' + projectId);
let hideBots = persisted(false, 'hideBots_' + projectId);
let hideInactive = persisted(false, 'hideInactive_' + projectId);
let filtersActive = derived(
[includePrs, includeRemote, includeStashed, hideBots, hideInactive],
([prs, remote, stashed, bots, inactive]) => {
return !prs || !remote || !stashed || bots || inactive;
[includePrs, includeRemote, hideBots, hideInactive],
([prs, remote, bots, inactive]) => {
return !prs || !remote || bots || inactive;
}
);
@ -49,15 +48,13 @@
textFilter$,
storeToObservable(includePrs),
storeToObservable(includeRemote),
storeToObservable(includeStashed),
storeToObservable(hideBots),
storeToObservable(hideInactive)
],
(branches, search, includePrs, includeRemote, includeStashed, hideBots, hideInactive) => {
(branches, search, includePrs, includeRemote, hideBots, hideInactive) => {
const filteredByType = filterByType(branches, {
includePrs,
includeRemote,
includeStashed,
hideBots
});
const filteredBySearch = filterByText(filteredByType, search);
@ -78,7 +75,6 @@
params: {
includePrs: boolean;
includeRemote: boolean;
includeStashed: boolean;
hideBots: boolean;
}
): CombinedBranch[] {
@ -87,7 +83,6 @@
return !params.hideBots || !b.pr.author?.isBot;
}
if (params.includeRemote && b.remoteBranch) return true;
if (params.includeStashed && b.vbranch) return true;
return false;
});
}
@ -153,7 +148,6 @@
{visible}
{includePrs}
{includeRemote}
{includeStashed}
{hideBots}
{hideInactive}
showPrCheckbox={$githubEnabled$}

View File

@ -1,37 +0,0 @@
<script lang="ts">
import { page } from '$app/stores';
import Icon from '$lib/icons/Icon.svelte';
import type { Branch } from '$lib/vbranches/types';
import { slide } from 'svelte/transition';
export let branch: Branch;
export let projectId: string;
$: href = `/${projectId}/stashed/${branch.id}`;
$: selected = $page.url.href.includes(href);
</script>
<a class="item" {href} class:selected transition:slide={{ duration: 250 }}>
<Icon name="branch" />
<div class="text-color-2 flex-grow truncate">
{branch.name}
{branch.files[0]?.modifiedAt}
</div>
</a>
<style lang="postcss">
.item {
display: flex;
gap: var(--space-10);
padding-top: var(--space-10);
padding-bottom: var(--space-10);
padding-left: var(--space-8);
padding-right: var(--space-8);
border-radius: var(--radius-m);
}
.item:hover,
.item:focus,
.selected {
background-color: var(--clr-theme-container-pale);
}
</style>