@motiadev/workbench 0.6.4-beta.130 → 0.6.4-beta.131-595093

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,5 +17,5 @@ export const FlowTabMenuItem = () => {
17
17
  selectFlowId(flowId);
18
18
  analytics.track('flow_selected', { flow: flowId });
19
19
  };
20
- return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs("div", { "data-testid": "flows-dropdown-trigger", className: "flex flex-row justify-center items-center gap-2 cursor-pointer", children: [_jsx(Workflow, {}), selectedFlowId ?? 'No flow selected', _jsx(ChevronsUpDown, { className: "size-4" })] }) }), _jsx(DropdownMenuContent, { className: "bg-background text-foreground flows-dropdown", children: flows.map((item) => (_jsx(DropdownMenuItem, { "data-testid": `dropdown-${item}`, className: "cursor-pointer gap-2 flow-link", onClick: () => handleFlowSelect(item), children: item }, `dropdown-${item}`))) })] }));
20
+ return (_jsxs("div", { className: "flex flex-row justify-center items-center gap-2 cursor-pointer", children: [_jsx(Workflow, {}), selectedFlowId ?? 'No flow selected', _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx("div", { "data-testid": "flows-dropdown-trigger", className: "flex flex-row justify-center items-center gap-2 cursor-pointer", children: _jsx(ChevronsUpDown, { className: "size-4" }) }) }), _jsx(DropdownMenuContent, { className: "bg-background text-foreground flows-dropdown", children: flows.map((item) => (_jsx(DropdownMenuItem, { "data-testid": `dropdown-${item}`, className: "cursor-pointer gap-2 flow-link", onClick: () => handleFlowSelect(item), children: item }, `dropdown-${item}`))) })] })] }));
21
21
  };
@@ -0,0 +1 @@
1
+ export declare const DeployButton: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,28 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Button, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '@motiadev/ui';
3
+ import { Rocket } from 'lucide-react';
4
+ import { useState } from 'react';
5
+ import { analytics } from '@/lib/analytics';
6
+ export const DeployButton = () => {
7
+ const [isOpen, setIsOpen] = useState(false);
8
+ const onDeployButtonClick = () => {
9
+ analytics.track('deploy_button_clicked');
10
+ };
11
+ const onDeployClick = () => {
12
+ setIsOpen(false);
13
+ analytics.track('deploy_button_deploy_clicked');
14
+ };
15
+ const onClose = () => {
16
+ setIsOpen(false);
17
+ analytics.track('deploy_button_closed');
18
+ };
19
+ const onMotiaCloudClick = () => {
20
+ setIsOpen(true);
21
+ analytics.track('deploy_button_motia_cloud_clicked');
22
+ };
23
+ const onSelfHostedClick = () => {
24
+ analytics.track('deploy_button_self_hosted_clicked');
25
+ window.open('https://www.motia.dev/docs/concepts/deployment/self-hosted', '_blank');
26
+ };
27
+ return (_jsxs(_Fragment, { children: [isOpen && (_jsxs("div", { children: [_jsx("div", { className: "fixed inset-0 z-[9999] bg-black/20 backdrop-blur-sm", onClick: () => setIsOpen(false) }), _jsxs("div", { className: "driver-popover w-[600px]! fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-[10000] animate-in fade-in-0 zoom-in-95", children: [_jsx("img", { src: "https://oxhhfuuoqzsaqthfairn.supabase.co/storage/v1/object/public/public-images/preview.png", alt: "Motia Cloud", className: "driver-popover-image object-cover", style: { height: 393, width: '100%' } }), _jsx("div", { className: "driver-popover-title", children: _jsx("h2", { className: "popover-title", children: "Motia Cloud is Live!" }) }), _jsx("div", { className: "driver-popover-description", children: "Deploy to production in minutes, not hours. One click gets your Motia project live with enterprise-grade reliability. Seamlessly scale, rollback instantly, and monitor everything in real-time. Your code deserves infrastructure that just works." }), _jsx("a", { href: "https://www.motia.dev/docs/concepts/deployment/motia-cloud/features", target: "_blank", className: "text-foreground text-xs font-semibold px-4 hover:underline", children: "Learn more about Motia Cloud" }), _jsx("div", { className: "driver-popover-footer flex items-center justify-end", children: _jsxs("div", { className: "driver-popover-navigation-btns flex gap-6", children: [_jsx("button", { className: "tutorial-opt-out-button text-sm! font-semibold! text-muted-foreground!", onClick: onClose, children: "Close" }), _jsx("a", { href: "https://motia.cloud?utm_source=workbench&utm_medium=referral", target: "_blank", onClick: onDeployClick, children: _jsx("button", { className: "driver-popover-next-btn", children: "Deploy!" }) })] }) })] })] })), _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(Button, { variant: "ghost", className: "font-semibold text-sm dark:bg-white dark:text-black dark:hover:bg-white/90 bg-black/90 hover:bg-black/80 text-white", onClick: onDeployButtonClick, children: [_jsx(Rocket, {}), "Deploy"] }) }), _jsxs(DropdownMenuContent, { className: "bg-background text-foreground w-56", children: [_jsx(DropdownMenuItem, { className: "cursor-pointer h-10 font-semibold", onClick: onMotiaCloudClick, children: "Motia Cloud" }), _jsx(DropdownMenuItem, { className: "cursor-pointer h-10 font-semibold", onClick: onSelfHostedClick, children: "Self-Hosted (Docker)" })] })] })] }));
28
+ };
@@ -2,7 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useThemeStore } from '@/stores/use-theme-store';
3
3
  import { ThemeToggle } from '../ui/theme-toggle';
