Skip to content

Commit 82989c8

Browse files
committed
Improvements to the dev presence
1 parent bf7b1f1 commit 82989c8

File tree

3 files changed

+45
-21
lines changed
  • apps/webapp/app

3 files changed

+45
-21
lines changed

apps/webapp/app/components/navigation/SideMenu.tsx

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,13 @@ import { HelpAndFeedback } from "./HelpAndFeedbackPopover";
8585
import { SideMenuHeader } from "./SideMenuHeader";
8686
import { SideMenuItem } from "./SideMenuItem";
8787
import { SideMenuSection } from "./SideMenuSection";
88+
import {
89+
SimpleTooltip,
90+
Tooltip,
91+
TooltipContent,
92+
TooltipProvider,
93+
TooltipTrigger,
94+
} from "../primitives/Tooltip";
8895

8996
type SideMenuUser = Pick<User, "email" | "admin"> & { isImpersonating: boolean };
9097
export type SideMenuProject = Pick<
@@ -515,19 +522,32 @@ export function DevConnection() {
515522

516523
return (
517524
<Dialog>
518-
<DialogTrigger asChild>
519-
<Button
520-
variant="minimal/small"
521-
className="px-1"
522-
LeadingIcon={
523-
isConnected ? (
524-
<ConnectedIcon className="size-5" />
525-
) : (
526-
<DisconnectedIcon className="size-5" />
527-
)
528-
}
529-
/>
530-
</DialogTrigger>
525+
<div>
526+
<TooltipProvider disableHoverableContent={true}>
527+
<Tooltip>
528+
<TooltipTrigger asChild>
529+
<div>
530+
<DialogTrigger asChild>
531+
<Button
532+
variant="minimal/small"
533+
className="px-1"
534+
LeadingIcon={
535+
isConnected ? (
536+
<ConnectedIcon className="size-5" />
537+
) : (
538+
<DisconnectedIcon className="size-5" />
539+
)
540+
}
541+
/>
542+
</DialogTrigger>
543+
</div>
544+
</TooltipTrigger>
545+
<TooltipContent side="right" className={"text-xs"}>
546+
{isConnected ? "Your dev server is connected" : "Your dev server is not connected"}
547+
</TooltipContent>
548+
</Tooltip>
549+
</TooltipProvider>
550+
</div>
531551
<DialogContent>
532552
<DialogHeader>
533553
{isConnected

apps/webapp/app/components/primitives/Tooltip.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ function SimpleTooltip({
5959
disableHoverableContent = false,
6060
className,
6161
buttonClassName,
62+
asChild = false,
6263
}: {
6364
button: React.ReactNode;
6465
content: React.ReactNode;
@@ -68,11 +69,12 @@ function SimpleTooltip({
6869
disableHoverableContent?: boolean;
6970
className?: string;
7071
buttonClassName?: string;
72+
asChild?: boolean;
7173
}) {
7274
return (
7375
<TooltipProvider disableHoverableContent={disableHoverableContent}>
7476
<Tooltip>
75-
<TooltipTrigger tabIndex={-1} className={cn("h-fit", buttonClassName)}>
77+
<TooltipTrigger tabIndex={-1} className={cn("h-fit", buttonClassName)} asChild={asChild}>
7678
{button}
7779
</TooltipTrigger>
7880
<TooltipContent

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam/route.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ import { useCurrentPlan } from "../_app.orgs.$organizationSlug/route";
9595
import { SpanView } from "../resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route";
9696
import { useDevPresence } from "~/components/DevPresence";
9797
import { DisconnectedIcon } from "~/assets/icons/ConnectionIcons";
98+
import { ClipboardField } from "~/components/primitives/ClipboardField";
9899

99100
const resizableSettings = {
100101
parent: {
@@ -1257,15 +1258,16 @@ function ConnectedDevWarning() {
12571258
isConnected ? "h-0 opacity-0" : "opacity-100"
12581259
)}
12591260
>
1260-
<Callout variant="info" icon={<DisconnectedIcon className="size-6" />} className="mt-2">
1261+
<Callout
1262+
variant="error"
1263+
icon={<DisconnectedIcon className="size-5 shrink-0" />}
1264+
className="mt-2"
1265+
>
12611266
<div className="flex flex-col gap-1">
1262-
<Paragraph variant="small" spacing className="text-error">
1263-
Your local dev server is not connected to Trigger.dev.
1264-
</Paragraph>
1265-
<Paragraph variant="small">Check you're running the CLI:</Paragraph>
1266-
<Paragraph variant="small">
1267-
<InlineCode className="whitespace-nowrap">npx trigger.dev@latest dev</InlineCode>
1267+
<Paragraph variant="small" spacing>
1268+
Your local dev server is not connectedr. Check you're running the CLI:
12681269
</Paragraph>
1270+
<ClipboardField variant="secondary/small" value="npx trigger.dev@latest dev" />
12691271
</div>
12701272
</Callout>
12711273
</div>

0 commit comments

Comments
 (0)