Skip to content

fix(web): size loading placeholders from counts the directory already knows - #360

Merged
botandbang merged 3 commits into
mainfrom
bnb/lighthouse-cls
Nov 1, 2026
Merged

botandbang merged 3 commits into
mainfrom
bnb/lighthouse-cls

Conversation

@botandbang

Copy link
Copy Markdown
Contributor

What and why

The press-kit lists and upcoming shows stream in after the page loads, and their placeholders were a single bar or row, so everything below moved when the real list arrived. Lighthouse measured CLS 0.199 on the public press-kits page on a phone (budget 0.02), and 0.05 to 0.07 on the dashboard project pages. getProject takes a new counts param and answers how many press kits and upcoming shows a project has in the same query, and each list shows that many placeholders shaped like its real cards or rows. The cards themselves are unchanged. The artist search can't know its result count before it answers, so its results area keeps the placeholder's height instead. /dashboard is unchanged (0.084 on a phone): nothing stored says which projects an account manages.

The getProject lexicon changed: run pnpm lexicons:publish before deploying.

How it was tested

Lighthouse before and after on mobile and desktop, median of 3: every changed page is at 0 to 0.001 CLS, and the public press-kits page's mobile performance went from 0.89 to 0.98. Screenshots at 390 and 1440 match the previous loaded pages. Tests cover the counts in the directory query and the service, the placeholder counts on the press-kits and project pages, and the Storybook loading stories. Each was broken once to confirm it fails. format, lint, check, test, Storybook, knip, coverage and tools/policy.sh pass.

… knows

The press-kit lists and upcoming shows stream in after the page loads,
and their placeholders were a single bar or row, so everything below
moved when the real list arrived (CLS 0.2 on the public press-kits page
on a phone). getProject takes a new `counts` param and answers how many
press kits and upcoming shows the project has in the same query, and
each list shows that many placeholders shaped like its real cards or
rows. The artist search can't know its count before it answers, so its
results area keeps the placeholder's height instead.

The getProject lexicon changed: run `pnpm lexicons:publish` before
deploying.
@botandbang
botandbang requested a review from bnb as a code owner November 1, 2026 19:05
bnb
bnb previously approved these changes Nov 1, 2026
# Conflicts:
#	apps/web/README.md
#	apps/web/src/routes/dashboard/projects/[slug]/press-kits/+page.svelte
@github-actions github-actions Bot added documentation Improvements or additions to documentation web The Local Network website (apps/web) lexicons The computer.localnetwork.* lexicons web: directory Directory search, the show matcher, genres and places web: projects Project profiles, claims, and the DJ stats and sets on them web: epk Press kits and who can see them web: server Spaces, sync, HappyView, the database and the server around them web: ui Shared components, design tokens, layout and the static pages tests Tests, fixtures and test harnesses labels Nov 1, 2026
@botandbang
botandbang enabled auto-merge November 1, 2026 20:07
@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Coverage Report for apps/web

Status Category Percentage Covered / Total
🟢 Lines 95.52% (🎯 93%)
⬆️ +0.01 pp
8252 / 8639
🟢 Statements 94.19% (🎯 91%)
⬆️ +0.02 pp
12507 / 13278
🟢 Functions 94.15% (🎯 92%)
⬆️ +0.02 pp
3239 / 3440
🟢 Branches 84.94% (🎯 80%)
⬆️ +0.01 pp
5892 / 6936
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
apps/web/src/lib/shows.ts 100%
🟰 ±0 pp
100%
🟰 ±0 pp
100%
🟰 ±0 pp
100%
🟰 ±0 pp
apps/web/src/lib/components/epk/EpkKitList.svelte 100%
🟰 ±0 pp
73.07%
⬆️ +0.16 pp
100%
🟰 ±0 pp
100%
🟰 ±0 pp
apps/web/src/lib/components/supports/ArtistResults.svelte 96%
⬆️ +0.88 pp
91.66%
🟰 ±0 pp
90%
⬆️ +0.53 pp
94.73%
⬆️ +0.98 pp
51
apps/web/src/lib/server/manage.ts 100%
🟰 ±0 pp
100%
🟰 ±0 pp
100%
🟰 ±0 pp
100%
🟰 ±0 pp
apps/web/src/lib/server/project-page.ts 83.33%
🟰 ±0 pp
76.19%
🟰 ±0 pp
100%
🟰 ±0 pp
100%
🟰 ±0 pp
16, 19
apps/web/src/lib/server/happyview/client.ts 100%
🟰 ±0 pp
96.77%
🟰 ±0 pp
100%
🟰 ±0 pp
100%
🟰 ±0 pp
apps/web/src/lib/server/services/projects.ts 96.66%
⬆️ +0.07 pp
92.92%
⬆️ +0.54 pp
100%
🟰 ±0 pp
98.4%
⬆️ +0.03 pp
237, 320, 344, 399, 484
apps/web/src/lib/server/services/shows.ts 94.3%
⬇️ -0.03 pp
88.88%
🟰 ±0 pp
100%
🟰 ±0 pp
95.48%
⬇️ -0.04 pp
96-97, 105-106, 133, 442-444
Generated in workflow #76 for commit 20c31f7 by the Vitest Coverage Report Action

Size

Compared with main. KiB are 1,024 bytes.

This pull request main Change
Client JavaScript 716.9 KiB 715 KiB +1.9 KiB (+0.3%)
Client JavaScript, brotli 240.8 KiB 240.3 KiB +523 B (+0.2%)
Client CSS 90.3 KiB 90.2 KiB +59 B (+0.1%)
Client CSS, brotli 13 KiB 12.9 KiB +14 B (+0.1%)

@botandbang
botandbang added this pull request to the merge queue Nov 1, 2026
Merged via the queue into main with commit c51a150 Nov 1, 2026
24 checks passed
@botandbang
botandbang deleted the bnb/lighthouse-cls branch November 1, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation lexicons The computer.localnetwork.* lexicons tests Tests, fixtures and test harnesses web: directory Directory search, the show matcher, genres and places web: epk Press kits and who can see them web: projects Project profiles, claims, and the DJ stats and sets on them web: server Spaces, sync, HappyView, the database and the server around them web: ui Shared components, design tokens, layout and the static pages web The Local Network website (apps/web)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants