feat: open notes sidebar after approving a compose outline#100
Merged
Conversation
When a user approves a compose outline, the plugin now switches the active complementary area to Gutenberg's Unresolved notes sidebar (or All notes on small viewports) so the editorial notes that land with the scaffold are immediately visible. The cancel-on-close watcher is taught to ignore this intentional switch, and the auto-open effect no longer re-fires on the awaiting_input → running transition that arrives on the /respond round-trip.
✅ Coverage Report — plugin-php
✅ Coverage Report — plugin-typescript
Changed Files
✅ Coverage Report — typescript
|
There was a problem hiding this comment.
Pull request overview
This PR updates the ConversationPanel behavior so that approving a compose outline automatically switches the active Gutenberg sidebar to the editorial notes UI (Unresolved notes on larger viewports, All notes on smaller ones), while preventing the conversation command from being cancelled due to the sidebar switch and avoiding an unwanted “auto-open” re-trigger on awaiting_input → running.
Changes:
- Switch complementary area to Gutenberg collab sidebars after a successful outline approve (with viewport-based fallback).
- Adjust auto-open logic to not re-open the conversation sidebar on
awaiting_input → running. - Add/extend unit tests covering recovery auto-open, sidebar switching, and cancel-on-close behavior around approve.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| wordpress-plugin/src/components/ConversationPanel/index.tsx | Implements approve-triggered sidebar switching, refines auto-open transitions, and updates cancel-on-close behavior. |
| wordpress-plugin/src/components/ConversationPanel/constants.ts | Adds constants for Gutenberg collab sidebar identifiers used in the approve flow. |
| wordpress-plugin/src/components/ConversationPanel/test/index.test.tsx | Adds tests for viewport-based notes sidebar switching, recovery auto-open, and ensuring approve doesn’t trigger cancellation or re-open. |
useViewportMatch is imported from @wordpress/compose by the conversation panel; declare it as a direct dependency so the lint rule import/no-extraneous-dependencies passes.
…and id. Replaces the boolean post-approve ref with a command-id-scoped ref so a signal that never gets consumed (e.g. if the approved command reaches terminal status before the close-watcher effect fires) cannot cause a subsequent unrelated command's close to silently skip cancel().
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.
Summary
edit-post/collab-sidebar), falling back to All notes (edit-post/collab-history-sidebar) on small viewports where the floating sidebar is not rendered. The editorial notes attached to the scaffold are immediately visible instead of requiring a manual sidebar toggle.awaiting_input → runningtransition that arrives on the/respondround-trip. Before, that transition re-enabled the conversation sidebar (harmless when the target was the same sidebar, but now undoes the switch).Test plan
npm run typechecknpm test— 70/70ConversationPaneltests pass, 426/426 overallawaiting_input → running, auto-open on refresh recovery intoawaiting_inputand intorunning