@@ -93,6 +93,8 @@ import {
93
93
} from "~/utils/pathBuilder" ;
94
94
import { useCurrentPlan } from "../_app.orgs.$organizationSlug/route" ;
95
95
import { 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" ;
96
98
97
99
const resizableSettings = {
98
100
parent : {
@@ -477,6 +479,8 @@ function TasksTreeView({
477
479
const treeScrollRef = useRef < HTMLDivElement > ( null ) ;
478
480
const timelineScrollRef = useRef < HTMLDivElement > ( null ) ;
479
481
482
+ const displayEvents = showDebug ? events : events . filter ( ( event ) => ! event . data . isDebug ) ;
483
+
480
484
const {
481
485
nodes,
482
486
getTreeProps,
@@ -490,7 +494,7 @@ function TasksTreeView({
490
494
scrollToNode,
491
495
virtualizer,
492
496
} = useTree ( {
493
- tree : showDebug ? events : events . filter ( ( event ) => ! event . data . isDebug ) ,
497
+ tree : displayEvents ,
494
498
selectedId,
495
499
// collapsedIds,
496
500
onSelectedIdChanged,
@@ -636,7 +640,7 @@ function TasksTreeView({
636
640
</ div >
637
641
</ div >
638
642
</ div >
639
- { events . length === 1 && environmentType === "DEVELOPMENT" && (
643
+ { displayEvents . length === 1 && environmentType === "DEVELOPMENT" && (
640
644
< ConnectedDevWarning />
641
645
) }
642
646
</ >
@@ -1241,29 +1245,22 @@ function CurrentTimeIndicator({
1241
1245
}
1242
1246
1243
1247
function 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 ( ) ;
1253
1249
1254
1250
return (
1255
1251
< div
1256
1252
className = { cn (
1257
1253
"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 "
1259
1255
) }
1260
1256
>
1261
- < Callout variant = "info" className = "mt-2" >
1257
+ < Callout variant = "info" icon = { < DisconnectedIcon className = "size-6" /> } className = "mt-2" >
1262
1258
< 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 >
1263
1263
< 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:{ " " }
1267
1264
< InlineCode className = "whitespace-nowrap" > npx trigger.dev@latest dev</ InlineCode >
1268
1265
</ Paragraph >
1269
1266
</ div >
0 commit comments