Files
Convivo/docs/frontend/screens.md
T
25df5b3abc chore(assets): move Manfred originals to assets/manfred, rename by pose
Relocate the four full-resolution mascot source PNGs out of the root
Manfred/ folder into assets/manfred/ (a non-build-context source dir,
like mockup/), renamed from their ChatGPT export names to pose names:
manfred-{waving,confident,coffee,celebrating}.png. git mv preserves
history (all four recorded as renames).

These originals are never shipped (Vite serves only apps/convivo/public/),
so the served 224px WebP poses are untouched and the attendee bundle is
byte-identical. Add assets/manfred/README.md with the pose table and a
regeneration command, and note a pre-existing cosmetic mismatch: the
deployed WebP filenames are rotated relative to their content (harmless —
Profile picks a pose at random and e2e asserts the filename).

Docs: fix the stale Manfred/ pointer in releases/2026-10-10.md and
cross-reference the source dir from frontend/screens.md.

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]>
2026-10-16 23:32:57 +02:00

348 lines
19 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Screens
Every screen in [`apps/convivo/src/screens/`](../../apps/convivo/src/screens/).
All screens are mobile-first and use the shared UI components
([app-structure.md#shared-ui-components](./app-structure.md#shared-ui-components)).
Data comes from the typed [api client](./api-client.md); the normal app's current
user comes from `useAuth()` (`contact` + `registration`). The speaker portal
uses its own auth lifecycle and backend-scoped session list.
| Screen | File | Reach |
|---|---|---|
| Login | `Login.tsx` | shown when not authenticated |
| Home | `Home.tsx` | tab (default) |
| Agenda | `Agenda.tsx` | tab |
| Scan | `Scan.tsx` | tab (staff get an Attendee/Staff mode toggle inside) |
| Connections | `Connections.tsx` | tab (hosts a **Networking** sub-tab; Home's "Networking" quick action deep-links into it) |
| Profile | `Profile.tsx` | tab |
| Leaderboard | `Leaderboard.tsx` | from Home (points pill / quick action) |
| Feedback | `Feedback.tsx` | full-screen takeover from Agenda |
| EventFeedback | `EventFeedback.tsx` | full-screen takeover from Home ("Rate this event") |
| Speaker Portal | [SpeakerPortal.tsx](../../apps/convivo/src/screens/SpeakerPortal.tsx) | `/speaker/secret` (also `/speaker`) |
## Speaker Portal
An email-only magic-link login for **existing Auth users**. The canonical
redirect is `/speaker/secret`; `/speaker` is also accepted. Neither route is a
secret credential: authorization is enforced by the backend. Failed/expired
callbacks show a recoverable error and callback tokens/codes are removed from
the address bar. Callback consumption is shared across StrictMode mounts.
Signed-in users see only their own assigned non-service talks with a `speaker`
or `staff` registration for the corresponding event. Admin/organizer staff can
also speak while retaining their staff category; service-slot assignments are excluded.
The list spans all events, including
inactive, past and future events. No physical check-in is required. An empty
list grants no material controls; access/load failures offer retry.
Each talk shows event, date/time, room and material status, with upload,
replacement, download and confirmed removal. Uploads accept non-empty PDF,
PowerPoint, ODP, ZIP and TXT files up to 50 MB. Controls are disabled during a
material operation; failures reload server state. Signing out is local to the
browser session.
The attachment-style upload control is an independent implementation adapted
from the icon button concept by [vinodjangid07](https://uiverse.io/vinodjangid07/good-donkey-28)
(MIT); no source was copied.
Portal operations never mark attendance or award points. Visiting `/` still
uses the normal app's check-in gate. See [portal API behavior](./api-client.md#speaker-portal),
[authorization](../backend/rls.md#speaker-portal-authorization) and
[regression coverage](../backend/tests.md#speaker-portal).
## Login
A QR flow (**splash → scan → confirm**) and an admin email branch share the
same entry field.
1. **Splash** — "APPE / Break the ice. Earn the points." Tap anywhere to continue.
2. **Scan** — scan (or type) your lanyard QR. Calls `lanyardLookup(qrToken)` to
resolve the contact (pre-login, public). Shows the resolved name + registration
type badge.
3. **Confirm** — the field depends on the resolved role:
- **Staff** (`registration_type === 'staff'`) — enter the **staff password**.
Login is `signInWithPassword({ email: <resolved contact email>, password })`.
(The email is taken from the resolved contact, so staff only type their
password.)
- **Everyone else** — enter the **email used to buy the ticket**, then
`signInWithPassword({ email, password: qrToken })` (the QR token is the auth
password).
On success the `AuthContext` updates and the Shell renders the app. On
mismatch, an error is shown ("Email and QR code do not match" for attendees,
"That password is incorrect" for staff).
Entering a valid email instead of a QR requests a magic link only when the
address belongs to an existing Auth user with server-backed admin eligibility.
Whitespace and case are normalized; malformed emails show a validation error
without a QR lookup. Enter submits the field. Sending locks controls; a
successful request starts a 60-second resend cooldown, while QR entry remains
available. Eligible and ineligible addresses receive the same confirmation.
Network and rate-limit failures show a generic recoverable error.
The `/auth/callback` route verifies the Auth user and calls `is_admin()` before
admitting the session. Editable user metadata is not an authorization source.
Invalid, expired and non-admin callbacks clear the local session and return to
the entry field. Tokens/codes are scrubbed before auth calls, and callback
consumption is shared across StrictMode mounts.
Admins stay in Convivo with its existing Staff scan mode; there is no redirect
to the admin domain and no registration or physical check-in requirement for
admins. Login does not create accounts, registrations, attendance or points.
Attendee QR login retains its checked-in gate and staff QR login retains its
password confirmation. The separate speaker portal remains independent. See
[admin entry API behavior](./api-client.md#admin-email-entry) and
[authorization](../backend/rls.md).
## Home
The landing screen. Shows:
- **Greeting + pills** — "Good morning, Ana 👋" and, to the right, a **red
material pill** `📎 {n}` (only for speakers who have one or more of their
**non-service** sessions without material — tapping it opens a popup listing
the pending sessions) and the **points pill** `⚡ {points}` (tapping opens the
Leaderboard). The event name (`event.name`) is shown under the greeting.
- **Pending-feedback pill** — a full-width **"⭐ Rate your last session"** (or
"Rate N sessions") button, shown only when the user is checked into one or more
**over** sessions, is **not** the speaker of that session, and **hasn't**
submitted feedback for it yet. It stays while feedback is pending and disappears
once submitted. Tapping goes to the Agenda (where the "Give feedback ⭐" button
lives on the session sheet).
- **Now card** — **always shown** for the current slot. If the user has a pick,
the picked session's title + room + speaker + a "✓ Checked in" / "Show your QR
to staff to check in" pill. **If there's no pick, the card still shows what's
running** — one clean sub-section per concurrent session (title + room +
speaker), so a slot with 1, 2, or 3 sessions renders 1, 2, or 3 sub-sections.
If the slot has no sessions at all, a "Nothing scheduled right now." line.
- **Next card** — **always shown** for the next slot (same pick / concurrent-list
logic as the Now card, without the check-in pill).
- **My picks today** — one row per pick the user has made **today** (in slot
order), each showing the slot time + session title + room. Tapping a row
opens the **same session detail sheet the Agenda shows** (description,
speaker/level/area pills, pick/un-pick, material download, feedback entry)
**in place over Home** — no round trip to the Agenda tab. "tap to change" is
a **hyperlink** to the Agenda. With no picks, a "No picks yet" line.
- The detail sheet is a shared component (`components/SessionDetail.tsx`) used
by both Home's picks and the Agenda list, so a session looks and behaves
identically wherever it is opened.
- **Quick actions** — Scan & connect, Agenda, Connections, Leaderboard.
- **No active event** — a graceful empty state ("No active event right now.
Check back soon!").
> **Identical for every role.** The Home screen (and the tab bar) is the same for
> attendees and staff — no role badge, no "Check-in" relabel. The Now/Next cards
> always render (with a concurrent-session list or "Nothing scheduled" when there's
> no pick), so the layout is identical whether or not the user has picks. Staff
> keep their check-in capability inside the **Scan** screen (Attendee/Staff mode
> toggle).
Data: `useEvent()` (event + agenda + clock) + `getMyPreferences()` +
`getMyCheckins(email)` + `getMySpeakerSessions(email)` (for the pending-material
pill) + `getMyFeedback(email)` (for the pending-feedback pill). Slot status comes
from `slotStatus(slot, now)`
([app-structure.md#the-event-clock](./app-structure.md#the-event-clock)).
## Agenda
Demo status uses 10:20 on the active event's configured start date. Real-time mode
uses the system date/time instead; see [the event clock](./app-structure.md#the-event-clock-libtime-ts).
Service sessions named **Placeholder** (case-insensitive, trimmed) are displayed
inside an ordinary talk block when their date, start time and end time match
exactly. Other services, unmatched Placeholders and partial time overlaps retain
their own blocks. The displayed slot count reflects these merged blocks.
Grouping is presentation-only: original slot IDs and session types remain intact.
Merged Placeholders retain staff speakers, stay visible under level/area filters,
and have no pick control, speaker mic tag or pending-material requirement.
Lists all slots, each with its sessions, a **slot-type badge** (**Session** /
**Service Session** — the `slot_type` enum, capitalized), and a status pill
(**Done / ● Live / Up next**). The user's pick per slot is highlighted (filled
check). A session the user speaks shows a **"🎤 you"** tag; a session with
material shows a **📎**.
**Service sessions** (breaks / lunch / closing / plenums) are treated
differently:
- the **pick circle (✓) is hidden** — they can't be picked (the sheet shows
"No pick needed for this slot." instead of the pick button);
- the **🎤 mic emoji is never shown** (neither the "🎤 you" tag nor the mic in
the speaker pill) — service sessions have no individual speaker;
- they have **no material requirement** (the pending-material notice never
applies to them).
A **service slot with no session behind it** (an orphan left over from an
earlier feed or a manual edit) is **hidden entirely** by `groupAgenda`, exactly
like an empty talk slot. Without this it would render as a header-only card
while every real service card shows a header **plus** its session row — the
inconsistency the attendee reported. The rule lives in the grouping layer, so
the agenda list, its slot count, and Home's Now/Next cards all agree.
- **Tap a session** → opens a bottom **sheet** with details (description,
speakers, room, capacity, checked-in state) and actions. The subtitle shows
**time · room**, prefixed with the **slot name only when it adds
information** — auto-named talk slots ("Slot 10:15–11:00") and service slots
named like their session are not repeated:
- **Give feedback ⭐** — only when the session is *done* **and** the user is
checked in. Opens the Feedback takeover (`openFeedback(sessionId)`).
- **Speaker feedback review** — when the user is a **speaker** of the session
**and** the session is *done*, a **"⭐ Your session feedback"** block shows the
session's **average rating** (stars + number) and the **AI-generated summary**
(`ai_generated_feedback`). It is **never shown while the session is still
running** — only after it's over.
- **Pick / Remove my pick** — `setPreference(sessionId)` / `clearPreference(slotId)`.
- **Speaker material** — if the user is a speaker of a **non-service** session
and no material is uploaded yet, a **non-dismissible** "📎 Upload your session
material" notice with a file input. Uploading stores the file in the
`materials` bucket and calls `set_session_material` (via
`uploadSessionMaterial`). Once uploaded, the notice is gone and a **📎
Download material** button appears (visible to **all** attendees), pinned to
the **bottom** of the sheet's button stack (below "Pick this session").
- **Remove material** — a speaker of the session can also **🗑 Remove material**
(to re-upload). This deletes the storage object and clears `material_path` via
`set_session_material` (null) — `removeSessionMaterial`.
- Picking is "one per slot" — picking a new session in a slot replaces the old
pick (enforced by the `set_preference` RPC).
Data: `useEvent()` + `getMyPreferences()` + `getMyCheckins(email)` +
`getMySpeakerSessions(email)`.
## Scan / Check-in
One screen, two modes (segmented control: **Attendee / Staff**). The tab label is
always **"Scan"** (the home page is identical for every role); the **default mode**
is role-aware — staff (`contact.is_admin`) default to **Staff** mode, attendees to
**Attendee** mode.
- **Attendee mode (connect):** scan a peer's lanyard → `lanyardLookup` → a
"Connect with {name}?" sheet (with the peer's registration-type badge + LinkedIn
link if visible) → `createConnectionRequest(qr)`. Guards: can't connect with
yourself. Result toast reflects the connection status (sent / already connected).
- **Staff mode (check-in):** a **check-in type toggle** (uiverse switch) switches
between two sub-modes:
- **Session check-in** (default) — pick a session (dropdown grouped by slot,
**service sessions excluded** — they can't be checked into), then scan an
attendee's lanyard → `checkinAttendee(sessionId, qr)`. Shows a result sheet:
"✓ {name} — Checked in — +10 pts · now {total}" or "⚠️ Already checked in —
no extra points" (the `already` flag from the RPC). The `checkin_attendee`
RPC also rejects a service session server-side ("service sessions cannot be
checked in").
- **Welcome check-in** — no session dropdown; scanning an attendee's lanyard →
`welcomeCheckin(qr)` marks them present at the **event**
(`registrations.checked_in = true`, no points). Result sheet: "👋 {name} —
Welcome to the event! — ✓ Checked in" (or "Already checked in to the event").
Data: `useEvent()` (for the session list) + the RPCs above.
## Connections
Three sub-tabs: **My connections**, **Requests** (with a count badge), and
**🗣 Networking** (see [Networking](#networking-a-sub-tab-of-connections)).
- **My connections** — accepted connections (the other person's name +
registration type). **Clicking a row** opens a bottom **sheet** with that
person's **public info + their points** (avatar, name, type pill, `⚡ N pts`,
LinkedIn if visible, email if `show_email`). **Other people's QR codes are
never shown.**
- **Requests** — incoming (`to_email = me`, pending) with **Accept / Decline**
buttons (`acceptConnection` / `rejectConnection`), and outgoing (`from_email =
me`, pending) shown as "Sent". The person block is also clickable (same detail
sheet).
- Accepting awards +5 to both, **plus the per-event talk networking bonus** when
the two parties shared a checked-in talk (see
[../backend/rpcs.md#accept_connectionp_connection_id](../backend/rpcs.md#accept_connectionp_connection_id)).
- **Red dot** — any interaction with the connection logic (accept / decline / send)
dispatches a `connections-changed` window event; the Shell listens and
**recalculates the Connect red dot immediately** (it stays while any incoming
request is pending and disappears once none are). It also polls every 5s as a
fallback (`usePolling`).
Data: `getMyConnections()` + `getPublicContacts()` (names + types) +
`getLeaderboard()` (points for the detail sheet).
## Networking (a sub-tab of Connections)
A **sub-tab inside the Connect screen** (the third of My connections / Requests /
🗣 Networking; the screen header switches to "Networking" while it is active)
that rewards **networking around talks**. The Home "Networking" quick action
deep-links straight into it. Rendered by the `NetworkingPanel` component
(`Networking.tsx`). For every talk the user was checked into, it lists the
**other attendees who were also in that talk** (the "talk cohort") so the user
can make a connection.
- **Your talks** — the sessions the user is checked into (`getMyCheckins()`),
shown as cards (title, room, speakers).
- **Also attended** — for each talk, the other checked-in participants
(`get_talk_cohort(sessionId)` — staff excluded, self excluded), each with a
name + registration-type badge and a **Connect** button (the same
`createConnectionRequest` flow as the Scan screen).
- **Bonus** — when the event's `talk_networking_bonus > 0`, the header shows
"Connect with them to earn +N pts (shared talk)". Accepting a connection with
a shared talk awards the bonus (see
[../backend/rpcs.md#accept_connectionp_connection_id](../backend/rpcs.md#accept_connectionp_connection_id)).
- **Empty states** — "You haven't been checked into a talk yet…" (no check-ins)
and "No one else was checked in here yet." (a talk with no other attendees).
Data: `getMyCheckins()` + `getTalkCohort()` + the agenda (via `useEvent()`).
## Feedback
A **full-screen takeover** (no tab bar), opened from the Agenda session sheet.
- Shows the session (slot · time · room · title).
- **1–5 star** rating + optional comment ("bonus points for details").
- On submit: `submitFeedback(sessionId, rating, comment)` → a success toast
("+N pts ⭐").
Data: `useEvent()` (session/slot) + `submitFeedback`.
## Leaderboard
The live leaderboard.
- **Podium** for the top 3 (1st/2nd/3rd bars), then the rest as ranked rows.
- **Staff are excluded** — only attendees appear (enforced in
`get_leaderboard()` / `_sync_leaderboard`).
- **Your row is highlighted** (`me`).
- **Live:** subscribes to Realtime `postgres_changes` on the `leaderboard` table
and re-fetches on any change — so it updates the moment points change anywhere.
```ts
supabase.channel('leaderboard-live')
.on('postgres_changes', { event: '*', schema: 'public', table: 'leaderboard' }, () => {
getLeaderboard().then(setRows);
})
.subscribe();
```
Data: `getLeaderboard()` (the `get_leaderboard()` RPC — initial + on each realtime
event). The `leaderboard` table is kept in sync transactionally by the RPCs — see
[../backend/schema.md#leaderboard--realtime-mirror](../backend/schema.md#leaderboard--realtime-mirror).
## Profile
- **Manfred** — a compact mascot beside the title uses one of four transparent
WebP poses from `apps/convivo/public/manfred`. A pose is selected randomly each
time Profile mounts, including returning from another tab or refreshing; it
stays stable during edits. Random selection can repeat the previous pose.
The full-resolution source PNGs live in [`assets/manfred/`](../../assets/manfred)
(outside any build context) — see that folder's README for the pose mapping.
- **Header** — avatar, name, email, registration-type pill, a **staff** pill
(only when `contact.is_admin` **and** the type isn't already `staff`, so it
never shows twice), and a points pill.
- **My QR code** — renders `registration.qr_token` (the token lives on the
registration, per event) as a scannable QR (`QrImage`). "Show this to staff for
check-in and to peers to connect."
- **Profile settings** — self-service card: a **LinkedIn** URL input plus two
**visibility toggles** ("Show my email" / "Show my LinkedIn") and a **Save
profile** button. Saving calls `update_my_profile` (the security-definer RPC,
since the `contacts` UPDATE policy is admin-only), then `refresh()` to reload
the contact. The toggles control what other attendees see — the public
projection (`lanyard_lookup` / `get_public_contacts`) nulls `linkedin_url` when
`show_linkedin` is off and omits the email when `show_email` is off.
- **Points breakdown** — sums `points_log` by category
(Session check-ins / Connections / Feedback / Other) + Total.
- **Log out** — `signOut()`.
Data: `useAuth()` (contact + registration + `refresh`) + `getMyPointsLog(email)`
+ `updateMyProfile(...)`.