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

Post Title: Transform added for paragraph and heading #68239

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

benazeer-ben
Copy link
Contributor

What?

Fixes #52203

Why?

Currently Title block has no transform option for paragraph and heading.

How?

Added paragraph and heading transform to title block.

Testing Instructions

  1. Go to WP admin dashboard.
  2. Edit/create any post/page.
  3. Create a Title Block
  4. Try to transform it to a heading/paragraph block.

Screenshots or screencast

Screenshare.-.2024-12-23.1_54_34.PM.mp4

Copy link

github-actions bot commented Dec 23, 2024

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.

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

Co-authored-by: benazeer-ben <[email protected]>
Co-authored-by: carolinan <[email protected]>
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: hanneslsm <[email protected]>

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

@akasunil akasunil added [Type] Enhancement A suggestion for improvement. [Block] Post Title Affects the Post Title Block labels Jan 6, 2025
@benazeer-ben
Copy link
Contributor Author

Hi Team,

Whenever you have some time, could you please review this PR? I’d really appreciate your feedback.

Thanks in advance!

@fabiankaegy @t-hamano @carolinan

@carolinan
Copy link
Contributor

Thank you for the ping. I actually looked at this earlier today but wanted to think about it for a bit before I responded.

First, my major concern is that it has not been discussed what exactly should happen for example when a paragraph is transformed into a title block. I do feel that there needs to be a decision first.
Should the paragraph text be replaced? Or should the title of the post be update with the paragraph text?
It is not clear to me what the user's need and expectation is, and I think the scope of the change should be reduced.

Is there a reason why the edit.js file is updated instead of using a transforms.js file? I believe using the separate file is preferred.

As you found out, the block library should not depend on wordpress/editor.
If it must be used, please compare the code with how this is solved in the other blocks, and include the relevant inline comments about why an exception is needed.

@benazeer-ben
Copy link
Contributor Author

Is there a reason why the edit.js file is updated instead of using a transforms.js file? I believe using the separate file is preferred.

Thanks for pointing that out @carolinan

I will add the transform code to a separate file, that will be the best way!

@t-hamano
Copy link
Contributor

First, my major concern is that it has not been discussed what exactly should happen for example when a paragraph is transformed into a title block. I do feel that there needs to be a decision first.
Should the paragraph text be replaced? Or should the title of the post be update with the paragraph text?
It is not clear to me what the user's need and expectation is, and I think the scope of the change should be reduced.

I agree. The issue was originally proposed to be transformed to Heading/Paragraph, with no mention of the reverse. Changing from Headings/Paragraph should be discussed separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Post Title Affects the Post Title Block [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Title block: Transform to Heading
4 participants