diff --git a/.gitignore b/.gitignore index 5ac2f3c..0f5009b 100644 --- a/.gitignore +++ b/.gitignore @@ -24,4 +24,6 @@ vite.config.ts.timestamp-* references -sveltekit-cloudflare-workers \ No newline at end of file +sveltekit-cloudflare-workers + +inlay \ No newline at end of file diff --git a/.prettierignore b/.prettierignore index ab78a95..74f7945 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,3 +2,6 @@ package-lock.json pnpm-lock.yaml yarn.lock + +# Unrelated sub-project +inlay diff --git a/eslint.config.js b/eslint.config.js index 2033331..ddef03e 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -44,6 +44,7 @@ export default [ 'svelte/no-at-html-tags': 'off', '@typescript-eslint/no-explicit-any': 'off', 'no-unused-vars': 'off', + 'no-useless-assignment': 'off', '@typescript-eslint/no-unused-vars': [ 'warn', { diff --git a/scripts/simulate-load.ts b/scripts/simulate-load.ts index 8925d3e..c0ce408 100644 --- a/scripts/simulate-load.ts +++ b/scripts/simulate-load.ts @@ -4,19 +4,21 @@ * * Usage: npx tsx scripts/atproto.ts listRecords app.blento.card 2>/dev/null | npx tsx scripts/simulate-load.ts */ -import { - correctBounds, - verticalCompactor, - type LayoutItem -} from 'react-grid-layout/core'; +import { correctBounds, verticalCompactor, type LayoutItem } from 'react-grid-layout/core'; import * as fs from 'fs'; const COLUMNS = 8; type Item = { id: string; - x: number; y: number; w: number; h: number; - mobileX: number; mobileY: number; mobileW: number; mobileH: number; + x: number; + y: number; + w: number; + h: number; + mobileX: number; + mobileY: number; + mobileW: number; + mobileH: number; cardType: string; }; @@ -33,8 +35,13 @@ function applyLayout(items: Item[], layout: LayoutItem[], mobile: boolean) { for (const l of layout) { const item = map.get(l.i); if (!item) continue; - if (mobile) { item.mobileX = l.x; item.mobileY = l.y; } - else { item.x = l.x; item.y = l.y; } + if (mobile) { + item.mobileX = l.x; + item.mobileY = l.y; + } else { + item.x = l.x; + item.y = l.y; + } } } @@ -60,9 +67,14 @@ const cards: Item[] = records .filter((r: any) => r.value.cardType && (!r.value.page || r.value.page === 'blento.self')) .map((r: any) => ({ id: r.value.id, - x: r.value.x, y: r.value.y, w: r.value.w, h: r.value.h, - mobileX: r.value.mobileX, mobileY: r.value.mobileY, - mobileW: r.value.mobileW, mobileH: r.value.mobileH, + x: r.value.x, + y: r.value.y, + w: r.value.w, + h: r.value.h, + mobileX: r.value.mobileX, + mobileY: r.value.mobileY, + mobileW: r.value.mobileW, + mobileH: r.value.mobileH, cardType: r.value.cardType })); @@ -86,7 +98,9 @@ for (const card of cards) { console.log( `${orig.cardType.padEnd(20)} id=${orig.id}` + (dChanged ? ` DESKTOP: (${orig.x},${orig.y}) → (${card.x},${card.y})` : '') + - (mChanged ? ` MOBILE: (${orig.mobileX},${orig.mobileY}) → (${card.mobileX},${card.mobileY})` : '') + (mChanged + ? ` MOBILE: (${orig.mobileX},${orig.mobileY}) → (${card.mobileX},${card.mobileY})` + : '') ); if (dChanged) desktopChanges++; if (mChanged) mobileChanges++; @@ -101,8 +115,9 @@ if (desktopChanges === 0 && mobileChanges === 0) { // Check for ORDER changes in mobile layout console.log('\n=== Mobile reading order (y, then x) ==='); -const sortByMobile = (items: { id: string; mobileX: number; mobileY: number; cardType: string }[]) => - [...items].sort((a, b) => a.mobileY - b.mobileY || a.mobileX - b.mobileX); +const sortByMobile = ( + items: { id: string; mobileX: number; mobileY: number; cardType: string }[] +) => [...items].sort((a, b) => a.mobileY - b.mobileY || a.mobileX - b.mobileX); const origOrder = sortByMobile(originals); const newOrder = sortByMobile(cards); @@ -111,13 +126,13 @@ let orderChanges = 0; for (let i = 0; i < origOrder.length; i++) { const same = origOrder[i].id === newOrder[i].id; if (!same) orderChanges++; - const orig = originals.find(o => o.id === newOrder[i].id)!; - const card = cards.find(c => c.id === newOrder[i].id)!; + const orig = originals.find((o) => o.id === newOrder[i].id)!; + const card = cards.find((c) => c.id === newOrder[i].id)!; console.log( `${i.toString().padStart(2)}: ${same ? ' ' : '!!'} ` + - `${card.cardType.padEnd(20)} ` + - `was (${orig.mobileX},${orig.mobileY}) → now (${card.mobileX},${card.mobileY})` + - (!same ? ` [was #${origOrder.findIndex(o => o.id === newOrder[i].id)}]` : '') + `${card.cardType.padEnd(20)} ` + + `was (${orig.mobileX},${orig.mobileY}) → now (${card.mobileX},${card.mobileY})` + + (!same ? ` [was #${origOrder.findIndex((o) => o.id === newOrder[i].id)}]` : '') ); } console.log(`\n${orderChanges} order changes in mobile layout.`); diff --git a/src/lib/cards/media/SecretImageCard/EditingSecretImageCard.svelte b/src/lib/cards/media/SecretImageCard/EditingSecretImageCard.svelte index 8c8fe89..42d2cb6 100644 --- a/src/lib/cards/media/SecretImageCard/EditingSecretImageCard.svelte +++ b/src/lib/cards/media/SecretImageCard/EditingSecretImageCard.svelte @@ -102,5 +102,4 @@ {/if} - diff --git a/src/lib/cards/media/StatusphereCard/EditStatusphereCard.svelte b/src/lib/cards/media/StatusphereCard/EditStatusphereCard.svelte index 22d8c6a..e376b57 100644 --- a/src/lib/cards/media/StatusphereCard/EditStatusphereCard.svelte +++ b/src/lib/cards/media/StatusphereCard/EditStatusphereCard.svelte @@ -29,9 +29,7 @@ let mode = $derived(item.cardData?.mode ?? 'emoji'); // Emoji mode: use cardData. Statusphere mode: use latest record or preview. let emoji = $derived( - mode === 'statusphere' - ? (item.cardData?.emoji ?? record?.value?.status) - : item.cardData?.emoji + mode === 'statusphere' ? (item.cardData?.emoji ?? record?.value?.status) : item.cardData?.emoji ); let showPopover = $state(false); diff --git a/src/lib/cards/media/StatusphereCard/StatusphereCard.svelte b/src/lib/cards/media/StatusphereCard/StatusphereCard.svelte index d251c4d..4dcd3d8 100644 --- a/src/lib/cards/media/StatusphereCard/StatusphereCard.svelte +++ b/src/lib/cards/media/StatusphereCard/StatusphereCard.svelte @@ -11,9 +11,7 @@ let mode = $derived(item.cardData?.mode ?? 'emoji'); // Emoji mode: use cardData. Statusphere mode: use latest record from PDS. - let emoji = $derived( - mode === 'statusphere' ? record?.value?.status : item.cardData?.emoji - ); + let emoji = $derived(mode === 'statusphere' ? record?.value?.status : item.cardData?.emoji); let animated = $derived(emojiToNotoAnimatedWebp(emoji)); diff --git a/src/lib/cards/social/KichRecipeCard/KichRecipeCard.svelte b/src/lib/cards/social/KichRecipeCard/KichRecipeCard.svelte index d9bb75a..84c1ffc 100644 --- a/src/lib/cards/social/KichRecipeCard/KichRecipeCard.svelte +++ b/src/lib/cards/social/KichRecipeCard/KichRecipeCard.svelte @@ -121,7 +121,7 @@ {title}
diff --git a/src/lib/cards/social/KichRecipeCollectionCard/KichRecipeCollectionCard.svelte b/src/lib/cards/social/KichRecipeCollectionCard/KichRecipeCollectionCard.svelte index 3942e39..ba48a39 100644 --- a/src/lib/cards/social/KichRecipeCollectionCard/KichRecipeCollectionCard.svelte +++ b/src/lib/cards/social/KichRecipeCollectionCard/KichRecipeCollectionCard.svelte @@ -84,10 +84,10 @@ class="relative block min-h-0 flex-1" > {#if imageUrl} - {title} + {title} {:else}
{/if} diff --git a/src/lib/website/EditableWebsite.svelte b/src/lib/website/EditableWebsite.svelte index 34da2b4..28f4b8e 100644 --- a/src/lib/website/EditableWebsite.svelte +++ b/src/lib/website/EditableWebsite.svelte @@ -586,8 +586,8 @@

Layout Auto-Fixed

Your card layout had overlapping cards from an older version. This has been automatically - fixed, but some cards may have moved. Please check your layout and rearrange if needed, - then save to keep the changes. + fixed, but some cards may have moved. Please check your layout and rearrange if needed, then + save to keep the changes.