feat(activities): backend-truth counts + scanned list, tabs + popup result on Scan Tickets #76
No reviewers
Labels
No labels
app:activities
app:chat
app:events
app:forum
app:libra
app:market
app:restaurant
app:tasks
app:wallet
app:webapp
bug
enhancement
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
aiolabs/webapp!76
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ticket-scanner-counts-rpc"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Follow-up to #73 (organizer ticket scanner over nostr-transport) that addresses three loose ends spotted while smoking the page on a real event:
events_list_event_ticketsRPC on the backend, so every session agrees.ScrollArea h-72below the camera. Now it's a dedicated tab with full viewport height for a long event-day roster.Changes
useTicketScannerexposeseventStats/statsLoading/statsError/refreshStats(). Auto-fetches on mount and after every decode (success or failure).ScanTicketsPagerewired to render Scanner / Scanned tabs, the counts strip fromeventStats, a manual Refresh in the top bar, and the tap-to-dismiss result overlay.Dependencies
aiolabs/events ≥ v1.6.1-aio.3(the version that ships theevents_list_event_ticketsRPC). Already in the catalog as of this morning.NOSTR_TRANSPORT_ENABLED=true+ aNOSTR_TRANSPORT_RELAYSvalue on the LNbits host. Demo's deploy config is being updated inserver-deployseparately.Test plan
/scan/<eventId>for an event you own. Counts strip populates within a second from the RPC (not zero with a—fallback).Scanned+1,Remaining-1./scan/<eventId>from a different device mid-event → counts match the first device (no localStorage divergence).The Scan Tickets page now sources its counts strip and scanned-ticket roster from the new `events_list_event_tickets` RPC instead of a per-device localStorage cache. The previous design diverged the moment a second organizer scanned, or the operator switched from mobile to laptop, or refreshed in incognito — backend truth keeps all sessions consistent. Webapp-side changes: - useTicketScanner now exposes `eventStats` (sold / registered / remaining + per-ticket roster), `statsLoading`, `statsError`, and `refreshStats()`. Initial load on mount, refresh after every decode (success or failure) so the UI reflects state seconds after a scan lands. - localStorage cache demoted to silent decode dedup only. The Clear-list button + its confirm dialog are gone — the cache isn't authoritative state to clear anymore. - ScanTicketsPage gets two tabs: Scanner (camera + result) and Scanned ({count} from backend). Counts strip up top reads from `eventStats` (with the nostr-event `tickets_sold` tag as a fallback before the RPC roundtrip completes). A manual Refresh button in the top bar covers the rare case where a second device scans during your session. - Result of each scan now lands as a full-viewport tap-to-dismiss overlay (success green / warning amber / destructive red) so the door operator can't skim past it on a busy entry. Depends on aiolabs/events v1.6.1-aio.3 (already in the catalog).