From 6528538814f95bae4b2dd9be1cc5483c9199b030 Mon Sep 17 00:00:00 2001 From: Guido Dinello Date: Tue, 18 Nov 2025 00:43:14 -0300 Subject: [PATCH 01/15] refactor: use @ imports --- src/entrypoints/content.ts | 2 +- src/entrypoints/popup/popup.ts | 2 +- src/lib/components/FilterEditor.svelte | 2 +- src/lib/components/Toast.svelte | 6 +++--- src/lib/github.ts | 4 ++-- src/lib/storage.ts | 6 +++--- src/lib/stores/filters.ts | 6 +++--- src/lib/types/messages.ts | 4 ++-- src/lib/utils/messaging.ts | 8 ++++---- src/lib/utils/validation.ts | 2 +- 10 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/entrypoints/content.ts b/src/entrypoints/content.ts index d8fa000..2ab6dc2 100644 --- a/src/entrypoints/content.ts +++ b/src/entrypoints/content.ts @@ -1,6 +1,6 @@ import "../app.css"; import { mount } from "svelte"; -import GithubPrFilter from "./content/GithubPRFilter.svelte"; +import GithubPrFilter from "@/entrypoints/content/GithubPRFilter.svelte"; import { logger } from "@/lib/utils/logger"; export default defineContentScript({ diff --git a/src/entrypoints/popup/popup.ts b/src/entrypoints/popup/popup.ts index 46c1e1d..7a0a5fb 100644 --- a/src/entrypoints/popup/popup.ts +++ b/src/entrypoints/popup/popup.ts @@ -1,5 +1,5 @@ import "../../app.css"; -import Popup from "./Popup.svelte"; +import Popup from "@/entrypoints/popup/Popup.svelte"; import { mount } from "svelte"; const appElement = document.getElementById("app"); diff --git a/src/lib/components/FilterEditor.svelte b/src/lib/components/FilterEditor.svelte index 60a8f9f..a8e9dc9 100644 --- a/src/lib/components/FilterEditor.svelte +++ b/src/lib/components/FilterEditor.svelte @@ -3,7 +3,7 @@ import { filterStore } from "@/lib/stores/filters"; import { validateFilter, validateFilterName } from "@/lib/utils/validation"; import { cn } from "@/lib/utils/cn"; - import ErrorDisplay from "./ErrorDisplay.svelte"; + import ErrorDisplay from "@/lib/components/ErrorDisplay.svelte"; let { filter, diff --git a/src/lib/components/Toast.svelte b/src/lib/components/Toast.svelte index 471d0cd..c209447 100644 --- a/src/lib/components/Toast.svelte +++ b/src/lib/components/Toast.svelte @@ -1,8 +1,8 @@ {#if toastMessage} - (toastMessage = "")} - /> + (toastMessage = "")} + /> {/if} diff --git a/src/entrypoints/options/Options.svelte b/src/entrypoints/options/Options.svelte index 5ff50ed..eb91300 100644 --- a/src/entrypoints/options/Options.svelte +++ b/src/entrypoints/options/Options.svelte @@ -1,222 +1,233 @@
-
-

GitHub PR Filters

- Logo -
- - - -
-

- Configure filters to be automatically applied when you visit GitHub Pull Request pages. -

-

- These filters use GitHub's search syntax. For example, add - -author:app/dependabot - to hide Dependabot PRs. -

-
- - {#if isLoading} -
-
+
+

GitHub PR Filters

+ Logo
- {:else} - {#if !editingFilter && !showAddForm} -
- -
- {/if} - {#if editingFilter} -
- -
- {/if} - - {#if showAddForm} -
- -
- {/if} + + +
+

+ Configure filters to be automatically applied when you visit GitHub Pull Request pages. +

+

+ These filters use GitHub's search syntax. For example, add + -author:app/dependabot + to hide Dependabot PRs. +

+
- {#if filters.length === 0 && !showAddForm} -
-

You haven't added any filters yet.

-
+ {#if isLoading} +
+
+
{:else} -

Your Filters

-
- {#each filters as filter (filter.id)} -
-
-
- {filter.name} - +
-
- {filter.value} -
+ + Add New Filter + +
+ {/if} + + {#if editingFilter} +
+
+ {/if} -
- - - + {#if showAddForm} +
+ +
+ {/if} + + {#if filters.length === 0 && !showAddForm} +
+

You haven't added any filters yet.

+
+ {:else} +

Your Filters

+
+ {#each filters as filter (filter.id)} +
+
+
+ {filter.name} + + {filter.enabled ? "Enabled" : "Disabled"} + +
+
+ {filter.value} +
+
+ +
+ + + +
+
+ {/each}
-
- {/each} -
+ {/if} {/if} - {/if} -
-

Pullscope Extension

-

by guidodinello

-
+
+

Pullscope Extension

+

by guidodinello

+
diff --git a/src/entrypoints/options/index.html b/src/entrypoints/options/index.html index f0fb217..e2530b8 100644 --- a/src/entrypoints/options/index.html +++ b/src/entrypoints/options/index.html @@ -1,12 +1,12 @@ - - - - Pullscope Options - - -
- - + + + + Pullscope Options + + +
+ + diff --git a/src/entrypoints/options/options.ts b/src/entrypoints/options/options.ts index 2e048d7..99cf20b 100644 --- a/src/entrypoints/options/options.ts +++ b/src/entrypoints/options/options.ts @@ -5,9 +5,9 @@ import { mount } from "svelte"; const appElement = document.getElementById("app"); if (!appElement) { - throw new Error("Failed to find app element. Cannot mount options page."); + throw new Error("Failed to find app element. Cannot mount options page."); } mount(Options, { - target: appElement, + target: appElement, }); diff --git a/src/entrypoints/popup/Popup.svelte b/src/entrypoints/popup/Popup.svelte index aec4e61..29b2d92 100644 --- a/src/entrypoints/popup/Popup.svelte +++ b/src/entrypoints/popup/Popup.svelte @@ -1,119 +1,121 @@
-
-

GitHub PR Filters

- Logo -
- - {#if isLoading} -
-
-
- {:else if filters.length === 0} -
-

No filters configured yet

+
+

GitHub PR Filters

+ Logo
- {:else} -
- {#each filters as filter (filter.id)} -
-
- {filter.name} -
- {filter.value} -
-
- + {#if isLoading} +
+
- {/each} -
- {/if} + {:else if filters.length === 0} +
+

No filters configured yet

+
+ {:else} +
+ {#each filters as filter (filter.id)} +
+
+ {filter.name} +
+ {filter.value} +
+
-
- -
+ +
+ {/each} +
+ {/if} + +
+ +
diff --git a/src/entrypoints/popup/index.html b/src/entrypoints/popup/index.html index 67de68e..4028201 100644 --- a/src/entrypoints/popup/index.html +++ b/src/entrypoints/popup/index.html @@ -1,13 +1,13 @@ - - - - Pullscope - - - -
- - + + + + Pullscope + + + +
+ + diff --git a/src/entrypoints/popup/popup.ts b/src/entrypoints/popup/popup.ts index 7a0a5fb..dd59534 100644 --- a/src/entrypoints/popup/popup.ts +++ b/src/entrypoints/popup/popup.ts @@ -5,9 +5,9 @@ import { mount } from "svelte"; const appElement = document.getElementById("app"); if (!appElement) { - throw new Error("Failed to find app element. Cannot mount popup."); + throw new Error("Failed to find app element. Cannot mount popup."); } mount(Popup, { - target: appElement, + target: appElement, }); diff --git a/src/lib/components/ErrorDisplay.svelte b/src/lib/components/ErrorDisplay.svelte index 029ac3f..b1055b8 100644 --- a/src/lib/components/ErrorDisplay.svelte +++ b/src/lib/components/ErrorDisplay.svelte @@ -1,41 +1,45 @@ {#if message} -