4
4
  import { TutorialButton } from '../tutorial/tutorial-button';
5
+ import { DeployButton } from './deploy-button';
5
6
  export const Header = () => {
6
7
  const theme = useThemeStore((state) => state.theme);
7
- return (_jsxs("header", { className: "min-h-16 px-4 gap-4 flex items-center bg-default text-default-foreground border-b", children: [_jsx("img", { src: `/motia-${theme}.png`, className: "h-5", id: "logo-icon", "data-testid": "logo-icon" }), _jsx("div", { className: "flex-1" }), _jsx(TutorialButton, {}), _jsx(ThemeToggle, {})] }));
8
+ return (_jsxs("header", { className: "min-h-16 px-4 gap-4 flex items-center bg-default text-default-foreground border-b", children: [_jsx("img", { src: `/motia-${theme}.png`, className: "h-5", id: "logo-icon", "data-testid": "logo-icon" }), _jsx("div", { className: "flex-1" }), _jsx(ThemeToggle, {}), _jsx(TutorialButton, {}), _jsx(DeployButton, {})] }));
8
9
  };
@@ -3,10 +3,19 @@ import { TraceTimeline } from '@/components/observability/trace-timeline';
3
3
  import { useStreamGroup } from '@motiadev/stream-client-react';
4
4
  import { TracesGroups } from '@/components/observability/traces-groups';
5
5
  import { useGlobalStore } from '../../stores/use-global-store';
6
+ import { useEffect } from 'react';
6
7
  export const TracesPage = () => {
7
8
  const selectedGroupId = useGlobalStore((state) => state.selectedTraceGroupId);
8
9
  const selectTraceGroupId = useGlobalStore((state) => state.selectTraceGroupId);
9
10
  const { data } = useStreamGroup({ streamName: 'motia-trace-group', groupId: 'default' });
10
11
  const handleGroupSelect = (group) => selectTraceGroupId(group.id);
12
+ useEffect(() => {
13
+ if (data && data.length > 0) {
14
+ const group = data[data.length - 1];
15
+ if (group && group.status === 'running' && group.id !== selectedGroupId) {
16
+ selectTraceGroupId(group.id);
17
+ }
18
+ }
19
+ }, [data]);
11
20
  return (_jsxs("div", { className: "flex flex-1 overflow-hidden h-full", children: [_jsx("div", { className: "max-w-1/3 border-r border-border overflow-auto h-full", "data-testid": "traces-container", children: _jsx(TracesGroups, { groups: data, selectedGroupId: selectedGroupId, onGroupSelect: handleGroupSelect }) }), _jsxs("div", { className: "flex-2 overflow-auto", "data-testid": "trace-details", children: [selectedGroupId && _jsx(TraceTimeline, { groupId: selectedGroupId }), !selectedGroupId && (_jsx("div", { className: "flex items-center justify-center h-full text-muted-foreground", children: "Select a trace or trace group to view the timeline" }))] })] }));
12
21
  };
