diff --git a/.Jules/palette.md b/.Jules/palette.md index d6d129bc..ef1c3b63 100644 --- a/.Jules/palette.md +++ b/.Jules/palette.md @@ -1,4 +1,6 @@ -## 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. +## 2026-03-30 - Contextual Search Icons +**Learning:** When implementing search inputs, use contextual icons (e.g., a disabled 'search' magnifying glass when empty, and an enabled 'cancel'/'clear' icon when text is present) rather than a persistent 'cancel' icon to prevent false affordances. Ensure `aria-label`s reflect the active icon's purpose (e.g., `aria-label="clear search"`). +**Action:** Next time, replace persistent 'cancel' icons in search inputs with a contextual toggle based on the input text, using an `{#if}` block to display a disabled search icon or an enabled clear icon, while updating the `aria-label` respectively. +## 2026-03-30 - Contextual Search Icons +**Learning:** When implementing search inputs, use contextual icons (e.g., a disabled 'search' magnifying glass when empty, and an enabled 'cancel'/'clear' icon when text is present) rather than a persistent 'cancel' icon to prevent false affordances. Ensure `aria-label`s reflect the active icon's purpose (e.g., `aria-label="clear search"`). +**Action:** Next time, replace persistent 'cancel' icons in search inputs with a contextual toggle based on the input text, using an `{#if}` block to display a disabled search icon or an enabled clear icon, while updating the `aria-label` respectively. diff --git a/.jules/palette.md b/.jules/palette.md deleted file mode 100644 index 00f41cdf..00000000 --- a/.jules/palette.md +++ /dev/null @@ -1,3 +0,0 @@ -## 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/routes/profile/+page.svelte b/src/routes/profile/+page.svelte index 7f290736..3b66e835 100644 --- a/src/routes/profile/+page.svelte +++ b/src/routes/profile/+page.svelte @@ -59,9 +59,15 @@ >
- - - + {#if search.length > 0} + + + + {:else} + + + + {/if}