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.
This commit is contained in:
blake committed 2026-10-28 16:59:07 -05:00
1 parent e9bc80cd95
commit a0fa56202e
2 files changed
+80 -6

No files matched your search

+68
View File
@@ -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;
}
+12 -6
View File
@@ -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 (
<div class="event-page">
<Crumb
@@ -949,10 +952,10 @@ export function ShiftRoster(props: {
</details>
)}
</section>
<section class="desk-events" aria-labelledby="roster-heading">
<section class="desk-events" aria-labelledby="volunteers-heading">
<div class="desk-toolbar">
<div class="desk-toolbar-copy">
<h2 id="roster-heading">Roster</h2>
<h2 id="volunteers-heading">Volunteers</h2>
</div>
{cancelledPeople.length > 0 ? (
<div class="desk-actions pick-bar">
@@ -982,9 +985,12 @@ export function ShiftRoster(props: {
) : (
<Roster config={props.config} csrf={props.csrf} people={props.shift.people} moves={props.moves} />
)}
</section>
{props.walkIn ? (
<section class="desk-events" aria-labelledby="walkin-heading">
<details class="walkin-menu" open={walkInOpen ? true : undefined}>
<summary>
Add a walk-in
<span class="edit-chevron" aria-hidden="true" />
</summary>
<WalkInForm
config={props.config}
csrf={props.csrf}
@@ -993,10 +999,11 @@ export function ShiftRoster(props: {
form={props.walkIn}
contacts={props.contacts ?? []}
/>
</section>
</details>
) : props.walkInNote ? (
<p class="panel-note">{props.walkInNote}</p>
) : null}
</section>
<div class="desk-actions">
{props.shift.cancelled ? null : (
<ConfirmAnchor
@@ -1665,7 +1672,6 @@ function WalkInForm(props: {
const contactId = props.form.contactId ?? '';
return (
<form method="post" action={appPath(props.config, `/admin/shifts/${props.shiftId}/walk-in`)} class="signup-form event-details-form">
<h2 id="walkin-heading">Add a walk-in</h2>
<p>Choose how many people are here, including the person named below. This signup holds that many spots and queues one confirmation email. Another person can use the same email. The name is listed on the public sign-up page when this shift is posted there. Email and notes stay off that page.</p>
{props.form.message ? <p class="error">{props.form.message}</p> : null}
{errorEntries.length > 0 ? (