-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: Correction box & Loop item blocks #312
Conversation
Hi @Takshil-Kunadia , I pushed a few changes. Overall it works well but I noticed the blocks need to support all the settings properly. Also, the idea of the Corrections block (the one you named Correction Box) is to have it within the Single template. Not inside an actual post. With the "Block Spacing" setting, it's supposed to control the spacing between corrections |
Can we change "Archive Newspack Corrections" to "Corrections Archive"? |
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.
See comments:
#312 (comment)
#312 (comment)
Thanks! @thomasguillot for taking a look.
I have fixed this, all settings are supported now.
The blockGap setting will work partially ( spacing is visible in front-end but not in the editor ), blockGap doesn't work well with ServerSideRender. It seems to be a core issue. If you can confirm this, I will raise it on Gutenberg and solve it.
Yes, this block will work in the Single template. Please review 🙇 |
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.
In the editor, the styles are being applied to 2 divs.
We also need the block to come with some default settings:
- Font size: small
- Text (and link) colour: contrast-3
- Block spacing: spacing--30
Overall, I do think the empty state can be improved (and it will fix the way it looks when added to a Template):
- Change the placeholder to some text: "This is the Corrections block, it will display all the corrections and clarifications". If the block is added to a post we can even add more context to a new paragraph: "[...] There are no corrections or clarifications for this post."
- In a template, we don't need the refresh functionality
- Can we avoid the whole "loading corrections" placeholder since it's empty? Especially when it's added to a template
Thanks for the input @thomasguillot . The blockgap is not working because it doesn't seem to work well with SSR blocks. Should I raise an issue?(#312 (comment)) |
Sorry @Takshil-Kunadia, I clearly missed this. I don't think it'll be fixed anytime soon but it's worth reporting, yes. 👍 |
@thomasguillot Had a dig at the mentioned issues.
Agreed, added a separate UI for site editor with the custom message as you mentioned. No loading placeholders & refresh.
This shouldn't be the case. Can you please confirm this behaviour?
I also hit a road block with this one as this is a know issue of Gutenberg( ref: WordPress/gutenberg#7342 ), we can set defaults for block support styles and they do appear in the editor as expected, but these attributes do not get saved unless there is a manual change in one of the settings. So if this block is added, since the styles are available in editor it will display the default styles but they won't be saved and take effect in the front-end. This is what it results in:-
Due to this, I don't feel confident in adding default block support styles for this block. Regardless, if you feel it is a necessity, I'll add it 🙇 . |
Yes, it’s fixed. Not sure what happened. |
2018! Wow... ok let's ignore default settings 👍 |
Looks great. Thank you @Takshil-Kunadia. I have one more request... I forgot to comment on this:
I didn't realise we needed |
Thanks @thomasguillot and @Takshil-Kunadia , Sorry to do this again, but once this is ready to ship, I think it actually should live somewhere else. I discussed with @laurelfulford and it makes sense for this to live in the main plugin, alongside the rest of the feature implementation. Isn't that one of the beauties of Block Themes? Now we can more easily have theme agnostic features. We could also argue to add it to the newspack-blocks plugin, but we often say we want to merge that with the main plugin so... |
No worries @leogermani 😄 , created a PR to add the blocks to plugin. Automattic/newspack-plugin#3787. We can safely close this PR. |
All Submissions:
Changes proposed in this Pull Request:
Addresses https://app.asana.com/0/1209292256643614/1209292256643625
How to test the changes in this Pull Request:
Testing Corrections Box Block:-
Testing Corrections Loop template:-
Archive Newspack Corrections
template.For individual testing of the Corrections Loop item block
Other information:
Demo:-
Corrections Box block:-
Screen.Recording.2025-02-17.at.12.27.17.PM.mov
Archive Corrections Loop Item/Template block:-
Screen.Recording.2025-02-17.at.12.25.41.PM.mov