Skip to content

Agents Manager: Restrict zoom action to editor pages#109908

Merged
wellyshen merged 2 commits intotrunkfrom
fix/am-zoom-action-outside-of-editors
Apr 9, 2026
Merged

Agents Manager: Restrict zoom action to editor pages#109908
wellyshen merged 2 commits intotrunkfrom
fix/am-zoom-action-outside-of-editors

Conversation

@wellyshen
Copy link
Copy Markdown
Contributor

@wellyshen wellyshen commented Apr 9, 2026

Part of BSKY-1892

Proposed Changes

  • Add an isEditorPage() guard to the zoom action hook so the zoom button only appears on editor pages (site editor, post/page editor).
  • Align the action id from zoom-toggle to zoom, matching the convention used by other message action hooks (copy, checkpoint, sources).

Why are these changes being made?

The zoom action button was appearing on all pages, including non-editor contexts where show_component tool messages are not meaningful. This restricts it to editor pages only.

Testing Instructions

A minor fixing, will do self-review, test, and then merge.

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?
  • 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)?

The zoom action button was appearing on all pages, but it should only
be available on editor pages (site editor, post/page editor) where
show_component tool messages are meaningful. Also aligns the action id
with the convention used by other message action hooks.

BSKY-1892

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@wellyshen wellyshen self-assigned this Apr 9, 2026
@wellyshen wellyshen marked this pull request as ready for review April 9, 2026 09:55
Copilot AI review requested due to automatic review settings April 9, 2026 09:55
@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 Apr 9, 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

Restricts the “zoom” message action so it only appears in relevant WordPress editor contexts, and standardizes the action identifier to match other message action hooks.

Changes:

  • Add an isEditorPage() guard so zoom actions are only registered for editor pages (site editor / post editor contexts).
  • Rename the action id from zoom-toggle to zoom to align with other action IDs (copy, checkpoint, sources).

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

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@matticbot
Copy link
Copy Markdown
Contributor

matticbot commented Apr 9, 2026

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • agents-manager
  • notifications
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug fix/am-zoom-action-outside-of-editors on your sandbox.

@wellyshen wellyshen changed the title fix: Restrict zoom action to editor pages Agents Manager: Restrict zoom action to editor pages Apr 9, 2026
@wellyshen wellyshen merged commit e095c87 into trunk Apr 9, 2026
14 checks passed
@wellyshen wellyshen deleted the fix/am-zoom-action-outside-of-editors branch April 9, 2026 10:26
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Apr 9, 2026
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.

3 participants