feat: enhance user interaction with contact details and improved UI elements

Updated the signup and management pages to include clickable email and phone links for better user accessibility. Introduced new styles for roster management, including a collapsible move form for shift changes. Enhanced confirmation messages for cancellations and improved print styles to hide unnecessary elements. Added error handling for the Turnstile widget in the signup dialog, ensuring fallback options are visible when needed. Updated tests to verify the new features and ensure robust functionality across the application.
This commit is contained in:
blake committed 2026-11-02 15:17:51 -06:00
1 parent e6f072dcac
commit 38c08cf872
12 files changed
+251 -86

No files matched your search

+3
View File
@@ -526,6 +526,9 @@ describe('coordinator screens', () => {
expect(optionValues(html, 'destination')).toEqual([String(destinationId)]);
expect(html).toContain('<optgroup label="Friday, October 23, 2026">');
expect(html).toContain('>Distribution, October 23, 2026, 9:00 AM to 12:00 PM CDT<');
expect(html).toContain('href="mailto:kim@example.invalid"');
expect(html).toContain('href="tel:+17125550199"');
expect(html).toContain('>Move to another shift</summary>');
const moved = await postMove(app, cookie, signupId, html, String(destinationId));
expect(moved.status).toBe(303);
expect(moved.headers.get('location')).toBe(`/admin/shifts/${destinationId}?notice=moved`);
+5 -1
View File
@@ -36,7 +36,11 @@ describe('manage-link cancellation', () => {
};
const viewed = await app.request(managePath);
expect(viewed.status).toBe(200);
expect(await viewed.text()).toContain('Cancel this signup');
const viewedHtml = await viewed.text();
expect(viewedHtml).toContain('Cancel this signup');
expect(viewedHtml).toContain('>Cancel<');
expect(viewedHtml).toContain('>9:00 AM</time> to <time dateTime="12:00">12:00 PM</time>');
expect(viewedHtml).not.toContain('queues a change email');
expect(db.prepare('SELECT status, updated_at FROM signups').get()).toEqual({
status: 'confirmed',
updated_at: before.updated_at,
+13
View File
@@ -168,6 +168,17 @@ describe('public pages', () => {
expect(shiftHtml).toContain('name="last_name"');
expect(shiftHtml).toContain('First name');
expect(shiftHtml).toContain('Last name');
expect(shiftHtml).toContain('9:00 AM to 12:00 PM');
expect(shiftHtml).toMatch(/id="signup-email"[^>]*required/);
expect(shiftHtml).toContain('Signing up needs JavaScript. Call the pantry at');
expect(shiftHtml).toContain('712\u2011540\u20119351');
expect(shiftHtml).toContain('href="tel:+17125409351"');
expect(shiftHtml).toContain('href="mailto:hopepantry@gmail.com"');
expect(shiftHtml).toContain('data-turnstile-fallback');
expect(shiftHtml).toContain('The signup check could not load.');
expect(shiftHtml).not.toContain('has not published a contact method');
expect(shiftHtml).not.toContain('abuse check');
expect(shiftHtml).not.toContain('This check confirms the signup came from a browser');
expect(shiftHtml).toContain('class="signup-note">Your full name is listed on the public sign-up page. Email, phone, and notes stay off that page.');
expect(shiftHtml).not.toContain('name="robots"');
expect(shift.headers.get('x-robots-tag')).toBeNull();
@@ -176,6 +187,8 @@ describe('public pages', () => {
expect(shiftHtml).not.toContain('data-guardian');
expect(shiftHtml).not.toContain('I am under 18');
const css = await (await app.request('/css/app.css')).text();
expect(css).toContain('@media print');
expect(css).toContain('.roster-move');
expect(css).toContain('grid-template-columns: repeat(4, minmax(0, 1fr))');
expect(css).toContain('grid-template-columns: repeat(2, minmax(0, 1fr))');
expect(css).not.toContain('minmax(16rem, 1fr)');
+2
View File
@@ -273,6 +273,8 @@ describe('reminder mail', () => {
const confirmHtml = await confirm.text();
expect(confirmHtml).toContain('Are you sure you want to cancel?');
expect(confirmHtml).toContain('Cancel this signup to open the spot for someone else.');
expect(confirmHtml).toContain('We&#39;ll email you when it&#39;s cancelled.');
expect(confirmHtml).toContain('>9:00 AM</time> to <time dateTime="12:00">12:00 PM</time>');
expect(confirmHtml).toContain('Pat Review');
expect(confirmHtml).toContain('Sorting');
expect(db.prepare(`SELECT status FROM signups`).get()).toEqual({ status: 'confirmed' });