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(theme): grow day/night toggle tap targets to 40px on mobile

Adam Eivyb15afbfcc471
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index c8c79c546b..ab79286a89 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -48,6 +48,8 @@
- **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.
+- **Day/night theme toggles now have real mobile tap targets.** The per-card Sun/Moon switch in `Settings → General` and the global Sun/Moon button in the sidebar/mobile-header rendered ~26–30px buttons (`p-1.5` around a 14–18px icon), which sat below the 40px minimum touch target rule and were especially error-prone in the per-card pill where the two adjacent buttons share a 2px-padded seam. Both now expand to a `min-w-[40px] min-h-[40px]` touch target on mobile and collapse back to the original compact pill at `sm+` so the desktop chrome stays tight.
+
- **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/Layout.jsx b/client/src/components/Layout.jsx
index 76f438a049..790b4127bb 100644
--- a/client/src/components/Layout.jsx
+++ b/client/src/components/Layout.jsx
@@ -104,9 +104,9 @@ function ThemeModeToggle({ className = '' }) {
onClick={toggleMode}
title={`${theme?.label ?? 'Theme'}${pairLabel}`}
aria-label={`Toggle day/night mode${pairLabel}`}
- className={`p-1.5 rounded-lg text-gray-500 hover:text-port-accent transition-colors ${className}`}
+ className={`inline-flex items-center justify-center min-w-[40px] min-h-[40px] sm:min-w-0 sm:min-h-0 sm:p-1.5 rounded-lg text-gray-500 hover:text-port-accent transition-colors ${className}`}
>
- <Icon size={18} />
+ <Icon size={18} aria-hidden="true" />
</button>
);
}
diff --git a/client/src/components/ThemePickerPanel.jsx b/client/src/components/ThemePickerPanel.jsx
index 0689d90a85..7732849c5b 100644
--- a/client/src/components/ThemePickerPanel.jsx
+++ b/client/src/components/ThemePickerPanel.jsx
@@ -69,6 +69,9 @@ export default function ThemePickerPanel({ compact = false }) {
function ModeSwitch({ group, activeMode, onPick }) {
const has = (mode) => Boolean(group[mode]);
+ // Buttons are 40x40 minimum so the seam in the middle of the pill is still
+ // a comfortable mobile tap target. >=sm collapses to the original compact pill.
+ const buttonClass = 'inline-flex items-center justify-center rounded-full transition-colors min-w-[40px] min-h-[40px] sm:min-w-0 sm:min-h-0 sm:p-1.5';
return (
<div
role="group"
@@ -81,13 +84,13 @@ function ModeSwitch({ group, activeMode, onPick }) {
aria-label={`Use ${group.night?.label ?? 'night'} mode`}
aria-pressed={activeMode === 'night'}
disabled={!has('night')}
- className={`p-1.5 rounded-full transition-colors ${
+ className={`${buttonClass} ${
activeMode === 'night'
? 'bg-port-accent text-port-on-accent'
: 'text-port-text-muted hover:text-port-text disabled:opacity-40'
}`}
>
- <Moon size={14} />
+ <Moon size={14} aria-hidden="true" />
</button>
<button
type="button"
@@ -95,13 +98,13 @@ function ModeSwitch({ group, activeMode, onPick }) {
aria-label={`Use ${group.day?.label ?? 'day'} mode`}
aria-pressed={activeMode === 'day'}
disabled={!has('day')}
- className={`p-1.5 rounded-full transition-colors ${
+ className={`${buttonClass} ${
activeMode === 'day'
? 'bg-port-accent text-port-on-accent'
: 'text-port-text-muted hover:text-port-text disabled:opacity-40'
}`}
>
- <Sun size={14} />
+ <Sun size={14} aria-hidden="true" />
</button>
</div>
);