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

refactor: adopt shared PageHeader in Messages, Wiki, FeatureAgents, CreativeDirector (#1207)

[._.]/ Adam Eivy8b91db2d4fee
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index e846d129f3..4804d9fbec 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -142,3 +142,5 @@
- **[issue-1403] Chunked LLM editorial checks now also carry clean cross-chapter *setup* between chunks, not just prior findings.** The #1383 prior-findings digest stops a later chunk from re-flagging a problem an earlier chunk recorded — but clean setup produces no finding, so a payoff in chunk 2 could still be mis-flagged "missing setup" when chunk 1 cleanly established it, and `style.conformance` had no signal of which tense/POV chapter 1 set when judging chapter 3. `objects.unmotivated-interaction` and `style.conformance` now additionally opt into a **cross-chunk clean-setup digest** (`crossChunkSetup` + a per-check `setupFocus`): after each non-final chunk, one extra **stage-scoped** inline summarization call (`ctx.callStageScopedInlineLLM`, tagged `pipeline-editorial-setup-digest`, built by `buildSetupDigestPrompt`) rolls a short "setup so far" summary forward, and `editorialSetupDigest` prepends it to later chunks alongside the findings digest — riding INSIDE the manuscript var (no stage-prompt change). The summary call resolves the **same provider the check's stage is pinned to** (a new `runStageScopedInlineLLM` in `stageRunner.js`), so manuscript text never routes to a different (e.g. cloud) provider than the stage chose. Both digests **yield to manuscript coverage**: the setup digest is fitted *after* the findings digest into whatever spare room remains, so a tight chunk drops the digest rather than the manuscript. A single-chunk (whole-fits) run never summarizes, so the common case pays nothing; the stored summary is capped (so a verbose response can't compound across chunks) and a summarizer failure keeps the prior summary and never aborts the check. When the reverse-outline (#1349) or continuity-bible (#1305) artifacts land, either could feed this context more cheaply than a per-chunk call. (`server/lib/editorial/checkRegistry.js`, #1403)
- **[issue-1329] The mflux LoRA trainer now logs a one-line runtime fingerprint at startup, so every run log (and any future GPU-watchdog paniclog) self-documents the exact numerical stack it ran on.** The macOS GPU watchdog kernel panics that hard-reboot the box during long mflux runs (`docs/research/2026-06-13-mflux-training-watchdog-panic.md`) are version-specific to the mflux/mlx/mlx-metal/mlx-lm trio, and PortOS installs `mflux>=0.17` as a *floor* (`scripts/setup-image-video.sh`) — so the stack can drift silently and a paniclog couldn't say which versions were live. `train_mflux_lora.py` now emits a single `STATUS:` line at the top of `main()` (`runtime · mflux X · mlx Y · mlx-metal Z · mlx-lm W · <chip> · <os> · python <v>`) reusing the shared `_runner_common.build_runtime_fingerprint` (the same definition the video-gen `/status` probe uses, so the two never drift). Best-effort: a fingerprint failure logs an "unavailable" line and never aborts a training run. This is the code half of #1329; the *bisect + pin a validated trio* half is a human M5 bench session (each failing candidate hard-reboots the machine) and stays open. (`scripts/train_mflux_lora.py`, #1329)
+
+- **[issue-1207] Messages, Wiki, Feature Agents, and Creative Director now use the shared `PageHeader` title bar.** These four tabbed/top-level pages still hand-rolled the same icon + `<h1>` + subtitle + `border-b border-port-border` bar with their own padding and title scale, so navigating between them and the already-adopted pages (Brain, MeatSpace, Settings, Goals, Calendar, Insights — #1182) produced visual jitter. Each now renders `PageHeader` with its stats/controls moved into the `actions` slot: Messages' account count, Wiki's page/source counts + vault `<select>`, Feature Agents' refresh button + "New Agent" link, and Creative Director's smoke-test + "New project" buttons. Creative Director's subtitle token reconciles from `text-port-text-muted` to `PageHeader`'s `text-gray-500` (and its title from `font-semibold` to the shared `font-bold`) as called out in the issue. AIProviders/PromptManager were correctly left alone — they render inside the Settings shell, not a standalone bar. (`client/src/pages/Messages.jsx`, `client/src/pages/Wiki.jsx`, `client/src/pages/FeatureAgents.jsx`, `client/src/pages/CreativeDirector.jsx`, #1207)
diff --git a/client/src/pages/CreativeDirector.jsx b/client/src/pages/CreativeDirector.jsx
index 5e83b7b53f..99a7521b1d 100644
--- a/client/src/pages/CreativeDirector.jsx
+++ b/client/src/pages/CreativeDirector.jsx
@@ -12,6 +12,7 @@ import {
} from '../services/apiCreativeDirector.js';
import { listVideoModels } from '../services/apiImageVideo.js';
import ModelSelect from '../components/ModelSelect';
+import PageHeader from '../components/PageHeader';
const ASPECT_RATIOS = ['16:9', '9:16', '1:1'];
const QUALITIES = ['draft', 'standard', 'high'];
@@ -133,16 +134,12 @@ export default function CreativeDirector() {
return (
<div className="flex flex-col h-full">
- <div className="shrink-0 px-6 pt-6 pb-4 border-b border-port-border">
- <div className="flex items-center justify-between">
- <div className="flex items-center gap-3">
- <Film className="w-6 h-6 text-port-accent" />
- <div>
- <h1 className="text-xl font-semibold">Creative Director</h1>
- <p className="text-sm text-port-text-muted">Long-form video projects driven by an autonomous CoS agent</p>
- </div>
- </div>
- <div className="flex items-center gap-2">
+ <PageHeader
+ icon={Film}
+ title="Creative Director"
+ subtitle="Long-form video projects driven by an autonomous CoS agent"
+ actions={
+ <>
<button
onClick={async () => {
const created = await createSmokeTestCreativeDirectorProject().catch((e) => {
@@ -166,9 +163,9 @@ export default function CreativeDirector() {
<Plus className="w-4 h-4" />
New project
</button>
- </div>
- </div>
- </div>
+ </>
+ }
+ />
{showForm && (
<form onSubmit={handleCreate} className="shrink-0 p-6 border-b border-port-border bg-port-card/40 space-y-3">
diff --git a/client/src/pages/FeatureAgents.jsx b/client/src/pages/FeatureAgents.jsx
index bd813290d8..9fc4a3b9a0 100644
--- a/client/src/pages/FeatureAgents.jsx
+++ b/client/src/pages/FeatureAgents.jsx
@@ -6,6 +6,7 @@ import * as api from '../services/api';
import socket from '../services/socket';
import FeatureAgentCard from '../components/feature-agents/FeatureAgentCard';
import BrailleSpinner from '../components/BrailleSpinner';
+import PageHeader from '../components/PageHeader';
export default function FeatureAgents() {
const [agents, setAgents] = useState([]);
@@ -75,18 +76,12 @@ export default function FeatureAgents() {
return (
<div className="flex flex-col h-full">
- <div className="shrink-0 px-6 pt-6 pb-4 border-b border-port-border">
- <div className="flex items-center justify-between">
- <div className="flex items-center gap-3">
- <Wand2 size={24} className="text-port-accent" />
- <div>
- <h1 className="text-xl font-bold text-white">Feature Agents</h1>
- <p className="text-sm text-gray-500">
- {agents.length} agent{agents.length !== 1 ? 's' : ''} &middot; {activeCount} active &middot; {totalRuns} total runs
- </p>
- </div>
- </div>
- <div className="flex items-center gap-2">
+ <PageHeader
+ icon={Wand2}
+ title="Feature Agents"
+ subtitle={`${agents.length} agent${agents.length !== 1 ? 's' : ''} · ${activeCount} active · ${totalRuns} total runs`}
+ actions={
+ <>
<button
onClick={fetchAgents}
className="p-2 text-gray-400 hover:text-white hover:bg-port-border/50 rounded-lg transition-colors"
@@ -100,9 +95,9 @@ export default function FeatureAgents() {
>
<Plus size={16} /> New Agent
</Link>
- </div>
- </div>
- </div>
+ </>
+ }
+ />
<div className="flex-1 overflow-auto p-6">
{loading ? (
diff --git a/client/src/pages/Messages.jsx b/client/src/pages/Messages.jsx
index 9a972e9225..a0a805880a 100644
--- a/client/src/pages/Messages.jsx
+++ b/client/src/pages/Messages.jsx
@@ -3,6 +3,7 @@ import { Mail, RefreshCw, Settings } from 'lucide-react';
import { useState, useEffect, useCallback } from 'react';
import * as api from '../services/api';
import BrailleSpinner from '../components/BrailleSpinner';
+import PageHeader from '../components/PageHeader';
import TabPills from '../components/ui/TabPills';
import { useValidTab } from '../hooks/useValidTab';
@@ -64,18 +65,12 @@ export default function Messages() {
return (
<div className="flex flex-col h-full">
- <div className="flex items-center justify-between p-4 border-b border-port-border">
- <div className="flex items-center gap-3">
- <Mail className="w-8 h-8 text-port-accent" />
- <div>
- <h1 className="text-xl font-bold text-white">Messages</h1>
- <p className="text-sm text-gray-500">Unified email and messaging management</p>
- </div>
- </div>
- <div className="flex items-center gap-4 text-sm">
- <span className="text-gray-500">{accounts.length} accounts</span>
- </div>
- </div>
+ <PageHeader
+ icon={Mail}
+ title="Messages"
+ subtitle="Unified email and messaging management"
+ actions={<span className="text-sm text-gray-500">{accounts.length} accounts</span>}
+ />
<TabPills tabs={TABS} activeTab={activeTab} onChange={handleTabChange} ariaLabel="Messages sections" />
diff --git a/client/src/pages/Wiki.jsx b/client/src/pages/Wiki.jsx
index e7bf8bbf45..549b39946b 100644
--- a/client/src/pages/Wiki.jsx
+++ b/client/src/pages/Wiki.jsx
@@ -3,6 +3,7 @@ import { useParams, useNavigate } from 'react-router-dom';
import * as api from '../services/api';
import { BookOpen, Search, Network, FileText, BarChart3, Activity } from 'lucide-react';
import BrailleSpinner from '../components/BrailleSpinner';
+import PageHeader from '../components/PageHeader';
import TabPills from '../components/ui/TabPills';
import WikiOverviewTab from '../components/wiki/tabs/OverviewTab';
@@ -118,32 +119,28 @@ export default function Wiki() {
return (
<div className="flex flex-col h-full">
- {/* Header */}
- <div className="flex items-center justify-between p-4 border-b border-port-border">
- <div className="flex items-center gap-3">
- <BookOpen className="w-8 h-8 text-port-accent" />
- <div>
- <h1 className="text-xl font-bold text-white">Wiki</h1>
- <p className="text-sm text-gray-500">LLM-maintained knowledge base</p>
- </div>
- </div>
-
- <div className="flex items-center gap-4 text-sm">
- <span className="text-gray-500">{stats.total} wiki pages</span>
- <span className="text-gray-500">{stats.rawSources} sources</span>
- {vaults.length > 1 && (
- <select
- value={selectedVaultId || ''}
- onChange={e => setSelectedVaultId(e.target.value)}
- className="bg-port-bg border border-port-border rounded px-2 py-1 text-sm text-white"
- >
- {vaults.map(v => (
- <option key={v.id} value={v.id}>{v.name}</option>
- ))}
- </select>
- )}
- </div>
- </div>
+ <PageHeader
+ icon={BookOpen}
+ title="Wiki"
+ subtitle="LLM-maintained knowledge base"
+ actions={
+ <>
+ <span className="text-sm text-gray-500">{stats.total} wiki pages</span>
+ <span className="text-sm text-gray-500">{stats.rawSources} sources</span>
+ {vaults.length > 1 && (
+ <select
+ value={selectedVaultId || ''}
+ onChange={e => setSelectedVaultId(e.target.value)}
+ className="bg-port-bg border border-port-border rounded px-2 py-1 text-sm text-white"
+ >
+ {vaults.map(v => (
+ <option key={v.id} value={v.id}>{v.name}</option>
+ ))}
+ </select>
+ )}
+ </>
+ }
+ />
<TabPills tabs={TABS} activeTab={activeTab} onChange={(id) => navigate(`/wiki/${id}`)} ariaLabel="Wiki sections" />