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: render a 404 page for unknown routes instead of silently redirecting to the Dashboard (#3793)
[._.]/ Adam Eivyb3038738bd17
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex 06e53e0f5f..3593568d4d 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -83,3 +83,4 @@- **Tribe now opens on the people who need a touch, and the "Needs Care" number is a control.** The page led with two blocks of pure summary — four stat tiles and a five-row ring-capacity table — before any person appeared, so at phone width the search field, the ring filter, every relationship and every **Touch** button sat below the fold: a screen announcing that 17 people are overdue with no way to act on any of them. The Care Queue is now the tab you land on, so the first screen is the queue itself with its Touch buttons. The **Needs Care** and **Coming Up** tiles became real buttons that filter the list to exactly the bucket they count (clicking the active one clears it), the filter is a shareable `?status=` deep link that the Circle roster honors too, and the ring-capacity meters collapse behind a "Ring capacity" disclosure below desktop width. The tiles themselves are a two-column grid on a phone instead of four stacked rows.- **OpenClaw is a chat screen again instead of the Settings tab strip with a chat under it.** `/openclaw` is a top-level route, but it rendered a "Settings" title and the full 22-item settings tab bar above its own header — so the first screen was navigation for somewhere else, and at phone width the composer and its **Send** button both started below the fold. The settings chrome is gone, the runtime-status readout collapsed into a disclosure that shows the runtime label at a glance, and the session list now hides behind a **Sessions** button below `lg` (picking a session closes it) so the conversation owns the width. In the composer, the three context fields (app, directory, extra instructions) fold behind a **Context** toggle that badges how many are set, and the drag/paste/files hint row came out because the placeholder already says it — leaving the message box and Send pinned to the bottom of the pane at any scroll position.- **Arc verification no longer reports a phantom "no pilot or finale" on a volume that has both.** The check that flags arc-role imbalance reads each episode's `arcRole`, but the plan snapshot handed to the verifier never included that field — so it saw twelve episodes with no roles at all and reported the imbalance on every single pass, on every series, no matter how the volume was actually laid out. On its own that was a stray low-severity finding. What made it expensive is that the foundation gate's structure repair reverts its whole rewrite whenever verification comes back with *any* blocker left: the phantom finding could never be closed, so a run whose real contradictions had all been fixed still rolled the repair back and paused for human review, reporting the correct fixes as a failed attempt. (Observed on a series that paused with "structure repair left 5 arc-verification blocker(s)", one of which was this.) The snapshot now carries `arcRole` — as an explicit `null` when unset, so "no role" stays distinguishable from a dropped field — which also means the auto-resolver can finally see the roles it is being asked to fix instead of assigning them blind.+- **A URL that doesn't match a page now says so instead of quietly depositing you on the Dashboard.** Every unmatched route — a stale bookmark, a typo, or a half-remembered path like `/annotate` (the annotator actually lives at `/media/annotate`) — hit a blanket redirect to `/`, so the user saw the page-loading spinner, then the Dashboard's skeleton widgets, then the Dashboard: indistinguishable from the app losing their navigation, with no account of what happened. Unknown routes now render a 404 page that names the path that didn't match and offers Go back, Dashboard, and a reminder that ⌘K searches every page by name. `/annotate` and `/annotate/:mediaKey` are redirected to their real `/media/annotate` home rather than being swallowed, and the annotator's own keyless state stopped reading like a loading screen: it now distinguishes "nothing selected" from "that media is no longer available" and offers **Choose media** and **Blank canvas** — the latter being the first way to start a free-standing sketch from the UI at all.diff --git a/client/src/App.jsx b/client/src/App.jsxindex 0ac40a6cf5..74e6f6e35e 100644--- a/client/src/App.jsx+++ b/client/src/App.jsx@@ -131,6 +131,7 @@ const PipelineManuscriptEditor = lazyWithReload(() => import('./pages/PipelineMaconst PipelineExport = lazyWithReload(() => import('./pages/PipelineExport'));const PipelineIssue = lazyWithReload(() => import('./pages/PipelineIssue'));const Login = lazyWithReload(() => import('./pages/Login'));+const NotFound = lazyWithReload(() => import('./pages/NotFound'));// Loading fallback for lazy-loaded pagesconst PageLoader = () => (@@ -191,6 +192,10 @@ const MEDIA_CREATIVE_DIRECTOR_PREFIX = /^\/media\/creative-director/;const MEDIA_SPRITES_PREFIX = /^\/media\/sprites/;const MEDIA_MUSIC_VIDEO_PREFIX = /^\/media\/music-video/;const MEDIA_3D_PREFIX = /^\/media\/3d/;+// The annotator lives under the Media shell (/media/annotate). A bare /annotate+// is what a bookmark, a typed URL, or a half-remembered path lands on — alias it+// rather than letting the catch-all swallow it (issue #3793).+const ANNOTATE_PREFIX = /^\/annotate/;// Normalize a tab-less /creative-director/:id URL to its overview tab while// preserving any query string + hash. A bare `<Navigate to="overview">` would@@ -327,6 +332,8 @@ export default function App() {<Route path="timeline" element={<Timeline />} /><Route path="timeline/:date" element={<Timeline />} /><Route path="openclaw" element={<OpenClawPage />} />+ <Route path="annotate" element={<PrefixRedirect from={ANNOTATE_PREFIX} to="/media/annotate" />} />+ <Route path="annotate/:mediaKey" element={<PrefixRedirect from={ANNOTATE_PREFIX} to="/media/annotate" />} /><Route path="datadog" element={<Navigate to="/devtools/datadog" replace />} /><Route path="jira" element={<Navigate to="/devtools/jira" replace />} /><Route path="devtools/jira" element={<Jira />} />@@ -491,7 +498,7 @@ export default function App() {<Route path="agents" element={<Agents />} /><Route path="agents/:agentId" element={<Agents />} /><Route path="agents/:agentId/:tab" element={<Agents />} />- <Route path="*" element={<Navigate to="/" replace />} />+ <Route path="*" element={<NotFound />} /></Route></Routes></Suspense>diff --git a/client/src/pages/MediaAnnotate.jsx b/client/src/pages/MediaAnnotate.jsxindex e750a05905..c4cc11c9ce 100644--- a/client/src/pages/MediaAnnotate.jsx+++ b/client/src/pages/MediaAnnotate.jsx@@ -1,10 +1,11 @@import { useCallback, useEffect, useMemo, useRef, useState } from 'react';import { useParams, useSearchParams, Link, useNavigate } from 'react-router';-import { Pencil, Eraser, Undo2, Trash2, Save, Download, ArrowLeft, ImageOff, Wand2, Loader2 } from 'lucide-react';+import { Pencil, Eraser, Undo2, Trash2, Save, Download, ArrowLeft, ImageOff, Images, Wand2, Loader2 } from 'lucide-react';import toast from '../components/ui/Toast';import Modal from '../components/ui/Modal';import AnnotationCanvas from '../components/media/AnnotationCanvas';import { useAsyncAction } from '../hooks/useAsyncAction';+import { uuidv4 } from '../lib/uuid';import { undoStrokes, clampSize, DEFAULT_COLOR, DEFAULT_SIZE, MIN_SIZE, MAX_SIZE } from '../lib/sketchCanvas';import { getMediaSketch, saveMediaSketch, getRegenAvailability, rerenderWithAnnotations } from '../services/api';@@ -200,9 +201,29 @@ export default function MediaAnnotate() {</Link><div className="mt-6 bg-port-card border border-port-border rounded-xl p-8 text-center"><ImageOff className="w-8 h-8 mx-auto mb-2 text-gray-600" />- {mediaKey- ? 'Only generated images or blank-canvas sketches can be annotated. This link points at an unsupported or missing item.'- : 'Open a generated image from Media History or a Collection and choose “Annotate” to draw over it.'}+ <p className="text-gray-300 font-medium">+ {mediaKey ? 'That media is no longer available' : 'Nothing selected to annotate'}+ </p>+ <p className="mt-2">+ {mediaKey+ ? 'Only generated images or blank-canvas sketches can be annotated. This link points at an unsupported or missing item.'+ : 'Draw over a generated image to mark it up (and optionally re-render it guided by your marks), or start from an empty canvas.'}+ </p>+ <div className="mt-5 flex flex-wrap items-center justify-center gap-2">+ <Link+ to="/media/history"+ className="px-3 py-1.5 text-sm bg-port-accent text-white rounded hover:bg-port-accent/80 inline-flex items-center gap-1.5"+ >+ <Images className="w-4 h-4" /> Choose media+ </Link>+ <button+ type="button"+ onClick={() => navigate(`/media/annotate/${encodeURIComponent(`sketch:${uuidv4()}`)}`)}+ className="px-3 py-1.5 text-sm bg-port-card border border-port-border text-gray-200 rounded hover:bg-port-border inline-flex items-center gap-1.5"+ >+ <Pencil className="w-4 h-4" /> Blank canvas+ </button>+ </div></div></div>);diff --git a/client/src/pages/NotFound.jsx b/client/src/pages/NotFound.jsxnew file mode 100644index 0000000000..2c4f20b741--- /dev/null+++ b/client/src/pages/NotFound.jsx@@ -0,0 +1,45 @@+import { Link, useLocation, useNavigate } from 'react-router';+import { Compass, ArrowLeft, LayoutDashboard } from 'lucide-react';++// Catch-all for unknown routes. This used to be a bare `<Navigate to="/" />`,+// which silently deposited the user on the Dashboard after the page-loader+// spinner — indistinguishable from "your page is loading" followed by the app+// losing the navigation (issue #3793). Name the route that didn't match and+// offer real ways forward instead of bouncing.+export default function NotFound() {+ const { pathname, search, hash } = useLocation();+ const navigate = useNavigate();+ const attempted = `${pathname}${search}${hash}`;++ return (+ <div className="p-4 md:p-6 max-w-2xl mx-auto">+ <div className="bg-port-card border border-port-border rounded-xl p-6 md:p-8 text-center">+ <Compass className="w-8 h-8 mx-auto mb-3 text-gray-600" />+ <h1 className="text-lg font-semibold text-gray-100">That page doesn't exist</h1>+ <p className="mt-2 text-sm text-gray-400">+ Nothing in PortOS is mounted at{' '}+ <code className="px-1.5 py-0.5 rounded bg-port-bg border border-port-border text-gray-300 break-all">{attempted}</code>.+ It may have been renamed, or the link may be mistyped.+ </p>+ <div className="mt-5 flex flex-wrap items-center justify-center gap-2">+ <button+ type="button"+ onClick={() => navigate(-1)}+ className="px-3 py-1.5 text-sm bg-port-card border border-port-border text-gray-200 rounded hover:bg-port-border inline-flex items-center gap-1.5"+ >+ <ArrowLeft className="w-4 h-4" /> Go back+ </button>+ <Link+ to="/"+ className="px-3 py-1.5 text-sm bg-port-accent text-white rounded hover:bg-port-accent/80 inline-flex items-center gap-1.5"+ >+ <LayoutDashboard className="w-4 h-4" /> Dashboard+ </Link>+ </div>+ <p className="mt-4 text-xs text-gray-500">+ Press <kbd className="px-1 py-0.5 rounded bg-port-bg border border-port-border">⌘K</kbd> to search every page by name.+ </p>+ </div>+ </div>+ );+}diff --git a/client/src/pages/NotFound.test.jsx b/client/src/pages/NotFound.test.jsxnew file mode 100644index 0000000000..5716f96e83--- /dev/null+++ b/client/src/pages/NotFound.test.jsx@@ -0,0 +1,26 @@+import { describe, it, expect } from 'vitest';+import { render, screen } from '@testing-library/react';+import { MemoryRouter } from 'react-router';+import NotFound from './NotFound';++describe('NotFound', () => {+ it('names the route that did not match instead of silently redirecting', () => {+ render(+ <MemoryRouter initialEntries={['/annotate?x=1#frag']}>+ <NotFound />+ </MemoryRouter>,+ );+ expect(screen.getByText("That page doesn't exist")).toBeInTheDocument();+ expect(screen.getByText('/annotate?x=1#frag')).toBeInTheDocument();+ });++ it('offers a way forward (back + dashboard)', () => {+ render(+ <MemoryRouter initialEntries={['/nope']}>+ <NotFound />+ </MemoryRouter>,+ );+ expect(screen.getByRole('button', { name: /go back/i })).toBeInTheDocument();+ expect(screen.getByRole('link', { name: /dashboard/i })).toHaveAttribute('href', '/');+ });+});diff --git a/server/lib/navManifest.test.js b/server/lib/navManifest.test.jsindex d590501432..70cf79cd25 100644--- a/server/lib/navManifest.test.js+++ b/server/lib/navManifest.test.js@@ -312,6 +312,7 @@ const APP_JSX = path.join(REPO_ROOT, 'client/src/App.jsx');// the nav manifest — reached via an in-page button or as a create-mode sentinel,// not from ⌘K / voice / the sidebar.const NAV_COVERAGE_OPT_OUT = new Map([+ ['/*', 'catch-all 404 page — reached only by an unmatched URL, never a destination'],['/apps/create', 'create-app form, reached via the "New App" button on /apps'],['/creative-commission/new', 'create-commission drawer, reached via the "New Commission" button on /creative-commission'],['/feature-agents/create', 'create-agent form, reached via the "New Agent" button'],