Skip to content

npm upgrade (refactor Dropdown)#65

Merged
vsasyan-ignf merged 3 commits intomainfrom
upgrade
Feb 13, 2026
Merged

npm upgrade (refactor Dropdown)#65
vsasyan-ignf merged 3 commits intomainfrom
upgrade

Conversation

@vsasyan-ignf
Copy link
Contributor

  • refactor(Dropdown.vue): replace lodash debounce with setTimeout for hover updates

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors Dropdown.vue to remove the lodash debounce dependency and change how hover updates are deferred when hovering dropdown options.

Changes:

  • Removed lodash debounce import and the debouncedHoverUpdate helper.
  • Updated hover handling to use setTimeout(..., 0) to defer scanStore.updateHoverScan(option).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 135 to 138
function handleOptionHover(option) {
if (props.nameDropdown !== 'Support' || props.nameDropdown !== 'Emulsion') {
debouncedHoverUpdate(option)
setTimeout(() => {scanStore.updateHoverScan(option)}, 0);
}
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

Replacing debounce(..., 0) with setTimeout(..., 0) changes behavior: multiple rapid hover events will now enqueue multiple updates instead of coalescing to the last one, which can spam the store and cause transient hover states. Consider implementing a simple debounce with a stored timeout id (clearTimeout + setTimeout) so only the latest hovered option updates, and clear any pending timeout when resetting/closing the dropdown to avoid stale hover updates after mouseleave.

Copilot uses AI. Check for mistakes.
function handleOptionHover(option) {
if (props.nameDropdown !== 'Support' || props.nameDropdown !== 'Emulsion') {
debouncedHoverUpdate(option)
setTimeout(() => {scanStore.updateHoverScan(option)}, 0);
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

This line doesn’t match the repo’s Prettier config (semi: false) and typical formatting (extra semicolon and missing spaces inside the block). Please run Prettier / adjust formatting to avoid lint/format churn.

Suggested change
setTimeout(() => {scanStore.updateHoverScan(option)}, 0);
setTimeout(() => scanStore.updateHoverScan(option), 0)

Copilot uses AI. Check for mistakes.
* @param option
*/
function handleOptionHover(option) {
if (props.nameDropdown !== 'Support' || props.nameDropdown !== 'Emulsion') {
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

The condition props.nameDropdown !== 'Support' || props.nameDropdown !== 'Emulsion' is always true (a value can't be both 'Support' and 'Emulsion' at the same time), so hover updates will run even for those dropdowns. If the intent is to skip hover updates for both 'Support' and 'Emulsion', this should use an AND condition (or an explicit inclusion check) so the block is only entered when the dropdown name is neither value.

Suggested change
if (props.nameDropdown !== 'Support' || props.nameDropdown !== 'Emulsion') {
if (props.nameDropdown !== 'Support' && props.nameDropdown !== 'Emulsion') {

Copilot uses AI. Check for mistakes.
* refactor(Dropdown.vue): replace lodash debounce with setTimeout for hover updates
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@vsasyan-ignf vsasyan-ignf merged commit fc4617a into main Feb 13, 2026
1 check passed
@vsasyan-ignf vsasyan-ignf deleted the upgrade branch February 13, 2026 12:00
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