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

address review: fix script job validation, keyboard a11y, extract deriveUiPort helper

Adam Eivy60849dcc181e
diff --git a/client/src/components/calendar/EventDetail.jsx b/client/src/components/calendar/EventDetail.jsx
index 998aa052f9..aab1ae11da 100644
--- a/client/src/components/calendar/EventDetail.jsx
+++ b/client/src/components/calendar/EventDetail.jsx
@@ -21,7 +21,7 @@ export default function EventDetail({ event, onClose }) {
aria-label="Close panel"
className="absolute inset-0 bg-black/50"
onClick={onClose}
- onKeyDown={(e) => e.key === 'Escape' && onClose()}
+ onKeyDown={(e) => (e.key === 'Escape' || e.key === 'Enter' || e.key === ' ') && onClose()}
/>
<div className="relative w-full max-w-md bg-port-card border-l border-port-border overflow-y-auto animate-slide-in-right">
<div className="sticky top-0 bg-port-card border-b border-port-border p-4 flex items-center justify-between">
diff --git a/server/routes/apps.js b/server/routes/apps.js
index f2df7ae4c3..a16210164c 100644
--- a/server/routes/apps.js
+++ b/server/routes/apps.js
@@ -18,6 +18,15 @@ import { parseEcosystemFromPath } from '../services/streamingDetect.js';
const router = Router();
+/**
+ * Derive uiPort from apiPort when app has dev UI but no dedicated prod UI port
+ * (prod UI is served by the API server in these cases).
+ */
+function deriveUiPort(uiPort, apiPort, devUiPort) {
+ if (!uiPort && apiPort && devUiPort) return apiPort;
+ return uiPort;
+}
+
/** Read and parse a JSON file, returning null on any failure (missing file, bad JSON, etc.) */
const safeReadJson = (path) => readFile(path, 'utf-8').then(JSON.parse).catch(() => null);
@@ -98,11 +107,7 @@ router.get('/', asyncHandler(async (req, res) => {
const devUiProc = processes.find(p => p.ports?.devUi);
if (devUiProc) devUiPort = devUiProc.ports.devUi;
}
- // When app has API + Vite dev processes but no dedicated UI port,
- // the prod UI is served by the API server
- if (!uiPort && apiPort && devUiPort) {
- uiPort = apiPort;
- }
+ uiPort = deriveUiPort(uiPort, apiPort, devUiPort);
return {
...app,
@@ -155,11 +160,7 @@ router.get('/:id', loadApp, asyncHandler(async (req, res) => {
const devUiProc = processes.find(p => p.ports?.devUi);
if (devUiProc) devUiPort = devUiProc.ports.devUi;
}
- // When app has API + Vite dev processes but no dedicated UI port,
- // the prod UI is served by the API server
- if (!uiPort && apiPort && devUiPort) {
- uiPort = apiPort;
- }
+ uiPort = deriveUiPort(uiPort, apiPort, devUiPort);
// Read version from app's package.json if available
let appVersion = null;
@@ -675,11 +676,7 @@ router.post('/:id/refresh-config', loadApp, asyncHandler(async (req, res) => {
const devUiProc = processes.find(p => p.ports?.devUi);
if (devUiProc) updates.devUiPort = devUiProc.ports.devUi;
- // When app has API + Vite dev but no dedicated UI port,
- // the prod UI is served by the API server
- if (!updates.uiPort && updates.apiPort && (updates.devUiPort || app.devUiPort)) {
- updates.uiPort = updates.apiPort;
- }
+ updates.uiPort = deriveUiPort(updates.uiPort, updates.apiPort, updates.devUiPort || app.devUiPort);
}
// Only update if we have changes
diff --git a/server/routes/cos.js b/server/routes/cos.js
index f4ec34c179..fa29ac2ad7 100644
--- a/server/routes/cos.js
+++ b/server/routes/cos.js
@@ -855,8 +855,10 @@ router.post('/jobs', asyncHandler(async (req, res) => {
if (type === 'shell' && !command?.trim()) {
throw new ServerError('command is required for shell jobs', { status: 400, code: 'VALIDATION_ERROR' });
}
- if (type !== 'shell' && !promptTemplate) {
- throw new ServerError('promptTemplate is required for agent jobs', { status: 400, code: 'VALIDATION_ERROR' });
+ if (!type || type === 'agent') {
+ if (!promptTemplate) {
+ throw new ServerError('promptTemplate is required for agent jobs', { status: 400, code: 'VALIDATION_ERROR' });
+ }
}
const job = await autonomousJobs.createJob({