Merge pull request #126 from peerloomllc/bugfix/agenda-scroll-short-lists
Release / build (push) Canceled after 0s

fix: agenda scroll when future content is short (#77)
This commit is contained in:
Tim
2026-04-23 11:11:35 -05:00
committed by GitHub
2 changed files with 55 additions and 43 deletions
+32 -29
View File
@@ -19708,35 +19708,38 @@
days.push(todayStr2);
days.sort((a38, b) => a38.localeCompare(b));
}
return days.map((date) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { "data-date": date, style: { marginBottom: 20 }, children: [
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: {
fontSize: 12,
fontWeight: 400,
color: th.muted,
letterSpacing: "0.05em",
marginBottom: 8,
paddingBottom: 4,
borderBottom: "1px solid " + th.border
}, children: date === todayStr2 ? "TODAY" : (/* @__PURE__ */ new Date(date + "T12:00:00")).toLocaleDateString(
"en-US",
{ weekday: "long", month: "short", day: "numeric" }
).toUpperCase() }),
seen.get(date).map((ev2, i2) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { animation: `pearFadeUp 150ms var(--easing) ${i2 * 30}ms both` }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
EventCard,
{
ev: ev2,
th,
isPast: date < todayStr2,
myRsvpStatus: myRsvps[ev2.id],
myProfileId,
use24h,
dayIndex: ev2._dayIndex,
dayTotal: ev2._dayTotal,
groups,
onClick: () => setModal({ mode: "edit", event: { ...ev2 } })
}
) }, ev2.id))
] }, date));
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
days.map((date) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { "data-date": date, style: { marginBottom: 20 }, children: [
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: {
fontSize: 12,
fontWeight: 400,
color: th.muted,
letterSpacing: "0.05em",
marginBottom: 8,
paddingBottom: 4,
borderBottom: "1px solid " + th.border
}, children: date === todayStr2 ? "TODAY" : (/* @__PURE__ */ new Date(date + "T12:00:00")).toLocaleDateString(
"en-US",
{ weekday: "long", month: "short", day: "numeric" }
).toUpperCase() }),
seen.get(date).map((ev2, i2) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { animation: `pearFadeUp 150ms var(--easing) ${i2 * 30}ms both` }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
EventCard,
{
ev: ev2,
th,
isPast: date < todayStr2,
myRsvpStatus: myRsvps[ev2.id],
myProfileId,
use24h,
dayIndex: ev2._dayIndex,
dayTotal: ev2._dayTotal,
groups,
onClick: () => setModal({ mode: "edit", event: { ...ev2 } })
}
) }, ev2.id))
] }, date)),
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { "aria-hidden": "true", style: { height: "100vh" } })
] });
})()
] }),
(() => {
+23 -14
View File
@@ -3183,22 +3183,31 @@ function CalendarTab ({ th, viewDate, setViewDate, calDays, selectedDate, setSel
days.push(todayStr)
days.sort((a,b) => a.localeCompare(b))
}
return days.map(date => (
<div key={date} data-date={date} style={{ marginBottom:20 }}>
<div style={{ fontSize:12, fontWeight:400, color:th.muted, letterSpacing:'0.05em',
marginBottom:8, paddingBottom:4, borderBottom:'1px solid ' + th.border }}>
{date === todayStr ? 'TODAY' : new Date(date + 'T12:00:00').toLocaleDateString('en-US',
{ weekday:'long', month:'short', day:'numeric' }).toUpperCase()}
</div>
{seen.get(date).map((ev, i) => (
<div key={ev.id} style={{ animation: `pearFadeUp 150ms var(--easing) ${i * 30}ms both` }}>
<EventCard ev={ev} th={th} isPast={date < todayStr} myRsvpStatus={myRsvps[ev.id]} myProfileId={myProfileId}
use24h={use24h} dayIndex={ev._dayIndex} dayTotal={ev._dayTotal} groups={groups}
onClick={() => setModal({ mode:'edit', event:{ ...ev } })} />
return (
<>
{days.map(date => (
<div key={date} data-date={date} style={{ marginBottom:20 }}>
<div style={{ fontSize:12, fontWeight:400, color:th.muted, letterSpacing:'0.05em',
marginBottom:8, paddingBottom:4, borderBottom:'1px solid ' + th.border }}>
{date === todayStr ? 'TODAY' : new Date(date + 'T12:00:00').toLocaleDateString('en-US',
{ weekday:'long', month:'short', day:'numeric' }).toUpperCase()}
</div>
{seen.get(date).map((ev, i) => (
<div key={ev.id} style={{ animation: `pearFadeUp 150ms var(--easing) ${i * 30}ms both` }}>
<EventCard ev={ev} th={th} isPast={date < todayStr} myRsvpStatus={myRsvps[ev.id]} myProfileId={myProfileId}
use24h={use24h} dayIndex={ev._dayIndex} dayTotal={ev._dayTotal} groups={groups}
onClick={() => setModal({ mode:'edit', event:{ ...ev } })} />
</div>
))}
</div>
))}
</div>
))
{/* Scroll sentinel: ensures scrollToDate(today) can always push today
to the top even when little future content follows. Without it,
short lists clamp scrollTop short and leave past events visible
above today. 100vh is plenty for any realistic viewport. */}
<div aria-hidden="true" style={{ height:'100vh' }} />
</>
)
})()}
</div>