Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

feat(settings): host cron jobs panel in workflows page

Steven Enamakel5d8af02e101c
diff --git a/app/src/components/settings/panels/CronJobsPanel.tsx b/app/src/components/settings/panels/CronJobsPanel.tsx
index 0c5d0048fa..42e190cb4c 100644
--- a/app/src/components/settings/panels/CronJobsPanel.tsx
+++ b/app/src/components/settings/panels/CronJobsPanel.tsx
@@ -17,6 +17,7 @@ import {
} from '../../../utils/tauriCommands';
import Button from '../../ui/Button';
import { SettingsSection, SettingsStatusLine } from '../controls';
+import { SettingsLayoutProvider } from '../layout/SettingsLayoutContext';
import SettingsPanel from '../layout/SettingsPanel';
import CoreJobList from './cron/CoreJobList';
import CronJobFormModal from './cron/CronJobFormModal';
@@ -194,78 +195,93 @@ const CronJobsPanel = () => {
};
return (
- <SettingsPanel testId="cron-jobs-panel" description={t('settings.developerMenu.cronJobs.desc')}>
- <SettingsSection title={t('cron.scheduledJobs')} description={t('cron.manageCronJobs')}>
- <div className="px-4 pb-4 space-y-4">
- <div className="pt-2">
- <Button
- type="button"
- variant="primary"
- size="sm"
- data-testid="cron-new-job"
- onClick={() => {
- setEditingJob(null);
- setFormOpen(true);
- }}>
- {t('settings.cron.jobs.createJob')}
- </Button>
- </div>
+ // Hosted by the Workflows page (`/flows?view=schedules`), not by
+ // `/settings/*` any more. Two consequences, both handled here rather than
+ // by the host:
+ //
+ // - The title must be explicit. `SettingsPanel` derives it from the active
+ // settings route, and off `/settings` that resolves to `home`, which
+ // would title this page "Settings".
+ // - `inTwoPaneShell` must be asserted, or `SettingsBackButton` shows (it
+ // renders whenever the path is not `/settings/*` and no two-pane shell is
+ // declared) and its Back would jump to the settings tree.
+ <SettingsLayoutProvider value={{ inTwoPaneShell: true }}>
+ <SettingsPanel
+ testId="cron-jobs-panel"
+ title={t('settings.developerMenu.cronJobs.title')}
+ description={t('settings.developerMenu.cronJobs.desc')}>
+ <SettingsSection title={t('cron.scheduledJobs')} description={t('cron.manageCronJobs')}>
+ <div className="px-4 pb-4 space-y-4">
+ <div className="pt-2">
+ <Button
+ type="button"
+ variant="primary"
+ size="sm"
+ data-testid="cron-new-job"
+ onClick={() => {
+ setEditingJob(null);
+ setFormOpen(true);
+ }}>
+ {t('settings.cron.jobs.createJob')}
+ </Button>
+ </div>
- <SettingsStatusLine saving={false} error={coreError} savingLabel="" />
+ <SettingsStatusLine saving={false} error={coreError} savingLabel="" />
- <CoreJobList
- loading={loading}
- coreJobs={coreJobs}
- profiles={profiles}
- coreRunsByJob={coreRunsByJob}
- coreBusyKey={coreBusyKey}
- onToggleCoreJob={job => void toggleCoreJob(job)}
- onRunCoreJob={jobId => void runCoreJob(jobId)}
- onLoadCoreRuns={jobId => void loadCoreRuns(jobId)}
- onRemoveCoreJob={jobId => void removeCoreJob(jobId)}
- onEditCoreJob={job => setEditingJob(job)}
- />
+ <CoreJobList
+ loading={loading}
+ coreJobs={coreJobs}
+ profiles={profiles}
+ coreRunsByJob={coreRunsByJob}
+ coreBusyKey={coreBusyKey}
+ onToggleCoreJob={job => void toggleCoreJob(job)}
+ onRunCoreJob={jobId => void runCoreJob(jobId)}
+ onLoadCoreRuns={jobId => void loadCoreRuns(jobId)}
+ onRemoveCoreJob={jobId => void removeCoreJob(jobId)}
+ onEditCoreJob={job => setEditingJob(job)}
+ />
- <div>
- <Button
- type="button"
- variant="secondary"
- size="sm"
- data-testid="cron-refresh"
- onClick={() => void loadCoreCronJobsOnly()}>
- {t('cron.refreshCronJobs')}
- </Button>
+ <div>
+ <Button
+ type="button"
+ variant="secondary"
+ size="sm"
+ data-testid="cron-refresh"
+ onClick={() => void loadCoreCronJobsOnly()}>
+ {t('cron.refreshCronJobs')}
+ </Button>
+ </div>
</div>
- </div>
- </SettingsSection>
+ </SettingsSection>
- {/* Create modal */}
- {formOpen && editingJob === null && (
- <CronJobFormModal
- key="cron-form-create"
- mode="create"
- open={true}
- profiles={profiles}
- onClose={() => setFormOpen(false)}
- onCreate={params => handleCreate(params)}
- onUpdate={handleUpdate}
- />
- )}
+ {/* Create modal */}
+ {formOpen && editingJob === null && (
+ <CronJobFormModal
+ key="cron-form-create"
+ mode="create"
+ open={true}
+ profiles={profiles}
+ onClose={() => setFormOpen(false)}
+ onCreate={params => handleCreate(params)}
+ onUpdate={handleUpdate}
+ />
+ )}
- {/* Edit modal */}
- {editingJob !== null && (
- <CronJobFormModal
- key={`cron-form-edit-${editingJob.id}`}
- mode="edit"
- job={editingJob}
- open={true}
- profiles={profiles}
- onClose={() => setEditingJob(null)}
- onCreate={handleCreate}
- onUpdate={handleUpdate}
- />
- )}
- </SettingsPanel>
+ {/* Edit modal */}
+ {editingJob !== null && (
+ <CronJobFormModal
+ key={`cron-form-edit-${editingJob.id}`}
+ mode="edit"
+ job={editingJob}
+ open={true}
+ profiles={profiles}
+ onClose={() => setEditingJob(null)}
+ onCreate={handleCreate}
+ onUpdate={handleUpdate}
+ />
+ )}
+ </SettingsPanel>
+ </SettingsLayoutProvider>
);
};