Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .Jules/palette.md
Original file line number Diff line number Diff line change
@@ -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.
3 changes: 0 additions & 3 deletions .jules/palette.md

This file was deleted.

12 changes: 9 additions & 3 deletions src/routes/profile/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,15 @@
>
<svelte:fragment slot="trailingIcon">
<div class="close-icon">
<IconButton on:click={cleanSearch} aria-label="cancel">
<Icon icon="cancel" />
</IconButton>
{#if search.length > 0}
<IconButton on:click={cleanSearch} aria-label="clear search">
<Icon icon="cancel" />
</IconButton>
{:else}
<IconButton disabled aria-label="search">
<Icon icon="search" />
</IconButton>
{/if}
</div>
</svelte:fragment>
</Textfield>
Expand Down