Branching logic for first/last page rendering in SegmentGroup.