Skip to content

feat: add readspeaker component#32

Merged
laravdiemen merged 3 commits into
mainfrom
feat/readspeaker
Apr 2, 2026
Merged

feat: add readspeaker component#32
laravdiemen merged 3 commits into
mainfrom
feat/readspeaker

Conversation

@laravdiemen

@laravdiemen laravdiemen commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

Steeds meer klanten willen de readspeaker knop onder de h1 hebben. Met dit component kan je heel makkelijk <x-brave-read-speaker /> toevoegen in alle templates waar het nodig is. En met de hook addReadSpeakerButtonToH1 wordt het automatisch onder elke h1 in the post content toegevoegd.

@github-actions

github-actions Bot commented Mar 27, 2026

Copy link
Copy Markdown

Coverage report for commit: 5736228
File: coverage.xml

Cover ┌─────────────────────────┐ Freq.
   0% │ ███████████████████████ │ 100.0%
  10% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  20% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  30% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  40% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  50% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  60% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  70% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  80% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  90% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
 100% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
      └─────────────────────────┘
 *Legend:* █ = Current Distribution 
Summary - Lines: - | Methods: -
FilesLinesMethodsBranches
src/Components
   Accordion.php--100.00%
   BackButton.php--100.00%
   Breadcrumb.php--100.00%
   Dialog.php--100.00%
   FeedbackForm.php--100.00%
   ImgFocalPoint.php--100.00%
   PatternContent.php--100.00%
   ReadSpeaker.php--100.00%
   SocialIcon.php--100.00%
src/Components/Breadcrumb
   Crumb.php--100.00%
src
   ComponentsServiceProvider.php--100.00%
src/Hooks
   PatternContent.php--100.00%
   ReadSpeaker.php--100.00%

🤖 comment via lucassabreu/comment-coverage-clover

Comment thread src/Components/ReadSpeaker.php Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Introduces a new ReadSpeaker Blade component and WordPress hook integration so customers can place a ReadSpeaker “read aloud” button under H1 headings (manually via <x-brave-read-speaker /> and automatically via block rendering).

Changes:

  • Adds a ReadSpeaker view component and Blade view for the ReadSpeaker button.
  • Adds a Hooks\ReadSpeaker hook to inject the ReadSpeaker script in the footer and append the button after H1 blocks.
  • Registers the component/hook via the service provider and documents/configures settings.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/Hooks/ReadSpeaker.php Adds footer script injection + render_block filter to append the button to H1 blocks.
src/ComponentsServiceProvider.php Registers the new component and conditionally registers the ReadSpeaker hook.
src/Components/ReadSpeaker.php Adds <x-brave-read-speaker /> component backed by config.
resources/views/components/read-speaker.blade.php Implements the ReadSpeaker button markup.
config/components.php Adds readSpeaker configuration options.
README.md Documents ReadSpeaker component usage and configuration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Hooks/ReadSpeaker.php Outdated
Comment thread src/Hooks/ReadSpeaker.php Outdated
Comment thread resources/views/components/read-speaker.blade.php Outdated
Comment thread resources/views/components/read-speaker.blade.php Outdated
Comment thread src/ComponentsServiceProvider.php Outdated
Comment thread src/Hooks/ReadSpeaker.php Outdated
Comment thread src/Hooks/ReadSpeaker.php Outdated
@@ -0,0 +1,7 @@
<div id="{{ wp_unique_prefixed_id('readspeaker_button_') }}" class="rs_skip rsbtn rs_preserve">
<a rel="nofollow" class="rsbtn_play" title="Laat de tekst voorlezen met ReadSpeaker webReader"
href="https://app-eu.readspeaker.com/cgi-bin/rsent?customerid={{ $customerId }}&amp;lang=nl_nl&amp;readid={{ $readId }}&amp;url={{ rawurlencode(get_permalink()) }}">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Zit er soms niet nog meer in deze string? ik meeeen in ineen duister ver verleden ter herinneren dat her soms ook options en languages ofso in die url verwerkt zaten.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ik kon niks anders bedenken, anders kunnen we het altijd later nog toevoegen.

Comment thread resources/views/components/read-speaker.blade.php Outdated
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