Skip to content

Fix/bugbot 2.1.0#31

Merged
firestar300 merged 4 commits into
developfrom
fix/bugbot-2.1.0
Jun 30, 2026
Merged

Fix/bugbot 2.1.0#31
firestar300 merged 4 commits into
developfrom
fix/bugbot-2.1.0

Conversation

@firestar300

@firestar300 firestar300 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Note

Low Risk
Editor UX and structured-data merging only; no auth or sensitive data paths, with a small risk of duplicate FAQ entries if SEOpress and blocks both define overlapping questions.

Overview
SEOpress FAQ schema now appends block-generated questions to any existing mainEntity from SEOpress instead of replacing them. New helpers normalize mainEntity (single question vs list) and assign sequential position values on the merged list.

FAQ block editor refactors question heading level sync: shared syncQuestionHeadingLevels, useLayoutEffect for ongoing sync, and immediate sync when accordion is turned on or the heading level control changes (not only via a passive effect). Block editor store usage is aligned via blockEditorStore and explicit clientId.

Reviewed by Cursor Bugbot for commit 9bdccb9. Bugbot is set up for automated code reviews on this repo. Configure here.

Refactors heading level synchronization using `useLayoutEffect` and direct calls. This prevents visual delays and inconsistencies when the parent FAQ block's `isAccordion` or `headingLevel` attributes change in the editor.
Ensures that new FAQ questions are merged with existing ones in the schema data, rather than overwriting them. Normalizes the structure of existing questions and renumbers all combined questions to maintain valid Schema.org position values.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 2f1d1f8. Configure here.

Comment thread src/faq/edit.js
Comment thread src/faq/edit.js
Updates the `useSyncQuestionHeadingLevels` hook to leverage `@wordpress/data`'s
`useSelect` and `useDispatch` for accessing block editor state and actions.

This removes the need to pass the `blockEditor` object as a prop, improving
the hook's encapsulation and aligning with modern WordPress block editor
development patterns.
Updates the `useSyncQuestionHeadingLevels` hook to explicitly select the inner
FAQ question blocks using `useSelect`. By including these blocks in the
`useEffect` dependencies, heading levels are now correctly re-synchronized
when questions are added, removed, or reordered within the FAQ block.
@firestar300 firestar300 merged commit 1bcb917 into develop Jun 30, 2026
3 checks passed
@firestar300 firestar300 deleted the fix/bugbot-2.1.0 branch June 30, 2026 10:26
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.

1 participant