File tree Expand file tree Collapse file tree
apps/webapp/app/components/dashboard-agent Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { EyeIcon } from "@heroicons/react/20/solid";
22import type { WatchSpec } from "@internal/dashboard-agent-contracts" ;
33import { Button } from "~/components/primitives/Buttons" ;
44import { useDashboardAgent } from "./dashboardAgentLauncher" ;
5+ import { watchTooltipLabel } from "./watch-presentation" ;
56
67/**
78 * The universal **Watch…** action (§2.1).
@@ -54,8 +55,8 @@ export function WatchButton({
5455 fullWidth = { fullWidth }
5556 textAlignLeft = { fullWidth }
5657 className = { className }
57- // The recommendation's own promise is the best description of the button .
58- tooltip = { tooltip ?? spec . note }
58+ // Same imperative form as the Investigate tooltip .
59+ tooltip = { tooltip ?? watchTooltipLabel ( spec ) }
5960 onClick = { ( ) => agent . openWithWatch ( spec ) }
6061 >
6162 { label }
Original file line number Diff line number Diff line change @@ -420,6 +420,32 @@ export function watchConditionLabel(spec: WatchSpec): string {
420420 }
421421}
422422
423+ /** The Watch button's tooltip — same imperative form as Investigate's. */
424+ export function watchTooltipLabel ( spec : WatchSpec ) : string {
425+ switch ( spec . kind ) {
426+ case "run_start" :
427+ return "Get notified when this run starts" ;
428+ case "run_finished" :
429+ return "Get notified when this run finishes" ;
430+ case "run_failed" :
431+ return "Get notified if this run fails" ;
432+ case "backlog_drain" :
433+ return "Get notified when this queue drains" ;
434+ case "queue_depth_above" :
435+ return `Get notified if this queue goes above ${ spec . threshold } ` ;
436+ case "queue_depth_below" :
437+ return `Get notified when this queue is back below ${ spec . threshold } ` ;
438+ case "queue_stalled" :
439+ return "Get notified if this queue stops moving" ;
440+ case "queue_oldest_age" :
441+ return `Get notified if runs wait longer than ${ formatWatchSla ( spec . thresholdMinutes ) } ` ;
442+ case "error_recurrence" :
443+ return "Get notified if this error happens again" ;
444+ case "health_recovery" :
445+ return "Get notified when health recovers" ;
446+ }
447+ }
448+
423449/** "For 1 hour · checking every 5 min" — the duration line of the card. */
424450export function watchDurationLabel ( spec : WatchSpec ) : string {
425451 return `For ${ formatWatchWindow ( spec . maxHours ) } · checking ${ formatWatchCadence (
You can’t perform that action at this time.
0 commit comments