Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,23 @@ const WithBackupsValueSection = props => {
{ lastRewindableEvent ? (
<div className={ styles.activity }>
<Gridicon icon={ lastRewindableEvent.gridicon } size={ 24 } />
<p className={ styles.summary }>{ lastRewindableEvent.summary }</p>
<p className={ styles.summary }>
{ lastRewindableEvent.summary }
{ lastRewindableEvent.actor?.is_mcp_agent && (
<>
{ ' ' }
<span className={ styles.mcpBadge }>
{ sprintf(
/* translators: %s: The name of the MCP client application. */
__( 'via %s (MCP)', 'jetpack-my-jetpack' ),
lastRewindableEvent.actor?.mcp_client ||
lastRewindableEvent.actor?.mcp_client_name ||
__( 'MCP client', 'jetpack-my-jetpack' )
) }
</span>
</>
) }
</p>
</div>
) : null }
</ProductCard>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@
font-size: var(--font-body-small);
margin: 0;
}

.mcpBadge {
display: block;
font-size: var(--font-body-extra-small);
color: var(--jp-gray-50);
}
}

.description {
Expand Down
4 changes: 4 additions & 0 deletions projects/packages/my-jetpack/changelog/mcp-activity-log
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: added

Display MCP client actor attribution in My Jetpack backup card
11 changes: 10 additions & 1 deletion projects/plugins/jetpack/_inc/client/at-a-glance/backups.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,8 @@ class DashBackups extends Component {
actorName,
actorRole,
actorAvatarUrl,
isMcpAgent,
mcpClient,
undoBackupId,
} = backupUndoEvent;

Expand All @@ -440,7 +442,14 @@ class DashBackups extends Component {
</div>
<div className="dash-backup-undo__activity-log-user-meta-name">
{ actorName }
{ actorRole && ' - ' + actorRole }
{ isMcpAgent
? ' - ' +
sprintf(
/* translators: %s: The name of the MCP client application. */
__( 'via %s (MCP)', 'jetpack' ),
mcpClient || __( 'MCP client', 'jetpack' )
)
: actorRole && ' - ' + actorRole }
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ const backupUndoEvent = (
actorName: activity.actor?.name ?? '',
actorRole: activity.actor?.role ?? '',
actorType: activity.actor?.type ?? '',
isMcpAgent: activity.actor?.is_mcp_agent ?? false,
mcpClient: activity.actor?.mcp_client ?? activity.actor?.mcp_client_name ?? '',
activityDate: activity.published ?? '',
activityId: activity.activity_id,
activityName: activity.name,
Expand Down
4 changes: 4 additions & 0 deletions projects/plugins/jetpack/changelog/mcp-activity-log
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: enhancement

Display MCP client actor on backup undo card and backup card attribution
Loading