diff --git a/.Jules/palette.md b/.Jules/palette.md new file mode 100644 index 0000000..d6d129b --- /dev/null +++ b/.Jules/palette.md @@ -0,0 +1,4 @@ +## 2024-10-24 - Persisting Error State in Async Buttons + +**Learning:** Async buttons that handle errors often fail to reset their error state on subsequent attempts. This leads to a confusing UX where a successful retry still displays the error icon, making the user believe the action failed again. +**Action:** Always ensure that error flags (e.g., `hasError`) are reset at the _start_ of the async operation, not just set in the `catch` block. diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 42adb44..301e978 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,7 +5,7 @@ version: 2 updates: - - package-ecosystem: "npm" - directory: "/" + - package-ecosystem: 'npm' + directory: '/' schedule: - interval: "weekly" + interval: 'weekly' diff --git a/.jules/bolt.md b/.jules/bolt.md new file mode 100644 index 0000000..400b475 --- /dev/null +++ b/.jules/bolt.md @@ -0,0 +1,6 @@ +# Bolt's Journal + +## 2024-05-22 - Async Race Conditions + +**Learning:** Asynchronous typeahead searches must implement a request ID mechanism. Without it, stale responses can overwrite newer ones, leading to correct search terms displaying incorrect results. +**Action:** Always use a request ID or cancellation token pattern when implementing async search/filter operations. diff --git a/.jules/palette.md b/.jules/palette.md new file mode 100644 index 0000000..00f41cd --- /dev/null +++ b/.jules/palette.md @@ -0,0 +1,3 @@ +## 2024-10-24 - Accessible Icon Props and Loading Button State +**Learning:** Svelte wrapper components (like `Icon.svelte`) must spread `$$restProps` to allow passing accessibility attributes (e.g., `aria-label`) from parent components. Without this, icons remain inaccessible to screen readers. Also, persistent "Success" states on buttons can be confusing; auto-resetting them after a timeout improves clarity. +**Action:** Always include `{...$$restProps}` in wrapper components and implement auto-reset logic for temporary success states in interactive elements. diff --git a/src/components/DomainPayment.svelte b/src/components/DomainPayment.svelte index ac131ee..aa60faf 100644 --- a/src/components/DomainPayment.svelte +++ b/src/components/DomainPayment.svelte @@ -51,7 +51,7 @@ years += amount; } - async function handleApproveError(error: Error) { + async function handleApproveError(error: unknown) { let message; if (error instanceof InsufficientBalanceError) message = { @@ -102,7 +102,11 @@
Payment token