-
Notifications
You must be signed in to change notification settings - Fork 4.6k
DataViews: Do not render an item for visible locked items in properties config menu #73878
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
base: trunk
Are you sure you want to change the base?
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
An alternative approach here would be to keep the menu item visible, but make it disabled, or show a lock icon. I decided to try hiding it altogether inspired by MacOS Finder which also hides untoggle-able items. |
packages/dataviews/src/components/dataviews-view-config/properties-section.tsx
Outdated
Show resolved
Hide resolved
|
Seems reasonable to me. |
|
Flaky tests detected in aaee500. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/20101047876
|
|
This changes a few things:
This is how it works in Screen.Recording.2025-12-11.at.19.37.00.movThis is how it works with this change (can hide any fields because there's title/media/description): Screen.Recording.2025-12-11.at.19.33.27.movHowever, this is what happens when there is no title/media/description is provided (cannot hide the last field): Screen.Recording.2025-12-11.at.19.34.21.mov |
|
@oandregal Good catch. Do you think it would make sense to simply disable the last visible field (when there's no title/media/description)? Is that possible? |
|
Showing it active and disabled makes sense to me. |
What
Stop rendering
FieldItemcomponents for visible locked fields in the properties section of the DataViews view config.Why
Visible locked fields are always visible and cannot be toggled off when they're already shown. Displaying them in the properties list adds unnecessary UI clutter and can confuse users since these items appear interactive but don't provide meaningful actions when visible.
How
Removed the
visibleLockedFields.map()block that was renderingFieldItemcomponents for visible locked fields. ThevisibleLockedFieldsvariable is still calculated and used for logic (determining total visible fields count and preventing hiding when only one field is visible), but these items are no longer rendered in the UI. Hidden locked fields and regular fields continue to render as before.Note there is no longer a 'Title' item in the menu because the Title field cannot be toggled on/off.