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
1 change: 1 addition & 0 deletions .jules/palette.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
## 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.
20 changes: 17 additions & 3 deletions src/routes/DomainSearch.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,15 @@
>
<svelte:fragment slot="trailingIcon">
<div class="submit">
<IconButton aria-label="search">
<Icon icon="search" />
</IconButton>
{#if isLoading}
<div class="loading-icon" role="status" aria-label="Searching">
<CircularProgress style="height: 24px; width: 24px;" indeterminate />
</div>
{:else}
<IconButton aria-label="search">
<Icon icon="search" />
</IconButton>
{/if}
</div>
</svelte:fragment>
<svelte:fragment slot="helper">
Expand Down Expand Up @@ -179,4 +185,12 @@
.submit {
align-self: center;
}

.loading-icon {
display: flex;
align-items: center;
justify-content: center;
width: 48px;
height: 48px;
}
</style>
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default defineConfig({
}),
sveltekit(),
nodePolyfills({
include: ['buffer', 'crypto', 'stream']
include: ['buffer', 'crypto', 'stream', 'util']
}),
tsconfigPaths()
],
Expand Down