Skip to content

#42114 Zoom actions not visible for items CM - #115

Open
daniela-mateescu wants to merge 5 commits into
master-flower-platformfrom
dana-RM42114-no-zoom-actions-on-item-CM
Open

#42114 Zoom actions not visible for items CM#115
daniela-mateescu wants to merge 5 commits into
master-flower-platformfrom
dana-RM42114-no-zoom-actions-on-item-CM

Conversation

@daniela-mateescu

Copy link
Copy Markdown
Collaborator

Proposed Change:

What is your change

Change type

Put an x in the boxes that apply

  • Bugfix
  • New feature

Checklist

  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

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

Copy link
Copy Markdown

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 restricts zoom actions in the context menu to only appear when right-clicking on the gantt area (i.e., when there is no active selection). It also updates item test IDs to dynamically use the timeline's component ID instead of a hardcoded prefix, and adds corresponding scenario tests. The review feedback suggests adding defensive checks to the zoom visibility logic to prevent potential runtime errors, and providing a default value for the new timelineComponentId parameter in rowItemsRenderer to maintain backward compatibility.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/timeline.js
Comment on lines +751 to +755
const ZOOM_BASE_ACTION = {
isVisible(param) {
return param.selection.length === 0;
}
};

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

To prevent potential runtime errors (e.g., TypeError: Cannot read properties of undefined) if param or param.selection is not provided, it is safer to use defensive checks. Since zoom is a global action, it should default to being visible if no selection context is present.

Suggested change
const ZOOM_BASE_ACTION = {
isVisible(param) {
return param.selection.length === 0;
}
};
const ZOOM_BASE_ACTION = {
isVisible(param) {
return !param || !param.selection || param.selection.length === 0;
}
};

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

done

Comment thread src/utils/itemUtils.js Outdated
Comment on lines +38 to +39
rowIndex,
timelineComponentId

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

Since rowItemsRenderer is an exported function, it can be called by external consumers or custom row renderers without the newly added timelineComponentId parameter. Providing a default value of 'r9k1' ensures backward compatibility and prevents test IDs from rendering as undefined_item_....

Suggested change
rowIndex,
timelineComponentId
rowIndex,
timelineComponentId = 'r9k1'

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

done

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.

3 participants