Show 'Fleet will try again.' in host activity feed for NotNow MDM commands (#44532)

Relates to: https://github.com/fleetdm/fleet/issues/44529

## Summary

- Adds "Fleet will try again." text to the host-level activity feed for
MDM commands with a "NotNow" status, matching the existing behavior in
the CommandDetailsModal.
- Previously, users had to open the modal to see this retry information;
now it's visible directly in the activity feed.

## Changes

-
`frontend/pages/hosts/details/cards/Activity/CommandItem/CommandItem.tsx`:
When a command's `status` is `"NotNow"`, append " Fleet will try again."
to the activity text displayed in the feed.

## QA

1. Navigate to a host details page with MDM commands enabled.
2. Trigger or find a command with "NotNow" status (host locked or
running on battery in Power Nap).
3. Verify the activity feed item shows "The **{command}** command is
deferred. Fleet will try again."
4. Verify the CommandDetailsModal still shows the full deferred message
with "Fleet will try again."

---

Built for [Mel
Pike](https://fleetdm.slack.com/archives/D0AKX7DJFCN/p1777575458215749?thread_ts=1777299502.461149&cid=D0AKX7DJFCN)
by [Kilo for Slack](https://kilo.ai/slack)

Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
Co-authored-by: melpike <79950145+melpike@users.noreply.github.com>
This commit is contained in:
kilo-code-bot[bot]
2026-05-07 09:22:48 -06:00
committed by GitHub
co-authored by kiloconnect[bot] melpike
parent e0da361901
commit 5c3d8ae807
@@ -38,9 +38,10 @@ const getStatusText = (command: ICommand): string => {
};
const CommandItem = ({ command, onShowDetails }: ICommandItemProps) => {
const { request_type, updated_at, name } = command;
const { request_type, updated_at, name, status } = command;
const statusText = getStatusText(command);
const willRetryText = status === "NotNow" ? " Fleet will try again." : "";
const onShowCommandDetails = (e: React.MouseEvent<HTMLButtonElement>) => {
e.stopPropagation();
@@ -50,10 +51,11 @@ const CommandItem = ({ command, onShowDetails }: ICommandItemProps) => {
const activityText = name ? (
<>
The <b>{request_type}</b> command for <b>{name}</b> {statusText}.
{willRetryText}
</>
) : (
<>
The <b>{request_type}</b> command {statusText}.
The <b>{request_type}</b> command {statusText}.{willRetryText}
</>
);