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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user