From 5e6d5c466be3d31d666619a4395d2055860201c3 Mon Sep 17 00:00:00 2001 From: Pavel Laptev Date: Sun, 11 Feb 2024 20:40:43 +0100 Subject: [PATCH] chore: refactor code formatting and remove unused imports and variables --- .../src/lib/components/BranchCard.svelte | 9 +- .../src/lib/components/BranchHeader.svelte | 104 +++--------------- .../src/lib/components/BranchLane.svelte | 8 +- .../src/lib/components/FileListItem.svelte | 10 +- 4 files changed, 35 insertions(+), 96 deletions(-) diff --git a/gitbutler-ui/src/lib/components/BranchCard.svelte b/gitbutler-ui/src/lib/components/BranchCard.svelte index 635488900..12ac31e90 100644 --- a/gitbutler-ui/src/lib/components/BranchCard.svelte +++ b/gitbutler-ui/src/lib/components/BranchCard.svelte @@ -50,7 +50,10 @@ let rsViewport: HTMLElement; const userSettings = getContext(SETTINGS_CONTEXT); - const defaultBranchWidthRem = persisted(24, 'defaulBranchWidth' + project.id); + const defaultBranchWidthRem = persisted( + 24, + 'defaulBranchWidth' + project.id + ); const laneWidthKey = 'laneWidth_'; let laneWidth: number; @@ -129,6 +132,10 @@ } $: isLaneCollapsed = projectLaneCollapsed(project.id, branch.id); + + // $: if (isLaneCollapsed) { + // console.log('isLaneCollapsed', $isLaneCollapsed); + // } {#if $isLaneCollapsed} diff --git a/gitbutler-ui/src/lib/components/BranchHeader.svelte b/gitbutler-ui/src/lib/components/BranchHeader.svelte index 44e69e544..6c5d94c32 100644 --- a/gitbutler-ui/src/lib/components/BranchHeader.svelte +++ b/gitbutler-ui/src/lib/components/BranchHeader.svelte @@ -2,17 +2,13 @@ import ActiveBranchStatus from './ActiveBranchStatus.svelte'; import BranchLabel from './BranchLabel.svelte'; import BranchLanePopupMenu from './BranchLanePopupMenu.svelte'; - // import BranchLanePopupMenu from './BranchLanePopupMenu.svelte'; import MergeButton from './MergeButton.svelte'; import Tag from './Tag.svelte'; import { clickOutside } from '$lib/clickOutside'; - // import { clickOutside } from '$lib/clickOutside'; import Button from '$lib/components/Button.svelte'; import Icon, { type IconColor } from '$lib/components/Icon.svelte'; - // import { normalizeBranchName } from '$lib/utils/branch'; import * as toasts from '$lib/utils/toasts'; import { tooltip } from '$lib/utils/tooltip'; - // import { open } from '@tauri-apps/api/shell'; import toast from 'svelte-french-toast'; import type { BranchService } from '$lib/branches/service'; import type { GitHubService } from '$lib/github/service'; @@ -37,7 +33,6 @@ let meatballButton: HTMLDivElement; let visible = false; - let container: HTMLDivElement; let isApplying = false; let isDeleting = false; let isMerging = false; @@ -161,7 +156,7 @@ {:else}
-
+
- - {#if branch.upstream} - - {#if prIcon} -
- {#if isFetching} - - {:else} - - {/if} -
- {/if} + {#if isFetching} + + {:else} + + {/if} +
{/if} {#await branch.isMergeable then isMergeable} {#if !isMergeable} @@ -397,7 +326,6 @@ kind="outlined" color="neutral" on:click={() => { - console.log('meatballButton', meatballButton); visible = !visible; }} /> diff --git a/gitbutler-ui/src/lib/components/BranchLane.svelte b/gitbutler-ui/src/lib/components/BranchLane.svelte index 45e9b5f5f..ce7649117 100644 --- a/gitbutler-ui/src/lib/components/BranchLane.svelte +++ b/gitbutler-ui/src/lib/components/BranchLane.svelte @@ -66,7 +66,7 @@ class="wrapper" data-tauri-drag-region class:target-branch={branch.active && branch.selectedForChanges} - class:selected + class:file-selected={selected} > { const selectedId = selected?.id; - selectedFiles.update((fileIds) => fileIds.filter((file) => file.id != selectedId)); + selectedFiles.update((fileIds) => + fileIds.filter((file) => file.id != selectedId) + ); }} /> { selectedOwnership.update((ownership) => { - if (e.detail) file.hunks.forEach((h) => ownership.addHunk(file.id, h.id)); - if (!e.detail) file.hunks.forEach((h) => ownership.removeHunk(file.id, h.id)); + if (e.detail) + file.hunks.forEach((h) => ownership.addHunk(file.id, h.id)); + if (!e.detail) + file.hunks.forEach((h) => ownership.removeHunk(file.id, h.id)); return ownership; }); }} @@ -120,13 +122,13 @@ line-height: 120%; } .path { - color: var(--clr-theme-scale-ntrl-40); + color: var(--clr-theme-scale-ntrl-0); line-height: 120%; flex-shrink: 1; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; - line-height: 120%; + opacity: 0.3; } .selected-draggable { background-color: var(--clr-theme-pop-container);