-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
fix (nc-gui): resolve warnings when opening grid header dropdown #9984
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughThe changes in this pull request introduce a new optional property Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
All reactions
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (2)
packages/nc-gui/components/nc/MenuItem.vue (2)
17-17
: Consider using only boolean type for disabled propThe
disabled
prop accepts bothboolean | number
, but typically disabled states are boolean values. Using numbers might lead to confusion about what numbers constitute a disabled state.- disabled?: boolean | number + disabled?: boolean
27-27
: Consider adding ARIA attributes for accessibilityWhile the disabled state is correctly implemented, consider adding appropriate ARIA attributes to improve accessibility for screen readers.
- <a-menu-item v-bind="$attrs" :disabled="Boolean(disabled)" class="nc-menu-item"> + <a-menu-item + v-bind="$attrs" + :disabled="Boolean(disabled)" + :aria-disabled="Boolean(disabled)" + class="nc-menu-item" + >
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
packages/nc-gui/components/nc/MenuItem.vue
(2 hunks)
🔇 Additional comments (2)
packages/nc-gui/components/nc/MenuItem.vue (2)
Line range hint 1-16
: LGTM! Well-documented known issue and solution
The documentation clearly explains the v-if vs v-show issue and provides a proper solution to prevent DOM manipulation errors. This will help other developers avoid potential runtime errors.
Line range hint 1-58
: Verify component usage in grid header dropdown
Let's verify that this component is used in the grid header dropdown and that these changes resolve the warnings mentioned in the PR objective.
✅ Verification successful
The component is used in grid header dropdowns and the changes are relevant
Based on the search results, the MenuItem
component is indeed used extensively in grid-related dropdowns, particularly in:
- Grid header menu (
smartsheet/header/Menu.vue
) - For column operations like filtering, sorting, and editing - Grid table context menu (
smartsheet/grid/Table.vue
) - For row operations - Column filter menu (
smartsheet/toolbar/ColumnFilter.vue
) - For filter operations
The changes to properly handle the disabled state in MenuItem.vue
are relevant as these menus frequently use the disabled
prop for various conditions (e.g., permission checks, system columns, etc.).
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for usage of MenuItem in grid header related components
rg -l "MenuItem" packages/nc-gui/components/grid/header/
Length of output: 136
Script:
#!/bin/bash
# First, let's find the correct path for grid-related components
fd "grid" --type directory packages/nc-gui/components/
# Then search for MenuItem usage in the entire nc-gui directory
rg -l "MenuItem" packages/nc-gui/components/
Length of output: 2283
Script:
#!/bin/bash
# Let's check the content of relevant grid and toolbar components that use MenuItem
# to verify if they're related to grid header dropdowns
rg -C 5 "MenuItem" packages/nc-gui/components/smartsheet/grid/Table.vue
rg -C 5 "MenuItem" packages/nc-gui/components/smartsheet/toolbar/ColumnFilter.vue
rg -C 5 "MenuItem" packages/nc-gui/components/smartsheet/header/Menu.vue
Length of output: 24149
Sorry, something went wrong.
All reactions
Uffizzi Preview |
All reactions
Sorry, something went wrong.
coderabbitai[bot]
DarkPhoenix2704
Successfully merging this pull request may close these issues.
Change Summary
Provide summary of changes with issue number if any.
Change type
Test/ Verification
Provide summary of changes.
Additional information / screenshots (optional)
Anything for maintainers to be made aware of