Skip to content

Refactor GenerateAudio component#498

Merged
galbus merged 10 commits intomainfrom
revert-495-revert-475-s-7806-refactor-wordpress-generate-audio-component-to-improve
Mar 11, 2026
Merged

Refactor GenerateAudio component#498
galbus merged 10 commits intomainfrom
revert-495-revert-475-s-7806-refactor-wordpress-generate-audio-component-to-improve

Conversation

@galbus
Copy link
Copy Markdown
Contributor

@galbus galbus commented Mar 7, 2026

This pull request refactors how the "Generate audio" checkbox state is managed in the post editor. It removes the custom beyondwords/interactions Redux store in favor of relying solely on post meta and editor state, simplifying state management and reducing complexity. The logic for preselecting and updating the checkbox is now handled directly within the GenerateAudio component using React hooks.

@linear
Copy link
Copy Markdown

linear bot commented Mar 7, 2026

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 7, 2026

✅ WordPress Plugin Check Report

✅ Status: Passed

📊 Report

All checks passed! No errors or warnings found.


🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the post editor’s “Generate audio” checkbox to rely on @wordpress/data hooks within the GenerateAudio component, and removes the now-unused beyondwords/interactions Redux store to simplify state management.

Changes:

  • Refactor GenerateAudio from withSelect/withDispatch HOCs to useSelect/useDispatch, moving preselect + meta-read logic into the component.
  • Remove the beyondwords/interactions data store (actions/reducer/selectors/registration) and stop registering it at Core init.
  • Adjust/clarify preselect logic and session-override behavior around setting beyondwords_generate_audio.

Reviewed changes

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

Show a summary per file
File Description
src/Core/index.js Stops registering the removed interactions store.
src/Core/Interactions/index.js Deletes interactions store registration entrypoint.
src/Core/Interactions/store/index.js Deletes the interactions store definition (createReduxStore).
src/Core/Interactions/store/actions.js Deletes actions for the interactions store.
src/Core/Interactions/store/reducer.js Deletes reducer for the interactions store.
src/Core/Interactions/store/selectors.js Deletes selectors for the interactions store.
src/Component/Post/GenerateAudio/index.js Converts component to hooks-based selection/dispatch and in-component preselect/meta logic.

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

@galbus galbus changed the title Refactor GenerateAudio component to use hooks and useState Refactor GenerateAudio component Mar 7, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.


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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants