fix(points): welcome check-in awards +10; add Sessions view, AI connection test, silent reload

The front-desk check-in set checked_in and printed badges but awarded nothing,
so the +10 depended on which check-in a person happened to get. Every award
path was reviewed:

- welcome_checkin awards +10 (category checkin) on a genuine first check-in and
  returns points + points_awarded; checkin_attendee and preview_welcome_checkin
  return points_awarded too.
- set_registration_checked_in(false) deleted all checkin points while keeping
  the checkins rows, and switching back on awarded nothing -- one mistaken
  toggle destroyed those points permanently. ON now recomputes from the rows
  that still exist and awards only the shortfall: reversible, still unfarmable.
- The staff/Admin/@appe.at exclusion stays (product decision) but is no longer
  silent: three-way points sheets in the scanner, "no points" with a tooltip in
  Registrations, and the Contacts points modal refuses to apply rather than
  letting adjust_points (void) no-op quietly.

Also in this change:
- admin silent refresh (5s poll + 500ms after writes) across all data views;
  Registrations patches in place so rows never slide under the cursor
- Settings "Validate AI connection" via a new sidecar POST /llm-test verdict
  endpoint (never leaks the key, distinguishes "no usage block" from "off")
- new Sessions view between Schedule and Activity: speakers, attendance,
  ratings, attendee filter, and one button that summarises every session with
  feedback (one request each, concurrency 3, UI blocked until all settle)
- provider requests disable thinking through one shared body builder sending
  both reasoning_effort:"none" and chat_template_kwargs.enable_thinking

SQL: 113 / 57 / 24 assertions (set_registration_checked_in section 3 was
rewritten, it asserted the bug). Sidecar 34 unit tests. Full e2e 202 passed,
0 failed. Migration applied locally only -- not deployed.
This commit is contained in:
Lago committed 2026-10-19 20:14:03 +02:00
1 parent 96e4e6a6ea
commit fdb6045966
35 files changed
+2778 -154

No files matched your search

+9
View File
@@ -178,6 +178,8 @@ export interface CheckinResult {
attendee_name: string;
points: number;
already: boolean;
/** False for staff / Admin contacts, who never earn points. */
points_awarded: boolean;
}
/** Result of a staff welcome check-in (marks an attendee present at the event). */
@@ -185,6 +187,11 @@ export interface WelcomeCheckinResult {
attendee_email: string;
attendee_name: string;
already: boolean;
/** Points balance after the check-in. */
points: number;
/** False when this person does not earn points (staff or Admin contact), so
* the sheet must not promise a +10 the database never granted. */
points_awarded: boolean;
}
/** Read-only preview of a welcome check-in (shown before confirming). */
@@ -196,6 +203,8 @@ export interface WelcomeCheckinPreview {
will_print: boolean;
/** How many labels confirming will print (0 when nothing prints). */
copies: number;
/** True when confirming will award check-in points (false for staff/Admin). */
points_awarded: boolean;
}
/** Result of accepting a connection (the connection row + the shared-talk flag). */
+19 -3
View File
@@ -226,9 +226,11 @@ export function Scan() {
<div className="sub">{checkin.already ? 'Already checked in' : 'Checked in'}</div>
<div style={{ marginTop: 14 }}>
{checkin.already ? (
<span className="pill amber">No extra points</span>
<span className="pill amber" data-testid="session-points">No extra points</span>
) : checkin.points_awarded ? (
<span className="pill green" data-testid="session-points">+10 pts · now {checkin.points}</span>
) : (
<span className="pill green">+10 pts · now {checkin.points}</span>
<span className="pill amber" data-testid="session-points">Checked in · staff earn no points</span>
)}
</div>
<button className="btn primary" style={{ marginTop: 18 }} onClick={() => setCheckin(null)}>
@@ -269,6 +271,12 @@ export function Scan() {
{!pendingWelcome.preview.will_print && !pendingWelcome.preview.already && (
<div className="muted small" style={{ marginTop: 6 }}>No badge will print (no layout for this event).</div>
)}
{pendingWelcome.preview.points_awarded && (
<div className="muted small" style={{ marginTop: 6 }}>Checking in awards +10 points.</div>
)}
{!pendingWelcome.preview.points_awarded && !pendingWelcome.preview.already && (
<div className="muted small" style={{ marginTop: 6 }}>This person does not earn points (staff or organiser).</div>
)}
<div style={{ marginTop: 16 }}>
<button className="btn primary" data-testid="welcome-checkin-confirm-yes" disabled={busy} onClick={confirmWelcome}>
{busy ? 'Checking in…' : 'Yes, check in'}
@@ -289,7 +297,15 @@ export function Scan() {
<h3 style={{ marginTop: 10 }}>{welcome.attendee_name}</h3>
<div className="sub">{welcome.already ? 'Already checked in to the event' : 'Welcome to the event!'}</div>
<div style={{ marginTop: 14 }}>
<span className="pill green">✓ Checked in</span>
{welcome.already ? (
<span className="pill amber" data-testid="welcome-points">No extra points</span>
) : welcome.points_awarded ? (
<span className="pill green" data-testid="welcome-points">+10 pts · now {welcome.points}</span>
) : (
// Staff / Admin contacts never earn points; say so instead of
// showing a +10 the database deliberately refused to award.
<span className="pill amber" data-testid="welcome-points">Checked in · staff earn no points</span>
)}
</div>
<button className="btn primary" style={{ marginTop: 18 }} onClick={() => setWelcome(null)}>
Scan next