@@ -93,6 +93,8 @@ import {
9393} from "~/utils/pathBuilder" ;
9494import { useCurrentPlan } from "../_app.orgs.$organizationSlug/route" ;
9595import { SpanView } from "../resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route" ;
96+ import { useDevPresence } from "~/components/DevPresence" ;
97+ import { DisconnectedIcon } from "~/assets/icons/ConnectionIcons" ;
9698
9799const resizableSettings = {
98100 parent : {
@@ -477,6 +479,8 @@ function TasksTreeView({
477479 const treeScrollRef = useRef < HTMLDivElement > ( null ) ;
478480 const timelineScrollRef = useRef < HTMLDivElement > ( null ) ;
479481
482+ const displayEvents = showDebug ? events : events . filter ( ( event ) => ! event . data . isDebug ) ;
483+
480484 const {
481485 nodes,
482486 getTreeProps,
@@ -490,7 +494,7 @@ function TasksTreeView({
490494 scrollToNode,
491495 virtualizer,
492496 } = useTree ( {
493- tree : showDebug ? events : events . filter ( ( event ) => ! event . data . isDebug ) ,
497+ tree : displayEvents ,
494498 selectedId,
495499 // collapsedIds,
496500 onSelectedIdChanged,
@@ -636,7 +640,7 @@ function TasksTreeView({
636640 </ div >
637641 </ div >
638642 </ div >
639- { events . length === 1 && environmentType === "DEVELOPMENT" && (
643+ { displayEvents . length === 1 && environmentType === "DEVELOPMENT" && (
640644 < ConnectedDevWarning />
641645 ) }
642646 </ >
@@ -1241,29 +1245,22 @@ function CurrentTimeIndicator({
12411245}
12421246
12431247function ConnectedDevWarning ( ) {
1244- const [ isVisible , setIsVisible ] = useState ( false ) ;
1245-
1246- useEffect ( ( ) => {
1247- const timer = setTimeout ( ( ) => {
1248- setIsVisible ( true ) ;
1249- } , 3000 ) ;
1250-
1251- return ( ) => clearTimeout ( timer ) ;
1252- } , [ ] ) ;
1248+ const { isConnected } = useDevPresence ( ) ;
12531249
12541250 return (
12551251 < div
12561252 className = { cn (
12571253 "flex items-center overflow-hidden pl-5 pr-2 transition-opacity duration-500" ,
1258- isVisible ? "opacity-100 " : "h-0 opacity-0 "
1254+ isConnected ? "h-0 opacity-0 " : "opacity-100 "
12591255 ) }
12601256 >
1261- < Callout variant = "info" className = "mt-2" >
1257+ < Callout variant = "info" icon = { < DisconnectedIcon className = "size-6" /> } className = "mt-2" >
12621258 < div className = "flex flex-col gap-1" >
1259+ < Paragraph variant = "small" spacing className = "text-error" >
1260+ Your local dev server is not connected to Trigger.dev.
1261+ </ Paragraph >
1262+ < Paragraph variant = "small" > Check you're running the CLI:</ Paragraph >
12631263 < Paragraph variant = "small" >
1264- Runs usually start within 1 second in{ " " }
1265- < EnvironmentCombo environment = { { type : "DEVELOPMENT" } } className = "inline-flex" /> .
1266- Check you're running the CLI:{ " " }
12671264 < InlineCode className = "whitespace-nowrap" > npx trigger.dev@latest dev</ InlineCode >
12681265 </ Paragraph >
12691266 </ div >
0 commit comments