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

fix(cos): tappable toggles in Schedule tab agent options on iOS

Adam Eivy30a0f4d86b6a
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index ff77e7442c..c8c79c546b 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -46,6 +46,8 @@
## Fixed
+- **CoS Schedule tab — agent-option toggles now respond to taps on iPhone.** The per-task "Agent Options" rows in `/cos/schedule` rendered a `<ToggleSwitch>` (which is a `<button>`) inside another `<button>`, producing invalid nested-button HTML. iOS Safari refuses to dispatch tap events reliably for nested interactive controls, so tapping the toggle (or the row) sometimes did nothing. `ToggleSwitch` now supports a `decorative` prop that renders as a `<span>` (with `aria-hidden`) so it can be used purely visually inside another button without breaking the click target. The Schedule tab's Agent Options use it; the outer button's existing `aria-pressed` continues to communicate state to assistive tech.
+
- **Creative Director projects no longer get stuck in `planning` with zero runs.** Clicking Start on a fresh `draft` project flipped status to `planning` in the route, then fired `startCreativeDirectorProject` → `advanceAfterSceneSettled`, which re-read the project, saw `status === 'planning'`, and bailed via a too-aggressive dedup early-return that was meant to catch "treatment task already in flight." The treatment task was never enqueued, no run was recorded, and the same flaw silently bricked `failed`/`paused` projects without a treatment plus the boot-time recovery path. Replaced the brittle status check with a runs-array probe (`runs.some(r => r.kind === 'treatment' && r.status === 'running')`) that actually reflects "a treatment task is mid-flight." Boot recovery now correctly resumes stuck projects on server restart. Two new regression tests in `orchestrator.test.js` cover the fresh-Start path and the genuine in-flight dedup path.
- **Creative Director scene segments play inline.** The Segments tab used to render each scene's mp4 as an `<a target="_blank">`-wrapped thumbnail — clicking opened the file in a new tab, which is awkward for previewing 6–20 short clips in sequence. Each tile is now an inline `<video controls preload="none" playsInline poster=…>` element using the existing per-job thumbnail JPEG as the poster frame, so the grid still renders instantly without paying for 20 metadata round-trips on tab open. Fetching only happens on play. `onError` hides any tile whose mp4 is missing, matching the prior `<img>` fallback behavior.
diff --git a/client/src/components/ToggleSwitch.jsx b/client/src/components/ToggleSwitch.jsx
index ba15040f7a..7a0e070f05 100644
--- a/client/src/components/ToggleSwitch.jsx
+++ b/client/src/components/ToggleSwitch.jsx
@@ -13,8 +13,23 @@ const SIZES = {
}
};
-export default function ToggleSwitch({ enabled, onChange, disabled, ariaLabel, size = 'md', activeColor = 'bg-port-accent', className = '', tabIndex }) {
+export default function ToggleSwitch({ enabled, onChange, disabled, ariaLabel, size = 'md', activeColor = 'bg-port-accent', className = '', tabIndex, decorative = false }) {
const s = SIZES[size] || SIZES.md;
+ const knob = (
+ <span className={`inline-block ${s.knob} transform rounded-full bg-white transition-transform ${
+ enabled ? s.on : s.off
+ }`} />
+ );
+ const trackClass = `relative inline-flex ${s.track} items-center rounded-full transition-colors shrink-0 ${
+ enabled ? activeColor : 'bg-gray-600'
+ } ${disabled ? 'opacity-50' : ''} ${className}`;
+
+ // Decorative mode renders as a <span> so it can sit inside another <button>
+ // without producing invalid nested-button HTML (which breaks tap on iOS Safari).
+ if (decorative) {
+ return <span aria-hidden="true" className={trackClass}>{knob}</span>;
+ }
+
return (
<button
type="button"
@@ -23,14 +38,10 @@ export default function ToggleSwitch({ enabled, onChange, disabled, ariaLabel, s
onClick={onChange}
disabled={disabled}
tabIndex={tabIndex}
- className={`relative inline-flex ${s.track} items-center rounded-full transition-colors shrink-0 ${
- enabled ? activeColor : 'bg-gray-600'
- } ${disabled ? 'opacity-50' : ''} ${className}`}
+ className={trackClass}
aria-label={ariaLabel}
>
- <span className={`inline-block ${s.knob} transform rounded-full bg-white transition-transform ${
- enabled ? s.on : s.off
- }`} />
+ {knob}
</button>
);
}
diff --git a/client/src/components/cos/tabs/ScheduleTab.jsx b/client/src/components/cos/tabs/ScheduleTab.jsx
index c269411d15..65e3dd13ab 100644
--- a/client/src/components/cos/tabs/ScheduleTab.jsx
+++ b/client/src/components/cos/tabs/ScheduleTab.jsx
@@ -483,10 +483,8 @@ function GlobalConfigControls({ taskType, config, onUpdate, onTrigger, onReset,
</div>
<ToggleSwitch
enabled={enabled}
- onChange={undefined}
disabled={updating}
- tabIndex={-1}
- ariaLabel={undefined}
+ decorative
/>
</button>
);