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
4 changes: 4 additions & 0 deletions .Jules/palette.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@

**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.

## 2024-10-24 - Conditional Trailing Icons for Accessibility
**Learning:** When using trailing icons in text fields (like a clear button), the icon remains focusable by keyboard even when it is visually unnecessary (e.g. empty input). Also, binding the `withTrailingIcon` property to a condition is necessary for proper layout updates.
**Action:** Always conditionally render trailing icons (e.g., `{#if search !== ''}`) so they are not focusable when irrelevant. Also bind `withTrailingIcon` to the same condition and use descriptive aria-labels (e.g. 'clear search').
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@ node_modules
pnpm-lock.yaml
package-lock.json
yarn.lock

.Jules/
.jules/
static/
test-results/
18 changes: 11 additions & 7 deletions src/routes/profile/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

$: if (search !== '') {
domainsFiltered = domains.filter((domain) => isFuzzyMatch(domain.name, search));
} else {
domainsFiltered = domains;
}

walletAddress.subscribe(async (address) => {
Expand All @@ -39,7 +41,7 @@

if (trimmedDomain.startsWith(trimmedSearch) || trimmedDomain.includes(trimmedSearch))
return true;
else false;
else return false;
}
</script>

Expand All @@ -55,14 +57,16 @@
label="Search"
bind:value={search}
variant="outlined"
withTrailingIcon
withTrailingIcon={search !== ''}
>
<svelte:fragment slot="trailingIcon">
<div class="close-icon">
<IconButton on:click={cleanSearch} aria-label="cancel">
<Icon icon="cancel" />
</IconButton>
</div>
{#if search !== ''}
<div class="close-icon">
<IconButton on:click={cleanSearch} aria-label="clear search">
<Icon icon="cancel" />
</IconButton>
</div>
{/if}
</svelte:fragment>
</Textfield>
<DomainsTable domains={domainsFiltered} {loaded} />
Expand Down