Skip to content

Feat/utsav feedback form#1

Draft
vvshk wants to merge 7 commits intomainfrom
feat/utsav-feedback-form
Draft

Feat/utsav feedback form#1
vvshk wants to merge 7 commits intomainfrom
feat/utsav-feedback-form

Conversation

@vvshk
Copy link
Copy Markdown
Collaborator

@vvshk vvshk commented Feb 19, 2026

No description provided.

@vvshk vvshk requested a review from vendz February 19, 2026 19:52
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @vvshk, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new feature to collect feedback for Utsav events, enhancing the application's ability to gather user insights. It provides a dedicated, user-friendly form for participants to rate their experience across multiple categories and offer suggestions. The feedback mechanism is seamlessly integrated into the existing event booking flow, making it accessible at the appropriate time. Additionally, minor technical updates were made to dependencies and development environment configurations.

Highlights

  • New Utsav Feedback Form: A comprehensive feedback form has been implemented for Utsav events, allowing users to rate various aspects like accommodation, food, program, and provide suggestions for improvement. This form includes star ratings and text input fields.
  • Feedback Form Integration: The new Utsav feedback form is integrated into the event booking cancellation component, providing a 'Give Feedback' button for relevant past events. This button navigates users to the new feedback screen.
  • Routing and Navigation: New routing has been configured for the Utsav feedback screen, making it accessible as a modal with a dynamic ID parameter.
  • Dependency Update: The Expo dependency has been updated to a newer patch version.
  • Development API Endpoint Adjustment: The development API endpoint logic was adjusted to use a local IP address when a PR number is specified, facilitating local testing.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • package.json
    • Updated the 'expo' dependency from '^54.0.9' to '^54.0.31'.
  • src/app/(tabs)/index.tsx
    • Imported 'TouchableOpacity' from 'react-native'.
  • src/app/utsav/_layout.tsx
    • Added a new 'Stack.Screen' for the 'feedback/[id]' route, configured as a modal without a header.
  • src/app/utsav/feedback/[id].tsx
    • Added a new screen component for the Utsav feedback form.
    • Implemented 'UtsavFeedbackData' type and 'getInitialUtsavFeedbackForm' function.
    • Created 'StarRating' and 'FieldLabel' reusable components.
    • Developed the 'UtsavFeedbackForm' component to render all feedback fields with validation.
    • Implemented 'UtsavFeedbackScreen' to handle form state, API calls for access validation and submission, and display loading/error states.
  • src/components/cancel booking/EventBookingCancellation.tsx
    • Imported 'useRouter' from 'expo-router'.
    • Initialized the 'router' hook.
    • Added a console log for 'UTSAV BOOKINGS RESPONSE' in the fetchUtsavs success callback.
    • Modified the condition for displaying the item amount to check if 'item.amount > 0'.
    • Refactored the action buttons to include a 'Give Feedback' button, which navigates to the new feedback screen when 'item?.showFeedback' is true.
    • Adjusted the 'Cancel Booking' button's display condition to use 'item.utsav_start_date' and be part of a new 'Actions Row'.
  • src/utils/HandleApiCall.js
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

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

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 feedback form for "Utsavs". The implementation includes a new screen for the form, integration with the existing booking list to show a "Give Feedback" button, and necessary routing changes. The code is generally well-structured, but there are a few critical and high-severity issues that must be addressed. A hardcoded local development URL has been introduced, which will break API calls in production. There's also a console.log statement that should be removed, and a potential bug in promise handling that could cause the app to hang. I've also included some suggestions to improve maintainability and prevent potential race conditions.

