Skip to content

Conversation

@vikrantwiz02
Copy link

No description provided.

Copilot AI review requested due to automatic review settings December 5, 2025 06:25
@vikrantwiz02 vikrantwiz02 merged commit f315836 into FusionIIIT:prod/acad-react Dec 5, 2025
5 checks passed
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the student result PDF generation by implementing comprehensive word wrapping for all text fields in the student information table, replacing the previous approach that only conditionally wrapped long names (over 25 characters).

Key Changes

  • Introduced a unified cell_style ParagraphStyle with word wrapping configuration for all table cells
  • Converted all student data table cells from plain strings to Paragraph objects for consistent text wrapping behavior
  • Removed conditional name wrapping logic in favor of uniform wrapping across all fields

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +3549 to +3551
[Paragraph('Name of Student:', cell_style), Paragraph(student_info.get('name', 'N/A'), cell_style), Paragraph('Roll No.:', cell_style), Paragraph(student_info.get('rollNumber', student_info.get('roll_number', 'N/A')), cell_style)],
[Paragraph('Programme:', cell_style), Paragraph(student_info.get('programme', 'N/A'), cell_style), Paragraph('Branch:', cell_style), Paragraph(student_info.get('branch', student_info.get('department', 'N/A')), cell_style)],
[Paragraph('Semester:', cell_style), Paragraph(formatted_semester, cell_style), Paragraph('Academic Year:', cell_style), Paragraph(student_info.get('academicYear', student_info.get('academic_year', 'N/A')), cell_style)]
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines are excessively long (over 200 characters each) and significantly impact code readability. Consider breaking them into multiple lines by extracting the Paragraph creation into variables or using temporary variables for the dictionary .get() calls.

Example refactoring for line 3549:

student_name = Paragraph(student_info.get('name', 'N/A'), cell_style)
roll_number = Paragraph(student_info.get('rollNumber', student_info.get('roll_number', 'N/A')), cell_style)
student_data = [
    [Paragraph('Name of Student:', cell_style), student_name, Paragraph('Roll No.:', cell_style), roll_number],
    # ... remaining rows
]

Copilot uses AI. Check for mistakes.
parent=styles['Normal'],
fontSize=10,
fontName='Times-Roman',
wordWrap='CJK'
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The wordWrap parameter is not a standard parameter for ReportLab's ParagraphStyle class. ReportLab's Paragraph class automatically handles word wrapping based on the available width without needing a wordWrap parameter in the style definition. This parameter will likely be ignored, but could cause confusion or issues if the library behavior changes.

Consider removing this line as word wrapping is automatically handled by the Paragraph class when it's constrained by the table column width.

Suggested change
wordWrap='CJK'

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant