Skip to content

Conversation

@sneridagh
Copy link
Member

@sneridagh sneridagh commented Oct 28, 2025

This is the first time we will use @plone/components in Volto core.
We decided that in Volto 19, we will allow the usage of @plone/components.

@sneridagh sneridagh changed the title New ButtonsWidget Refactored ButtonsWidget and AlignWidget. New blockWidth, blockAlignment and size widgets based on ButtonsWidget. Oct 28, 2025
@sneridagh sneridagh marked this pull request as ready for review October 28, 2025 10:22
*/
// import '../theme/themes/pastanaga-cms-ui/extras/cms-ui.semantic.less';
import 'semantic-ui-less/semantic.less';
import '@plone/components/dist/basic.css';
Copy link
Member Author

Choose a reason for hiding this comment

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

@pnicolli we have to talk about this one.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I noticed this one and yes we need to, this is a new problem to tackle.

@sneridagh sneridagh requested a review from a team October 28, 2025 10:26
Copy link
Collaborator

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

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

Comment on lines 112 to 122
React.useEffect(() => {
if (!value && defaultValue) {
const nextValue =
typeof defaultValue === 'string'
? normalizedActions.find(({ name }) => name === defaultValue)
?.value ?? defaultValue
: defaultValue;

onChange(id, nextValue);
}
}, [defaultValue, id, normalizedActions, onChange, value]);
Copy link
Contributor

Choose a reason for hiding this comment

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

What is this for?

Copy link
Member Author

Choose a reason for hiding this comment

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

It was necessary for managing the default value... This predates the "fixed" defaults in the blocks settings, so I haven't tried if that's necessary afterwards. Also, could be that RAC takes care for you, so you don't have to now. I will take a look.

Copy link
Member Author

Choose a reason for hiding this comment

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

I removed it, and refactored to use RadioGroup defaultValue instead.

[actions],
);

const selectedActionName = React.useMemo(
Copy link
Contributor

Choose a reason for hiding this comment

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

This memoization feels unnecessary to me, do you have a situation where it's needed?

Copy link
Member Author

@sneridagh sneridagh Oct 31, 2025

Choose a reason for hiding this comment

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

Isnt't what the compiler is doing? The machine suggested that in case the options are big (for sure it would never be...)

[normalizedActions, value],
);

const handleChange = React.useCallback(
Copy link
Contributor

Choose a reason for hiding this comment

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

This one as well, not sure it's really needed

Copy link
Member Author

Choose a reason for hiding this comment

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

Same here.

Copy link
Collaborator

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

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

Docs look purty now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants