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

Redesign Smaily block component #30

Merged
merged 31 commits into from
Feb 13, 2025
Merged

Conversation

sinukaarel
Copy link
Collaborator

The block component has an issue that the source code is not editable. This can be resolved only by implementing a new component with source code available for manipulation. This allows further improvements to the component and fixing bugs and providing new features is a much simpler task.

The block component has an issue that the source code is not editable. This can be resolved only by implementing a new component with source code available for manipulation.  This allows further improvements to the component and fixing bugs and providing new features is a much simpler task.
@sinukaarel sinukaarel added the enhancement New feature or request label Jan 29, 2025
@sinukaarel sinukaarel self-assigned this Jan 29, 2025
@sinukaarel sinukaarel marked this pull request as ready for review February 6, 2025 08:28
@sinukaarel
Copy link
Collaborator Author

@kaittodesk ready for the first test run. I have some improvements to make but it should be compatible with previous functionality right now.

So... to get started you should run composer run build-blocks script or if you want to tinker around and see active changes then cd into the blocks/newsletter-signup and run npm ci && npm start. This should also build the block component.

Currently blocking question is if the block should be usable also in case the user hasn't validated their credentials.

I will give you also a general overview.

The block-building flow is similar, you can find it in the block editor when searching for smaily or by scrolling

image

I have changed the Blocks UI logic - the user sees the preview in the block editor and settings in the settings panel. The previous iteration didn't provide a preview in the editor. You could only see the form "live".

image

Settings are separated into two categories - visible and hidden. The visible category is open by default, hidden fields are more "advanced" and should be manipulated only for advanced usage.

image

Visible fields no longer provide an option to select a "title". This can be done in the editor by just introducing a title block above the form. Also, the form is relatively simple and minimal. This allows the building of UI elements around the form itself. This allows adding pictures or other visual elements to catch the attention of possible subscribers. Also, the success and error messages are unified into two states where the user can define messages. The same logic is applied for labels so that users don't have to install a third-party plugin to translate values into their preferred language.

image

The advanced form options allow selecting the autoresponder and success/error URLs. These default URLs (not specified) no longer redirect back to the webpage root but to the same page on which the block is on. I think this is a better approach.

@sinukaarel sinukaarel requested a review from kaittodesk February 6, 2025 09:18
blocks/newsletter-signup/src/block.json Show resolved Hide resolved
blocks/newsletter-signup/src/block.json Outdated Show resolved Hide resolved
blocks/newsletter-signup/src/block.json Show resolved Hide resolved
blocks/newsletter-signup/src/edit.js Outdated Show resolved Hide resolved
includes/smaily-helper.class.php Outdated Show resolved Hide resolved
Comment on lines 30 to 31
title: __( 'Smaily Sign-Up Form', 'smaily' ),
description: __( 'Smaily newsletter subscription form.', 'smaily' ),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Might need a name improvement here:
image

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe Opt-in subscribers directly to Smaily for seamless email marketing.

@sinukaarel sinukaarel merged commit 65dd4d5 into main Feb 13, 2025
1 check passed
@sinukaarel sinukaarel deleted the dev/smaily-block-component branch February 13, 2025 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants