Skip to content

Conversation

@Trishamishra08
Copy link

Related Issues

#409

Short Description and Why It's Useful

This Pull Request disables the "Add" button when users are viewing the Accepted or Rejected tabs in the Store View.
Previously, users could add items in these tabs, but the newly added items were only visible in the All tab, causing confusion.
This change ensures that users can only add products when the items will be immediately visible, improving UX and preventing errors.

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

Add button enabled on Accepted/Rejected tabs
Newly added items not visible in the same tab
image

Add button enabled on Accepted/Rejected tabs
Newly added items not visible in the same tab
image

Contribution and Currently Important Rules Acceptance

I have read and followed contribution rules

@gemini-code-assist
Copy link

Summary of Changes

Hello @Trishamishra08, 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 addresses a user experience issue in the Store View where the 'Add' button was active across all tabs, leading to confusion when items added in 'Accepted' or 'Rejected' tabs were not immediately visible. The core change involves disabling the 'Add' button for these specific tabs, making it available only when the 'Assigned' tab is selected. This ensures that users can only add products in a context where they will be immediately reflected, streamlining the inventory management process and preventing misinterpretations.

Highlights

  • Conditional 'Add' Button: The 'Add' button in the Store View is now conditionally disabled, appearing only when the 'Assigned' tab is active. This prevents users from attempting to add items to 'Accepted' or 'Rejected' tabs where they would not be immediately visible.
  • Improved User Experience: This change enhances the user experience by preventing confusion and potential errors that arose when users added items in tabs where new entries were not displayed, ensuring a more intuitive workflow.
  • Code Readability and Structure: The Count.vue component has been refactored with additional comments and minor formatting adjustments, improving the overall readability and maintainability of the template and script sections.
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

@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 successfully disables the 'Add' button on the 'Accepted' and 'Rejected' tabs, which aligns with the goal of improving user experience. However, I've found a couple of issues. The click handler for the new 'Add' button contains flawed logic that results in a confusing error message for the user. Additionally, there's a minor regression in the UI text where pluralization for 'item(s) counted' has been removed, leading to grammatical incorrectness. I've also noted the removal of the .env.example file, which is generally not recommended as it's a helpful guide for project setup; consider restoring it. My detailed comments and suggestions are below.

Comment on lines +257 to +261
function addNewItem() {
if (selectedSegment.value !== "assigned") return;
showToast(translate("You can only add items in the Assigned tab."));
// add your actual add logic here...
}

Choose a reason for hiding this comment

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

high

The logic inside addNewItem is flawed. Since the 'Add' button is disabled on tabs other than 'Assigned', this function will only ever be called when selectedSegment.value is 'assigned'.

However, the function currently shows a toast message saying "You can only add items in the Assigned tab.", which is confusing for the user as they are already on the correct tab. The check on line 258 is also redundant given the button's disabled state.

This function should contain the logic for adding a new item, or be an empty placeholder if the functionality is not yet implemented.

function addNewItem() {
  // add your actual add logic here...
}

Comment on lines +98 to +101
<ion-note>
{{ getCycleCountStats(count.inventoryCountImportId, count.countTypeEnumId === "HARD_COUNT") }}
{{ translate("items counted") }}
</ion-note>

Choose a reason for hiding this comment

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

medium

This change simplifies the template, but it introduces a minor grammatical issue. The previous implementation handled the pluralization for "item counted" vs "items counted". With this change, it will always display "items counted", leading to incorrect phrases like "1 items counted".

While the old logic was complex, it's better to handle pluralization correctly. I'd suggest reintroducing the logic in a cleaner format.

                <ion-note>{{ getCycleCountStats(count.inventoryCountImportId, count.countTypeEnumId === "HARD_COUNT") }} {{ translate((count.countTypeEnumId === "HARD_COUNT" && getCycleCountStats(count.inventoryCountImportId, true) === '1') ? "item counted" : "items counted") }}</ion-note>

Comment on lines +140 to +143
<ion-note>
{{ getCycleCountStats(count.inventoryCountImportId, count.countTypeEnumId === "HARD_COUNT") }}
{{ translate("items counted") }}
</ion-note>

Choose a reason for hiding this comment

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

medium

Similar to the 'Pending review' tab, this change introduces a grammatical issue by removing the pluralization logic for "item counted". This will result in incorrect phrases like "1 items counted". It would be best to restore the pluralization handling.

                <ion-note>{{ getCycleCountStats(count.inventoryCountImportId, count.countTypeEnumId === "HARD_COUNT") }} {{ translate((count.countTypeEnumId === "HARD_COUNT" && getCycleCountStats(count.inventoryCountImportId, true) === '1') ? "item counted" : "items counted") }}</ion-note>

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