fix(ui): remove monitor reply-wake copy and vertically center Check now (#23763)

## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - The task detail view renders two monitor surfaces
(`IssueMonitorBanner` and `IssueMonitorComposerStrip`) when a task waits
for a scheduled monitor check or scheduled retry.
> - The composer monitor strip displayed a default helper line ("Sending
a reply wakes the agent now — before the scheduled check.") below the
header row.
> - That helper line added unnecessary copy and pushed the `Check now`
button upward, leaving it off-center inside the card, while
`IssueMonitorBanner` inherited top alignment (`sm:items-start`) from
`InlineBanner`.
> - This pull request removes the default reply-wake copy, computes the
remaining specialized hints in `buildMonitorSurfaceCopy`, places them
inside the left column of the flex row, and vertically centers the
`Check now` button on both monitor surfaces.
> - The benefit is a cleaner monitor card with a vertically centered
primary action across all waiting states.

## Linked Issues or Issue Description

**What existing behavior does this improve?**
The task detail monitor card above the reply composer
(`IssueMonitorComposerStrip`) and the pinned monitor banner
(`IssueMonitorBanner`) in `ui/src/components/IssueMonitorBanner.tsx`.

**Subsystem affected**
ui/ — React + Vite board UI

**Current behavior**
For scheduled monitors and ordinary scheduled retries,
`IssueMonitorComposerStrip` renders `"Sending a reply wakes the agent
now — before the scheduled check."` below the flex row that holds the
`Check now` button. That footer paragraph makes the `Check now` button
sit near the top of the card instead of the vertical center.
`IssueMonitorBanner` also inherits `sm:items-start` from `InlineBanner`,
which top-aligns `Check now`.

**Proposed behavior**
Remove the default `"Sending a reply wakes the agent now — before the
scheduled check."` text completely. Move the remaining specialized hints
(pull request review, workspace wait, active run wait, and AI connection
pool wait) into `buildMonitorSurfaceCopy` (`stripHint`) and render them
inside the left content column so `sm:items-center` vertically centers
`Check now` against the full card content. Override `sm:items-center` on
`IssueMonitorBanner` so `Check now` is also vertically centered in the
pinned banner.

**Reason and benefit**
Operators do not need the generic reply-wake reminder on every scheduled
monitor, and removing it eliminates unnecessary text clutter. Keeping
`Check now` vertically centered improves visual balance on both the
composer strip and the pinned banner.

**Breaking changes**
None. Existing specialized wait hints and button actions remain
unchanged.

## What Changed

- Removed the default `"Sending a reply wakes the agent now — before the
scheduled check."` copy from `IssueMonitorComposerStrip` in
`ui/src/components/IssueMonitorBanner.tsx`.
- Added `stripHint?: string` to `MonitorSurfaceCopy`, computed
state-specific strip hints directly in `buildMonitorSurfaceCopy`,
removed the now-unused write-only flags (`automaticChecksPaused`,
`executionWait`, `usageWait`), and rendered `copy.stripHint` inside the
left column of the `sm:flex-row sm:items-center sm:justify-between` row
so `Check now` / `Check status` stays vertically centered whether a
specialized hint is shown or omitted.
- Replaced per-element `mt-1.5` margin with `flex flex-col gap-1.5`
spacing on `IssueMonitorComposerStrip`.
- Added `sm:items-center` to `IssueMonitorBanner` so `InlineBanner`
vertically centers `Check now` instead of top-aligning it.
- Switched `ui/src/components/IssueMonitorBanner.test.tsx` to `jsdom`
DOM rendering and asserted the structural ancestor relationship:
specialized hint `<p>` nodes (usage wait and PR review requested) live
inside the left column whose parent is the same `sm:flex-row
sm:items-center` row as `Check now` / `Check status`, active-run monitor
states render their relocated `stripHint` copy, default scheduled
monitors and ordinary retries omit the reply-wake copy and render no
`<p>` hint, and `IssueMonitorBanner` overrides `sm:items-start` with
`sm:items-center`.

## Verification

- Ran `pnpm vitest run ui/src/components/IssueMonitorBanner.test.tsx
ui/src/lib/issue-monitor.test.tsx` on the exact tree committed in
`a4f8a78401`: 2 files, 29 tests passed (4 in
`IssueMonitorBanner.test.tsx`, 25 in `issue-monitor.test.tsx`).
- Ran `pnpm --filter @paperclipai/ui typecheck`: exited 0.
- Ran `pnpm check:tokens`: no forbidden tokens found.
- Confirmed all CI gates (including all 16 e2e shards, `ci / verify`,
`ci / Typecheck + Release Registry`, `ci / Build`, `ci / policy`) passed
on `ce42421728`; waiting for fresh CI and reviews on `a4f8a78401`.

## Risks

- Low risk. The change is scoped to layout alignment,
`buildMonitorSurfaceCopy` hint mapping, and unit tests in
`ui/src/components/IssueMonitorBanner.tsx` and
`ui/src/components/IssueMonitorBanner.test.tsx`, with no API, schema, or
behavioral changes to monitor scheduling or wakeup logic.

## Model Used

- Google Gemini (Antigravity coding agent with tool use and code
execution)

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [ ] All Paperclip CI gates are green
- [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

---------

Co-authored-by: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip authored and GitHub committed 2026-12-04 21:03:26 +00:00
1 parent 30334c1f03
commit 38dc3b96ef
2 files changed
+201 -43

No files matched your search

+180 -13
View File
@@ -1,8 +1,39 @@
// @vitest-environment node
import { renderToStaticMarkup } from "react-dom/server";
import { expect, it } from "vitest";
import type { Issue } from "@paperclipai/shared";
import { IssueMonitorComposerStrip } from "./IssueMonitorBanner";
// @vitest-environment jsdom
import type { ReactElement } from "react";
import { flushSync } from "react-dom";
import { createRoot, type Root } from "react-dom/client";
import { afterEach, expect, it } from "vitest";
import type { Issue, IssueWorkProduct } from "@paperclipai/shared";
import { IssueMonitorBanner, IssueMonitorComposerStrip } from "./IssueMonitorBanner";
const mounted: Array<{ root: Root; container: HTMLDivElement }> = [];
afterEach(() => {
while (mounted.length > 0) {
const entry = mounted.pop()!;
flushSync(() => entry.root.unmount());
entry.container.remove();
}
});
function render(element: ReactElement): HTMLDivElement {
const container = document.createElement("div");
document.body.appendChild(container);
const root = createRoot(container);
flushSync(() => root.render(element));
mounted.push({ root, container });
return container;
}
function findButton(container: HTMLElement, label: string): HTMLButtonElement | undefined {
return Array.from(container.querySelectorAll("button")).find(
(button) => button.textContent?.trim() === label,
);
}
function findCheckNowButton(container: HTMLElement): HTMLButtonElement | undefined {
return findButton(container, "Check now");
}
function waitingIssue(scheduledRetryReason: string) {
return {
@@ -17,14 +48,150 @@ function waitingIssue(scheduledRetryReason: string) {
} as unknown as Issue;
}
it("tells a user that a reply rechecks usage, not that it starts work outright", () => {
const markup = renderToStaticMarkup(<IssueMonitorComposerStrip issue={waitingIssue("ai_connection_pool_wait")} />);
expect(markup).toContain("Pool exhausted");
expect(markup).toContain("Sending a reply checks usage again now.");
expect(markup).not.toContain("wakes the agent now");
function monitoredIssue(serviceName = "github_pr_checks") {
return {
id: "issue-2",
status: "in_progress",
executionState: {
monitor: {
status: "scheduled",
nextCheckAt: new Date(Date.now() + 3 * 60_000).toISOString(),
attemptCount: 1,
serviceName,
},
},
} as unknown as Issue;
}
function pendingPullRequestWorkProduct(): IssueWorkProduct {
return {
id: "wp-pr-1",
type: "pull_request",
title: "PR #23763",
status: "open",
reviewState: "needs_board_review",
url: "https://github.com/paperclipai/paperclip/pull/23763",
isPrimary: true,
updatedAt: new Date().toISOString(),
} as unknown as IssueWorkProduct;
}
it("tells a user that a reply rechecks usage and keeps Check now vertically centered alongside the hint", () => {
const container = render(
<IssueMonitorComposerStrip issue={waitingIssue("ai_connection_pool_wait")} onCheckNow={() => {}} />,
);
const strip = container.querySelector('[data-testid="issue-monitor-composer-strip"]');
expect(strip?.textContent).toContain("Pool exhausted");
expect(strip?.textContent).not.toContain("wakes the agent now");
const hint = Array.from(container.querySelectorAll("p")).find((node) =>
node.textContent?.includes("Sending a reply checks usage again now."),
);
const button = findCheckNowButton(container);
expect(hint).toBeDefined();
expect(button).toBeDefined();
const row = button!.parentElement;
const leftColumn = hint!.parentElement;
expect(row).not.toBeNull();
expect(row!.classList.contains("sm:flex-row")).toBe(true);
expect(row!.classList.contains("sm:items-center")).toBe(true);
expect(leftColumn).not.toBeNull();
expect(leftColumn).not.toBe(row);
expect(leftColumn!.parentElement).toBe(row);
expect(leftColumn!.textContent).toContain("Pool exhausted");
expect(leftColumn!.contains(hint!)).toBe(true);
expect(leftColumn!.contains(button!)).toBe(false);
expect(row!.contains(hint!)).toBe(true);
expect(row!.contains(button!)).toBe(true);
});
it("keeps the wake-now promise for an ordinary scheduled retry", () => {
const markup = renderToStaticMarkup(<IssueMonitorComposerStrip issue={waitingIssue("transient_failure")} />);
expect(markup).toContain("Sending a reply wakes the agent now");
it("omits the reply wake copy for an ordinary scheduled retry", () => {
const container = render(
<IssueMonitorComposerStrip issue={waitingIssue("transient_failure")} onCheckNow={() => {}} />,
);
expect(container.textContent).not.toContain("wakes the agent now");
expect(container.textContent).not.toContain("before the scheduled check");
expect(container.querySelector("p")).toBeNull();
const button = findCheckNowButton(container);
expect(button).toBeDefined();
expect(button!.parentElement?.classList.contains("sm:flex-row")).toBe(true);
expect(button!.parentElement?.classList.contains("sm:items-center")).toBe(true);
});
it("omits the reply wake copy and centers Check now for a scheduled monitor", () => {
const stripContainer = render(
<IssueMonitorComposerStrip issue={monitoredIssue()} onCheckNow={() => {}} />,
);
expect(stripContainer.textContent).toContain("Watching: github_pr_checks");
expect(stripContainer.textContent).not.toContain("wakes the agent now");
expect(stripContainer.textContent).not.toContain("before the scheduled check");
expect(stripContainer.querySelector("p")).toBeNull();
const stripButton = findCheckNowButton(stripContainer);
expect(stripButton).toBeDefined();
expect(stripButton!.parentElement?.classList.contains("sm:flex-row")).toBe(true);
expect(stripButton!.parentElement?.classList.contains("sm:items-center")).toBe(true);
const bannerContainer = render(
<IssueMonitorBanner issue={monitoredIssue()} onCheckNow={() => {}} />,
);
const banner = bannerContainer.querySelector('[role="note"]');
const bannerButton = findCheckNowButton(bannerContainer);
expect(banner).not.toBeNull();
expect(banner!.classList.contains("sm:flex-row")).toBe(true);
expect(banner!.classList.contains("sm:items-center")).toBe(true);
expect(banner!.classList.contains("sm:items-start")).toBe(false);
expect(bannerButton).toBeDefined();
expect(bannerButton!.parentElement?.parentElement).toBe(banner);
});
it("renders the relocated pullRequestReview and active-run strip hints inside the centered row", () => {
const workProducts = [pendingPullRequestWorkProduct()];
const reviewContainer = render(
<IssueMonitorComposerStrip
issue={monitoredIssue("github")}
workProducts={workProducts}
onCheckNow={() => {}}
/>,
);
const reviewHint = Array.from(reviewContainer.querySelectorAll("p")).find((node) =>
node.textContent?.includes("Review on GitHub, then check status to have the agent verify the result."),
);
const checkStatusButton = findButton(reviewContainer, "Check status");
expect(reviewHint).toBeDefined();
expect(checkStatusButton).toBeDefined();
const reviewRow = checkStatusButton!.parentElement;
const reviewLeftColumn = reviewHint!.parentElement;
expect(reviewRow?.classList.contains("sm:flex-row")).toBe(true);
expect(reviewRow?.classList.contains("sm:items-center")).toBe(true);
expect(reviewLeftColumn?.parentElement).toBe(reviewRow);
expect(reviewLeftColumn?.contains(checkStatusButton!)).toBe(false);
const activeReviewContainer = render(
<IssueMonitorComposerStrip
issue={monitoredIssue("github")}
workProducts={workProducts}
hasActiveRun
onCheckNow={() => {}}
/>,
);
expect(activeReviewContainer.textContent).toContain(
"Review on GitHub while the current run finishes saving its work.",
);
expect(findButton(activeReviewContainer, "Check status")).toBeUndefined();
const activeRunContainer = render(
<IssueMonitorComposerStrip
issue={monitoredIssue()}
hasActiveRun
onCheckNow={() => {}}
/>,
);
expect(activeRunContainer.textContent).toContain(
"You can keep sending instructions while the agent waits.",
);
expect(findCheckNowButton(activeRunContainer)).toBeUndefined();
});
+21 -30
View File
@@ -61,15 +61,13 @@ export interface MonitorSurfaceCopy {
bannerMeta: string[];
/** Muted detail line for the composer strip. */
stripMeta: string[];
/** Optional state-specific hint rendered beneath the strip metadata inside the left column. */
stripHint?: string;
/** `warning` (amber) once overdue, `info` (blue) while still on schedule. */
tone: "info" | "warning";
workspaceWait?: boolean;
pullRequestReview?: boolean;
automaticChecksPaused?: boolean;
checkUnavailable?: boolean;
executionWait?: boolean;
/** Waiting for AI account usage; a reply rechecks usage instead of starting work outright. */
usageWait?: boolean;
}
function capitalize(value: string): string {
@@ -102,7 +100,6 @@ export function buildMonitorSurfaceCopy(
bannerMeta: [hint],
stripMeta: [hint],
tone: "info",
automaticChecksPaused: true,
checkUnavailable: !canCheckNow,
};
}
@@ -113,6 +110,7 @@ export function buildMonitorSurfaceCopy(
stripTitle: "Waiting for the sandbox provider",
bannerMeta: ["The sandbox provider is unavailable. Work continues automatically when it is back."],
stripMeta: ["Work continues automatically when the sandbox provider is back."],
stripHint: "You can keep sending instructions while the agent waits.",
tone: "info",
workspaceWait: true,
};
@@ -124,6 +122,7 @@ export function buildMonitorSurfaceCopy(
stripTitle: "Waiting for workspace",
bannerMeta: ["Another task is using this workspace. Work starts automatically when it is available."],
stripMeta: ["Work starts automatically when the workspace is available."],
stripHint: "You can keep sending instructions while the agent waits.",
tone: "info",
workspaceWait: true,
};
@@ -139,8 +138,10 @@ export function buildMonitorSurfaceCopy(
stripTitle: "Monitor waits for current run",
bannerMeta: [hint, `Scheduled for ${absolute} (your time)`],
stripMeta: [hint, `Scheduled for ${absolute}`],
stripHint: awaitingPullRequestReview
? "Review on GitHub while the current run finishes saving its work."
: "You can keep sending instructions while the agent waits.",
tone: "info",
executionWait: true,
checkUnavailable: true,
pullRequestReview: awaitingPullRequestReview,
};
@@ -151,6 +152,7 @@ export function buildMonitorSurfaceCopy(
stripTitle: "Pull request review requested",
bannerMeta: [`Next check ${eta} · ${absolute} (your time)`],
stripMeta: [`Next check ${eta} · ${absolute}`],
stripHint: "Review on GitHub, then check status to have the agent verify the result.",
tone: derived.state === "overdue" ? "warning" : "info",
pullRequestReview: true,
};
@@ -161,8 +163,8 @@ export function buildMonitorSurfaceCopy(
stripTitle: "Pool exhausted",
bannerMeta: [`Usage recheck ${eta} · ${absolute} (your time)`, "Tasks with a selected account keep it while waiting. Work resumes when usage permits or the agent uses a different account."],
stripMeta: [`Usage recheck ${eta} · ${absolute}`, "Tasks with a selected account keep it while waiting."],
stripHint: "Sending a reply checks usage again now. The agent starts as soon as usage is available.",
tone: "info",
usageWait: true,
};
}
@@ -321,7 +323,7 @@ export function IssueMonitorBanner({
tone={copy.tone}
icon={Clock}
title={copy.bannerTitle}
className={cn("relative my-3", canCancel && "pr-12")}
className={cn("relative my-3 sm:items-center", canCancel && "pr-12")}
actions={onCheckNow && !copy.workspaceWait && !copy.checkUnavailable ? <CheckNowButton onCheckNow={onCheckNow} checkingNow={checkingNow} reviewRequested={copy.pullRequestReview} /> : null}
>
{canCancel ? <CancelMonitorButton key={issue.id} onCancel={onCancelMonitor} /> : null}
@@ -336,8 +338,7 @@ export function IssueMonitorBanner({
/**
* Slim, inline (not sticky) strip anchored directly above the reply composer.
* Mirrors the banner's monitor state and reminds the reader that replying wakes
* the agent early (PAP-14557 decisions 2 + wireframe 02).
* Mirrors the banner's monitor state.
*/
export function IssueMonitorComposerStrip({
issue,
@@ -356,32 +357,22 @@ export function IssueMonitorComposerStrip({
<div
role="note"
data-testid="issue-monitor-composer-strip"
className={cn("rounded-lg border border-border bg-muted/30 px-3 py-2", className)}
className={cn("flex flex-col gap-1.5 rounded-lg border border-border bg-muted/30 px-3 py-2", className)}
>
<div className="flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between">
<div className="flex min-w-0 items-start gap-2">
<Clock className={cn("mt-0.5 h-4 w-4 shrink-0", issue.displayStatus === "monitoring" ? "text-(--status-task-icon-monitoring)" : "text-muted-foreground")} aria-hidden="true" />
<div className="flex min-w-0 flex-col gap-2">
<div className="text-sm font-medium text-foreground">{copy.stripTitle}</div>
{copy.pullRequestReview ? <IssuePullRequestLinks products={reviews} /> : null}
<div className="text-xs text-muted-foreground">{copy.stripMeta.join(" · ")}</div>
<div className="flex min-w-0 flex-col gap-1.5">
<div className="flex min-w-0 items-start gap-2">
<Clock className={cn("mt-0.5 h-4 w-4 shrink-0", issue.displayStatus === "monitoring" ? "text-(--status-task-icon-monitoring)" : "text-muted-foreground")} aria-hidden="true" />
<div className="flex min-w-0 flex-col gap-2">
<div className="text-sm font-medium text-foreground">{copy.stripTitle}</div>
{copy.pullRequestReview ? <IssuePullRequestLinks products={reviews} /> : null}
<div className="text-xs text-muted-foreground">{copy.stripMeta.join(" · ")}</div>
</div>
</div>
{copy.stripHint ? <p className="text-xs text-muted-foreground">{copy.stripHint}</p> : null}
</div>
{onCheckNow && !copy.workspaceWait && !copy.checkUnavailable ? <CheckNowButton onCheckNow={onCheckNow} checkingNow={checkingNow} reviewRequested={copy.pullRequestReview} /> : null}
</div>
{!copy.automaticChecksPaused ? (
<p className="mt-1.5 text-xs text-muted-foreground">
{copy.pullRequestReview && copy.executionWait
? "Review on GitHub while the current run finishes saving its work."
: copy.pullRequestReview
? "Review on GitHub, then check status to have the agent verify the result."
: copy.workspaceWait || copy.executionWait
? "You can keep sending instructions while the agent waits."
: copy.usageWait
? "Sending a reply checks usage again now. The agent starts as soon as usage is available."
: "Sending a reply wakes the agent now — before the scheduled check."}
</p>
) : null}
{checkError ? <p role="alert" className="text-sm text-destructive">{checkError}</p> : null}
</div>
);