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
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix(apps): group Launch+Dev UI and fix Building button two-tone hover-on-disabled
Adam Eivy7c9e7ed8ffa2
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex 419f420858..cb35d82aea 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -38,6 +38,8 @@## Fixed+- **App detail header — Launch + Dev UI grouped, and "Building..." active-state two-tone fixed.** The Launch (HTTPS/HTTP) and Dev UI buttons in the App detail header were rendered as three independent pills, visually unrelated despite being a single "open in browser" cluster. Wrapped them in the same `inline-flex rounded-lg overflow-hidden border` segmented-button container the Stop/Restart group uses (with `divide-x divide-port-border` between segments). The "Building..." button on mobile showed an odd two-tone yellow — the right portion appeared darker than the left — because `hover:bg-port-warning/30` continued to apply after iOS Safari's "sticky hover" combined with the `disabled:opacity-50` state, so the bg flipped between `/20 * 0.5` and `/30 * 0.5` mid-transition. Replaced every `hover:bg-X` on a `disabled`-able button with Tailwind's `enabled:hover:bg-X` modifier so hover only fires while the button is interactive (Stop/Restart/Start/Build in both `AppDetailView` and `Apps` list, plus the launch buttons for consistency). Stop and Restart buttons now also show "Stopping..." / "Restarting..." active text (parity with the existing "Starting..." / "Building..." patterns) so the user has a verbal signal to match the icon-spin. Touched: `client/src/components/apps/AppDetailView.jsx`, `client/src/pages/Apps.jsx`.+- **Dashboard System Health — "0/16 apps" was always zero, and counted Xcode/iOS projects that can't run.** The widget called `getAllApps()` and filtered by `overallStatus === 'online'`, but `overallStatus` is only computed inside the `/api/apps` route's PM2 enrichment — `getAllApps()` returns the raw records, so the filter never matched and the count was always `0`. The denominator also included native projects (`xcode`, `ios-native`, `macos-native`, `swift`) that have no detectable runtime state at all. Replaced with a new `getAppStatusSummary()` helper in `services/apps.js` that groups apps by `pm2Home`, queries each unique home once, and computes `{ total, online, stopped, notStarted, unmanaged }` — `total` covers PM2-runnable apps only, while `unmanaged` separately tracks native projects. The widget tile now reads "Services" instead of "Apps", shows real running counts (e.g. `1/9` plus `+7 native`), uses "All running" instead of the confusing "Ready" fallback, and falls back to an em-dash when no PM2 apps exist (with a "N native only" subtext). A tooltip explains what's counted. Touched: `server/services/apps.js`, `server/routes/systemHealth.js`, `client/src/components/SystemHealthWidget.jsx`.- **Writers Room mobile editor squashed to ~150px (regression).** `WritersRoom`'s `<main>` element had `min-h-0 flex flex-col` with no `flex-1`, so on mobile (below `md:`, where the parent flips to `display: grid`) the main area sized to its natural content height — collapsing the textarea to whatever space was left after the library, header, and tab strip. Added `flex-1` so main grows to fill the remaining viewport on mobile; desktop is unaffected because `md:grid` takes over and the `flex-1` is dormant. Touched: `client/src/pages/WritersRoom.jsx`.diff --git a/client/src/components/apps/AppDetailView.jsx b/client/src/components/apps/AppDetailView.jsxindex 96f3e9b195..ae85398071 100644--- a/client/src/components/apps/AppDetailView.jsx+++ b/client/src/components/apps/AppDetailView.jsx@@ -177,7 +177,7 @@ export default function AppDetailView() {<buttononClick={handleStop}disabled={actionLoading}- className="px-2 py-1 bg-port-error/20 text-port-error hover:bg-port-error/30 transition-colors disabled:opacity-50 flex items-center gap-1"+ className="px-2 py-1 bg-port-error/20 text-port-error enabled:hover:bg-port-error/30 transition-colors disabled:opacity-50 flex items-center gap-1"><Square size={14} /><span className="text-xs">Stop</span>@@ -185,17 +185,17 @@ export default function AppDetailView() {<buttononClick={handleRestart}disabled={actionLoading}- className="px-2 py-1 bg-port-warning/20 text-port-warning hover:bg-port-warning/30 transition-colors disabled:opacity-50 border-l border-port-border flex items-center gap-1"+ className="px-2 py-1 bg-port-warning/20 text-port-warning enabled:hover:bg-port-warning/30 transition-colors disabled:opacity-50 border-l border-port-border flex items-center gap-1"><RotateCcw size={14} className={actionLoading === 'restart' ? 'animate-spin' : ''} />- <span className="text-xs">Restart</span>+ <span className="text-xs">{actionLoading === 'restart' ? 'Restarting...' : 'Restart'}</span></button></>) : (<buttononClick={handleStart}disabled={actionLoading}- className="px-2 py-1 bg-port-success/20 text-port-success hover:bg-port-success/30 transition-colors disabled:opacity-50 flex items-center gap-1"+ className="px-2 py-1 bg-port-success/20 text-port-success enabled:hover:bg-port-success/30 transition-colors disabled:opacity-50 flex items-center gap-1"><Play size={14} /><span className="text-xs">{actionLoading === 'start' ? 'Starting...' : 'Start'}</span>@@ -203,53 +203,65 @@ export default function AppDetailView() {)}</div>)}- {/* Launch buttons. When https is present, it's primary and http becomes a- muted sibling. Self-app uses current origin to avoid scheme mismatch. */}+ {/* Launch buttons grouped together. When https is present, it's primary and http+ becomes a muted sibling. Self-app uses current origin to avoid scheme mismatch. */}{(() => {if (app.overallStatus !== 'online') return null;const { https, http, dev } = getLaunchUrls(app);const httpIsSecondary = Boolean(https);+ const launchButtons = [];+ if (https) {+ launchButtons.push(+ <button+ key="https"+ onClick={() => window.open(https, '_blank')}+ className="px-2 py-1 bg-port-accent/20 text-port-accent enabled:hover:bg-port-accent/30 transition-colors flex items-center gap-1"+ >+ <ExternalLink size={14} />+ <span className="text-xs">Launch (HTTPS)</span>+ </button>+ );+ }+ if (http) {+ launchButtons.push(+ <button+ key="http"+ onClick={() => window.open(http, '_blank')}+ className={`px-2 py-1 transition-colors flex items-center gap-1 ${+ httpIsSecondary+ ? 'bg-port-border/30 text-gray-300 enabled:hover:bg-port-border/50'+ : 'bg-port-accent/20 text-port-accent enabled:hover:bg-port-accent/30'+ }`}+ >+ <ExternalLink size={14} />+ <span className="text-xs">{httpIsSecondary ? 'HTTP' : 'Launch'}</span>+ </button>+ );+ }+ if (dev) {+ launchButtons.push(+ <button+ key="dev"+ onClick={() => window.open(dev, '_blank')}+ className="px-2 py-1 bg-port-warning/20 text-port-warning enabled:hover:bg-port-warning/30 transition-colors flex items-center gap-1"+ >+ <ExternalLink size={14} />+ <span className="text-xs">Dev UI</span>+ </button>+ );+ }+ if (launchButtons.length === 0) return null;return (- <>- {https && (- <button- onClick={() => window.open(https, '_blank')}- className="px-2 py-1 bg-port-accent/20 text-port-accent hover:bg-port-accent/30 transition-colors rounded-lg border border-port-border flex items-center gap-1"- >- <ExternalLink size={14} />- <span className="text-xs">Launch (HTTPS)</span>- </button>- )}- {http && (- <button- onClick={() => window.open(http, '_blank')}- className={`px-2 py-1 transition-colors rounded-lg border border-port-border flex items-center gap-1 ${- httpIsSecondary- ? 'bg-port-border/30 text-gray-300 hover:bg-port-border/50'- : 'bg-port-accent/20 text-port-accent hover:bg-port-accent/30'- }`}- >- <ExternalLink size={14} />- <span className="text-xs">{httpIsSecondary ? 'HTTP' : 'Launch'}</span>- </button>- )}- {dev && (- <button- onClick={() => window.open(dev, '_blank')}- className="px-2 py-1 bg-port-warning/20 text-port-warning hover:bg-port-warning/30 transition-colors rounded-lg border border-port-border flex items-center gap-1"- >- <ExternalLink size={14} />- <span className="text-xs">Dev UI</span>- </button>- )}- </>+ <div className="inline-flex rounded-lg overflow-hidden border border-port-border divide-x divide-port-border">+ {launchButtons}+ </div>);})()}{app.buildCommand && (<buttononClick={handleBuild}disabled={buildLoading}- className="px-2 py-1 bg-port-warning/20 text-port-warning hover:bg-port-warning/30 transition-colors rounded-lg border border-port-border flex items-center gap-1 disabled:opacity-50"+ className="px-2 py-1 bg-port-warning/20 text-port-warning enabled:hover:bg-port-warning/30 transition-colors rounded-lg border border-port-border flex items-center gap-1 disabled:opacity-50 disabled:cursor-not-allowed"aria-label={`Build production UI: ${app.buildCommand}`}><Hammer size={14} className={buildLoading ? 'animate-bounce' : ''} />diff --git a/client/src/pages/Apps.jsx b/client/src/pages/Apps.jsxindex cc5588a145..7dac92d797 100644--- a/client/src/pages/Apps.jsx+++ b/client/src/pages/Apps.jsx@@ -289,29 +289,29 @@ export default function Apps() {<buttononClick={() => handleStop(app)}disabled={actionLoading[app.id]}- className="px-3 py-1.5 bg-port-error/20 text-port-error hover:bg-port-error/30 transition-colors disabled:opacity-50 flex items-center gap-1 focus:outline-hidden focus:ring-2 focus:ring-port-error"+ className="px-3 py-1.5 bg-port-error/20 text-port-error enabled:hover:bg-port-error/30 transition-colors disabled:opacity-50 flex items-center gap-1 focus:outline-hidden focus:ring-2 focus:ring-port-error"aria-label={`Stop ${app.name}`}aria-busy={actionLoading[app.id] === 'stop'}><Square size={14} aria-hidden="true" />- <span className="text-xs">Stop</span>+ <span className="text-xs">{actionLoading[app.id] === 'stop' ? 'Stopping...' : 'Stop'}</span></button><buttononClick={() => handleRestart(app)}disabled={actionLoading[app.id]}- className="px-3 py-1.5 bg-port-warning/20 text-port-warning hover:bg-port-warning/30 transition-colors disabled:opacity-50 border-l border-port-border flex items-center gap-1 focus:outline-hidden focus:ring-2 focus:ring-port-warning"+ className="px-3 py-1.5 bg-port-warning/20 text-port-warning enabled:hover:bg-port-warning/30 transition-colors disabled:opacity-50 border-l border-port-border flex items-center gap-1 focus:outline-hidden focus:ring-2 focus:ring-port-warning"aria-label={`Restart ${app.name}`}aria-busy={actionLoading[app.id] === 'restart'}><RotateCcw size={14} aria-hidden="true" className={actionLoading[app.id] === 'restart' ? 'animate-spin' : ''} />- <span className="text-xs">Restart</span>+ <span className="text-xs">{actionLoading[app.id] === 'restart' ? 'Restarting...' : 'Restart'}</span></button></>) : (<buttononClick={() => handleStart(app)}disabled={actionLoading[app.id]}- className="px-3 py-1.5 bg-port-success/20 text-port-success hover:bg-port-success/30 transition-colors disabled:opacity-50 flex items-center gap-1 focus:outline-hidden focus:ring-2 focus:ring-port-success"+ className="px-3 py-1.5 bg-port-success/20 text-port-success enabled:hover:bg-port-success/30 transition-colors disabled:opacity-50 flex items-center gap-1 focus:outline-hidden focus:ring-2 focus:ring-port-success"aria-label={`Start ${app.name}`}aria-busy={actionLoading[app.id] === 'start'}>@@ -322,26 +322,30 @@ export default function Apps() {</div>)}- {/* Launch buttons */}- {app.uiPort && app.overallStatus === 'online' && (- <button- onClick={() => window.open(`${window.location.protocol}//${window.location.hostname}:${app.uiPort}`, '_blank')}- className="px-3 py-1.5 bg-port-accent/20 text-port-accent hover:bg-port-accent/30 transition-colors rounded-lg border border-port-border flex items-center gap-1"- aria-label={`Launch ${app.name} UI`}- >- <ExternalLink size={14} aria-hidden="true" />- <span className="text-xs">Launch</span>- </button>- )}- {app.devUiPort && app.overallStatus === 'online' && (- <button- onClick={() => window.open(`${window.location.protocol}//${window.location.hostname}:${app.devUiPort}`, '_blank')}- className="px-3 py-1.5 bg-port-warning/20 text-port-warning hover:bg-port-warning/30 transition-colors rounded-lg border border-port-border flex items-center gap-1"- aria-label={`Launch ${app.name} Dev UI`}- >- <ExternalLink size={14} aria-hidden="true" />- <span className="text-xs">Dev UI</span>- </button>+ {/* Launch buttons grouped together */}+ {app.overallStatus === 'online' && (app.uiPort || app.devUiPort) && (+ <div className="inline-flex rounded-lg overflow-hidden border border-port-border divide-x divide-port-border">+ {app.uiPort && (+ <button+ onClick={() => window.open(`${window.location.protocol}//${window.location.hostname}:${app.uiPort}`, '_blank')}+ className="px-3 py-1.5 bg-port-accent/20 text-port-accent enabled:hover:bg-port-accent/30 transition-colors flex items-center gap-1"+ aria-label={`Launch ${app.name} UI`}+ >+ <ExternalLink size={14} aria-hidden="true" />+ <span className="text-xs">Launch</span>+ </button>+ )}+ {app.devUiPort && (+ <button+ onClick={() => window.open(`${window.location.protocol}//${window.location.hostname}:${app.devUiPort}`, '_blank')}+ className="px-3 py-1.5 bg-port-warning/20 text-port-warning enabled:hover:bg-port-warning/30 transition-colors flex items-center gap-1"+ aria-label={`Launch ${app.name} Dev UI`}+ >+ <ExternalLink size={14} aria-hidden="true" />+ <span className="text-xs">Dev UI</span>+ </button>+ )}+ </div>)}{/* Edit/Delete Actions */}@@ -552,7 +556,7 @@ export default function Apps() {<buttononClick={() => handleBuild(app)}disabled={building[app.id]}- className="px-3 py-1.5 bg-port-warning/20 text-port-warning hover:bg-port-warning/30 rounded-lg text-xs flex items-center gap-1 disabled:opacity-50"+ className="px-3 py-1.5 bg-port-warning/20 text-port-warning enabled:hover:bg-port-warning/30 transition-colors rounded-lg text-xs flex items-center gap-1 disabled:opacity-50 disabled:cursor-not-allowed"aria-label={`Build production UI: ${app.buildCommand}`}><Hammer size={14} aria-hidden="true" className={building[app.id] ? 'animate-bounce' : ''} />