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
5 changes: 5 additions & 0 deletions .jules/bolt.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@

**Learning:** Using `on:keyup` for search input debouncing triggers unnecessary API calls on navigation keys (arrows, home, end) and misses changes from paste/cut. Svelte's reactive statements `$: debounce(value)` provide a robust, declarative way to trigger debouncing only when the value actually changes.
**Action:** Replace `on:keyup` handlers with reactive statements for input debouncing to improve performance and correctness.

## 2024-11-20 - Concurrent Async Operations

**Learning:** SvelteKit server functions often execute multiple independent API requests to the SDK (e.g., getting counts, owners, and items). Executing them sequentially with `await` creates waterfall latency.
**Action:** Always group independent `await` calls using `Promise.all()` to execute them concurrently, drastically reducing the total response time to the maximum of the individual request times rather than their sum.
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.
11 changes: 6 additions & 5 deletions src/lib/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@ export interface DomainStats {
}

export const getStats = async (): Promise<DomainStats> => {
const domainCount = await metaNamesSdk.domainRepository.count();
const ownerCount = await metaNamesSdk.domainRepository
.getOwners()
.then((owners) => owners.length);
const recentDomains = await getRecentDomains();
// ⚡ Bolt: Execute independent SDK API calls concurrently to avoid waterfall latency
const [domainCount, ownerCount, recentDomains] = await Promise.all([
metaNamesSdk.domainRepository.count(),
metaNamesSdk.domainRepository.getOwners().then((owners) => owners.length),
getRecentDomains()
]);

return {
domainCount,
Expand Down
4 changes: 3 additions & 1 deletion src/routes/api/proposals/voters/add/+server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ export async function GET() {
?.setValue()
.values.map((voter) => voter.addressValue().value.toString('hex')) ?? [];

const newVoters = owners.filter((owner) => !voters.includes(owner)).slice(0, 50);
// ⚡ Bolt: Replace O(N^2) array.includes lookup with O(N) Set.has for performance
const votersSet = new Set(voters);
const newVoters = owners.filter((owner) => !votersSet.has(owner)).slice(0, 50);
if (newVoters.length === 0) return json({ newVoters }, { status: 200 });

const votingContract = await metaNamesSdk.contractRepository.getContract({
Expand Down
4 changes: 3 additions & 1 deletion src/routes/api/proposals/voters/remove/+server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ export async function GET() {
?.setValue()
.values.map((voter) => voter.addressValue().value.toString('hex')) ?? [];

const votersToRemove = voters.filter((voter) => !owners.includes(voter)).slice(0, 50);
// ⚡ Bolt: Replace O(N^2) array.includes lookup with O(N) Set.has for performance
const ownersSet = new Set(owners);
const votersToRemove = voters.filter((voter) => !ownersSet.has(voter)).slice(0, 50);
if (votersToRemove.length === 0) return json({ newVoters: votersToRemove }, { status: 200 });

const votingContract = await metaNamesSdk.contractRepository.getContract({
Expand Down
16 changes: 9 additions & 7 deletions static/~@fontsource/inter/500.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@
src:
url(./files/inter-vietnamese-500-normal.woff2) format('woff2'),
url(./files/inter-vietnamese-500-normal.woff) format('woff');
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0,
U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
unicode-range:
U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301,
U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

/* inter-latin-ext-500-normal */
Expand All @@ -68,8 +69,9 @@
src:
url(./files/inter-latin-ext-500-normal.woff2) format('woff2'),
url(./files/inter-latin-ext-500-normal.woff) format('woff');
unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
unicode-range:
U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF,
U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* inter-latin-500-normal */
Expand All @@ -81,7 +83,7 @@
src:
url(./files/inter-latin-500-normal.woff2) format('woff2'),
url(./files/inter-latin-500-normal.woff) format('woff');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF,
U+FFFD;
unicode-range:
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
16 changes: 9 additions & 7 deletions static/~@fontsource/inter/700.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@
src:
url(./files/inter-vietnamese-700-normal.woff2) format('woff2'),
url(./files/inter-vietnamese-700-normal.woff) format('woff');
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0,
U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
unicode-range:
U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301,
U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

/* inter-latin-ext-700-normal */
Expand All @@ -68,8 +69,9 @@
src:
url(./files/inter-latin-ext-700-normal.woff2) format('woff2'),
url(./files/inter-latin-ext-700-normal.woff) format('woff');
unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
unicode-range:
U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF,
U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* inter-latin-700-normal */
Expand All @@ -81,7 +83,7 @@
src:
url(./files/inter-latin-700-normal.woff2) format('woff2'),
url(./files/inter-latin-700-normal.woff) format('woff');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF,
U+FFFD;
unicode-range:
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
16 changes: 9 additions & 7 deletions static/~@fontsource/inter/900.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@
src:
url(./files/inter-vietnamese-900-normal.woff2) format('woff2'),
url(./files/inter-vietnamese-900-normal.woff) format('woff');
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0,
U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
unicode-range:
U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301,
U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

/* inter-latin-ext-900-normal */
Expand All @@ -68,8 +69,9 @@
src:
url(./files/inter-latin-ext-900-normal.woff2) format('woff2'),
url(./files/inter-latin-ext-900-normal.woff) format('woff');
unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
unicode-range:
U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF,
U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* inter-latin-900-normal */
Expand All @@ -81,7 +83,7 @@
src:
url(./files/inter-latin-900-normal.woff2) format('woff2'),
url(./files/inter-latin-900-normal.woff) format('woff');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF,
U+FFFD;
unicode-range:
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
16 changes: 9 additions & 7 deletions static/~@fontsource/inter/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@
src:
url(./files/inter-vietnamese-400-normal.woff2) format('woff2'),
url(./files/inter-vietnamese-400-normal.woff) format('woff');
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0,
U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
unicode-range:
U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301,
U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

/* inter-latin-ext-400-normal */
Expand All @@ -68,8 +69,9 @@
src:
url(./files/inter-latin-ext-400-normal.woff2) format('woff2'),
url(./files/inter-latin-ext-400-normal.woff) format('woff');
unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
unicode-range:
U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF,
U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* inter-latin-400-normal */
Expand All @@ -81,7 +83,7 @@
src:
url(./files/inter-latin-400-normal.woff2) format('woff2'),
url(./files/inter-latin-400-normal.woff) format('woff');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF,
U+FFFD;
unicode-range:
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
16 changes: 9 additions & 7 deletions static/~@fontsource/roboto/500.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@
src:
url(./files/roboto-vietnamese-500-normal.woff2) format('woff2'),
url(./files/roboto-vietnamese-500-normal.woff) format('woff');
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0,
U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
unicode-range:
U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301,
U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

/* roboto-latin-ext-500-normal */
Expand All @@ -68,8 +69,9 @@
src:
url(./files/roboto-latin-ext-500-normal.woff2) format('woff2'),
url(./files/roboto-latin-ext-500-normal.woff) format('woff');
unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
unicode-range:
U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF,
U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* roboto-latin-500-normal */
Expand All @@ -81,7 +83,7 @@
src:
url(./files/roboto-latin-500-normal.woff2) format('woff2'),
url(./files/roboto-latin-500-normal.woff) format('woff');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF,
U+FFFD;
unicode-range:
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
16 changes: 9 additions & 7 deletions static/~@fontsource/roboto/700.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@
src:
url(./files/roboto-vietnamese-700-normal.woff2) format('woff2'),
url(./files/roboto-vietnamese-700-normal.woff) format('woff');
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0,
U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
unicode-range:
U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301,
U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

/* roboto-latin-ext-700-normal */
Expand All @@ -68,8 +69,9 @@
src:
url(./files/roboto-latin-ext-700-normal.woff2) format('woff2'),
url(./files/roboto-latin-ext-700-normal.woff) format('woff');
unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
unicode-range:
U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF,
U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* roboto-latin-700-normal */
Expand All @@ -81,7 +83,7 @@
src:
url(./files/roboto-latin-700-normal.woff2) format('woff2'),
url(./files/roboto-latin-700-normal.woff) format('woff');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF,
U+FFFD;
unicode-range:
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
16 changes: 9 additions & 7 deletions static/~@fontsource/roboto/900.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@
src:
url(./files/roboto-vietnamese-900-normal.woff2) format('woff2'),
url(./files/roboto-vietnamese-900-normal.woff) format('woff');
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0,
U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
unicode-range:
U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301,
U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

/* roboto-latin-ext-900-normal */
Expand All @@ -68,8 +69,9 @@
src:
url(./files/roboto-latin-ext-900-normal.woff2) format('woff2'),
url(./files/roboto-latin-ext-900-normal.woff) format('woff');
unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
unicode-range:
U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF,
U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* roboto-latin-900-normal */
Expand All @@ -81,7 +83,7 @@
src:
url(./files/roboto-latin-900-normal.woff2) format('woff2'),
url(./files/roboto-latin-900-normal.woff) format('woff');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF,
U+FFFD;
unicode-range:
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
16 changes: 9 additions & 7 deletions static/~@fontsource/roboto/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@
src:
url(./files/roboto-vietnamese-400-normal.woff2) format('woff2'),
url(./files/roboto-vietnamese-400-normal.woff) format('woff');
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0,
U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
unicode-range:
U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301,
U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

/* roboto-latin-ext-400-normal */
Expand All @@ -68,8 +69,9 @@
src:
url(./files/roboto-latin-ext-400-normal.woff2) format('woff2'),
url(./files/roboto-latin-ext-400-normal.woff) format('woff');
unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
unicode-range:
U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF,
U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* roboto-latin-400-normal */
Expand All @@ -81,7 +83,7 @@
src:
url(./files/roboto-latin-400-normal.woff2) format('woff2'),
url(./files/roboto-latin-400-normal.woff) format('woff');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF,
U+FFFD;
unicode-range:
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}