Skip to content

Improved: Add direct item count input via alert in the session detail view and update localization.(#1318)#1376

Open
R-Sourabh wants to merge 1 commit intohotwax:mainfrom
R-Sourabh:#1318-in-hand-count-on-item
Open

Improved: Add direct item count input via alert in the session detail view and update localization.(#1318)#1376
R-Sourabh wants to merge 1 commit intohotwax:mainfrom
R-Sourabh:#1318-in-hand-count-on-item

Conversation

@R-Sourabh
Copy link
Copy Markdown
Contributor

Related Issues

#1318

Short Description and Why It's Useful

  • For directed counts, removed the common “Add Hand Count” button from the Session Count Detail page and added an Add Count button for each item.
  • On clicking the Add Count button, an input alert box is shown where the user can enter and add the in-hand count for the item.

Screenshots of Visual Changes before/after (If There Are Any)

Screenshot from 2026-02-03 10-12-37

Contribution and Currently Important Rules Acceptance

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @R-Sourabh, 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 enhances the inventory counting process by providing a more direct and intuitive way to record item counts in directed sessions. Instead of a general 'Add Hand Count' option, users can now input quantities for individual items directly through an alert dialog, improving efficiency and user experience during inventory management.

Highlights

  • Direct Item Count Input: Introduced a new 'Add Count' button for each individual item within the Session Count Detail view. Clicking this button now presents an input alert box, allowing users to directly enter and save the in-hand count for that specific item.
  • Streamlined Directed Counts: The general 'Add Hand Count' button has been removed from the Session Count Detail page when dealing with 'directed counts', simplifying the interface for this specific counting method.
  • Localization Updates: Added several new localization strings to support the new 'Add Count' functionality, including messages for saving counts, input prompts, and validation errors.

🧠 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
  • src/locales/en.json
    • Added new translation keys: 'Add Count', 'Count saved successfully', 'Enter quantity', 'Failed to save count', and 'Please enter a valid quantity'.
  • src/views/SessionCountDetail.vue
    • Modified the 'Add hand-counted items' card to be conditionally rendered, appearing only when isDirected is false.
    • Added an 'Add Count' button to each item in the product list, enabling direct quantity input.
    • Imported alertController from @ionic/vue to manage alert dialogs.
    • Implemented the openCountItemAlert function to display a quantity input alert, validate user input, and record the scan using useInventoryCountImport().recordScan.
    • Added CSS styling to vertically center ion-note elements.
Activity
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 useful feature for adding item counts directly from the session detail view, improving the user workflow. The changes are logical and well-implemented. I've provided a few suggestions to enhance type safety, improve data handling, and fix a potential bug related to product identifiers. Overall, this is a solid contribution.

Comment on lines +1670 to +1678
await useInventoryCountImport().recordScan({
inventoryCountImportId: props.inventoryCountImportId,
productId: item.productId,
productIdentifier: await useProductStore().getProductIdentificationValue(
item.productId,
useProductStore().getProductIdentificationPref.primaryId
),
quantity: quantity
})
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 getProductIdentificationValue function can return undefined if an identifier is not found. This undefined value would then be passed to recordScan for the productIdentifier parameter, which expects a string, potentially causing issues.

Please add a check to ensure productIdentifier has a value before calling recordScan. If it's undefined, you should show an error toast and prevent the scan from being recorded. For example:

const productIdentifier = await useProductStore().getProductIdentificationValue(
  item.productId,
  useProductStore().getProductIdentificationPref.primaryId
);

if (!productIdentifier) {
  console.error(`Could not find product identifier for productId: ${item.productId}`);
  showToast(translate('Failed to save count'));
  return false;
}

await useInventoryCountImport().recordScan({
  inventoryCountImportId: props.inventoryCountImportId,
  productId: item.productId,
  productIdentifier,
  quantity: quantity
})

Comment thread src/views/SessionCountDetail.vue
Comment thread src/views/SessionCountDetail.vue
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.

1 participant