diff --git a/apps/color-buddy/src/linting/LintToolTipContents.svelte b/apps/color-buddy/src/linting/LintToolTipContents.svelte index d4b4781..3cd337e 100644 --- a/apps/color-buddy/src/linting/LintToolTipContents.svelte +++ b/apps/color-buddy/src/linting/LintToolTipContents.svelte @@ -3,6 +3,7 @@ import type { Palette } from "color-buddy-palette"; import { suggestLintFix } from "color-buddy-palette-lint"; import { suggestLintAIFix, suggestLintMonteFix } from "../lib/lint-fixer"; + import { linter } from "color-buddy-palette-lint"; import Equal from "virtual:icons/fa6-solid/equals"; import colorStore from "../stores/color-store"; @@ -43,6 +44,11 @@ .then((x) => x.map((pal) => ({ pal, label })).at(0)) .then((x) => { + const lintResult = x?.pal + ? linter(x.pal, [lintProgram], { computeBlame: true }).at(0) + : { kind: "success", passes: false }; + (x as any).fixesIssue = + lintResult?.kind === "success" && lintResult.passes; suggestions = [...suggestions, x].filter((x) => x) as FixSuggestion[]; requestState = "loaded"; waitingOnFixes = waitingOnFixes - 1; @@ -241,57 +247,55 @@ {/if} + {#each suggestions as suggestion, idx} -
{suggestion.label}
-
-
- {#each suggestion.pal.colors as color, idx} +
+
+
{suggestion.label}
+
- {#if color?.toHex() === currentPal.colors[idx]?.toHex()} -
- + {#each suggestion.pal.colors as color, idx} +
+ {#if color?.toHex() === currentPal.colors[idx]?.toHex()} +
+ +
+ {/if}
- {/if} + {/each}
- {/each} +
+
+
+ {#if suggestion.fixesIssue} +
Fixes issue
+ {:else} +
Does not fix
+ {/if} +
- - - - - - -
{/each} {#if waitingOnFixes > 0}