From a0fa56202e70913d7bebd002b6fe5dffd5bd4a7c Mon Sep 17 00:00:00 2001 From: blake Date: Wed, 28 Oct 2026 16:59:07 -0500 Subject: [PATCH] feat: add walk-in functionality and update desk events section Introduced a new walk-in menu in the ShiftRoster component, allowing users to add walk-ins directly from the interface. Updated the desk events section to reflect this change, including renaming the heading for clarity. Enhanced styles for the walk-in menu to improve user experience and maintain consistency across the application. --- public/css/app.css | 68 +++++++++++++++++++++++++++++++++++++++++++++ src/admin-pages.tsx | 40 ++++++++++++++------------ 2 files changed, 91 insertions(+), 17 deletions(-) diff --git a/public/css/app.css b/public/css/app.css index a35c767..b630bbc 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -2321,6 +2321,33 @@ button.btn-quiet::before { justify-content: flex-end; } +/* The remove control sits in the heading row. Its height stays within that line so showing it does not push the list down. */ +.desk-events > .desk-toolbar { + align-items: center; + flex-wrap: nowrap; +} + +.desk-events > .desk-toolbar .desk-toolbar-copy { + min-width: 0; +} + +.desk-events > .desk-toolbar .pick-bar { + flex: none; + flex-direction: row; + flex-wrap: nowrap; + align-items: center; + margin-top: 0; +} + +.desk-events > .desk-toolbar .pick-bar .btn { + min-height: 2.2rem; + padding: 0.2rem 0.9rem; + font-size: 0.92rem; + line-height: 1.2; + width: auto; + flex: 0 0 auto; +} + .pick, .pick-all { display: inline-flex; @@ -2476,6 +2503,47 @@ button.btn-quiet::before { box-shadow: none; } +.walkin-menu { + margin: 0; +} + +.walkin-menu > summary { + display: inline-flex; + align-items: center; + gap: 0.4rem; + width: fit-content; + min-height: 2.35rem; + padding: 0.28rem 0.9rem; + list-style: none; + cursor: pointer; + background: #fff; + border: 1px solid #d5dee6; + border-radius: 999px; + color: var(--hope-ink); + font-size: 0.92rem; + font-weight: 650; +} + +.walkin-menu > summary::-webkit-details-marker { + display: none; +} + +.walkin-menu > summary::marker { + content: ""; +} + +.walkin-menu:not([open]) > :not(summary) { + display: none; +} + +.walkin-menu[open] .edit-chevron { + transform: translateY(0.08rem) rotate(225deg); +} + +.walkin-menu > .signup-form { + margin-top: 0.85rem; +} + .event-remove { margin-top: 0.35rem; } diff --git a/src/admin-pages.tsx b/src/admin-pages.tsx index 971f4b1..c58da4b 100644 --- a/src/admin-pages.tsx +++ b/src/admin-pages.tsx @@ -904,6 +904,9 @@ export function ShiftRoster(props: { const formError = props.shift.cancelled ? undefined : props.editError; const bannerError = props.error ?? (props.shift.cancelled ? props.editError : undefined); const detailLine = props.shift.cancelled ? 'Cancelled. The roster stays until you remove it.' : props.shift.whenLabel; + const walkInOpen = Boolean( + props.walkIn && (props.walkIn.message || Object.values(props.walkIn.errors).some((message) => Boolean(message))), + ); return (
)} -
+
-

Roster

+

Volunteers

{cancelledPeople.length > 0 ? (
@@ -982,21 +985,25 @@ export function ShiftRoster(props: { ) : ( )} + {props.walkIn ? ( +
+ + Add a walk-in + + +
+ ) : props.walkInNote ? ( +

{props.walkInNote}

+ ) : null}
- {props.walkIn ? ( -
- -
- ) : props.walkInNote ? ( -

{props.walkInNote}

- ) : null}
{props.shift.cancelled ? null : (