Skip to content
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

DataViews Templates: Auto-hide description field for list view in template dataview page #61990

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

Souptik2001
Copy link

What?

In DataViews page for template -
Auto-hide the description field when the layout is switched to "List".

Why?

Closes: #57596

As mentioned in the above issue, template descriptions can be quite long and in list layout, where the width is narrow due to the preview pannel, the layout might not look very good.
The layout does look good when description is turned off. And therefore its a good idea to auto-hide the description field when the layout is switched to "List".

Screenshot 2024-05-26 at 11 52 55 AM

How?

This PR automatically adds the description field to the hidden fields when you -

  • Switch the layout to "List".
  • Load the page with layout set as "List".

Testing Instructions

Please see the below screencast section or refer the steps below.

  • Open site-editor.
  • Go to "Templates".
  • By default you will see the layout is "Grid".
  • Make sure the "Description" field is visible, i.e not hidden.
  • Now change the layout to "List".
  • You will see as the layout field is changed to "List" the "Description" field automatically gets hidden.
  • But if you want you can definitely go and manually enable the "Description" field, if you still want to see it in the "List" view. But everytime you switch to "List" view, it automatically gets hidden.
  • You can also do one more test.
  • Switch on the "Description" field while in the "List" layout.
  • And now refresh the page.
  • You will see that the "Description" fields gets again auto-hidden.

Testing Instructions for Keyboard

Screenshots or screencast

Screen.Recording.2024-05-26.at.12.mp4

…page

Signed-off-by: Souptik Datta <souptikdatta2001@gmail.com>
Copy link

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 props-bot label.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @Souptik2001.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Unlinked contributors: Souptik2001.

Co-authored-by: carolinan <poena@git.wordpress.org>
Co-authored-by: jasmussen <joen@git.wordpress.org>
Co-authored-by: jameskoster <jameskoster@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label May 26, 2024
Copy link

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @Souptik2001! In case you missed it, we'd love to have you join us in our Slack community.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@akasunil akasunil added [Type] Enhancement A suggestion for improvement. [Feature] Data Views Work surrounding upgrading and evolving views in the site editor and beyond labels Jun 19, 2024
@jasmussen jasmussen requested a review from a team August 27, 2024 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Data Views Work surrounding upgrading and evolving views in the site editor and beyond First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Templates: Hide description field when switching to List layout
2 participants