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 (round 21): enforce name maxLength + gate fallback behind initial load

Adam Eivya9cfa6171bea
diff --git a/client/src/components/dashboard/LayoutEditor.jsx b/client/src/components/dashboard/LayoutEditor.jsx
index 4feb65f049..9046e91c6f 100644
--- a/client/src/components/dashboard/LayoutEditor.jsx
+++ b/client/src/components/dashboard/LayoutEditor.jsx
@@ -12,10 +12,12 @@ import toast from '../ui/Toast';
// the editor functional in degraded states). Kept in sync with the server's
// ID_MAX_LENGTH by convention — the server value is authoritative.
const FALLBACK_ID_MAX = 60;
+const FALLBACK_NAME_MAX = 80;
const FALLBACK_WIDGETS_MAX = 50;
export default function LayoutEditor({ layouts, activeLayoutId, limits, onClose, onSave, onDelete, onDuplicate }) {
const idMax = limits?.idMaxLength || FALLBACK_ID_MAX;
+ const nameMax = limits?.nameMaxLength || FALLBACK_NAME_MAX;
const widgetsMax = limits?.widgetsMax || FALLBACK_WIDGETS_MAX;
const [editingId, setEditingId] = useState(activeLayoutId);
const editing = layouts.find((l) => l.id === editingId);
@@ -193,6 +195,7 @@ export default function LayoutEditor({ layouts, activeLayoutId, limits, onClose,
type="text"
value={name}
onChange={(e) => { setName(e.target.value); setDirty(true); }}
+ maxLength={nameMax}
className="w-full bg-port-bg border border-port-border rounded-lg px-3 py-2 text-sm text-white focus:border-port-accent outline-hidden"
/>
</div>
@@ -252,6 +255,7 @@ export default function LayoutEditor({ layouts, activeLayoutId, limits, onClose,
if (e.key === 'Enter') { e.preventDefault(); e.stopPropagation(); commitDuplicate(); }
else if (e.key === 'Escape') { e.preventDefault(); e.stopPropagation(); setMode('idle'); }
}}
+ maxLength={nameMax}
placeholder="Name for new layout"
className="flex-1 bg-port-bg border border-port-border rounded-lg px-3 py-2 text-sm text-white focus:border-port-accent outline-hidden"
/>
diff --git a/client/src/pages/Dashboard.jsx b/client/src/pages/Dashboard.jsx
index c1627e827c..e00ab06fd5 100644
--- a/client/src/pages/Dashboard.jsx
+++ b/client/src/pages/Dashboard.jsx
@@ -96,15 +96,16 @@ export default function Dashboard() {
[apps, sortedApps, activeApps, appStats, health, usage, fetchData]
);
- // Falls back to a local minimal layout when the /api/dashboard/layouts
- // endpoint is unreachable (first load + transient outages). A failed
- // refresh preserves the prior `layouts` (the .catch() branch doesn't
- // reset them) but a failed initial load would otherwise leave the grid
- // blank — the fallback keeps the dashboard usable until recovery.
- const activeLayout = useMemo(
- () => layouts.find((l) => l.id === activeLayoutId) || layouts[0] || FALLBACK_LAYOUT,
- [layouts, activeLayoutId]
- );
+ // Falls back to a local minimal layout only AFTER the initial fetch has
+ // settled so the spinner isn't rendered alongside a flash of fallback
+ // widgets. A failed refresh preserves the prior `layouts` (the .catch()
+ // branch doesn't reset them); a failed/empty initial load then shows
+ // the fallback so the dashboard stays usable until recovery.
+ const activeLayout = useMemo(() => {
+ const found = layouts.find((l) => l.id === activeLayoutId) || layouts[0];
+ if (found) return found;
+ return layoutsLoading ? undefined : FALLBACK_LAYOUT;
+ }, [layouts, activeLayoutId, layoutsLoading]);
const visibleWidgets = useMemo(
() => (activeLayout?.widgets ?? [])