diff --git a/README.md b/README.md
index d089d15..df9f477 100644
--- a/README.md
+++ b/README.md
@@ -75,7 +75,7 @@ npm run seed
`npm run dev` serves the site on `127.0.0.1` at `BASE_URL` (from `.env`, `http://127.0.0.1:3000`). It is loopback only. Stop it with Ctrl+C.
-Open `/` for the weekly pantry sign-up page. **View** starts on **List**: a card for each day with a shift in the next three months, split into that day's shifts. Each shift lists the names of the people who are signed up. A shift that has already ended stays on that day's card, grayed out, until midnight in the event's time zone. At midnight the day leaves the list. Emails, phone numbers, and notes stay off the page. **Calendar** is the other choice in that menu, at `/?view=calendar`, and it stops at that same three-month date. A shift later than that date is left off both views, and the signup form does not take a reservation for it. `/e/weekly-pantry` is the same seeded event. `/healthz` returns `{"ok":true,"database":"ok"}` and nothing else. A shift shows how many spots are filled, such as 3/5 spots filled. A shift with space left uses a soft green label. A full shift uses a soft red label.
+Open `/` for the weekly pantry sign-up page. **View** starts on **List**: a card for each day with a shift in the next three months, split into that day's shifts. Each shift lists the names of the people who are signed up. A shift that has already ended stays on that day's card, grayed out, until midnight in the event's time zone. At midnight the day leaves the list. Emails, phone numbers, and notes stay off the page. **Calendar** is the other choice in that menu, at `/?view=calendar`, and it stops at that same three-month date. A shift later than that date is left off both views, and the signup form does not take a reservation for it. `/e/weekly-pantry` is the same seeded event. `/healthz` returns `{"ok":true,"database":"ok"}` and nothing else. A shift shows how many spots are filled, such as 3 of 5 spots filled. A shift with space left uses a soft green label. A full shift uses a soft red label. Coordinator lists use the same count with the state first, such as 2 open · 3 of 5 or Full · 5 of 5.
An open shift has a signup form. It asks for a first name, last name, email, and phone, with optional notes. **How many people** offers 1 to 20, and never more than the spots left. A signup for 3 people fills 3 spots, and only the person signing up is named. The form also lists every other open shift on the public list, from any published event, and up to 24 can be ticked in one submit. Full, ended, cancelled, and not-yet-open shifts are left out. Each date is its own signup, with its own confirmation email and private link. If any date cannot be saved, none are, and the form says which date to leave unchecked. Another person can use the same email and takes their own signup. The same person cannot sign up twice for one shift. The form needs JavaScript because of the Turnstile check. Wait a few seconds after the page loads before submitting. The confirmation page shows a private link and says a confirmation email is on the way. That page works without JavaScript. Cancel this signup there to open the spot again. A cancellation email is queued, and a confirmation that has not been sent yet is dropped. That person can sign up again once the cancellation is saved. Someone else can use the email while the first signup is still confirmed. A cancelled signup stays on that private page until the link expires. A private link controls only that signup. Use the separate link for each signup. On that page, **How many people** changes the party size. A larger number needs that many spots open. A smaller number gives spots back. Coordinators get an email when the count changes.
diff --git a/public/css/app.css b/public/css/app.css
index d25fcc0..a02c4c0 100644
--- a/public/css/app.css
+++ b/public/css/app.css
@@ -39,6 +39,9 @@
--hope-full-edge: #e4c4be;
--hope-blue-quiet: #d7ebf8;
--hope-blue-quiet-ink: #2d5f86;
+ /* Smallest text in the app. Footer fine print may use --hope-text-fine. */
+ --hope-text-small: 0.875rem;
+ --hope-text-fine: 13px;
--hope-scrollbar-size: 14px;
--hope-scrollbar-thumb: var(--hope-gold);
--hope-scrollbar-thumb-hover: color-mix(in srgb, var(--hope-gold) 72%, var(--hope-ink));
@@ -1184,7 +1187,7 @@ main a:hover {
.roster-label {
margin: 0.75rem 0 0.2rem;
color: var(--hope-ink-2);
- font-size: 0.82rem;
+ font-size: var(--hope-text-small);
font-weight: 650;
letter-spacing: 0.04em;
text-transform: uppercase;
@@ -1292,7 +1295,7 @@ main a:hover {
.cal-weekdays {
margin: 0.55rem 0 0.35rem;
text-align: center;
- font-size: 0.82rem;
+ font-size: var(--hope-text-small);
font-weight: 650;
color: var(--hope-ink-2);
}
@@ -1406,7 +1409,7 @@ main a:hover {
background: var(--hope-blue-50);
border: 1px solid var(--hope-gold);
border-radius: 999px;
- font-size: 0.68rem;
+ font-size: var(--hope-text-small);
font-weight: 700;
line-height: 1.4;
}
@@ -1452,7 +1455,7 @@ main a:hover {
padding: 0.08rem 0.28rem;
border-radius: 0.35rem;
background: var(--hope-yellow);
- font-size: 0.78rem;
+ font-size: var(--hope-text-small);
font-weight: 650;
line-height: 1.35;
}
@@ -1727,7 +1730,7 @@ article.shift-card {
justify-content: center;
gap: 0;
cursor: default;
- font-size: 0.85rem;
+ font-size: var(--hope-text-small);
font-weight: 500;
line-height: 1.25;
}
@@ -2364,7 +2367,7 @@ article.shift-card {
border: 1px solid #e4edf5;
box-shadow: none;
color: #4a5563;
- font-size: 0.75rem;
+ font-size: var(--hope-text-small);
font-weight: 500;
line-height: 1.2;
}
@@ -3373,7 +3376,7 @@ button.btn-quiet::before {
.need-day-count {
margin: 0;
- font-size: 0.82rem;
+ font-size: var(--hope-text-small);
font-weight: 650;
white-space: nowrap;
}
@@ -3516,7 +3519,7 @@ button.btn-quiet::before {
.desk-row-copy span {
color: #7d8b99;
- font-size: 0.86rem;
+ font-size: var(--hope-text-small);
}
.desk-row::after {
@@ -3539,7 +3542,7 @@ button.btn-quiet::before {
padding: 0.12rem 0.7rem;
border: 1px solid transparent;
border-radius: 999px;
- font-size: 0.82rem;
+ font-size: var(--hope-text-small);
font-weight: 650;
line-height: 1.2;
white-space: nowrap;
@@ -4009,7 +4012,7 @@ button.btn-quiet::before {
.admin-you {
margin-left: 0.45rem;
- font-size: 0.85rem;
+ font-size: var(--hope-text-small);
font-weight: 650;
}
@@ -4101,7 +4104,7 @@ button.btn-quiet::before {
}
.equal-text {
- font-size: 12.5px;
+ font-size: var(--hope-text-fine);
color: #444;
}
@@ -4454,7 +4457,7 @@ button.btn-quiet::before {
@media (max-width: 33em) {
.header,
.footer {
- font-size: 13.824px;
+ font-size: var(--hope-text-small);
}
.nav {
@@ -4486,14 +4489,14 @@ button.btn-quiet::before {
}
.equal-text {
- font-size: 9.6px;
+ font-size: var(--hope-text-fine);
}
.copyright-text {
display: flex;
flex-direction: column;
align-items: center;
- font-size: 11.52px;
+ font-size: var(--hope-text-fine);
}
.social-links {
@@ -4956,12 +4959,12 @@ main > .crumb,
display: inline-flex;
align-items: center;
flex: none;
- min-height: 1.4rem;
+ min-height: 1.6rem;
padding: 0.05rem 0.55rem;
border-radius: 999px;
background: #e7edf2;
color: #5c6770;
- font-size: 0.75rem;
+ font-size: var(--hope-text-small);
font-weight: 650;
line-height: 1.2;
}
@@ -5133,7 +5136,7 @@ main > .crumb,
}
.event-fields .hint {
- font-size: 0.86rem;
+ font-size: var(--hope-text-small);
line-height: 1.4;
color: #5c6b78;
}
@@ -5216,7 +5219,7 @@ main > .crumb,
}
.event-panel-tools .pick-all {
- font-size: 0.8rem;
+ font-size: var(--hope-text-small);
color: #7d8b99;
}
@@ -5322,12 +5325,12 @@ main > .crumb,
.help-tip > summary {
display: grid;
place-items: center;
- width: 1.15rem;
- height: 1.15rem;
+ width: 1.4rem;
+ height: 1.4rem;
border: 1.5px solid #b7c3cc;
border-radius: 999px;
color: #8b98a6;
- font-size: 0.72rem;
+ font-size: var(--hope-text-small);
font-weight: 700;
line-height: 1;
list-style: none;
@@ -5355,7 +5358,7 @@ main > .crumb,
border-radius: 0.75rem;
box-shadow: 0 8px 24px rgb(34 55 70 / 0.12);
color: #44515c;
- font-size: 0.86rem;
+ font-size: var(--hope-text-small);
font-weight: 400;
letter-spacing: 0;
line-height: 1.45;
@@ -5430,14 +5433,14 @@ main > .crumb,
display: grid;
justify-items: center;
flex: none;
- width: 2.6rem;
+ width: 3rem;
line-height: 1.05;
}
.shift-dow,
.shift-mon {
color: #8b98a6;
- font-size: 0.68rem;
+ font-size: var(--hope-text-small);
font-weight: 700;
letter-spacing: 0.04em;
}
@@ -5462,7 +5465,7 @@ main > .crumb,
.shift-copy span {
color: #7d8b99;
- font-size: 0.86rem;
+ font-size: var(--hope-text-small);
line-height: 1.3;
}
@@ -5476,7 +5479,7 @@ main > .crumb,
padding: 0.12rem 0.7rem;
border: 1px solid transparent;
border-radius: 999px;
- font-size: 0.82rem;
+ font-size: var(--hope-text-small);
font-weight: 650;
line-height: 1.2;
white-space: nowrap;
@@ -5624,7 +5627,7 @@ main > .crumb,
padding: 0;
list-style: none;
color: #7d8b99;
- font-size: 0.8rem;
+ font-size: var(--hope-text-small);
}
.fill-legend li {
@@ -5676,7 +5679,7 @@ main > .crumb,
.repeat-copy span {
color: #7d8b99;
- font-size: 0.86rem;
+ font-size: var(--hope-text-small);
line-height: 1.3;
}
diff --git a/src/admin-pages.tsx b/src/admin-pages.tsx
index 479472f..a5138f8 100644
--- a/src/admin-pages.tsx
+++ b/src/admin-pages.tsx
@@ -1,6 +1,6 @@
import { Temporal } from '@js-temporal/polyfill';
import { DESK_WINDOW_DAYS, type AdminEvent, type HomeEvent, type HomeShift, type AdminShift, type AdminShiftSummary, type AdminTemplate, type MoveTarget, type RosterPerson } from './admin/store.js';
-import { spotsSentence } from './schedule.js';
+import { fillLabel, spotsSentence } from './schedule.js';
import type { EventValues, ShiftValues, TemplateValues } from './admin/forms.js';
import { MAX_REMINDER_HOURS, MAX_RETENTION_MONTHS, type SettingsErrors, type SettingsForm } from './settings.js';
import type { AppConfig } from './config.js';
@@ -1251,7 +1251,7 @@ function ShiftNeedList(props: { config: AppConfig; shifts: HomeShift[]; today: s
function NeedShift(props: { config: AppConfig; shift: HomeShift; today: string }) {
const shift = props.shift;
- const need = shift.full ? { tone: 'full' as const, text: 'Full' } : needCopy(shift.occupied, shift.capacity);
+ const need = fillLabel(shift);
const when = shiftWhen(shift.date, shift.timeLabel, props.today);
return (
@@ -1333,16 +1333,6 @@ function eventSummary(event: HomeEvent, today: string): string {
return `Next shift ${when} · ${count}`;
}
-function needCopy(occupied: number, capacity: number): { text: string; tone: 'open' | 'needs' } {
- const filled = Math.min(capacity, Math.max(0, occupied));
- const open = Math.max(0, capacity - filled);
- const needs = open * 2 > capacity;
- return {
- tone: needs ? 'needs' : 'open',
- text: needs ? `Needs ${open} · ${filled} of ${capacity}` : `${open} open · ${filled} of ${capacity}`,
- };
-}
-
function shiftWhen(date: string, timeLabel: string, today: string): string {
if (date === today) return `Today, ${timeLabel}`;
return `${shortDate(date)}, ${timeLabel}`;
@@ -1555,7 +1545,7 @@ function EventNeedShift(props: { config: AppConfig; eventTitle: string; shift: A
const open = Boolean(props.now && !shift.cancelled && !ended);
const time = clockLabel(shift.start);
const when = shiftWhen(shift.date, time, props.today);
- const need = ended ? { tone: 'hidden' as const, text: 'Ended' } : shift.occupied >= shift.capacity ? { tone: 'full' as const, text: 'Full' } : needCopy(shift.occupied, shift.capacity);
+ const need = ended ? { tone: 'hidden' as const, text: 'Ended' } : fillLabel(shift);
const rowClass = ended ? 'desk-row is-ended' : 'desk-row';
return (
@@ -2274,9 +2264,5 @@ function shiftClockLine(shift: Pick
function fillStatus(shift: Pick): { tone: 'full' | 'open' | 'needs' | 'cancelled'; text: string } {
if (shift.cancelled) return { tone: 'cancelled', text: 'Cancelled' };
- const filled = Math.min(shift.capacity, Math.max(0, shift.occupied));
- const open = Math.max(0, shift.capacity - filled);
- if (open === 0) return { tone: 'full', text: `Full · ${filled} of ${shift.capacity}` };
- if (open * 2 > shift.capacity) return { tone: 'needs', text: `Needs ${open} · ${filled} of ${shift.capacity}` };
- return { tone: 'open', text: `${open} open · ${filled} of ${shift.capacity}` };
+ return fillLabel(shift);
}
diff --git a/src/schedule.ts b/src/schedule.ts
index 0f2708c..3892a8c 100644
--- a/src/schedule.ts
+++ b/src/schedule.ts
@@ -232,9 +232,29 @@ function dateChoice(shift: PublicShift): SignupDateChoice {
};
}
-export function spotsSentence(shift: Pick): string {
+/** "4 of 6". Every page counts filled spots this one way. */
+export function filledCount(shift: Pick): string {
const filled = Math.min(shift.capacity, Math.max(0, shift.occupied));
- return `${filled}/${shift.capacity} spots filled`;
+ return `${filled} of ${shift.capacity}`;
+}
+
+/** Volunteer pages and the roster heading: "4 of 6 spots filled". */
+export function spotsSentence(shift: Pick): string {
+ return `${filledCount(shift)} spots filled`;
+}
+
+export type FillTone = 'full' | 'open' | 'needs';
+
+/**
+ * Coordinator list pills: the state first, then the count.
+ * "Full · 6 of 6" or "2 open · 4 of 6". A shift less than half filled uses the needs tone.
+ */
+export function fillLabel(shift: Pick): { tone: FillTone; text: string } {
+ const filled = Math.min(shift.capacity, Math.max(0, shift.occupied));
+ const open = Math.max(0, shift.capacity - filled);
+ const count = filledCount(shift);
+ if (open === 0) return { tone: 'full', text: `Full · ${count}` };
+ return { tone: open * 2 > shift.capacity ? 'needs' : 'open', text: `${open} open · ${count}` };
}
/** One roster line. A signup that holds several spots stays one name, with the count beside it. */
diff --git a/tests/admin.test.ts b/tests/admin.test.ts
index 53e8f78..c23575f 100644
--- a/tests/admin.test.ts
+++ b/tests/admin.test.ts
@@ -266,7 +266,7 @@ describe('coordinator screens', () => {
expect(html).toContain('Today, 4:00 PM');
expect(html).toContain('2 open · 4 of 6');
expect(html).toContain('Tue, Oct 27, 4:00 PM');
- expect(html).toContain('Needs 4 · 2 of 6');
+ expect(html).toContain('4 open · 2 of 6');
expect(html).toContain('Sat, Oct 24 Sorting crew is full.');
expect(html).toContain('Wed, Oct 28, 9:00 AM');
expect(html).not.toContain('Later shift');
@@ -589,7 +589,7 @@ describe('coordinator screens', () => {
expect(roster).not.toContain('No-show');
const sourceRoster = await (await app.request(`/admin/shifts/${sourceId}`, { headers: { cookie } })).text();
expect(sourceRoster).not.toContain(`/admin/signups/${signupId}/move`);
- expect(sourceRoster).toContain('0/2 spots filled');
+ expect(sourceRoster).toContain('0 of 2 spots filled');
expect(sourceRoster).toContain('event-pill is-open');
const home = await (await app.request('/e/pantry?view=calendar')).text();
const shiftPage = await (await app.request(`/s/${destinationId}`)).text();
diff --git a/tests/cancel.test.ts b/tests/cancel.test.ts
index 78da06c..f5711c7 100644
--- a/tests/cancel.test.ts
+++ b/tests/cancel.test.ts
@@ -48,7 +48,7 @@ describe('manage-link cancellation', () => {
expect(before.created_at).toBe(before.updated_at);
const full = await app.request(`/s/${shiftId}`);
- expect(await full.text()).toContain('1/1 spots filled');
+ expect(await full.text()).toContain('1 of 1 spots filled');
const cancelled = await postCancel(app, managePath, token);
expect(cancelled.status).toBe(303);
@@ -73,7 +73,7 @@ describe('manage-link cancellation', () => {
const open = await app.request(`/s/${shiftId}`);
const openHtml = await open.text();
- expect(openHtml).toContain('0/1 spots filled');
+ expect(openHtml).toContain('0 of 1 spots filled');
expect(openHtml).not.toContain('pat.cancel@example.invalid');
const again = await postCancel(app, managePath, token, { ip: '203.0.113.71' });
@@ -87,7 +87,7 @@ describe('manage-link cancellation', () => {
{ status: 'cancelled' },
{ status: 'confirmed' },
]);
- expect((await (await app.request(`/s/${shiftId}`)).text())).toContain('1/1 spots filled');
+ expect((await (await app.request(`/s/${shiftId}`)).text())).toContain('1 of 1 spots filled');
const listed = await (await app.request('/?view=calendar')).text();
expect(listed).toContain('Pat Cancel');
expect(listed).not.toContain('pat.cancel@example.invalid');
@@ -215,8 +215,8 @@ describe('manage-link switch', () => {
const home = await (await app.request('/?view=calendar')).text();
expect(home).not.toContain('pat.switch@example.invalid');
expect(home).toContain('Pat Cancel');
- expect(home).toContain('0/2 spots filled');
- expect(home).toContain('1/2 spots filled');
+ expect(home).toContain('0 of 2 spots filled');
+ expect(home).toContain('1 of 2 spots filled');
const again = await postSwitch(app, managePath, html, String(destinationId));
expect(again.status).toBe(200);
@@ -376,7 +376,7 @@ describe('manage-link party size', () => {
}]);
expect(db.prepare('SELECT COUNT(*) AS n FROM contacts').get()).toEqual({ n: 1 });
expect(db.prepare("SELECT kind, status FROM outbox").all()).toEqual([{ kind: 'confirmation', status: 'pending' }]);
- expect(await (await app.request(`/s/${shiftId}`)).text()).toContain('1/6 spots filled');
+ expect(await (await app.request(`/s/${shiftId}`)).text()).toContain('1 of 6 spots filled');
const board = await (await app.request('/?view=calendar')).text();
expect(board).toContain('Pat Party');
expect(board).not.toContain('Pat Party (4 people)');
@@ -404,7 +404,7 @@ describe('manage-link party size', () => {
{ name: 'Pat Party', group_size: 3 },
{ name: 'Sam Other', group_size: 1 },
]);
- expect(await (await tight.app.request(`/s/${tight.shiftId}`)).text()).toContain('4/4 spots filled');
+ expect(await (await tight.app.request(`/s/${tight.shiftId}`)).text()).toContain('4 of 4 spots filled');
const wide = await buildApp({ capacity: 25 });
const opened = await postSignup(wide.app, wide.shiftId, { name: 'Pat Party', email: 'pat.wide@example.invalid', partySize: '1' }, '203.0.113.122');
@@ -426,7 +426,7 @@ describe('manage-link party size', () => {
group_size: 20,
status: 'confirmed',
}]);
- expect(await (await wide.app.request(`/s/${wide.shiftId}`)).text()).toContain('20/25 spots filled');
+ expect(await (await wide.app.request(`/s/${wide.shiftId}`)).text()).toContain('20 of 25 spots filled');
});
it('refuses a party update that did not come from this signup page', async () => {
diff --git a/tests/design-rules.test.ts b/tests/design-rules.test.ts
new file mode 100644
index 0000000..b569cbd
--- /dev/null
+++ b/tests/design-rules.test.ts
@@ -0,0 +1,36 @@
+import fs from 'node:fs';
+import path from 'node:path';
+import { describe, expect, it } from 'vitest';
+import { fillLabel, spotsSentence } from '../src/schedule.js';
+
+const css = fs.readFileSync(path.join(import.meta.dirname, '..', 'public', 'css', 'app.css'), 'utf8');
+
+/** Smallest text in the app is 14px. Footer fine print may use 13px. */
+function pixels(value: string): number | null {
+ const match = /^([0-9.]+)(rem|px)$/.exec(value.trim());
+ if (!match) return null;
+ return match[2] === 'rem' ? Number(match[1]) * 16 : Number(match[1]);
+}
+
+describe('design rules', () => {
+ it('keeps text at 14px or larger', () => {
+ const small = [...css.matchAll(/font-size:\s*([^;]+);/g)]
+ .map((match) => match[1] ?? '')
+ .filter((value) => {
+ const px = pixels(value);
+ return px !== null && px < 14;
+ });
+ expect(small).toEqual([]);
+ expect(css).toContain('--hope-text-small: 0.875rem;');
+ expect(css).toContain('--hope-text-fine: 13px;');
+ });
+
+ it('counts filled spots the same way everywhere', () => {
+ expect(spotsSentence({ occupied: 4, capacity: 6 })).toBe('4 of 6 spots filled');
+ expect(spotsSentence({ occupied: 9, capacity: 6 })).toBe('6 of 6 spots filled');
+ expect(fillLabel({ occupied: 6, capacity: 6 })).toEqual({ tone: 'full', text: 'Full · 6 of 6' });
+ expect(fillLabel({ occupied: 4, capacity: 6 })).toEqual({ tone: 'open', text: '2 open · 4 of 6' });
+ expect(fillLabel({ occupied: 3, capacity: 6 })).toEqual({ tone: 'open', text: '3 open · 3 of 6' });
+ expect(fillLabel({ occupied: 2, capacity: 6 })).toEqual({ tone: 'needs', text: '4 open · 2 of 6' });
+ });
+});
diff --git a/tests/public-pages.test.ts b/tests/public-pages.test.ts
index c7f89ce..e7bfa90 100644
--- a/tests/public-pages.test.ts
+++ b/tests/public-pages.test.ts
@@ -40,8 +40,8 @@ describe('public pages', () => {
expect(home.headers.get('x-robots-tag')).toBe('noindex');
expect(html).toContain('class="roster-mark" src="/img/sunburst.png?v=');
expect(html).toContain('Live Greeting');
- expect(html).toContain('0/2 spots filled');
- expect(html).toContain('1/4 spots filled');
+ expect(html).toContain('0 of 2 spots filled');
+ expect(html).toContain('1 of 4 spots filled');
expect(html).toContain('9:00 AM');
expect(html).toContain('CDT');
expect(html).toContain('October 14');
@@ -131,8 +131,8 @@ describe('public pages', () => {
expect(calendar).toContain('October 2026');
expect(calendar).toContain('Open Sorting');
expect(calendar).toContain('Full Intake');
- expect(calendar).toContain('1/3 spots filled');
- expect(calendar).toContain('1/1 spots filled');
+ expect(calendar).toContain('1 of 3 spots filled');
+ expect(calendar).toContain('1 of 1 spots filled');
expect(calendar).toContain('class="cal-line"');
expect(calendar).toContain('Past Setup');
expect(calendar).toContain('class="cal-shift is-ended"');
@@ -161,7 +161,7 @@ describe('public pages', () => {
const shiftMain = shiftHtml.slice(shiftHtml.indexOf(' {
const full = await app.request(`/s/${ids.full}`);
const fullHtml = await full.text();
- expect(fullHtml).toContain('1/1 spots filled');
+ expect(fullHtml).toContain('1 of 1 spots filled');
expect(fullHtml).toContain('spots is-full');
expect(fullHtml).not.toContain('