Skip to content

Ask students to re-enter a possibly wrong name at their next scan - #41

Merged
gbyo merged 1 commit into
mainfrom
gibby/name-check
Oct 12, 2026
Merged

gbyo merged 1 commit into
mainfrom
gibby/name-check

Conversation

@gbyo

@gbyo gbyo commented Oct 12, 2026

Copy link
Copy Markdown
Member

Summary

For students whose name is on file wrong when staff don't know the right one.

  • Dashboard: the student profile has a new Ask to confirm name button.
    • While a request is pending, the profile shows a banner with a Cancel button.
    • The Students list shows a Name check badge and has a "Name check pending" filter.
  • Kiosk: on that student's next scan, a Quick name check screen says "Your name may be entered incorrectly. Can you re-enter it?" and shows the name on file.
    • The first and last name fields start empty, so students type their real name rather than tapping past the wrong one.
    • Save my name updates the record, clears the request, and continues where the scan was going: the reasons screen for a check-in, or "See you next time" for a checkout.
    • Skip for now, or letting the 60-second timer run out, leaves the request for their next visit.
  • Archive: saving sends a STUDENT_NAME_CONFIRMED event to Google Sheets with the previous name, for example "Re-entered at the kiosk; was Leo Nelson". The Apps Script receiver logs unknown event types in the Events tab and leaves the Visit Log alone.
  • Schema: adds a library_students.name_check_requested_at column. It's applied by the existing on-request migration and is also added to library-schema.sql.
  • API:
    • new kiosk route POST /api/library/confirm-name;
    • new staff route admin-name-check;
    • scan responses now include a nameCheck field.

Testing

In wrangler dev against a seeded local D1 database:

  • Requesting a check from the API, then scanning at the kiosk, shows the prompt. Entering a new name updates the record ("Welcome, Leon!"), clears the request, and queues the Sheets event with the old name.
  • Requesting again, checking in, then scanning to check out shows the prompt. Skip for now finishes the checkout and leaves the request pending.
  • In the dashboard: the filter, the badge, the profile banner, Cancel, and requesting again all work.

🤖 Generated with Claude Code

A librarian can choose "Ask to confirm name" on a student's profile.
The next time that student scans, the kiosk says their name may be
entered incorrectly and asks them to re-enter it before continuing to
check-in or finishing the checkout. The fields start empty so students
type their real name instead of tapping past the wrong one; "Skip for
now" leaves the request for the following visit.

Saving updates the student record, clears the request, and sends a
STUDENT_NAME_CONFIRMED event to the Sheets archive with the old name.
The Students list gets a "Name check pending" filter and badge. Stored
in a new library_students.name_check_requested_at column, added by the
existing on-request migration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added area:docs Documentation changes area:source Changes to application source code labels Oct 12, 2026
@gbyo
gbyo merged commit 232cdcd into main Oct 12, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:docs Documentation changes area:source Changes to application source code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant