Skip to content

feat(repair): show and upload ticket photos - #158

Merged
wen-templari merged 3 commits into
mainfrom
feat/event-photos
Oct 15, 2026
Merged

wen-templari merged 3 commits into
mainfrom
feat/event-photos

Conversation

@m1ngsama

@m1ngsama m1ngsama commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Members need to attach on-site photos to repair tickets. Depends on nbtca/Saturday#234 being deployed.

Needs your decision

  • Admins now see the phone and QQ of any ticket in the drawer, because the drawer loads the private event detail to get photos (src/pages/repair/EventDetail.tsx).
  • Clients now see their own phone and QQ on the ticket page, for the same reason (src/pages/repair/TicketDetail.tsx).

What changed

  • The ticket drawer shows a 现场照片 grid. The assigned member or an admin can add photos while the ticket is accepted or committed; others see photos read-only.
  • Photos are resized in the browser to a 2048 px long edge and encoded as WebP at quality 0.8, or JPEG where the browser cannot encode WebP. EXIF orientation is applied and EXIF data is dropped.
  • The client ticket page shows photos read-only and hides the grid when there are none.
  • The 20-photo limit is checked before upload. Undecodable files, rejected uploads and network failures show a Chinese message and reset the button.
  • When a signed photo URL has expired, the event is fetched again once to get fresh URLs. Each request reads a fresh access token.
  • After a member drops a ticket, the drawer no longer shows its contact details or the upload button.
  • src/types/saturday.d.ts only gains the new endpoint and schema.

Verification

  • Tested on the astro build output in Chromium against a local Saturday: a 4000×3000 PNG uploads as 2048×1536 WebP, a portrait JPEG with EXIF orientation 6 uploads as 1536×2048, and each role sees the expected controls. JS output grows by 2.6 KB.
  • Not verified: Safari, including the JPEG fallback.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Deploying home with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2581a14
Status: ✅  Deploy successful!
Preview URL: https://98ffce95.fuji-2ku.pages.dev
Branch Preview URL: https://feat-event-photos.fuji-2ku.pages.dev

View logs

@m1ngsama
m1ngsama requested a review from wen-templari October 15, 2026 02:39
m1ngsama and others added 2 commits October 15, 2026 11:01
Re-fetch the event once when a signed photo url fails to load, read a
fresh access token for each request, show upload rejections in Chinese,
and clear private event data when the viewer loses access, such as after
dropping a ticket.
@wen-templari
wen-templari merged commit 4963bd4 into main Oct 15, 2026
4 checks passed
@wen-templari
wen-templari deleted the feat/event-photos branch October 15, 2026 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants