Skip to content

Sk/ssf 150 food request bugs#120

Open
swarkewalia wants to merge 13 commits intomainfrom
sk/SSF-150-food-request-bugs
Open

Sk/ssf 150 food request bugs#120
swarkewalia wants to merge 13 commits intomainfrom
sk/SSF-150-food-request-bugs

Conversation

@swarkewalia
Copy link

ℹ️ Issue
Closes 150

📝 Description
Ensured the “New Request” modal always initializes with empty form fields
Ensured correct fields are filled out when opening 'Resubmit latest' and that additional info is empty if latest request was empty
Resets the error state to avoid stale state between modal openings
✔️ Verification
UI tested

Copy link

@Juwang110 Juwang110 left a comment

Choose a reason for hiding this comment

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

lgtm! All bugs seem fixed.

Copy link
Collaborator

@sam-schu sam-schu left a comment

Choose a reason for hiding this comment

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

When I try to navigate to /request-form to test, I'm getting the error setSelectedItems is not defined

@swarkewalia swarkewalia requested a review from sam-schu March 11, 2026 02:35
Copy link
Collaborator

@sam-schu sam-schu left a comment

Choose a reason for hiding this comment

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

The selected food types still persist in the new request modal

const [selectedFoodTypes, setSelectedFoodTypes] = useState<FoodType[]>([]);
const [requestedSize, setRequestedSize] = useState<string>('');
const [additionalNotes, setAdditionalNotes] = useState<string>('');
const [selectedItems, setSelectedItems] = useState<string[]>([]); // For potential future use if we want to allow item-level selection
Copy link
Collaborator

Choose a reason for hiding this comment

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

We don't need to preemptively add this, if we decided to add this feature we could add in the state variable then

setRequestedSize('');
setAdditionalNotes('');
}
setAlert({ isError: true, message: '' });
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is causing success/failure alerts to immediately disappear - submitting a food request causes isOpen to change from true to false, which reruns the effect

Choose a reason for hiding this comment

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

Also, for the alert we should now use the new floating alert component

Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe this does already

Choose a reason for hiding this comment

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

My bad!

@maxn990 maxn990 requested a review from sam-schu March 12, 2026 14:10
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.

3 participants