Skip to content

feat(web): read shows and their calendar events from HappyView instead of PDSes - #255

Open
botandbang wants to merge 5 commits into
mainfrom
bnb/happyview-calendar-events
Open

botandbang wants to merge 5 commits into
mainfrom
bnb/happyview-calendar-events

Conversation

@botandbang

Copy link
Copy Markdown
Contributor

What and why

The show form, the "changed in another calendar app" marker and the reads before a show save or delete read the show and its community.lexicon.calendar.event from the manager's PDS. They now read HappyView.

Added:

  • lua/community/lexicon/calendar/event.lua, which indexes calendar events by accounts that manage one of the root's projects. It checks the author rather than a show naming the event, so arrival order doesn't matter
  • Calendar events in the per-manager re-read, and in the dev network's seed backfill

Changed:

  • The edit form carries the show's and event's CIDs. A save from a form whose versions HappyView no longer serves is refused before anything is written, then the event and the show are each written with swapRecord on those CIDs, so a change made elsewhere asks the manager to reload. applyWrites has no per-record swap, so an edit is two putRecords, event first; a new show stays one applyWrites, and a delete removes the event and then the show
  • Saves and deletes wait for HappyView to serve the event as well as the show
  • The CID pattern the project, press kit and show forms check lives in server/http.ts

How it was tested

  • Unit tests for the gate, the form CIDs, the swap paths (stale event, show changed on its own, HappyView lacking the event, HappyView down) and delete without HappyView's copy
  • pnpm test:integration: the form reads from HappyView, an edit made by another app while the form is open is refused, and a race against the real PDS's swap
  • pnpm verify and pnpm test:coverage

Checklist

  • Tests cover the change
  • For the website: Storybook stories cover any new UI states
  • For locallibrary: apps/locallibrary/CHANGELOG.md has a line under Unreleased, if people using it will notice
  • The READMEs, docs/ and --help still say what the code does

…d of PDSes

HappyView now indexes community.lexicon.calendar.event, keeping only events by accounts that manage one of the root's projects, and re-reads managers' events once per record script version. The announce form, the changed-in-another-app marker, and the reads before a save or delete come from HappyView instead of the manager's PDS. The edit form carries the CIDs of the show and event it shows, and a save only lands on those: one that HappyView no longer serves is refused before anything is written, and the event and then the show are written with swapRecord on them, so a change made elsewhere asks the manager to reload. A new show stays one applyWrites, a delete removes the event and then the show, and saves and deletes wait for the event to be served too.
…vents

# Conflicts:
#	apps/web/README.md
#	apps/web/src/lib/server/forms/project.ts
#	apps/web/src/routes/projects/[slug]/+page.server.ts
@botandbang
botandbang requested a review from bnb as a code owner October 25, 2026 22:42
@github-actions github-actions Bot added documentation Improvements or additions to documentation web The Local Network website (apps/web) 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 Oct 25, 2026
@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Coverage Report for apps/web

Status Category Percentage Covered / Total
🟢 Lines 94.37% (🎯 93%)
⬆️ +0.03 pp
5910 / 6262
🟢 Statements 92.73% (🎯 91%)
⬆️ +0.03 pp
9117 / 9831
🟢 Functions 93.34% (🎯 92%)
🟰 ±0 pp
2315 / 2480
🟢 Branches 82.39% (🎯 80%)
⬆️ +0.29 pp
4225 / 5128
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/ShowForm.svelte 100%
🟰 ±0 pp
100%
🟰 ±0 pp
100%
🟰 ±0 pp
100%
🟰 ±0 pp
apps/web/src/lib/server/app.ts 68.79%
🟰 ±0 pp
46.66%
🟰 ±0 pp
55.26%
🟰 ±0 pp
76.22%
🟰 ±0 pp
76, 108, 132, 134, 137, 197-210, 272, 283, 290, 293-294, 304, 320, 337-359, 363, 372-375, 385-390
apps/web/src/lib/server/http.ts 100%
🟰 ±0 pp
100%
🟰 ±0 pp
100%
🟰 ±0 pp
100%
🟰 ±0 pp
apps/web/src/lib/server/forms/announce.ts 100%
🟰 ±0 pp
100%
🟰 ±0 pp
100%
🟰 ±0 pp
100%
🟰 ±0 pp
apps/web/src/lib/server/forms/epk.ts 90.84%
🟰 ±0 pp
82.35%
🟰 ±0 pp
93.54%
🟰 ±0 pp
93.91%
🟰 ±0 pp
86, 115-120, 152, 180, 228, 233, 250, 258, 261, 279, 303, 305, 307, 324
apps/web/src/lib/server/forms/project.ts 98.91%
🟰 ±0 pp
91.09%
🟰 ±0 pp
100%
🟰 ±0 pp
99.51%
🟰 ±0 pp
319, 404, 451
apps/web/src/lib/server/happyview/bundle.ts 95.55%
⬆️ +0.10 pp
88.23%
⬆️ +1.57 pp
100%
🟰 ±0 pp
97.29%
⬆️ +0.15 pp
54, 92
apps/web/src/lib/server/happyview/refresh.ts 100%
🟰 ±0 pp
100%
🟰 ±0 pp
100%
🟰 ±0 pp
100%
🟰 ±0 pp
apps/web/src/lib/server/services/shows.ts 94.33%
⬆️ +1.23 pp
88.88%
⬆️ +9.94 pp
100%
🟰 ±0 pp
95.52%
⬆️ +1.36 pp
99-100, 108-109, 136, 445-447
apps/web/src/lib/server/testing/core.ts 94.91%
🟰 ±0 pp
80%
🟰 ±0 pp
100%
🟰 ±0 pp
100%
🟰 ±0 pp
68, 77, 84
Generated in workflow #479 for commit 8336bc2 by the Vitest Coverage Report Action

Size

Compared with main. KiB are 1,024 bytes.

This pull request main Change
Client JavaScript 619.4 KiB 619.2 KiB +192 B (+0%)
Client JavaScript, brotli 204.5 KiB 204.5 KiB +9 B (+0%)
Client CSS 87.6 KiB 87.6 KiB 0 B (0%)
Client CSS, brotli 12.5 KiB 12.5 KiB 0 B (0%)

This branch has not been deployed

No deployments
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 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