11// "More options" in the routine form (spec 20.9): the time zone, what to
22// do when the last run has not finished or the computer was off, and a
3- // cron expression for those who want one.
3+ // cron expression for those who want one. A routine that waits for a
4+ // signal (spec 20.13) has no time: only the overlap rule is left.
45
56import { ChevronRight } from "lucide-react" ;
67import { useT } from "../../i18n" ;
@@ -18,19 +19,22 @@ export function MoreOptions({
1819} ) {
1920 const d = useT ( ) . routines . dialog ;
2021 const zones = allZones ( ) ;
22+ const timed = form . frequency !== "signal" || form . useCron ;
2123 return (
2224 < details className = "group rounded-xl border border-line" >
2325 < summary className = "flex cursor-default items-center gap-1.5 px-3 py-2 font-medium text-ink-soft text-sm hover:text-ink" >
2426 < ChevronRight aria-hidden size = { 14 } className = "transition-transform group-open:rotate-90" />
2527 { d . more }
2628 </ summary >
2729 < div className = "flex flex-col gap-4 border-line border-t px-3 py-3" >
28- < SelectField
29- label = { d . timezone }
30- value = { form . timezone }
31- onChange = { ( event ) => change ( { timezone : event . target . value } ) }
32- options = { zones . map ( ( zone ) => ( { value : zone , label : zoneLabel ( zone ) } ) ) }
33- />
30+ { timed && (
31+ < SelectField
32+ label = { d . timezone }
33+ value = { form . timezone }
34+ onChange = { ( event ) => change ( { timezone : event . target . value } ) }
35+ options = { zones . map ( ( zone ) => ( { value : zone , label : zoneLabel ( zone ) } ) ) }
36+ />
37+ ) }
3438 < div className = "flex flex-col gap-1.5" >
3539 < p className = "font-medium text-ink-soft text-sm" > { d . overlap } </ p >
3640 < Choices
@@ -43,27 +47,31 @@ export function MoreOptions({
4347 onChange = { ( overlap ) => change ( { overlap } ) }
4448 />
4549 </ div >
46- < div className = "flex flex-col gap-1.5" >
47- < p className = "font-medium text-ink-soft text-sm" > { d . missed } </ p >
48- < Choices
49- label = { d . missed }
50- value = { form . missed }
51- options = { [
52- { value : "run_once" , label : d . missedRunOnce } ,
53- { value : "skip" , label : d . missedSkip } ,
54- ] }
55- onChange = { ( missed ) => change ( { missed } ) }
56- />
57- < p className = "text-muted text-xs" > { d . wakeNote } </ p >
58- </ div >
59- < label className = "flex items-center gap-2 text-sm" >
60- < input
61- type = "checkbox"
62- checked = { form . useCron }
63- onChange = { ( event ) => change ( { useCron : event . target . checked } ) }
64- />
65- { d . advanced }
66- </ label >
50+ { timed && (
51+ < div className = "flex flex-col gap-1.5" >
52+ < p className = "font-medium text-ink-soft text-sm" > { d . missed } </ p >
53+ < Choices
54+ label = { d . missed }
55+ value = { form . missed }
56+ options = { [
57+ { value : "run_once" , label : d . missedRunOnce } ,
58+ { value : "skip" , label : d . missedSkip } ,
59+ ] }
60+ onChange = { ( missed ) => change ( { missed } ) }
61+ />
62+ < p className = "text-muted text-xs" > { d . wakeNote } </ p >
63+ </ div >
64+ ) }
65+ { timed && (
66+ < label className = "flex items-center gap-2 text-sm" >
67+ < input
68+ type = "checkbox"
69+ checked = { form . useCron }
70+ onChange = { ( event ) => change ( { useCron : event . target . checked } ) }
71+ />
72+ { d . advanced }
73+ </ label >
74+ ) }
6775 { form . useCron && (
6876 < TextField
6977 label = { d . cron }
0 commit comments