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

Hide footnotes block from the inserter #55058

Merged
merged 1 commit into from
Oct 5, 2023
Merged

Conversation

richtabor
Copy link
Member

What?

Adding the block within the editor adds an empty placeholder, whereas the actual action of adding a footnote via the block toolbar formats control is when a footnote is added to the post. I propose we remove the Footnotes block from the inserter.

The block will still be appended to the content if a footnote is added, you just can't insert an empty footnotes block (which is a good thing).

Testing Instructions

  1. Open a post or page.
  2. Search for the footnotes block. -->
  3. See no local results.
  4. Add paragraph text.
  5. Create a footnote via the formats control.
  6. See footnotes block rendered below the content.

Screenshots or screencast

Before After
CleanShot 2023-10-04 at 14 24 06 CleanShot 2023-10-04 at 14 25 02

@richtabor richtabor added [Type] Bug An existing feature does not function as intended [Block] Footnotes Affects the Footnotes Block labels Oct 4, 2023
@richtabor richtabor requested review from scruffian and a team October 4, 2023 18:32
@richtabor richtabor self-assigned this Oct 4, 2023
@richtabor richtabor marked this pull request as ready for review October 4, 2023 18:32
@fabiankaegy
Copy link
Member

fabiankaegy commented Oct 4, 2023

I've not tested this so maybe it isn't even possible. But couldn't one add the footnotes block to a block template/template part for it to render the footnotes of the current post if they are set?

For that use case the block would need to be insertable?

If we already don't expose the block there / have something in place that prevents the block from getting used in a template this makes sense to me. Otherwise I would say it should stay visible in the inserter :)


Edit:

I have now tested it and whilst the block does show a notice when inserted in a template / template part it is working and behaving as expected 🤔

But it is rather confusing because you would want to remove the footnotes block from in content but need to leave it there till you are done editing all the footnotes... So for that alone it probably makes sense to remove it for now...

@github-actions
Copy link

github-actions bot commented Oct 4, 2023

Flaky tests detected in 9e0ce33.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6410070093
📝 Reported issues:

@richtabor
Copy link
Member Author

But it is rather confusing because you would want to remove the footnotes block from in content but need to leave it there till you are done editing all the footnotes... So for that alone it probably makes sense to remove it for now...

Yea if the footnotes aren't added to the post content (at least for now), then you can't edit them. Interesting.

Copy link
Contributor

@jasmussen jasmussen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would agree, it seems like a recipe for confusion to have the footnotes block available, and that the "inserter": false option exists for cases like these.

@richtabor richtabor added the Backport to WP 6.7 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Oct 5, 2023
@richtabor richtabor merged commit 7ffd96d into trunk Oct 5, 2023
61 checks passed
@richtabor richtabor deleted the tweak/footnotes-no-inserter branch October 5, 2023 17:29
@github-actions github-actions bot added this to the Gutenberg 16.9 milestone Oct 5, 2023
@youknowriad
Copy link
Contributor

I'm not sure I agree with this change personally. If you want to put the block in a given position in the "single" template for instance, you should be able to do so (and remove the block from post content)

@richtabor
Copy link
Member Author

I'm not sure I agree with this change personally. If you want to put the block in a given position in the "single" template for instance, you should be able to do so (and remove the block from post content)

But then you can't edit the footnote.

CleanShot 2023-10-05 at 14 33 20

@Mamaduka
Copy link
Member

Mamaduka commented Oct 5, 2023

I suggested the same during the WP 6.3 release cycle. Enabling the inserter was intentional. Ref: #52812 (comment).

@youknowriad
Copy link
Contributor

I think we discussed with @ellatrix that we should allow inline editing of the footnotes as well (like in a dropdown or something) for these cases.

@jasmussen
Copy link
Contributor

Apologies for missing this context. To be sure I understand this correctly, this is about ensuring you can position where the footnotes show up when you're building a template? Yes, that's valid, though I wonder, can we hide the block when you're not in the site editor?

@ellatrix
Copy link
Member

ellatrix commented Oct 6, 2023

We specifically enabled this in the inserter in #52445 after feedback (it was originally hidden).

@mikachan
Copy link
Member

mikachan commented Oct 9, 2023

👋 Just checking if this PR should be backported to 6.4, as I noticed there was continued discussion after it was merged.

@richtabor
Copy link
Member Author

Yes, that's valid, though I wonder, can we hide the block when you're not in the site editor?

I don't think we can specify editors in block.json, right?

@jasmussen
Copy link
Contributor

👋 Just checking if this PR should be backported to 6.4, as I noticed there was continued discussion after it was merged.

Probably not, given the same discussion.

@mikachan
Copy link
Member

Probably not, given the same discussion.

Thanks @jasmussen. I'll keep my eye on the discussion and cherry-pick if/when possible.

@mikachan mikachan removed the Backport to WP 6.7 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Footnotes Affects the Footnotes Block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants