Feature/building sharer button block - #1
Merged
Conversation
This commit transforms the initial block scaffold into a robust feature. It introduces server-side rendering for the post sharing block, allowing for dynamic content and improved performance. Key changes include: - Refactoring block rendering logic into dedicated PHP classes (`BlockRenderer`, `ResponsiveDisplay`). - Adding comprehensive block attributes for customizing button labels, icon visibility, and icon positioning. - Implementing responsive display settings, enabling conditional visibility of copy and share buttons based on viewport. - Integrating front-end JavaScript for clipboard copy functionality and leveraging the native Web Share API for sharing post URLs. - Enhancing development tooling with new Composer autoload rules, updated plugin metadata, and i18n scripts. - Updating dependencies and removing the old `package-lock.json` to reflect the new structure. This significantly enhances the block's functionality, customizability, and overall user experience.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit bde7f1b. Configure here.
Throw when execCommand('copy') fails so users do not see a false success state, and show feedback when canShare rejects the share payload.
Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Pull Request —
feature/building-sharer-button-block→developSummary
Implémentation complète du bloc Post Sharing Button : copie du lien de l’article et partage natif via l’API Web Share.
Bloc Gutenberg
blockparty/post-sharing-buttonsave.js)copiedLabel)link,share,check) viamask-imageet variables CSS surchargeables par le thèmesr-onlyaprès copieRéglages éditeur
displaySettingsPHP
blockparty-icons: namespaceBlockparty\PostSharing, autoload PSR-4BlockRenderer: rendu dynamique avec URL/titre de la publication couranteResponsiveDisplay: classes CSS responsive + breakpoint filtrable (blockparty_post_sharing_breakpoint, défaut 600px)Front-end (
view.js)navigator.share()(progressive enhancement)aria-livei18n & docs
languages/)README.mdQualité & tooling
phpcs.xml.dist: scan du dossierincludes/wpcs ^3.3,phpcs ^3.13.4)make-pot,make-json,start:env/stop:envTest plan
npm install && npm run build— build OKcomposer install && composer cs— PHPCS OK3 commits · 26 fichiers ·
+1537 / -25870lignesNote
Low Risk
New editor block and front-end clipboard/share behavior with no auth or sensitive data paths; scope is limited to post permalink sharing UI.
Overview
This PR ships the Post Sharing Button Gutenberg block (
blockparty/post-sharing-button) as a dynamic block: PHP renders copy/share actions with the current post URL and title, and the scaffold-styleinitis replaced by a namespaced bootstrap with Composer PSR-4 autoload forBlockRendererandResponsiveDisplay.Server-side,
BlockRendereroutputs labeled buttons, optional icon layout classes, anddata-*attributes for the view script;ResponsiveDisplayadds per-viewport visibility classes and injects breakpoint CSS (filterable viablockparty_post_sharing_breakpoint). Front-end behavior inview.jshandles clipboard copy (with fallback), Web Share when available, copied-state UI, andaria-livefeedback.Tooling & release: French translations and POT, a full
README.md, Playground blueprint/demo post (replacing the prior modal demo),.gitignoreforcomposer.lock, and bumped PHPCS/WPCS dev dependencies.Reviewed by Cursor Bugbot for commit 37a0e7c. Bugbot is set up for automated code reviews on this repo. Configure here.