Skip to content

Agents Manager: show the chat on the Site Editor navigation view#112372

Open
wellyshen wants to merge 2 commits into
trunkfrom
update/agents-manager-show-chat-on-site-editor-navigation
Open

Agents Manager: show the chat on the Site Editor navigation view#112372
wellyshen wants to merge 2 commits into
trunkfrom
update/agents-manager-show-chat-on-site-editor-navigation

Conversation

@wellyshen

@wellyshen wellyshen commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Related to AI-1056

Proposed Changes

Why are these changes being made?

  • We want the AI chat available on the Site Editor navigation view; the constraint that motivated hiding it there no longer holds. Part of AI-1056.
  • The Jetpack counterpart (Agents Manager: restore the AI chat on the Site Editor navigation view jetpack#50273) removes the backend pre-render gate (Agents_Manager::is_site_editor_navigation() and the docked-shell pre-render skip). Ship both together: with only the Jetpack side deployed, the frontend would still hide the chat on the navigation view; with only this PR, the chat renders but the docked shell isn't pre-rendered there (a minor flash, not breakage).

Testing Instructions

Sandbox (Simple site with the unified experience enabled):

  1. cd apps/agents-manager && yarn dev --sync — only widgets.wp.com needs sandboxing, not the site itself.
  2. Optionally apply the Jetpack counterpart PR (Agents Manager: restore the AI chat on the Site Editor navigation view jetpack#50273) to the sandbox to also restore the docked-shell pre-render on the navigation view.
  3. Open /wp-admin/site-editor.php (the navigation view, no ?canvas=edit).
  4. Verify the Ask AI button and the Help menu show in the admin bar, the chat opens and docks, and (with the Jetpack PR applied and the chat previously open + docked) the docked sidebar shell pre-renders on load without a flash.
  5. Navigate into the editing canvas (?canvas=edit) and back to the navigation view — the chat keeps working in both directions and the docked state persists.

Calypso:

  1. yarn start, log in at http://calypso.localhost:3000.
  2. Verify the masterbar AI chat entry still opens the chat on Calypso screens (no regression from the constant un-exports).

Unit tests: yarn jest -c test/packages/jest.config.js --testPathPattern=agents-manager (37 suites, 388 tests).

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • For UI changes, have you tested the affected components in dark mode?
  • Have you tested accessibility for your changes? Ensure the feature remains usable with various user agents (e.g., browsers), interfaces (e.g., keyboard navigation), and assistive technologies (e.g., screen readers) (PCYsg-S3g-p2).
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
    • For UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

🤖 Generated with Claude Code

@wellyshen wellyshen force-pushed the update/agents-manager-show-chat-on-site-editor-navigation branch from d2ba89c to ab8872c Compare July 7, 2026 10:51
@wellyshen wellyshen self-assigned this Jul 7, 2026
@wellyshen wellyshen marked this pull request as ready for review July 7, 2026 11:51
Copilot AI review requested due to automatic review settings July 7, 2026 11:51
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jul 7, 2026

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

Restores Agents Manager AI chat availability on the WordPress Site Editor navigation (hub/list) view by removing the previously introduced “hide on navigation view” behavior, while keeping unrelated improvements from the earlier change.

Changes:

  • Removes the Site Editor navigation-view hiding hook (useHideChatOnSiteEditorNavigation) and its unit tests.
  • Removes the navigation-view render/“ready” gate from AgentDock, allowing the dock + layout manager to run on the navigation view again.
  • Cleans up now-unused exports/helpers (e.g., isSiteEditorCanvasEditMode, and internal-only constants that no longer need to be exported).

Reviewed changes

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

Show a summary per file
File Description
packages/agents-manager/src/utils/site-editor-context.ts Removes the now-unused isSiteEditorCanvasEditMode helper.
packages/agents-manager/src/hooks/use-hide-chat-on-site-editor-navigation.ts Deletes the hook that hid chat surfaces on the Site Editor navigation view.
packages/agents-manager/src/hooks/use-agent-layout-manager/index.tsx Makes sidebar layout class constants internal-only (no longer exported).
packages/agents-manager/src/hooks/use-admin-bar-integration/index.tsx Makes admin-bar element ID constants internal-only (no longer exported).
packages/agents-manager/src/hooks/tests/use-hide-chat-on-site-editor-navigation.test.ts Removes tests for the deleted navigation-view hiding hook.
packages/agents-manager/src/components/agent-dock/index.tsx Removes the navigation-view gate so chat can render on the Site Editor navigation view again.

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

@wellyshen

Copy link
Copy Markdown
Contributor Author

This PR just gets the AI chat back on the site navigation screen. I will do a self-test, review, and then merge it when it's ready!

@wellyshen wellyshen requested a review from a team July 7, 2026 11:55
@wellyshen wellyshen force-pushed the update/agents-manager-show-chat-on-site-editor-navigation branch from ab8872c to 8c838ab Compare July 7, 2026 12:05

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

Worked as described

@wellyshen wellyshen force-pushed the update/agents-manager-show-chat-on-site-editor-navigation branch from 8c838ab to cf0facd Compare July 8, 2026 08:54
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

Looks like one of the E2E tests has failed.

You can fix them following these steps:

  1. Check out this branch locally:
    gh pr checkout 112372
  2. Start Claude Code in the repo:
    claude
  3. Run the /fix-e2e-tests skill, passing this PR number:
    /fix-e2e-tests 112372
    

Revert the navigation-view hiding added in #112164. Remove
`useHideChatOnSiteEditorNavigation` (and its test), the dock's render gate
and layout-manager `isReady` wiring, and the now-unused
`isSiteEditorCanvasEditMode` helper; un-export the admin-bar button IDs and
sidebar class-name constants the hook imported. The `#wpadminbar` height fix
and the `isChatEnabled` rename from that PR are kept.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@wellyshen wellyshen force-pushed the update/agents-manager-show-chat-on-site-editor-navigation branch from cf0facd to 35214bf Compare July 8, 2026 09:08
…ation

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants