-
-
Notifications
You must be signed in to change notification settings - Fork 721
Run Engine 2.0 (alpha) #1575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run Engine 2.0 (alpha) #1575
Changes from all commits
b9c9c75
71f04cf
3fe3c39
2635c58
fb6c33d
7653c22
ff369f3
fcb4e3b
fd58ce6
d7a9e2b
b95dd63
d434746
eb69641
8262320
05b7e30
a6d5ec4
d4a638e
4d41221
d707a94
3cee74c
b4739b7
c9a51f1
9da544e
ff79a77
03c9899
c84b506
160e219
086c1bf
e1177f7
b57e913
ab9e268
872cea3
93d2501
f572c0f
fb56932
e01288d
4c9e024
f020acf
f1e2736
fb433de
1238ef7
2490882
a24644b
3df8158
677a2d6
62c03bf
0b37539
da41728
d3a3951
476b20f
e155aad
23e8d37
fb5b2e7
f94154a
23f3400
5f07ff2
46c79e0
accf9f7
0b0b7da
fa8bfc9
958c439
c8f460e
082644e
95a7155
610c95f
b1604fb
079bd5c
14250d5
56979e6
ae6a473
482a98d
d3386e2
7d382ac
a759bf7
927edea
3d21147
4f954b2
3d4068a
0642c9c
fdf0bf6
d6e8743
9d24fc1
446a94f
ca82d75
3c67350
f961a75
3e2687e
45a829e
a254602
bc38276
1d6fb48
a76ef98
5cf7c52
994ac3e
70abb63
f319d3a
74dd91f
8704e77
4f8ce0b
b8cb8dc
b12b617
c8b835a
e742e8b
e942c04
68813bb
a37b528
46e0698
41cfaa4
6ff1893
35ab2bd
05c0ee9
6b8bd66
8aa07e7
9da8029
5f95a7b
54d297f
7733a72
e936cea
39fa134
5002ad8
3e21ad5
acdb65a
b9b1679
b77a8d3
87bbeac
d88310a
76d4cb0
40223c0
45d1b12
57be5d0
88b30d7
9bc223a
06db938
dbfa1bd
de05bda
e1ad2c1
426259a
f85d8ee
4744ba0
bd7479b
d89d5f1
a8a3b20
117bc4d
66d392c
8317e80
da0d4a0
b7e3801
8144140
323cfce
adeb113
881986c
19693fa
84c590b
8da1e6b
864fa1b
2580b3a
eee6a4d
837ba73
d995cf0
6a5f228
684b72b
f016857
ef970cd
b7f4959
5cb706c
b19498c
1d882d7
cb24953
87e8e89
a0216b9
4e27563
a2f36b6
6bfc246
d8e4c43
6088c27
8ec03c5
0ce2454
cc26e9b
7ba6a3d
1673c9c
3967e9f
f58545b
9e678e0
11ea497
0cbd59a
d948818
4d2a9ed
266636d
fa49295
ae6fb32
841b0da
298cc16
33c76be
e2d4ead
cce4402
9326c6b
e1df4d0
d1c7c39
68211e1
8fc9304
abbdb4f
720f461
b49f5a1
03c485b
95c8073
fde9918
b236a73
44e3158
acd351d
c8a56b1
a815bc2
f7c003c
8e72c51
cd158f6
210319a
26d1017
23c77d4
053c650
3910189
9600ee8
197dce3
677077a
05bdbf5
8aa47a9
d3b095b
3db4a29
32b89a2
5031fd9
153639f
31293b9
53b8ecf
14468c9
9c28bde
632881f
91538c9
c6f6eac
76e49f7
e8b7bee
ef1f7e4
c63915f
2bb3db4
56d2297
71356cd
6fd1fd9
fe2fb82
d465144
897b512
4a72898
6531e72
3557a3d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
"@trigger.dev/react-hooks": patch | ||
"@trigger.dev/sdk": patch | ||
"trigger.dev": patch | ||
"@trigger.dev/build": patch | ||
"@trigger.dev/core": patch | ||
"@trigger.dev/rsc": patch | ||
--- | ||
|
||
Run Engine 2.0 (alpha) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
link-workspace-packages=false | ||
public-hoist-pattern[]=*prisma* | ||
prefer-workspace-packages=true | ||
prefer-workspace-packages=true | ||
update-notifier=false |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { useAnimate } from "framer-motion"; | ||
import { HourglassIcon } from "lucide-react"; | ||
import { useEffect } from "react"; | ||
|
||
export function AnimatedHourglassIcon({ | ||
className, | ||
delay, | ||
}: { | ||
className?: string; | ||
delay?: number; | ||
}) { | ||
const [scope, animate] = useAnimate(); | ||
|
||
useEffect(() => { | ||
animate( | ||
[ | ||
[scope.current, { rotate: 0 }, { duration: 0.7 }], | ||
[scope.current, { rotate: 180 }, { duration: 0.3 }], | ||
[scope.current, { rotate: 180 }, { duration: 0.7 }], | ||
[scope.current, { rotate: 360 }, { duration: 0.3 }], | ||
], | ||
{ repeat: Infinity, delay } | ||
); | ||
}, []); | ||
|
||
return <HourglassIcon ref={scope} className={className} />; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export function PauseIcon({ className }: { className?: string }) { | ||
return ( | ||
<svg className={className} viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
<path | ||
fillRule="evenodd" | ||
clipRule="evenodd" | ||
d="M0 10C0 4.47715 4.47715 0 10 0C15.5228 0 20 4.47715 20 10C20 15.5228 15.5228 20 10 20C4.47715 20 0 15.5228 0 10ZM6.5 6C6.5 5.44772 6.94772 5 7.5 5C8.05229 5 8.5 5.44772 8.5 6V14C8.5 14.5523 8.05229 15 7.5 15C6.94772 15 6.5 14.5523 6.5 14V6ZM12.5 5C11.9477 5 11.5 5.44772 11.5 6V14C11.5 14.5523 11.9477 15 12.5 15C13.0523 15 13.5 14.5523 13.5 14V6C13.5 5.44772 13.0523 5 12.5 5Z" | ||
fill="currentColor" | ||
/> | ||
</svg> | ||
); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
export function TaskCachedIcon({ className }: { className?: string }) { | ||
return ( | ||
<svg | ||
className={className} | ||
width="16" | ||
height="16" | ||
viewBox="0 0 16 16" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<g clipPath="url(#clip0_15584_76102)"> | ||
<path | ||
d="M0.5 3.5L0.5 2.5C0.5 1.39543 1.39543 0.5 2.5 0.5H3.5" | ||
stroke="#3B82F6" | ||
strokeLinecap="square" | ||
strokeLinejoin="round" | ||
/> | ||
<path | ||
d="M15.5 12.5L15.5 13.5C15.5 14.6046 14.6046 15.5 13.5 15.5L12.5 15.5" | ||
stroke="#3B82F6" | ||
strokeLinecap="square" | ||
strokeLinejoin="round" | ||
/> | ||
<path | ||
d="M12.5 0.5L13.5 0.5C14.6046 0.5 15.5 1.39543 15.5 2.5L15.5 3.5" | ||
stroke="#3B82F6" | ||
strokeLinecap="square" | ||
strokeLinejoin="round" | ||
/> | ||
<path | ||
d="M3.5 15.5L2.5 15.5C1.39543 15.5 0.5 14.6046 0.5 13.5L0.5 12.5" | ||
stroke="#3B82F6" | ||
strokeLinecap="square" | ||
strokeLinejoin="round" | ||
/> | ||
<path d="M11.1799 4.19V5.598H8.8479V12H7.1649V5.598H4.8219V4.19H11.1799Z" fill="#3B82F6" /> | ||
<line x1="6" y1="15.5" x2="10" y2="15.5" stroke="#3B82F6" /> | ||
<line x1="6" y1="0.5" x2="10" y2="0.5" stroke="#3B82F6" /> | ||
<line x1="15.5" y1="6" x2="15.5" y2="10" stroke="#3B82F6" /> | ||
<line x1="0.5" y1="6" x2="0.5" y2="10" stroke="#3B82F6" /> | ||
</g> | ||
<defs> | ||
<clipPath id="clip0_15584_76102"> | ||
<rect width="16" height="16" fill="white" /> | ||
</clipPath> | ||
</defs> | ||
</svg> | ||
); | ||
} |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -3,6 +3,7 @@ | |||||||||||||||||||||||||||||||||||||||||||||||
import * as React from "react"; | ||||||||||||||||||||||||||||||||||||||||||||||||
import * as SwitchPrimitives from "@radix-ui/react-switch"; | ||||||||||||||||||||||||||||||||||||||||||||||||
import { cn } from "~/utils/cn"; | ||||||||||||||||||||||||||||||||||||||||||||||||
import { ShortcutDefinition, useShortcutKeys } from "~/hooks/useShortcutKeys"; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||
const variations = { | ||||||||||||||||||||||||||||||||||||||||||||||||
large: { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
@@ -23,14 +24,34 @@ const variations = { | |||||||||||||||||||||||||||||||||||||||||||||||
type SwitchProps = React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root> & { | ||||||||||||||||||||||||||||||||||||||||||||||||
label?: React.ReactNode; | ||||||||||||||||||||||||||||||||||||||||||||||||
variant: keyof typeof variations; | ||||||||||||||||||||||||||||||||||||||||||||||||
shortcut?: ShortcutDefinition; | ||||||||||||||||||||||||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||
export const Switch = React.forwardRef<React.ElementRef<typeof SwitchPrimitives.Root>, SwitchProps>( | ||||||||||||||||||||||||||||||||||||||||||||||||
({ className, variant, label, ...props }, ref) => { | ||||||||||||||||||||||||||||||||||||||||||||||||
const innerRef = React.useRef<HTMLButtonElement>(null); | ||||||||||||||||||||||||||||||||||||||||||||||||
React.useImperativeHandle(ref, () => innerRef.current as HTMLButtonElement); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||
const { container, root, thumb, text } = variations[variant]; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||
if (props.shortcut) { | ||||||||||||||||||||||||||||||||||||||||||||||||
useShortcutKeys({ | ||||||||||||||||||||||||||||||||||||||||||||||||
shortcut: props.shortcut, | ||||||||||||||||||||||||||||||||||||||||||||||||
action: () => { | ||||||||||||||||||||||||||||||||||||||||||||||||
if (innerRef.current) { | ||||||||||||||||||||||||||||||||||||||||||||||||
innerRef.current.click(); | ||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||
disabled: props.disabled, | ||||||||||||||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+37
to
+47
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Move shortcut action outside render function and avoid conditional hook. The current implementation has two issues:
Apply this diff to fix both issues: + const handleShortcutAction = React.useCallback(() => {
+ if (innerRef.current) {
+ innerRef.current.click();
+ }
+ }, []);
+
+ useShortcutKeys({
+ shortcut: props.shortcut,
+ action: handleShortcutAction,
+ disabled: props.disabled,
+ enabled: !!props.shortcut,
+ });
- if (props.shortcut) {
- useShortcutKeys({
- shortcut: props.shortcut,
- action: () => {
- if (innerRef.current) {
- innerRef.current.click();
- }
- },
- disabled: props.disabled,
- });
- } 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||
return ( | ||||||||||||||||||||||||||||||||||||||||||||||||
<SwitchPrimitives.Root className={cn("group", container, className)} {...props} ref={ref}> | ||||||||||||||||||||||||||||||||||||||||||||||||
<SwitchPrimitives.Root | ||||||||||||||||||||||||||||||||||||||||||||||||
className={cn("group", container, className)} | ||||||||||||||||||||||||||||||||||||||||||||||||
{...props} | ||||||||||||||||||||||||||||||||||||||||||||||||
ref={innerRef} | ||||||||||||||||||||||||||||||||||||||||||||||||
> | ||||||||||||||||||||||||||||||||||||||||||||||||
{label ? ( | ||||||||||||||||||||||||||||||||||||||||||||||||
<label className={cn("whitespace-nowrap", text)}> | ||||||||||||||||||||||||||||||||||||||||||||||||
{typeof label === "string" ? <span>{label}</span> : label} | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -359,8 +359,8 @@ function BatchIdDropdown({ | |
if (batchId) { | ||
if (!batchId.startsWith("batch_")) { | ||
error = "Batch IDs start with 'batch_'"; | ||
} else if (batchId.length !== 27) { | ||
error = "Batch IDs are 27 characters long"; | ||
} else if (batchId.length !== 27 && batchId.length !== 31) { | ||
error = "Batch IDs are 27/32 characters long"; | ||
Comment on lines
+362
to
+363
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainInconsistency in batch ID length validation. The error message states "27/32 characters" but the validation checks for "27/31 characters". This mismatch could confuse users. Apply this diff to fix the error message: - error = "Batch IDs are 27/32 characters long";
+ error = "Batch IDs are 27/31 characters long"; Additionally, there's an inconsistency with the validation in Run the following script to verify the batch ID validation across the codebase: 🏁 Script executed: #!/bin/bash
# Description: Search for batch ID validation logic to ensure consistency.
# Test: Search for batch ID length validation. Expect: Only occurrences of the new validation.
rg -A 5 'batch.*length.*27' Length of output: 896 Batch ID Validation Inconsistency Found
|
||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -66,3 +66,37 @@ export function LiveCountUp({ | |||||
</> | ||||||
); | ||||||
} | ||||||
|
||||||
export function LiveCountdown({ | ||||||
endTime, | ||||||
updateInterval = 100, | ||||||
}: { | ||||||
endTime: Date; | ||||||
updateInterval?: number; | ||||||
}) { | ||||||
const [now, setNow] = useState<Date>(); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Initialize the now state with current date. The - const [now, setNow] = useState<Date>();
+ const [now, setNow] = useState<Date>(new Date()); 📝 Committable suggestion
Suggested change
|
||||||
|
||||||
useEffect(() => { | ||||||
const interval = setInterval(() => { | ||||||
const date = new Date(); | ||||||
setNow(date); | ||||||
|
||||||
if (date > endTime) { | ||||||
clearInterval(interval); | ||||||
} | ||||||
}, updateInterval); | ||||||
|
||||||
return () => clearInterval(interval); | ||||||
}, [endTime]); | ||||||
|
||||||
return ( | ||||||
<> | ||||||
{formatDuration(now, endTime, { | ||||||
style: "short", | ||||||
maxDecimalPoints: 0, | ||||||
units: ["d", "h", "m", "s"], | ||||||
maxUnits: 4, | ||||||
})} | ||||||
</> | ||||||
); | ||||||
} |
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -763,8 +763,8 @@ function RunIdDropdown({ | |||||||||
if (runId) { | ||||||||||
if (!runId.startsWith("run_")) { | ||||||||||
error = "Run IDs start with 'run_'"; | ||||||||||
} else if (runId.length !== 25) { | ||||||||||
error = "Run IDs are 25 characters long"; | ||||||||||
} else if (runId.length !== 25 && runId.length !== 29) { | ||||||||||
error = "Run IDs are 25/30 characters long"; | ||||||||||
Comment on lines
+766
to
+767
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Inconsistency in run ID length error message. The error message states "25/30 characters" but the validation checks for "25/29 characters". This mismatch could confuse users. Apply this diff to fix the error message: - error = "Run IDs are 25/30 characters long";
+ error = "Run IDs are 25/29 characters long"; 📝 Committable suggestion
Suggested change
|
||||||||||
} | ||||||||||
} | ||||||||||
|
||||||||||
|
Uh oh!
There was an error while loading. Please reload this page.