Staff exclusions + contact-password auth sync

- contacts.password now auto-syncs to auth.users.encrypted_password via
  trg_contact_password_sync, so setting a password on the contact row in the
  Supabase UI makes it work with signInWithPassword immediately (fixes staff
  like Bruno not being able to log in with a UI-set password). One-time
  reconciliation in the migration.
- Staff excluded from the leaderboard: _sync_leaderboard skips/removes staff
  rows, get_leaderboard() filters type='staff', seed no longer inserts staff.
  Affects the attendee Leaderboard and the admin Dashboard 'Top points'.
- Home/Agenda/Profile identical for all roles: Home quick-action always
  'Scan & connect' (no 'Check-in' relabel), footer role badge removed, tab
  label always 'Scan' (staff keep check-in via the Scan screen mode toggle).
- Profile: removed the duplicate Staff pill (type pill already shows Staff).
- Agenda session sheet: 'Download material' moved to the bottom of the button
  stack with spacing.
- Docs updated (schema, rpcs, seed, screens, architecture, next-steps).

Co-authored-by: Stephan Charles <[email protected]>
Co-authored-by: Amelia Hernandez <[email protected]>
Co-authored-by: Markus Franz <[email protected]>
Co-authored-by: Sabrina Hota <[email protected]>
Co-authored-by: Nilüfer Doğan <[email protected]>
This commit is contained in:
committed 2026-08-23 18:27:01 +02:00
1 parent 0221b1a8c0
commit 5886de9d19
12 files changed
+203 -45

No files matched your search

+38 -3
View File
@@ -4,12 +4,15 @@ What's done, what's next, and the open decisions. The full roadmap lives in the
root [`roadmap.md`](../roadmap.md); this file is the working detail for the
current phase.
> **Current state:** Phases 0–8 are complete and verified, plus two polish
> **Current state:** Phases 0–8 are complete and verified, plus three polish
> rounds: **Fixes & Refinements** (QR token moved to the registration, role-pill
> capitalization, connection detail sheet + red-dot recalc, admin schedule
> speaker multi-select + upload/speaker bug fixes, sponsor contact search) and
> speaker multi-select + upload/speaker bug fixes, sponsor contact search),
> **Admin password + profile self-service** (admin logs in with email + password;
> attendees set LinkedIn + visibility on their Profile).
> attendees set LinkedIn + visibility on their Profile), and **Staff exclusions
> + password sync** (setting `contacts.password` auto-syncs the Auth password;
> staff excluded from the leaderboard; Home/Agenda/Profile identical for all
> roles).
> Remaining work is cross-cutting (real event clock, deployment, testing) and
> the open questions in [backend/interfaces.md](./backend/interfaces.md).
@@ -269,6 +272,38 @@ browser-verified.
`show_linkedin` is off and omits the email when `show_email` is off, so the
toggles actually control what other attendees see.
## Staff exclusions + password sync — ✅ complete
Migration `20260828000000_staff_exclusions_password_sync.sql` + app changes, all
browser-verified.
**Setting `contacts.password` now works for login.**
- A trigger (`trg_contact_password_sync`) re-hashes `contacts.password` into
`auth.users.encrypted_password` whenever it's set/changed, so entering a
password on the contact row in the Supabase Table Editor makes it work with
`signInWithPassword` immediately (previously the two had to be kept in sync
by hand). A one-time reconciliation in the migration synced any already-set
passwords.
- This is how a staff member (e.g. Bruno) can be given a password and log in.
**Staff are excluded from the leaderboard.**
- `_sync_leaderboard` skips (and removes) staff rows, so staff never appear on
the board even if they hold points. `get_leaderboard()` also filters
`type = 'staff'` (defense in depth), and the seed no longer inserts staff.
- Affects the attendee Leaderboard **and** the admin Dashboard "Top points".
**Home / Agenda / Profile are identical for every role.**
- Home: the quick-action tile is always **"Scan & connect"** (was
"Check-in" for staff) and the footer role badge is removed. The tab bar label
is always **"Scan"** (was "Check-in" for staff).
- Staff keep their check-in capability **inside the Scan screen** (the
Attendee/Staff mode toggle), so the home page stays role-agnostic.
- Profile: the duplicate **Staff** pill is gone (the registration-type pill
already shows "Staff" for staff; the extra `is_admin` pill only shows for
admins whose type isn't staff).
- Agenda session sheet: **"Download material"** moved to the **bottom** of the
button stack (below "Pick this session") with proper spacing.
## Cross-cutting / later
- **Real event clock** — replace the simulated `DEFAULT_NOW`