diff --git a/apps/lil-buddy/src/App.svelte b/apps/lil-buddy/src/App.svelte index 2bf68aa..8f65f71 100644 --- a/apps/lil-buddy/src/App.svelte +++ b/apps/lil-buddy/src/App.svelte @@ -5,6 +5,7 @@ import LintPicker from "./linting/LintPicker.svelte"; import NewLintSuggestion from "./linting/NewLintSuggestion.svelte"; + import KeyboardHooks from "./components/KeyboardHooks.svelte"; $: lint = $store.lints.find((lint) => lint.id === $store.focusedLint)!; @@ -45,3 +46,4 @@ {/if} + diff --git a/apps/lil-buddy/src/components/KeyboardHooks.svelte b/apps/lil-buddy/src/components/KeyboardHooks.svelte new file mode 100644 index 0000000..0a3680c --- /dev/null +++ b/apps/lil-buddy/src/components/KeyboardHooks.svelte @@ -0,0 +1,36 @@ + + + diff --git a/apps/lil-buddy/src/linting/FocusedTest.svelte b/apps/lil-buddy/src/linting/FocusedTest.svelte index bb703bb..dfe6641 100644 --- a/apps/lil-buddy/src/linting/FocusedTest.svelte +++ b/apps/lil-buddy/src/linting/FocusedTest.svelte @@ -39,6 +39,7 @@ $: errors = lintRun.errors; $: pairData = blameData as number[][]; $: program = lint.program; + let editTime: null | number = null; {#if currentLintAppliesToCurrentPalette && testPal} @@ -67,6 +68,10 @@ }} pal={testPal} updatePal={(newPal) => { + if (editTime === null) { + editTime = Date.now(); + store.setOkayToExecute(false); + } const oldTests = focusedTest.type === "passing" ? lint.expectedPassingTests @@ -78,6 +83,15 @@ } else { store.setCurrentLintExpectedFailingTests(newTests); } + editTime = Date.now(); + setTimeout(() => { + if (!editTime) { + store.setOkayToExecute(true); + } else if (Date.now() - editTime > 1000) { + store.setOkayToExecute(true); + editTime = null; + } + }, 1000); }} /> {/if} @@ -125,7 +139,16 @@ {:else}
This lint does not apply to the current palette due to a mismatch between - its tags and the palette's tags + its tags and the palette's tags. This lint requires the following tags: {lint.requiredTags + .map((x) => `"${x}"`) + .join(", ")}. + {#if testPal?.tags?.length} + The palette has the following tags: {(testPal?.tags || []) + .map((x) => `"${x}"`) + .join(", ")} + {:else} + The palette has no tags. + {/if}
{/if} diff --git a/apps/lil-buddy/src/linting/LintMeta.svelte b/apps/lil-buddy/src/linting/LintMeta.svelte index a04b941..f864ca5 100644 --- a/apps/lil-buddy/src/linting/LintMeta.svelte +++ b/apps/lil-buddy/src/linting/LintMeta.svelte @@ -90,7 +90,7 @@
{#each lint.requiredTags as tag} -
+
{tag}