feat: coordinator dropdown replaces the tab row

- pages.tsx: when signed in, the Coordinator pill in the session bar is a
  <details> menu with Shifts, Contacts and Settings, the current section
  marked. Signed out it stays a plain link to sign-in. Off coordinator pages
  no section is marked current. CoordinatorTabs is removed.
- Phones and tablets (75em and below): no nested menu inside the hamburger
  overlay; the three sections show as a second row under Sign Up / Log out.
- app.css: .coord-menu and .session-sections styles; drop .desk-tabs.
- enhance.js: the menu closes on outside click and Esc, like the View menu.
- tests: admins.test.ts checks the menu, the phone row, the signed-out link,
  and no current section on a public page.
This commit is contained in:
Cosmically Creative committed 2026-11-20 13:24:23 -06:00
1 parent c4fe911969
commit c576613b9d
4 files changed
+218 -90

No files matched your search

+14 -1
View File
@@ -24,6 +24,11 @@ describe('administrators', () => {
const page = await app.request('/admin/admins');
expect(page.status).toBe(303);
expect(page.headers.get('location')).toBe('/login');
const login = await app.request('/login');
expect(login.status).toBe(200);
const loginHtml = await login.text();
expect(loginHtml).toContain('session-entry');
expect(loginHtml).not.toContain('coord-menu');
const posted = await app.request('/admin/admins', {
method: 'POST',
headers: { origin: ORIGIN, 'content-type': 'application/x-www-form-urlencoded' },
@@ -38,10 +43,18 @@ describe('administrators', () => {
const cookie = await signIn(app, db, 'coordinator@example.invalid');
const home = await app.request('/admin', { headers: { cookie } });
const homeHtml = await home.text();
expect(homeHtml).toContain('<nav class="desk-tabs" aria-label="Coordinator">');
expect(homeHtml).toContain('<details class="coord-menu">');
expect(homeHtml).toContain('<summary class="session-here">Coordinator</summary>');
expect(homeHtml).toContain('<a href="/admin" aria-current="page">Shifts</a>');
expect(homeHtml).toContain('<a href="/admin/contacts">Contacts</a>');
expect(homeHtml).toContain('<a href="/admin/settings">Settings</a>');
expect(homeHtml).not.toContain('href="/admin/admins"');
expect(homeHtml).toContain('<nav class="session-sections" aria-label="Coordinator">');
const publicHtml = await (await app.request('/', { headers: { cookie } })).text();
expect(publicHtml).toContain('<details class="coord-menu">');
expect(publicHtml).toContain('<summary>Coordinator</summary>');
expect(publicHtml).toContain('<a href="/admin">Shifts</a>');
expect(publicHtml).not.toMatch(/href="\/admin[^"]*" aria-current/);
const settings = await (await app.request('/admin/settings', { headers: { cookie } })).text();
expect(settings).toContain('<a href="/admin/settings" aria-current="page">Settings</a>');
expect(settings).toContain('href="/admin/admins"');