Skip to content

[Meetings Tracker] MVP Prototype Frontend#162

Open
ChanukaUOJ wants to merge 11 commits into
LDFLK:mainfrom
ChanukaUOJ:meetings-tracker-mvp-prototype
Open

[Meetings Tracker] MVP Prototype Frontend#162
ChanukaUOJ wants to merge 11 commits into
LDFLK:mainfrom
ChanukaUOJ:meetings-tracker-mvp-prototype

Conversation

@ChanukaUOJ

Copy link
Copy Markdown
Member

Closes: #158

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment on lines +5 to +21
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
}));
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

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.

Suggested change
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) => (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Directly mapping over body.mandate without checking if it exists can cause a runtime crash if the mandate array is undefined or null. Using optional chaining prevents this potential error.

Suggested change
{body.mandate.map((mandate, index) => (
{body?.mandate?.map((mandate, index) => (

<div
className="flex transition-transform duration-300 ease-in-out"
style={{ transform: `translateX(-${currentRtiIndex * 100}%)` }}>
{body.rtiHistory.map((rti, index) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Directly mapping over body.rtiHistory without a fallback or optional chaining can cause a runtime crash if rtiHistory is undefined or null. Adding a fallback ensures safe rendering.

Suggested change
{body.rtiHistory.map((rti, index) => {
{(body?.rtiHistory || []).map((rti, index) => {

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.

[Meetings Tracker] MVP Prototype Frontend

1 participant