Restart numbering for individuals after each subheading

Modify attendee numbering logic to reset at each subheading, ensuring proper sequence and display across different views and PDF outputs.
This commit is contained in:
Riyadh
2026-04-30 12:47:50 +00:00
parent 47fa0090c1
commit 36cb2ca86e
4 changed files with 70 additions and 27 deletions
+7 -3
View File
@@ -531,15 +531,19 @@ export async function renderSchedulePdf(input: RenderPdfInput): Promise<Buffer>
meeting.attendees.length === 0
? "—"
: (() => {
// Walking person counter — subheadings are non-numbered
// labels, so they don't advance the index. Same logic as
// the on-screen AttendeeFlow and the print page.
// Walking person counter — each subheading starts a
// fresh numbered section, so persons restart at 1- after
// every subheading. Same logic as the on-screen
// AttendeeFlow and the client print page.
let personIdx = 0;
return meeting.attendees
.map((a) => {
const isSub = (a.kind ?? "person") === "subheading";
const name = htmlToPlain(a.name);
if (isSub) {
// Reset the in-section counter so the next person
// starts at 1.
personIdx = 0;
// Brackets keep subheadings visually distinct in the
// monospace plain-text PDF cell where bold/colour
// can't carry. Adapter prefix is non-numeric so a