@@ -13,6 +13,6 @@ export const TutorialStep = forwardRef(({ step, totalSteps, title, description,
13
13
  window.addEventListener('keydown', handleKeyDown);
14
14
  return () => window.removeEventListener('keydown', handleKeyDown);
15
15
  }, [onClose, onNext]);
16
- return (_jsxs("div", { ref: ref, className: "driver-popover", children: [image && (_jsx("img", { src: image.src, alt: "Step visual", className: "driver-popover-image object-cover", style: { height: image.height, width: '100%' } })), _jsx("div", { className: "driver-popover-title", children: _jsx("h2", { className: "popover-title", children: title }) }), _jsx("div", { className: "driver-popover-description", children: description }), link && (_jsx("a", { href: link, target: "_blank", className: "text-foreground text-xs font-semibold px-4 hover:underline", children: "Learn more" })), _jsxs("div", { className: "driver-popover-footer flex items-center justify-between", children: [_jsxs("div", { className: "text-sm text-muted-foreground font-semibold", children: [step, " ", _jsx("span", { className: "text-foreground", children: "/" }), " ", totalSteps] }), _jsx("div", { className: "driver-popover-navigation-btns flex gap-2", children: _jsx("button", { className: "driver-popover-next-btn", onClick: onNext, children: step < totalSteps ? 'Continue' : 'Finish' }) })] }), step < totalSteps && (_jsx("div", { className: "tutorial-opt-out-container", children: _jsx("button", { className: "tutorial-opt-out-button", onClick: onClose, children: "Close" }) }))] }));
16
+ return (_jsxs("div", { ref: ref, className: "driver-popover", children: [image && (_jsx("img", { src: image.src, alt: "Step visual", className: "driver-popover-image object-cover", style: { height: image.height, width: '100%' } })), _jsx("div", { className: "driver-popover-title", children: _jsx("h2", { className: "popover-title", children: title }) }), _jsx("div", { className: "driver-popover-description", children: description }), link && (_jsx("a", { href: link, target: "_blank", className: "text-foreground text-xs font-semibold px-4 hover:underline", children: "Learn more" })), _jsxs("div", { className: "driver-popover-footer flex items-center justify-between", children: [_jsxs("div", { className: "text-sm text-muted-foreground font-semibold", children: [step, " ", _jsx("span", { className: "text-foreground", children: "/" }), " ", totalSteps] }), _jsx("div", { className: "driver-popover-navigation-btns driver-popover-navigation-btns-hint flex gap-2", children: _jsx("button", { className: "driver-popover-next-btn", onClick: onNext, children: step < totalSteps ? 'Continue' : 'Finish' }) })] }), step < totalSteps && (_jsx("div", { className: "tutorial-opt-out-container", children: _jsx("button", { className: "tutorial-opt-out-button", onClick: onClose, children: "Close" }) }))] }));
17
17
  });
18
18
  TutorialStep.displayName = 'TutorialStep';
@@ -121,7 +121,7 @@
121
121
  flex-grow: 0;
122
122
  }
123
123
 
124
- .driver-popover-navigation-btns:hover:before {
124
+ .driver-popover-navigation-btns-hint:hover:before {
125
125
  content: 'Use arrow keys to navigate';
126
126
  position: absolute;
127
127
  color: white;
@@ -156,11 +156,18 @@
156
156
  }
157
157
 
158
158
  .driver-popover-next-btn, .driver-popover-next-btn:hover {
159
- background-color: var(--accent-1000);
160
159
  color: white;
161
160
  padding: 16px 32px;
162
161
  }
163
162
 
163
+ .driver-popover-next-btn {
164
+ background-color: var(--accent-1000);
165
+ }
166
+
167
+ .driver-popover-next-btn:hover {
168
+ background-color: var(--accent-900);
169
+ }
170
+
164
171
  .driver-popover-footer {
165
172
  padding: 16px;
166
173
  }