if (useDevBackend) {
if (devPrNumber) {
currentBaseUrl = `https://aashray-backend-pr-${devPrNumber}.onrender.com/api/v1`;
currentBaseUrl = `http://10.0.2.2:3000/api/v1`;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

This change hardcodes the base URL to a local development address (10.0.2.2). This is a critical issue as it will break all API calls for production builds and other developers. This line should be reverted to use the production or PR-specific Render URL.

Suggested change
currentBaseUrl = `http://10.0.2.2:3000/api/v1`;
currentBaseUrl = `https://aashray-backend-pr-${devPrNumber}.onrender.com/api/v1`;

Comment on lines +245 to +266
const validateFeedbackAccess = async () => {
setIsValidating(true);
await new Promise((resolve, reject) => {
handleAPICall(
'GET',
'/utsav/feedback/validate',
{ utsav_id: utsavId, cardno: user.cardno },
null,
() => resolve(true),
() => {
setIsValidating(false);
}
// (err) => {
// setValidationError(
// err?.message || 'You are not authorized to submit feedback for this utsav'
// );
// },
// false
);
});
setValidationError(null);
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

There's a potential hanging promise here. In the case of an API error, the Promise is never rejected because no errorCallback is provided to handleAPICall. This will cause the await to hang indefinitely, and the UI will be stuck. To fix this, you should provide an errorCallback that rejects the promise, and wrap the await in a try/catch/finally block to handle the error and loading states correctly.

    const validateFeedbackAccess = async () => {
      setIsValidating(true);
      try {
        await new Promise((resolve, reject) => {
          handleAPICall(
            'GET',
            '/utsav/feedback/validate',
            { utsav_id: utsavId, cardno: user.cardno },
            null,
            (res) => resolve(res),
            () => {},
            (err) => reject(err)
          );
        });
        setValidationError(null);
      } catch (err: any) {
        setValidationError(
          err?.message || 'You are not authorized to submit feedback for this utsav'
        );
      } finally {
        setIsValidating(false);
      }
    };

(res: any) => {
resolve(Array.isArray(res.data) ? res.data : []);
},
console.log('UTSAV BOOKINGS RESPONSE:', res.data);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

This console.log statement appears to be for debugging purposes. It should be removed before merging to avoid leaking data and cluttering logs in production environments.

Comment on lines +80 to +219
const UtsavFeedbackForm: React.FC<{
value: UtsavFeedbackData;
onChange: (data: UtsavFeedbackData) => void;
onSubmit: () => void;
isSubmitting?: boolean;
containerStyles?: string;
showValidation?: boolean;
}> = ({
value,
onChange,
onSubmit,
isSubmitting = false,
containerStyles = '',
showValidation = false,
}) => {
const fieldError = (cond: boolean) => showValidation && cond;

return (
<View className={`w-full ${containerStyles}`}>
<FieldLabel label="How would you rate the accommodation?" />
<StarRating
value={value.accommodation_rating}
onChange={(n) => onChange({ ...value, accommodation_rating: n })}
/>
<ErrorText
show={fieldError(!value.accommodation_rating)}
message="Accommodation rating is required"
/>

<FieldLabel label="How convenient was the QR code system?" />
<StarRating value={value.qr_rating} onChange={(n) => onChange({ ...value, qr_rating: n })} />
<ErrorText show={fieldError(!value.qr_rating)} message="QR rating is required" />

<FieldLabel label="How was the food quality & variety?" />
<StarRating
value={value.food_rating}
onChange={(n) => onChange({ ...value, food_rating: n })}
/>
<ErrorText show={fieldError(!value.food_rating)} message="Food rating is required" />

<FieldLabel label="How was the program structure & engagement?" />
<StarRating
value={value.program_rating}
onChange={(n) => onChange({ ...value, program_rating: n })}
/>
<ErrorText show={fieldError(!value.program_rating)} message="Program rating is required" />

<FieldLabel label="How would you rate the volunteer performance?" />
<StarRating
value={value.volunteer_rating}
onChange={(n) => onChange({ ...value, volunteer_rating: n })}
/>
<ErrorText
show={fieldError(!value.volunteer_rating)}
message="Volunteer rating is required"
/>

<FieldLabel label="How was the infrastructure?" />
<StarRating
value={value.infrastructure_rating}
onChange={(n) => onChange({ ...value, infrastructure_rating: n })}
/>
<ErrorText
show={fieldError(!value.infrastructure_rating)}
message="Infrastructure rating is required"
/>

<FieldLabel label="How was the decor?" />
<StarRating
value={value.decor_rating}
onChange={(n) => onChange({ ...value, decor_rating: n })}
/>
<ErrorText show={fieldError(!value.decor_rating)} message="Decor rating is required" />

<FieldLabel label="How was the internal transport coordination?" />
<StarRating
value={value.internal_transport_rating}
onChange={(n) => onChange({ ...value, internal_transport_rating: n })}
/>
<ErrorText
show={fieldError(!value.internal_transport_rating)}
message="Internal transport rating is required"
/>

<FieldLabel label="How was the Raj Pravas transport (Mumbai → Venue)?" />
<StarRating
value={value.raj_pravas_rating}
onChange={(n) => onChange({ ...value, raj_pravas_rating: n })}
/>
<ErrorText
show={fieldError(!value.raj_pravas_rating)}
message="Raj Pravas rating is required"
/>

<FieldLabel label="How was the Sparsh performance?" />
<StarRating
value={value.sparsh_rating}
onChange={(n) => onChange({ ...value, sparsh_rating: n })}
/>
<ErrorText show={fieldError(!value.sparsh_rating)} message="Sparsh rating is required" />

<FieldLabel label="How was the audio-visual setup?" />
<StarRating value={value.av_rating} onChange={(n) => onChange({ ...value, av_rating: n })} />
<ErrorText show={fieldError(!value.av_rating)} message="AV rating is required" />

<FormField
text="What did you love the most about this Utsav?"
placeholder="What did you love the most?"
value={value.loved_most}
handleChangeText={(t: string) => onChange({ ...value, loved_most: t })}
otherStyles="mt-5"
inputStyles="font-pmedium text-base"
error={fieldError(!value.loved_most)}
errorMessage="Required"
useNeomorphic
/>

<FormField
text="Any suggestions for improvement?"
placeholder="What can be improved?"
value={value.improvement_suggestions}
handleChangeText={(t: string) => onChange({ ...value, improvement_suggestions: t })}
otherStyles="mt-5"
inputStyles="font-pmedium text-base"
error={fieldError(!value.improvement_suggestions)}
errorMessage="Required"
useNeomorphic
/>

<CustomButton
text="Submit Feedback"
handlePress={onSubmit}
containerStyles="my-7 min-h-[62px]"
bgcolor="bg-secondary"
textStyles="text-white"
isLoading={isSubmitting}
isDisabled={isSubmitting}
/>
</View>
);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The UtsavFeedbackForm component has a lot of repetitive code for rendering each rating field. This makes the component large and harder to maintain. You can refactor this by creating an array of field configurations and mapping over it to render the fields dynamically. This will significantly reduce code duplication and make it easier to add or remove fields in the future.

Comment on lines +327 to +329
CustomAlert.alert('Thank you!', 'Your feedback has been submitted successfully.');
router.back();
setSubmitting(false);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Calling router.back() before setSubmitting(false) could lead to a React warning about setting state on an unmounted component if the navigation happens before the state update is processed. It's safer to update the component's state first, and then navigate away.

Suggested change
CustomAlert.alert('Thank you!', 'Your feedback has been submitted successfully.');
router.back();
setSubmitting(false);
setSubmitting(false);
CustomAlert.alert('Thank you!', 'Your feedback has been submitted successfully.');
router.back();

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.

2 participants