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

Add ability to show dropCap tools panel by default #45755

Closed
fabiankaegy opened this issue Nov 14, 2022 · 4 comments · Fixed by #45994
Closed

Add ability to show dropCap tools panel by default #45755

fabiankaegy opened this issue Nov 14, 2022 · 4 comments · Fixed by #45994
Labels
[Block] Paragraph Affects the Paragraph Block [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Feature] Extensibility The ability to extend blocks or the editing experience [Feature] Typography Font and typography-related issues and PRs Needs Testing Needs further testing to be confirmed. [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed.

Comments

@fabiankaegy
Copy link
Member

What problem does this address?

It is currently not possible to show the Drop Cap setting in the Settings sidebar by default. If your design system makes use of this option frequently it has become more difficult over time to actually add this control.

What is your proposed solution?

All of the other typography supports which actually technically are block support options make use of the __experimentalDefaultControls in the block supports configuration object to control which settings get shown by default.

It would be great if this mechanism (or any other way to achieve this) would also work for custom registered tools panels such as the drop cap setting

import { addFilter } from '@wordpress/hooks';

function addDropCapSettingByDefault(settings, name) {
	if (name !== 'core/paragraph') {
		return settings;
	}

	return {
		...settings,
		supports: {
			...settings?.supports,
			typography: {
				...settings?.supports?.typography,
				__experimentalDefaultControls: {
					...settings?.supports?.typography?.__experimentalDefaultControls,
					dropCap: true,
				},
			},
		},
	};
}

addFilter(
	'blocks.registerBlockType',
	'add-drop-cap-setting-by-default',
	addDropCapSettingByDefault,
);
@fabiankaegy fabiankaegy added [Feature] Extensibility The ability to extend blocks or the editing experience [Block] Paragraph Affects the Paragraph Block [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Feature] Typography Font and typography-related issues and PRs labels Nov 14, 2022
@github-actions
Copy link

Hi,
This issue has gone 180 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps.
Thanks for helping out.

@github-actions github-actions bot added the Needs Testing Needs further testing to be confirmed. label May 14, 2023
@github-actions
Copy link

Hi,
This issue has gone 30 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps.
Thanks for helping out.

@github-actions github-actions bot added the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Jun 14, 2023
@jordesign
Copy link
Contributor

As noted in the linked PRS (eg. #45994) this approach isn't the best fit for the dropCap panel - so I'll close this issue.

@jordesign jordesign closed this as not planned Won't fix, can't repro, duplicate, stale Jul 10, 2023
@jeffpaul
Copy link
Member

jeffpaul commented Nov 4, 2024

Copying over my note in #45994 (comment) in case this is a better place to converse on the topic:

Noting that I just ran into a project where dropcap's were prominently utilized in the frontend design and having to get all editors/authors to make all the additional clicks to set this on a paragraph block was not the most graceful experience for anyone. While I totally agree that the dropcap setting should not be exposed as a default, at least having the ability in code to do so for a specific site need (e.g. frontend design uses it on intro paragraph on posts) makes for a dramatically better editor experience.

Re-opening for consideration as this feels like a decent "paper cut" sort of simple improvement that may not impact the large majority but for those who do benefit its a much better experience than the current experience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Paragraph Affects the Paragraph Block [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Feature] Extensibility The ability to extend blocks or the editing experience [Feature] Typography Font and typography-related issues and PRs Needs Testing Needs further testing to be confirmed. [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants