Skip to content

Dev#102

Merged
vvshk merged 5 commits intomainfrom
dev
Dec 27, 2025
Merged

Dev#102
vvshk merged 5 commits intomainfrom
dev

Conversation

@vvshk
Copy link
Copy Markdown
Collaborator

@vvshk vvshk commented Dec 27, 2025

No description provided.

@vvshk vvshk merged commit f2f99a0 into main Dec 27, 2025
@gemini-code-assist
Copy link
Copy Markdown
Contributor

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 significantly enhances the plate issuance workflow by introducing a new QR code scanning system, making the process more efficient and user-friendly. It also refines error handling for plate issuance, providing clearer feedback to administrators. Furthermore, the room occupancy report has been improved for data integrity and export capabilities, ensuring more reliable reporting. These changes collectively aim to improve operational efficiency and data management within the system.

Highlights

  • New QR Code Scanner for Plate Issuance: A dedicated QR code scanning interface has been introduced for issuing plates, streamlining the process of food distribution.
  • Enhanced Error Message Differentiation: The plate issuance system now provides more specific visual feedback for different error types, such as 'already issued' (warning), 'invalid meal time' (info), and 'booking not found' (danger).
  • Improved Room Occupancy Report Robustness and Export: The room occupancy report has been made more resilient to missing data by using optional chaining and nullish coalescing, and its Excel export functionality has been enhanced to provide a flattened, consistent data structure.
  • Utsav Report UI Updates: The Utsav Report now includes a new 'Food Scanner' column with a link to the new QR code plate issuance page, and the existing 'Scanner' link has been clarified as 'Checkin Scanner'.

🧠 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.

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
Contributor

@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 new QR code scanner for food plate issuance and includes several enhancements across different parts of the admin interface. Key changes include differentiating alert types for plate issuance errors, adding defensive coding with optional chaining in the room occupancy report, and adding the new food scanner functionality to the Utsav report page. The changes are generally good, but I have identified some areas for improvement regarding code consistency, maintainability, and adherence to modern web practices. I've also flagged a potential issue with a missing URL parameter that could lead to incorrect behavior.

${
JSON.parse(sessionStorage.getItem('roles') || '[]').includes('utsavAdminReadOnly')
? '-'
: `<a href="/admin/utsav/issuePlateScanUtsav.html">
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.

high

The link for the "Food Scanner" does not include the utsavId query parameter, unlike the "Checkin Scanner" link. This is inconsistent. If the food scanner is specific to an Utsav, the utsavId should be passed to ensure it works correctly, especially if the backend logic changes to require it explicitly.

Suggested change
: `<a href="/admin/utsav/issuePlateScanUtsav.html">
: `<a href="/admin/utsav/issuePlateScanUtsav.html?utsavId=${item.id}">

Comment on lines +42 to +44
/* background-color: #fff3cd; */
color: #856404;
/* border: 2px solid #ffeeba; */
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

These commented-out CSS properties should be removed to keep the stylesheet clean. If they are intended for future use, a more descriptive comment explaining the purpose would be better than just leaving them commented out.

Comment thread admin/food/issuePlate.js
Comment on lines +64 to +74
if (data.message) {
const msg = data.message.toLowerCase();

if (msg.includes('already issued')) {
alertType = 'warning'; // 🟤 brown
} else if (msg.includes('invalid meal time')) {
alertType = 'info'; // 🔵 blue
} else if (msg.includes('booking not found')) {
alertType = 'danger'; // 🔴 red
}
}
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

This if/else if chain can be refactored for better readability and maintainability, especially if more error types are added in the future. A switch statement or a mapping object would be a good alternative.

if (data.message) {
  const msg = data.message.toLowerCase();
  switch (true) {
    case msg.includes('already issued'):
      alertType = 'warning'; // 🟤 brown
      break;
    case msg.includes('invalid meal time'):
      alertType = 'info'; // 🔵 blue
      break;
    case msg.includes('booking not found'):
      alertType = 'danger'; // 🔴 red
      break;
  }
}

<div class="whitesec">
<div class="inner-padding">
<div class="frm-head">
<h4><b><u>Plate Issuance</u></b></h4>
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

The <b> and <u> tags are considered deprecated for styling purposes. It's better to use CSS for bolding and underlining text. Please remove these tags and apply styling via a CSS class or by targeting the h4 element directly.

Suggested change
<h4><b><u>Plate Issuance</u></b></h4>
<h4>Plate Issuance</h4>

<div id="alert" class="alert" role="alert" style="display: none;"></div>

<div id="qr-scanner-section">
<div id="reader" style="width: 100%; max-width: 400px; margin: auto;"></div>
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

Inline styles should be avoided for better maintainability and separation of concerns. Please move this style to the <style> block at the top of the file or to an external stylesheet.

For example, you can give the div an ID or class and style it in the <style> block:

<div id="reader-container"></div>
#reader-container {
  width: 100%;
  max-width: 400px;
  margin: auto;
}

Comment on lines +60 to +62
if (Math.random() < 0.1) {
qrStatus.innerText = 'Scanning...';
}
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

The purpose of if (Math.random() < 0.1) is not immediately clear. It seems to be a way to throttle UI updates to avoid flickering. Adding a comment to explain this would improve code readability and help future maintainers understand the logic.

    // Throttle status updates to prevent flickering during scanning
    if (Math.random() < 0.1) {
      qrStatus.innerText = 'Scanning...';
    }

fetch(`${CONFIG.basePath}/utsav/issue/${cardno}`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
// body: JSON.stringify({ cardno })
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

This commented-out line should be removed to keep the code clean and avoid confusion for future developers.

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