Skip to content

Commit 935d061

Browse files
authored
Merge pull request #275 from flo-bit/fix-formatting-once-again
fix formatting
2 parents 57612ba + aadccfa commit 935d061

10 files changed

Lines changed: 49 additions & 33 deletions

File tree

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,6 @@ vite.config.ts.timestamp-*
2424

2525
references
2626

27-
sveltekit-cloudflare-workers
27+
sveltekit-cloudflare-workers
28+
29+
inlay

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@
22
package-lock.json
33
pnpm-lock.yaml
44
yarn.lock
5+
6+
# Unrelated sub-project
7+
inlay

eslint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export default [
4444
'svelte/no-at-html-tags': 'off',
4545
'@typescript-eslint/no-explicit-any': 'off',
4646
'no-unused-vars': 'off',
47+
'no-useless-assignment': 'off',
4748
'@typescript-eslint/no-unused-vars': [
4849
'warn',
4950
{

scripts/simulate-load.ts

Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,21 @@
44
*
55
* Usage: npx tsx scripts/atproto.ts listRecords <handle> app.blento.card 2>/dev/null | npx tsx scripts/simulate-load.ts
66
*/
7-
import {
8-
correctBounds,
9-
verticalCompactor,
10-
type LayoutItem
11-
} from 'react-grid-layout/core';
7+
import { correctBounds, verticalCompactor, type LayoutItem } from 'react-grid-layout/core';
128
import * as fs from 'fs';
139

1410
const COLUMNS = 8;
1511

1612
type Item = {
1713
id: string;
18-
x: number; y: number; w: number; h: number;
19-
mobileX: number; mobileY: number; mobileW: number; mobileH: number;
14+
x: number;
15+
y: number;
16+
w: number;
17+
h: number;
18+
mobileX: number;
19+
mobileY: number;
20+
mobileW: number;
21+
mobileH: number;
2022
cardType: string;
2123
};
2224

@@ -33,8 +35,13 @@ function applyLayout(items: Item[], layout: LayoutItem[], mobile: boolean) {
3335
for (const l of layout) {
3436
const item = map.get(l.i);
3537
if (!item) continue;
36-
if (mobile) { item.mobileX = l.x; item.mobileY = l.y; }
37-
else { item.x = l.x; item.y = l.y; }
38+
if (mobile) {
39+
item.mobileX = l.x;
40+
item.mobileY = l.y;
41+
} else {
42+
item.x = l.x;
43+
item.y = l.y;
44+
}
3845
}
3946
}
4047

@@ -60,9 +67,14 @@ const cards: Item[] = records
6067
.filter((r: any) => r.value.cardType && (!r.value.page || r.value.page === 'blento.self'))
6168
.map((r: any) => ({
6269
id: r.value.id,
63-
x: r.value.x, y: r.value.y, w: r.value.w, h: r.value.h,
64-
mobileX: r.value.mobileX, mobileY: r.value.mobileY,
65-
mobileW: r.value.mobileW, mobileH: r.value.mobileH,
70+
x: r.value.x,
71+
y: r.value.y,
72+
w: r.value.w,
73+
h: r.value.h,
74+
mobileX: r.value.mobileX,
75+
mobileY: r.value.mobileY,
76+
mobileW: r.value.mobileW,
77+
mobileH: r.value.mobileH,
6678
cardType: r.value.cardType
6779
}));
6880

@@ -86,7 +98,9 @@ for (const card of cards) {
8698
console.log(
8799
`${orig.cardType.padEnd(20)} id=${orig.id}` +
88100
(dChanged ? ` DESKTOP: (${orig.x},${orig.y}) → (${card.x},${card.y})` : '') +
89-
(mChanged ? ` MOBILE: (${orig.mobileX},${orig.mobileY}) → (${card.mobileX},${card.mobileY})` : '')
101+
(mChanged
102+
? ` MOBILE: (${orig.mobileX},${orig.mobileY}) → (${card.mobileX},${card.mobileY})`
103+
: '')
90104
);
91105
if (dChanged) desktopChanges++;
92106
if (mChanged) mobileChanges++;
@@ -101,8 +115,9 @@ if (desktopChanges === 0 && mobileChanges === 0) {
101115

102116
// Check for ORDER changes in mobile layout
103117
console.log('\n=== Mobile reading order (y, then x) ===');
104-
const sortByMobile = (items: { id: string; mobileX: number; mobileY: number; cardType: string }[]) =>
105-
[...items].sort((a, b) => a.mobileY - b.mobileY || a.mobileX - b.mobileX);
118+
const sortByMobile = (
119+
items: { id: string; mobileX: number; mobileY: number; cardType: string }[]
120+
) => [...items].sort((a, b) => a.mobileY - b.mobileY || a.mobileX - b.mobileX);
106121

107122
const origOrder = sortByMobile(originals);
108123
const newOrder = sortByMobile(cards);
@@ -111,13 +126,13 @@ let orderChanges = 0;
111126
for (let i = 0; i < origOrder.length; i++) {
112127
const same = origOrder[i].id === newOrder[i].id;
113128
if (!same) orderChanges++;
114-
const orig = originals.find(o => o.id === newOrder[i].id)!;
115-
const card = cards.find(c => c.id === newOrder[i].id)!;
129+
const orig = originals.find((o) => o.id === newOrder[i].id)!;
130+
const card = cards.find((c) => c.id === newOrder[i].id)!;
116131
console.log(
117132
`${i.toString().padStart(2)}: ${same ? ' ' : '!!'} ` +
118-
`${card.cardType.padEnd(20)} ` +
119-
`was (${orig.mobileX},${orig.mobileY}) → now (${card.mobileX},${card.mobileY})` +
120-
(!same ? ` [was #${origOrder.findIndex(o => o.id === newOrder[i].id)}]` : '')
133+
`${card.cardType.padEnd(20)} ` +
134+
`was (${orig.mobileX},${orig.mobileY}) → now (${card.mobileX},${card.mobileY})` +
135+
(!same ? ` [was #${origOrder.findIndex((o) => o.id === newOrder[i].id)}]` : '')
121136
);
122137
}
123138
console.log(`\n${orderChanges} order changes in mobile layout.`);

src/lib/cards/media/SecretImageCard/EditingSecretImageCard.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,5 +102,4 @@
102102
</div>
103103
{/if}
104104
</button>
105-
106105
</div>

src/lib/cards/media/StatusphereCard/EditStatusphereCard.svelte

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@
2929
let mode = $derived(item.cardData?.mode ?? 'emoji');
3030
// Emoji mode: use cardData. Statusphere mode: use latest record or preview.
3131
let emoji = $derived(
32-
mode === 'statusphere'
33-
? (item.cardData?.emoji ?? record?.value?.status)
34-
: item.cardData?.emoji
32+
mode === 'statusphere' ? (item.cardData?.emoji ?? record?.value?.status) : item.cardData?.emoji
3533
);
3634
3735
let showPopover = $state(false);

src/lib/cards/media/StatusphereCard/StatusphereCard.svelte

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
1212
let mode = $derived(item.cardData?.mode ?? 'emoji');
1313
// Emoji mode: use cardData. Statusphere mode: use latest record from PDS.
14-
let emoji = $derived(
15-
mode === 'statusphere' ? record?.value?.status : item.cardData?.emoji
16-
);
14+
let emoji = $derived(mode === 'statusphere' ? record?.value?.status : item.cardData?.emoji);
1715
let animated = $derived(emojiToNotoAnimatedWebp(emoji));
1816
</script>
1917

src/lib/cards/social/KichRecipeCard/KichRecipeCard.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
<img
122122
src={imageUrl}
123123
alt={title}
124-
class="recipe-image rounded-t-xl aspect-16/9 w-full object-cover"
124+
class="recipe-image aspect-16/9 w-full rounded-t-xl object-cover"
125125
/>
126126
<div class="image-overlay pointer-events-none absolute inset-0"></div>
127127
<div class="compact-overlay pointer-events-none absolute right-0 bottom-0 left-0 p-4">

src/lib/cards/social/KichRecipeCollectionCard/KichRecipeCollectionCard.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@
8484
class="relative block min-h-0 flex-1"
8585
>
8686
{#if imageUrl}
87-
<img src={imageUrl} alt={title} class="rounded-t-xl h-full w-full object-cover" />
87+
<img src={imageUrl} alt={title} class="h-full w-full rounded-t-xl object-cover" />
8888
{:else}
8989
<div
90-
class="rounded-t-xl from-base-300 to-base-200 dark:from-base-800 dark:to-base-900 h-full w-full bg-gradient-to-br"
90+
class="from-base-300 to-base-200 dark:from-base-800 dark:to-base-900 h-full w-full rounded-t-xl bg-gradient-to-br"
9191
></div>
9292
{/if}
9393

src/lib/website/EditableWebsite.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,8 +586,8 @@
586586
<p class="text-base-700 dark:text-base-300 text-xl font-bold">Layout Auto-Fixed</p>
587587
<p class="text-base-500 dark:text-base-400 text-sm">
588588
Your card layout had overlapping cards from an older version. This has been automatically
589-
fixed, but some cards may have moved. Please check your layout and rearrange if needed,
590-
then save to keep the changes.
589+
fixed, but some cards may have moved. Please check your layout and rearrange if needed, then
590+
save to keep the changes.
591591
</p>
592592
<Button class="w-full" onclick={acknowledgeLayoutFix}>Got it</Button>
593593
</div>

0 commit comments

Comments
 (0)