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

Duplicated settings in inspector controls on Comments Query Loop block #38080

Closed
cbravobernal opened this issue Jan 19, 2022 · 6 comments · Fixed by #39472
Closed

Duplicated settings in inspector controls on Comments Query Loop block #38080

cbravobernal opened this issue Jan 19, 2022 · 6 comments · Fixed by #39472
Assignees
Labels
[Block] Comments Affects the Comments Block - formerly known as Comments Query Loop [Type] Bug An existing feature does not function as intended

Comments

@cbravobernal
Copy link
Contributor

Description

When I add a Comments Query Loop, if we set more than 2 items per page. Most of the sidebars options of all inner elements appear n times, being n equal to items per page -1.

Step-by-step reproduction instructions

  1. Go to a page or a post with comments, you need to have at least 3 comments.
  2. Use the toolbar option to change the comments per page.
  3. Click on any inner block of the Comment Template and check sidebar for duplicated settings.

Screenshots, screen recording, code snippet

bugSettingsComments.mov

Environment info

  • WordPress version 5.9-beta3-52380
  • Gutenberg version "trunk"

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@cbravobernal cbravobernal added the [Block] Comments Affects the Comments Block - formerly known as Comments Query Loop label Jan 19, 2022
@cbravobernal cbravobernal added the [Type] Bug An existing feature does not function as intended label Jan 20, 2022
@gziolo
Copy link
Member

gziolo commented Jan 21, 2022

I reported it also in a comment here: #37154 (comment). I think it's related to the issue with rendering either a loop of the same blocks, or it's coming from the nested blocks. Anyway, we need to improve how we render the Comment Template block and its inner blocks. I think @michalczaplinski is looking into it already. We should find out whether #37154 and this one are separate issues.

@michalczaplinski
Copy link
Contributor

Strangely enough the same issue was mentioned by @andrewserong in #38263 (review)

Seems like the problem of having duplicate sidebar controls also came up before in Post Template block #37519 (comment)

@gziolo gziolo changed the title Duplicate settings on Comments Query Loop Duplicated settings in inspector controls on Comments Query Loop block Feb 9, 2022
@michalczaplinski michalczaplinski self-assigned this Feb 15, 2022
@SantosGuillamot
Copy link
Contributor

@michalczaplinski I've realised that, in the editor, if you click in any of the inner blocks of the Comment Template, it jumps to the latest comment. I made a quick video to show it:

https://www.loom.com/share/ac22dbcb0d25492888df959a3445dc86

Not sure if it is related to this issue, but as both happen only in the editor I thought they could be triaged at the same time. Please let me know if you think it makes sense to open a new one.

@gziolo
Copy link
Member

gziolo commented Feb 18, 2022

@michalczaplinski and @c4rl0sbr4v0, if you need some help we can pair to work on this one next week. It's a very tricky one and there are several issues with how it works today. We tested a few different scenarios yesterday with @SantosGuillamot and it was very difficult to achieve simple goals like wrapping inner blocks with a Group block or use multiselection, etc.

@michalczaplinski
Copy link
Contributor

@michalczaplinski I've realised that, in the editor, if you click in any of the inner blocks of the Comment Template, it jumps to the latest comment. I made a quick video to show it:

Yup, this is a known issue 🙂 These are the 3 the bugs that I'm quite sure are related to the problem of "duplicate settings" that is described in the current issue:

  • If a top-level comment has replies and is clicked on, its innermost reply is being selected instead.
  • If a comment has multiple replies and a user selects one of the inner blocks of that comment (e.g. the Comment Date) then this same Comment Date block flickers across all the comments.
  • In order to select one of the inner blocks of the Comment Template, it is necessary to click twice. That is, clicking on a block within another instance selects the parent template block instead. This issue is mentioned here (I’d say it’s not essential, but it is a quite annoying) This one is probably related but I'm not 100% sure

@gziolo That would be great! I have in fact spent a couple of hours trying to come up with a solution yesterday and I haven't made great progress so far :/ It seems to be tricker than I thought. I think it's somehow related to the fact that we are are nesting inner blocks several times (because replies can have replies that can have replies, etc.)

@michalczaplinski
Copy link
Contributor

michalczaplinski commented Mar 15, 2022

Status update:

This issue has been blocked by two additional issues:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Comments Affects the Comments Block - formerly known as Comments Query Loop [Type] Bug An existing feature does not function as intended
Projects
None yet
4 participants