diff --git a/.jules/palette.md b/.jules/palette.md index 00f41cdf..949eaf2c 100644 --- a/.jules/palette.md +++ b/.jules/palette.md @@ -1,3 +1,7 @@ ## 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. +## 2024-10-25 - Trailing Icons in SMUI Textfields + +**Learning:** When conditionally rendering a trailing icon inside an SMUI `Textfield` component, the `withTrailingIcon` prop must dynamically match the conditional rendering of the icon slot itself. If `withTrailingIcon` is persistently true while the icon is conditionally removed, it creates accessibility and layout issues. Additionally, an empty trailing icon button should be completely removed from the DOM to prevent screen readers and keyboard users from focusing on an inactive element. +**Action:** Always bind the `withTrailingIcon` property to the same condition used to render the trailing icon slot (e.g., `withTrailingIcon={search !== ''}` and `{#if search !== ''}`). diff --git a/.prettierignore b/.prettierignore index 38972655..f80bd7e7 100644 --- a/.prettierignore +++ b/.prettierignore @@ -11,3 +11,8 @@ node_modules pnpm-lock.yaml package-lock.json yarn.lock +test-results +playwright-report +.jules +.Jules +static/ diff --git a/src/routes/profile/+page.svelte b/src/routes/profile/+page.svelte index 7f290736..391ccfc6 100644 --- a/src/routes/profile/+page.svelte +++ b/src/routes/profile/+page.svelte @@ -17,6 +17,8 @@ $: if (search !== '') { domainsFiltered = domains.filter((domain) => isFuzzyMatch(domain.name, search)); + } else { + domainsFiltered = domains; } walletAddress.subscribe(async (address) => { @@ -39,7 +41,7 @@ if (trimmedDomain.startsWith(trimmedSearch) || trimmedDomain.includes(trimmedSearch)) return true; - else false; + else return false; } @@ -55,14 +57,16 @@ label="Search" bind:value={search} variant="outlined" - withTrailingIcon + withTrailingIcon={search !== ''} > -
- - - -
+ {#if search !== ''} +
+ + + +
+ {/if}