[Meetings Tracker] MVP Prototype Frontend#162
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new "Meetings Tracker" feature, including multiple new screens, components, and hooks for tracking governance meetings and RTI requests. It also refactors the application's routing structure to use nested routes and layouts with React Router's <Outlet /> and useOutletContext(), and extracts the sidebar into a standalone component. The review feedback highlights several opportunities to prevent potential runtime crashes by adding optional chaining and fallback arrays when rendering properties of the body prop across the new components.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| const allMeetings = body.meetingInstances | ||
| ? body.meetingInstances.map((meeting) => ({ | ||
| date: meeting.date, | ||
| description: meeting.id || meeting.description, | ||
| files: meeting.files || (meeting.minutesLink ? [meeting.minutesLink] : []), | ||
| rtiRound: null | ||
| })) | ||
| : (body.rtiHistory || []).flatMap((rti, index) => { | ||
| if (!rti.meetingDetails) return []; | ||
| const rtiRound = body.rtiHistory.length - index; | ||
| return rti.meetingDetails.map((meeting) => ({ | ||
| date: meeting.date, | ||
| description: meeting.description, | ||
| files: (meeting.minutesLink || rti.minutesLink) ? [meeting.minutesLink || rti.minutesLink] : [], | ||
| rtiRound | ||
| })); | ||
| }); |
There was a problem hiding this comment.
If the body prop is null or undefined, accessing body.meetingInstances or body.rtiHistory will throw a runtime TypeError. Applying optional chaining and providing a fallback array ensures robust and defensive rendering.
| const allMeetings = body.meetingInstances | |
| ? body.meetingInstances.map((meeting) => ({ | |
| date: meeting.date, | |
| description: meeting.id || meeting.description, | |
| files: meeting.files || (meeting.minutesLink ? [meeting.minutesLink] : []), | |
| rtiRound: null | |
| })) | |
| : (body.rtiHistory || []).flatMap((rti, index) => { | |
| if (!rti.meetingDetails) return []; | |
| const rtiRound = body.rtiHistory.length - index; | |
| return rti.meetingDetails.map((meeting) => ({ | |
| date: meeting.date, | |
| description: meeting.description, | |
| files: (meeting.minutesLink || rti.minutesLink) ? [meeting.minutesLink || rti.minutesLink] : [], | |
| rtiRound | |
| })); | |
| }); | |
| const allMeetings = body?.meetingInstances | |
| ? body.meetingInstances.map((meeting) => ({ | |
| date: meeting.date, | |
| description: meeting.id || meeting.description, | |
| files: meeting.files || (meeting.minutesLink ? [meeting.minutesLink] : []), | |
| rtiRound: null | |
| })) | |
| : (body?.rtiHistory || []).flatMap((rti, index) => { | |
| if (!rti.meetingDetails) return []; | |
| const rtiRound = (body?.rtiHistory?.length || 0) - index; | |
| return rti.meetingDetails.map((meeting) => ({ | |
| date: meeting.date, | |
| description: meeting.description, | |
| files: (meeting.minutesLink || rti.minutesLink) ? [meeting.minutesLink || rti.minutesLink] : [], | |
| rtiRound | |
| })); | |
| }); |
| <div> | ||
| <div className="text-xs font-medium text-primary/60 mb-0.5">Mandates</div> | ||
| <div className="flex flex-wrap gap-2 mt-1"> | ||
| {body.mandate.map((mandate, index) => ( |
There was a problem hiding this comment.
| <div | ||
| className="flex transition-transform duration-300 ease-in-out" | ||
| style={{ transform: `translateX(-${currentRtiIndex * 100}%)` }}> | ||
| {body.rtiHistory.map((rti, index) => { |
There was a problem hiding this comment.
Closes: #158