feat(convivo): pending-material chip opens the session detail directly

Tapping a session in the red-clip popup only did go('agenda'), leaving the
speaker to hunt for the talk the popup had just named. It now opens the same
SessionDetail sheet "My picks today" uses -- the upload form is inside it, so
one tap reaches the action.

CONV-MATERIAL-005 provisions its own speaker fixture (the old demo speaker died
with the pretix-import reseed), drives the real QR login, and asserts the
upload notice is visible with the home tab still active; mutation-checked by
restoring go('agenda') -- the test fails on the old behavior.

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-10-19 21:40:56 +02:00
1 parent 23af4f3930
commit 9cd2f0b957
4 files changed
+93 -4

No files matched your search

+6 -1
View File
@@ -275,9 +275,14 @@ export function Home({ go, onEventFeedback, openFeedback }: { go: (tab: string)
<button <button
key={s.id} key={s.id}
className="pick-chip" className="pick-chip"
data-testid={`pending-material-${s.id}`}
onClick={() => { onClick={() => {
// Open this session's detail sheet directly — the same sheet
// "My picks today" opens — instead of dropping the speaker on
// the Agenda and making them hunt for the very talk they were
// just told about. The detail sheet carries the upload form.
setMaterialSheetOpen(false); setMaterialSheetOpen(false);
go('agenda'); setSelected(s);
}} }}
> >
<span className="t">{slot ? fmtRange(slot) : ''}</span> <span className="t">{slot ? fmtRange(slot) : ''}</span>
+5 -1
View File
@@ -100,7 +100,11 @@ The landing screen. Shows:
- **Greeting + pills** — "Good morning, Ana 👋" and, to the right, a **red - **Greeting + pills** — "Good morning, Ana 👋" and, to the right, a **red
material pill** `📎 {n}` (only for speakers who have one or more of their material pill** `📎 {n}` (only for speakers who have one or more of their
**non-service** sessions without material — tapping it opens a popup listing **non-service** sessions without material — tapping it opens a popup listing
the pending sessions) and the **points pill** `⚡ {points}` (tapping opens the the pending sessions; **tapping a session in that popup opens its detail sheet
directly**, the same one "My picks today" opens, *not* the Agenda tab — the
detail sheet is where the upload control lives, so the speaker lands on the
thing they can act on, not on a list they must search) and the **points pill**
`⚡ {points}` (tapping opens the
Leaderboard). The event name (`event.name`) is shown under the greeting. Leaderboard). The event name (`event.name`) is shown under the greeting.
- **Pending-feedback pill** — a full-width **"⭐ Rate your last session"** (or - **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 "Rate N sessions") button, shown only when the user is checked into one or more
+20
View File
@@ -639,3 +639,23 @@ transform — JS owns the final coordinates. All 6 call sites benefit.
answering with an array silently drops the app to the login screen, which answering with an array silently drops the app to the login screen, which
looks exactly like a broken tooltip. looks exactly like a broken tooltip.
- Full serial e2e: **211 passed, 0 failed.** - Full serial e2e: **211 passed, 0 failed.**
## Speaker flow: pending-material chip now opens the session itself
The red 📎 pill opened its popup, but tapping a session in it only did
`go('agenda')` — dropping the speaker on the Agenda list to hunt for the very
talk the popup had just named. It now sets `selected` and opens the same
`SessionDetail` sheet "My picks today" already uses; the upload form lives in
that sheet, so one tap reaches the action.
- `CONV-MATERIAL-005` (in `speaker-material.spec.ts`) drives the real backend:
provisions its own speaker on a real session without material, logs in through
the QR flow, clicks 📎 -> the session -> asserts `material-upload-notice` +
`material-upload` are visible and the **home tab is still active** (proving it
did not navigate away). **Validated by mutation: putting `go('agenda')` back
makes the test fail.**
- It is deliberately **self-contained** — the §27/§28 demo speaker
(`duncanboyne@hotmail.co.uk`) belongs to the old seed and no longer exists
since the pretix import, so the rest of that spec family only passes when an
earlier spec happens to provision the seed; the fixture-provisioning pattern
from `checkin-points.spec.ts` is the one that survives data changes.
+62 -2
View File
@@ -1,10 +1,10 @@
import path from 'node:path'; import path from 'node:path';
import { test, expect } from './base'; import { test, expect } from './base';
import { APP_URL, ID, SPEAKER_SESSION } from '../src/helpers/config'; import { APP_URL, ID, SPEAKER_SESSION, EVENT_ID, type Identity } from '../src/helpers/config';
import { login } from '../src/helpers/auth'; import { login } from '../src/helpers/auth';
import { createUser } from '../src/helpers/multi'; import { createUser } from '../src/helpers/multi';
import { signInJwt, userRpcResult } from '../src/helpers/api'; import { signInJwt, userRpcResult } from '../src/helpers/api';
import { db } from '../src/helpers/db'; import { db, psql, psqlScalar, sqlQuote } from '../src/helpers/db';
import { AppPage } from '../src/pages/AppPage'; import { AppPage } from '../src/pages/AppPage';
import { AgendaPage } from '../src/pages/AgendaPage'; import { AgendaPage } from '../src/pages/AgendaPage';
import { HomePage } from '../src/pages/HomePage'; import { HomePage } from '../src/pages/HomePage';
@@ -76,6 +76,66 @@ test.describe('Speaker + material upload', () => {
await expect(page.getByTestId('material-upload-notice')).toBeVisible(); await expect(page.getByTestId('material-upload-notice')).toBeVisible();
}); });
test('CONV-MATERIAL-005 the pending-material pill opens the session directly', async ({ page }) => {
// Self-contained fixture: the demo speaker of §27/§28 belongs to the old
// seed and no longer exists since the pretix import, so this test provisions
// its own speaker on a real session that has no material.
const email = '[email protected]';
const token = 'CVV-PENDING-PILL-01';
const session = psqlScalar(`select s.id || '|' || s.title from public.sessions s
join public.slots sl on sl.id = s.slot_id
join public.session_speakers sp on sp.session_id = s.id
where (s.material_path is null or s.material_path = '')
and sl.type <> 'service_session'
order by sl.id limit 1`).split('|')[0];
const title = psqlScalar(`select title from public.sessions where id = ${sqlQuote(session)}`);
psql(`insert into public.contacts (email, full_name, is_admin)
values (${sqlQuote(email)}, 'Pending Pill Speaker', false)
on conflict (email) do update set full_name = excluded.full_name`);
psql(`insert into public.registrations (event_id, contact_email, type, checked_in, points, qr_token)
values (${sqlQuote(EVENT_ID)}, ${sqlQuote(email)}, 'speaker', true, 0, ${sqlQuote(token)})
on conflict (event_id, contact_email)
do update set type = 'speaker', checked_in = true, qr_token = excluded.qr_token`);
psql(`insert into public.session_speakers (session_id, contact_email)
values (${sqlQuote(session)}, ${sqlQuote(email)}) on conflict do nothing`);
// Auth user, password = QR token (same trick ensureSponsor uses).
psql(`insert into auth.users (instance_id, id, aud, role, email, encrypted_password, email_confirmed_at,
confirmation_token, email_change_token_new, email_change, recovery_token, reauthentication_token,
phone_change_token, raw_app_meta_data, raw_user_meta_data, created_at, updated_at)
values ('00000000-0000-0000-0000-000000000000', gen_random_uuid(), 'authenticated', 'authenticated',
${sqlQuote(email)}, extensions.crypt(${sqlQuote(token)}, extensions.gen_salt('bf')), now(),
'', '', '', '', '', '', '{\"provider\":\"email\",\"providers\":[\"email\"]}', '{}', now(), now())
on conflict (email) where is_sso_user = false do update
set encrypted_password = extensions.crypt(${sqlQuote(token)}, extensions.gen_salt('bf'))`);
try {
const app = new AppPage(page, APP_URL);
const home = new HomePage(page);
await login(page, APP_URL, { email, qrToken: token, type: 'speaker' } as Identity);
await app.waitForAdmitted();
// Red clip -> the pending-material sheet, listing this session.
await expect(home.materialPill()).toBeVisible();
await home.materialPill().click();
await expect(page.getByText('Pending material')).toBeVisible();
// Clicking the session opens THAT session's detail sheet with the upload
// form in place — not the Agenda tab, which used to drop the speaker there
// and make them hunt for the talk they were just told about.
await page.locator('.pick-chip').filter({ hasText: title }).click();
await expect(page.getByTestId('material-upload-notice')).toBeVisible();
await expect(page.getByTestId('material-upload')).toBeVisible();
// Still on Home: the sheet opened over it, the tab bar never moved.
await expect(page.getByTestId('tab-home')).toHaveClass(/active/);
} finally {
psql(`delete from public.session_speakers where contact_email = ${sqlQuote(email)}`);
psql(`delete from public.registrations where contact_email = ${sqlQuote(email)}`);
psql(`delete from public.contacts where email = ${sqlQuote(email)}`);
psql(`delete from auth.users where email = ${sqlQuote(email)}`);
}
});
test('CONV-MATERIAL-002 speaker uploads material and it persists across reload', async ({ page }) => { test('CONV-MATERIAL-002 speaker uploads material and it persists across reload', async ({ page }) => {
const app = new AppPage(page, APP_URL); const app = new AppPage(page, APP_URL);
const agenda = new AgendaPage(page); const agenda = new AgendaPage(page);