#42114 Zoom actions not visible for items CM - #115
Conversation
There was a problem hiding this comment.
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.
| const ZOOM_BASE_ACTION = { | ||
| isVisible(param) { | ||
| return param.selection.length === 0; | ||
| } | ||
| }; |
There was a problem hiding this comment.
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.
| 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; | |
| } | |
| }; |
| rowIndex, | ||
| timelineComponentId |
There was a problem hiding this comment.
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_....
| rowIndex, | |
| timelineComponentId | |
| rowIndex, | |
| timelineComponentId = 'r9k1' |
Proposed Change:
What is your change
Change type
Put an
xin the boxes that applyChecklist