Skip to content

feat: open notes sidebar after approving a compose outline#100

Merged
pento merged 3 commits into
mainfrom
feat/notes-sidebar-after-approve
Apr 22, 2026
Merged

feat: open notes sidebar after approving a compose outline#100
pento merged 3 commits into
mainfrom
feat/notes-sidebar-after-approve

Conversation

@pento
Copy link
Copy Markdown
Owner

@pento pento commented Apr 22, 2026

Summary

  • When a user approves a compose outline, the plugin switches the active complementary area to Gutenberg's Unresolved notes sidebar (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.
  • The cancel-on-close watcher now honours an intentional post-approve switch, so the command that just got approved is not cancelled as the conversation panel closes.
  • The auto-open effect no longer re-fires on the awaiting_input → running transition that arrives on the /respond round-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 typecheck
  • npm test — 70/70 ConversationPanel tests pass, 426/426 overall
  • New tests cover: large-viewport switch, small-viewport fallback, no-switch-on-failure, no-cancel on the approve-triggered close, no re-open on awaiting_input → running, auto-open on refresh recovery into awaiting_input and into running
  • Manual: run through a Compose flow end-to-end in a Playground and confirm the Unresolved notes sidebar opens on approve with the scaffold's notes visible
  • Manual: refresh mid-conversation and confirm the conversation sidebar re-opens

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.
Copilot AI review requested due to automatic review settings April 22, 2026 01:04
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 22, 2026

✅ Coverage Report — plugin-php

Metric Value
Current coverage 99.06% (738/745)
Baseline coverage 99.06% (738/745)
Result PASS

✅ Coverage Report — plugin-typescript

Metric Value
Current coverage 99.91% (1131/1132)
Baseline coverage 99.91% (1120/1121)
Result PASS

Changed Files

File Baseline Current Status
wordpress-plugin/src/components/ConversationPanel/constants.ts 100.00% 100.00% PASS
wordpress-plugin/src/components/ConversationPanel/index.tsx 100.00% 100.00% PASS
wordpress-plugin/src/components/ConversationPanel/test/index.test.tsx SKIP (ignored)

✅ Coverage Report — typescript

Metric Value
Current coverage 96.58% (2681/2776)
Baseline coverage 96.58% (2681/2776)
Result PASS

Copy link
Copy Markdown

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 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.

Comment thread wordpress-plugin/src/components/ConversationPanel/index.tsx Outdated
pento added 2 commits April 22, 2026 11:09
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().
Copilot AI review requested due to automatic review settings April 22, 2026 01:13
Copy link
Copy Markdown

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 4 out of 5 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • wordpress-plugin/package-lock.json: Language not supported

@pento pento merged commit b478d76 into main Apr 22, 2026
12 checks passed
@pento pento deleted the feat/notes-sidebar-after-approve branch April 22, 2026 01: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.

2 participants