Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

label overdue/catch-up launches on the Schedule Timeline instead of drawing them as on-cadence

[._.]/ Adam Eivy16a5dcf44e88
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 1069359024..0f8e3752f0 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -37,6 +37,8 @@
- **Digital Twin Taste questionnaire no longer shows "Question 5 of 3" after follow-ups.** The progress header used total response count (core + follow-ups) as the current question number against a core-only total, so once branching follow-ups fired the counter overran the "of N". It now reports the 1-based index among core questions for that section, so the label stays "Question 2 of 3" even when follow-ups sit between cores.
+- **Schedule Timeline now explains why a task sits on "Now" instead of looking like a bug.** A weekly task that has never run, or a cron task whose scheduled slot passed while it was down, is genuinely *due now* — the scheduler will fire it on the next check as a first-run or catch-up. The timeline drew that NOW launch identically to an on-cadence launch, so a marker on "Now" next to a "Sun at 07:00" / "weekly" label read as wrong (e.g. `branch-cleanup` and `reference-watch` both showing NOW). Due-now launches are now tagged server-side (`dueNow` + the scheduler's reason and any missed cron slot) and rendered distinctly: an amber ring on the Now marker, a `first run` / `catch-up` / `overdue` badge on the Scheduled-order chip, and tooltips/legend explaining that it launches on the next check rather than waiting for the next cadence slot. On-cadence future launches are unchanged.
+
- **Accessibility: icon-only controls, keyboard-trapped elements, and unlabeled form fields across the app are now screen-reader and keyboard accessible.** An audit found ~65 icon-only buttons (modal/panel close `✕`, calendar prev/next, refresh, inline-edit save/cancel/edit/delete, reorder, delete, skip/back) with no accessible name, 15 `<div>`/`<span>` elements that were clickable by mouse only (no keyboard focus or Enter/Space activation), and several settings/config inputs missing a `<label>` association. Buttons gained descriptive `aria-label`s; clickable non-buttons now use a new shared helper `clickableProps()` (`client/src/lib/a11yKeyboard.js` — adds `role="button"`, `tabIndex`, and Enter/Space `onKeyDown`) so keyboard users can reach and activate them; and the form fields (external SD API URL, Python interpreter path, test-render prompt, per-row AI provider/model selects, image-gen seed) got proper `htmlFor`/`id` or `aria-label` associations. `IconPicker` also gained Escape-to-dismiss and an `aria-hidden` backdrop. The shared shells (Layout, Modal, Drawer, ⌘K, Logo, MediaImage) were already accessible and unchanged.
- **Sidebar nav no longer truncates long link names.** App names (and other child labels) under Apps and the rest of the sidebar used `truncate` in a 224px rail, so names like `barnhub.online` or `IdeatorPro…` collapsed to ellipsis with no way to read them. Labels now wrap with `break-words`, always expose the full name via `title`, the pin control is overlaid so it no longer steals label width, and the expanded sidebar is slightly wider (`w-64`).
diff --git a/client/src/components/cos/tabs/WorkflowTab.jsx b/client/src/components/cos/tabs/WorkflowTab.jsx
index 05a590a7ae..cdd77553ce 100644
--- a/client/src/components/cos/tabs/WorkflowTab.jsx
+++ b/client/src/components/cos/tabs/WorkflowTab.jsx
@@ -50,6 +50,25 @@ function relativeTime(iso) {
return `in ${Math.round(deltaMinutes / 1440)}d`;
}
+// A launch tagged `dueNow` fires because the scheduler already considers the
+// task due — a catch-up, first run, or elapsed interval — not because a cadence
+// slot lands now. Explain why, so a NOW marker beside "Sun at 07:00" doesn't
+// read as a bug. Returns null for ordinary on-cadence launches.
+function dueNowMeta(occurrence, node, timezone) {
+ if (!occurrence?.dueNow) return null;
+ const reason = occurrence.reason || '';
+ if (reason.startsWith('cron-catch-up')) {
+ const slot = occurrence.missedSlot
+ ? new Date(occurrence.missedSlot).toLocaleString([], { weekday: 'short', hour: 'numeric', minute: '2-digit', timeZone: timezone })
+ : null;
+ return { badge: 'catch-up', detail: slot ? `Catch-up for the missed ${slot} slot` : 'Catch-up for a missed slot' };
+ }
+ if (reason === 'once-first-run' || !node?.lastRun) {
+ return { badge: 'first run', detail: 'First run — has never run before' };
+ }
+ return { badge: 'overdue', detail: 'Overdue — the interval elapsed since the last run' };
+}
+
function timelinePercent(iso, timeline) {
const start = new Date(timeline.startAt).getTime();
const end = new Date(timeline.endAt).getTime();
@@ -109,14 +128,20 @@ function TimelineRow({ node, occurrences, windows, timeline, hours, timezone, se
<span className="absolute left-2 top-1/2 -translate-y-1/2 whitespace-nowrap text-[10px] font-medium text-amber-200"><InfinityIcon className="mr-1 inline h-3 w-3" />draining</span>
</span>
))}
- {occurrences.map(occurrence => (
- <span
- key={occurrence.id}
- className={`absolute top-1/2 z-20 h-4 w-4 -translate-x-1/2 -translate-y-1/2 rounded-sm border-2 border-port-bg shadow ${occurrence.kind === 'recheck' ? 'rotate-45 bg-amber-300' : palette.marker} ${occurrence.collision ? 'ring-2 ring-port-warning ring-offset-1 ring-offset-port-bg' : ''}`}
- style={{ left: `${timelinePercent(occurrence.at, timeline)}%` }}
- title={`${occurrence.kind === 'recheck' ? 'Reset/recheck' : 'Launch'} ${formatPoint(occurrence.at, hours, timezone)}${occurrence.collision ? ' · another task launches within 15 minutes' : ''}`}
- />
- ))}
+ {occurrences.map(occurrence => {
+ const meta = dueNowMeta(occurrence, node, timezone);
+ const ring = occurrence.collision
+ ? 'ring-2 ring-port-warning ring-offset-1 ring-offset-port-bg'
+ : meta ? 'ring-2 ring-amber-300 ring-offset-1 ring-offset-port-bg' : '';
+ return (
+ <span
+ key={occurrence.id}
+ className={`absolute top-1/2 z-20 h-4 w-4 -translate-x-1/2 -translate-y-1/2 rounded-sm border-2 border-port-bg shadow ${occurrence.kind === 'recheck' ? 'rotate-45 bg-amber-300' : palette.marker} ${ring}`}
+ style={{ left: `${timelinePercent(occurrence.at, timeline)}%` }}
+ title={`${occurrence.kind === 'recheck' ? 'Reset/recheck' : 'Launch'} ${formatPoint(occurrence.at, hours, timezone)}${meta ? ` · ${meta.detail}` : ''}${occurrence.collision ? ' · another task launches within 15 minutes' : ''}`}
+ />
+ );
+ })}
</div>
</button>
);
@@ -134,10 +159,14 @@ function NextUp({ occurrences, nodeMap, hours, timezone, onSelect }) {
{next.map((occurrence, index) => {
const node = nodeMap.get(occurrence.nodeId);
if (!node) return null;
+ const meta = dueNowMeta(occurrence, node, timezone);
return (
<div key={occurrence.id} className="flex shrink-0 items-center gap-2">
- <button type="button" onClick={() => onSelect(node.id)} className={`min-w-36 rounded border px-3 py-2 text-left hover:border-port-accent/50 ${occurrence.collision ? 'border-port-warning/50 bg-port-warning/5' : 'border-port-border bg-port-bg/50'}`}>
- <span className="block text-[10px] font-medium uppercase tracking-wide text-gray-500">{formatPoint(occurrence.at, hours, timezone)} · {relativeTime(occurrence.at)}</span>
+ <button type="button" onClick={() => onSelect(node.id)} title={meta?.detail || undefined} className={`min-w-36 rounded border px-3 py-2 text-left hover:border-port-accent/50 ${occurrence.collision ? 'border-port-warning/50 bg-port-warning/5' : meta ? 'border-amber-400/50 bg-amber-500/5' : 'border-port-border bg-port-bg/50'}`}>
+ <span className="flex items-center gap-1.5 text-[10px] font-medium uppercase tracking-wide text-gray-500">
+ <span>{formatPoint(occurrence.at, hours, timezone)} · {relativeTime(occurrence.at)}</span>
+ {meta && <span className="rounded-sm bg-amber-500/15 px-1 py-px text-[9px] text-amber-300">{meta.badge}</span>}
+ </span>
<span className="mt-0.5 block max-w-44 truncate text-xs text-gray-200">{occurrence.kind === 'recheck' ? '↻ ' : ''}{node.label}</span>
</button>
{index < next.length - 1 && <ArrowRight className="h-3.5 w-3.5 text-gray-700" />}
@@ -278,6 +307,7 @@ export default function WorkflowTab() {
<span className="inline-flex items-center gap-1"><span className="h-2.5 w-2.5 rounded-sm bg-purple-400" /> pinned</span>
<span className="inline-flex items-center gap-1"><span className="h-2.5 w-2.5 rounded-sm bg-cyan-400" /> interval job</span>
<span className="inline-flex items-center gap-1"><span className="h-2.5 w-2.5 rotate-45 rounded-sm bg-amber-300" /> reset/recheck</span>
+ <span className="inline-flex items-center gap-1"><span className="h-2.5 w-2.5 rounded-sm bg-emerald-400 ring-2 ring-amber-300 ring-offset-1 ring-offset-port-bg" /> due now (catch-up)</span>
</div>
<span className="inline-flex items-center gap-1"><CalendarDays className="h-3 w-3" />{graph.timezone}</span>
</div>
@@ -321,6 +351,7 @@ export default function WorkflowTab() {
<div className="flex flex-wrap gap-x-4 gap-y-1 text-[10px] text-gray-600">
<span><AlertTriangle className="mr-1 inline h-3 w-3 text-port-warning" />A ring means another launch is within 15 minutes; actual overlap depends on runtime.</span>
+ <span><Clock3 className="mr-1 inline h-3 w-3 text-amber-300" />An amber ring at Now means the task is already due (catch-up, first run, or overdue) — it launches on the next check rather than waiting for its next cadence slot.</span>
<span><TimerReset className="mr-1 inline h-3 w-3" />Perpetual bands have no fixed end while backlog remains.</span>
</div>
</div>
diff --git a/server/services/workflow.js b/server/services/workflow.js
index 9570a14a3b..3799dce145 100644
--- a/server/services/workflow.js
+++ b/server/services/workflow.js
@@ -181,6 +181,13 @@ export async function getWorkflowGraph({ horizonHours = 24, from = new Date() }
blocked: info.status?.reason === 'waiting-on-dependencies' ? info.status.reason : null,
statusReason: info.status?.shouldRun === false ? info.status.reason : null,
shouldRun: info.status?.shouldRun === true,
+ // Why the task is due right now (e.g. 'weekly-due', 'cron-catch-up',
+ // 'once-first-run'). Surfaced only for shouldRun=true so the timeline can
+ // explain a NOW marker that sits far from the task's next cadence slot —
+ // a catch-up or first run reads as a bug otherwise (issue: NOW markers on
+ // weekly/Sunday tasks). `missedSlot` is the cron slot catch-up recovers.
+ runReason: info.status?.shouldRun === true ? (info.status.reason || null) : null,
+ missedSlot: info.status?.missedSlot || null,
pendingDeps: info.status?.pendingDeps || [],
nextRunAt: info.status?.nextRunAt || info.perpetual?.nextRecheckAt || null,
perpetual: info.perpetual || null
@@ -287,7 +294,7 @@ export function projectWorkflowTimeline(nodes, { start, end, timezone = 'UTC' })
if (schedule.cronExpression) {
const dueNow = isCronDueNow(node, schedule.cronExpression, startMs, timezone);
if (dueNow) {
- occurrences.push(makeOccurrence(node, startMs, 'launch'));
+ occurrences.push(makeOccurrence(node, startMs, 'launch', dueNowExtra(node)));
}
// When a due-now marker was emitted, start the projection strictly after
// startMs so a cron slot landing exactly on the current minute doesn't
@@ -374,7 +381,7 @@ function projectIntervalTask(node, startMs, endMs, timezone, occurrences) {
const type = node.schedule?.type;
if (type === 'rotation' || type === 'on-demand') return;
if (type === 'once') {
- if (node.shouldRun) occurrences.push(makeOccurrence(node, startMs, 'launch'));
+ if (node.shouldRun) occurrences.push(makeOccurrence(node, startMs, 'launch', dueNowExtra(node)));
return;
}
@@ -382,10 +389,19 @@ function projectIntervalTask(node, startMs, endMs, timezone, occurrences) {
|| (type === 'weekly' ? 7 * DAY : type === 'daily' ? DAY : node.schedule?.intervalMs);
if (!cadence) return;
- let nextMs = node.shouldRun ? startMs : (node.nextRunAt ? new Date(node.nextRunAt).getTime() : NaN);
- if (!Number.isFinite(nextMs)) {
- const lastRunMs = node.lastRun ? new Date(node.lastRun).getTime() : NaN;
- nextMs = Number.isFinite(lastRunMs) ? lastRunMs + cadence : startMs;
+ let nextMs;
+ if (node.shouldRun) {
+ // Emit the due-now marker explicitly (tagged) and project subsequent cadence
+ // slots strictly after now so the recurring slots aren't mislabelled due-now.
+ occurrences.push(makeOccurrence(node, startMs, 'launch', dueNowExtra(node)));
+ const anchor = node.nextRunAt ? new Date(node.nextRunAt).getTime() : NaN;
+ nextMs = Number.isFinite(anchor) && anchor > startMs ? anchor : startMs + cadence;
+ } else {
+ nextMs = node.nextRunAt ? new Date(node.nextRunAt).getTime() : NaN;
+ if (!Number.isFinite(nextMs)) {
+ const lastRunMs = node.lastRun ? new Date(node.lastRun).getTime() : NaN;
+ nextMs = Number.isFinite(lastRunMs) ? lastRunMs + cadence : startMs;
+ }
}
appendIntervalOccurrences(node, nextMs, cadence, startMs, endMs, timezone, occurrences, 'launch');
}
@@ -397,7 +413,7 @@ function projectIntervalJob(node, startMs, endMs, timezone, occurrences) {
let nextMs = Number.isFinite(lastRunMs) ? lastRunMs + cadence : startMs;
const timeMatch = String(node.schedule?.scheduledTime || '').match(/^([01]\d|2[0-3]):([0-5]\d)$/);
if (isIntervalJobDueNow(node, startMs, timezone)) {
- occurrences.push(makeOccurrence(node, startMs, 'launch'));
+ occurrences.push(makeOccurrence(node, startMs, 'launch', dueNowExtra(node)));
nextMs = startMs + cadence;
}
// Fast-forward a stale anchor (lastRun many cadences ago but not due right
@@ -468,15 +484,25 @@ function appendIntervalOccurrences(node, firstMs, cadence, startMs, endMs, timez
}
}
-function makeOccurrence(node, atMs, kind) {
+function makeOccurrence(node, atMs, kind, extra = {}) {
return {
id: `${node.id}:${kind}:${atMs}`,
nodeId: node.id,
at: new Date(atMs).toISOString(),
- kind
+ kind,
+ ...extra
};
}
+// A launch pinned to the window start (NOW) fires because the scheduler already
+// considers the task due — a catch-up, first run, or elapsed interval — NOT
+// because a cadence slot happens to land now. Tag it so the UI can distinguish
+// it from an on-cadence launch (a NOW marker next to "Sun at 07:00" otherwise
+// reads as a bug). Future cadence slots never carry this flag.
+function dueNowExtra(node) {
+ return { dueNow: true, reason: node?.runReason || null, missedSlot: node?.missedSlot || null };
+}
+
function findCollisionOccurrenceIds(occurrences) {
const ids = new Set();
const launches = occurrences.filter(item => item.kind === 'launch');
diff --git a/server/services/workflow.test.js b/server/services/workflow.test.js
index 1d090b5eb4..72dfcde6c2 100644
--- a/server/services/workflow.test.js
+++ b/server/services/workflow.test.js
@@ -245,6 +245,46 @@ describe('projectWorkflowTimeline', () => {
expect(timeline.occurrences[0]).toMatchObject({ nodeId: 'task:due', at: range.start.toISOString(), kind: 'launch' });
});
+ it('tags an overdue interval task launch as due-now and carries its reason', () => {
+ const timeline = projectWorkflowTimeline([{
+ id: 'task:weekly', kind: 'task', enabled: true, shouldRun: true,
+ runReason: 'weekly-due', lastRun: null,
+ schedule: { type: 'weekly', effectiveIntervalMs: 7 * 86_400_000 }
+ }], range);
+
+ // The NOW marker is flagged; subsequent cadence slots (out of the 24h
+ // window) are not, so only the tagged launch is present.
+ expect(timeline.occurrences).toEqual([
+ expect.objectContaining({ nodeId: 'task:weekly', at: range.start.toISOString(), dueNow: true, reason: 'weekly-due' })
+ ]);
+ });
+
+ it('does not tag a future on-cadence interval slot as due-now', () => {
+ const timeline = projectWorkflowTimeline([{
+ id: 'task:soon', kind: 'task', enabled: true, shouldRun: false,
+ lastRun: '2026-07-08T18:00:00.000Z', nextRunAt: '2026-07-09T18:00:00.000Z',
+ schedule: { type: 'daily', effectiveIntervalMs: 86_400_000 }
+ }], range);
+
+ expect(timeline.occurrences).toHaveLength(1);
+ expect(timeline.occurrences[0]).toMatchObject({ nodeId: 'task:soon', at: '2026-07-09T18:00:00.000Z' });
+ expect(timeline.occurrences[0].dueNow).toBeUndefined();
+ });
+
+ it('tags a cron catch-up launch as due-now with the missed slot', () => {
+ const timeline = projectWorkflowTimeline([{
+ id: 'task:sunday', kind: 'task', enabled: true, shouldRun: true,
+ runReason: 'cron-catch-up', missedSlot: '2026-07-05T14:00:00.000Z',
+ lastRun: '2026-07-05T00:57:50.000Z',
+ schedule: { type: 'cron', cronExpression: '0 7 * * 0' }
+ }], range);
+
+ expect(timeline.occurrences[0]).toMatchObject({
+ nodeId: 'task:sunday', at: range.start.toISOString(), dueNow: true,
+ reason: 'cron-catch-up', missedSlot: '2026-07-05T14:00:00.000Z'
+ });
+ });
+
it('omits weekend occurrences for weekday-only interval tasks', () => {
const timeline = projectWorkflowTimeline([{
id: 'task:weekdays', kind: 'task', enabled: true, shouldRun: false,