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

Polish settings and data UI

[._.]/ Adam Eivy0f9f7f73329f
diff --git a/client/src/components/ToggleSwitch.jsx b/client/src/components/ToggleSwitch.jsx
index 7a0e070f05..215910941b 100644
--- a/client/src/components/ToggleSwitch.jsx
+++ b/client/src/components/ToggleSwitch.jsx
@@ -22,7 +22,7 @@ export default function ToggleSwitch({ enabled, onChange, disabled, ariaLabel, s
);
const trackClass = `relative inline-flex ${s.track} items-center rounded-full transition-colors shrink-0 ${
enabled ? activeColor : 'bg-gray-600'
- } ${disabled ? 'opacity-50' : ''} ${className}`;
+ } border border-port-border/60 shadow-sm ${disabled ? 'opacity-50' : ''} ${className}`;
// Decorative mode renders as a <span> so it can sit inside another <button>
// without producing invalid nested-button HTML (which breaks tap on iOS Safari).
diff --git a/client/src/components/settings/MortalLoomTab.jsx b/client/src/components/settings/MortalLoomTab.jsx
index 64353e4f15..f8bb2ecf82 100644
--- a/client/src/components/settings/MortalLoomTab.jsx
+++ b/client/src/components/settings/MortalLoomTab.jsx
@@ -2,6 +2,7 @@ import { useState, useEffect, useId } from 'react';
import { Save, Download, ExternalLink, CheckCircle2, AlertCircle } from 'lucide-react';
import toast from '../ui/Toast';
import BrailleSpinner from '../BrailleSpinner';
+import ToggleSwitch from '../ToggleSwitch';
import {
getSettings,
updateSettings,
@@ -103,13 +104,12 @@ export function MortalLoomTab() {
<div className="flex flex-wrap items-center gap-x-3 gap-y-1">
<label className="text-sm text-gray-400">Enabled</label>
- <button
- onClick={() => setEnabled(!enabled)}
- aria-pressed={enabled}
- className={`relative w-10 h-5 rounded-full transition-colors shrink-0 ${enabled ? 'bg-port-accent' : 'bg-port-border'}`}
- >
- <span className={`absolute top-0.5 left-0.5 w-4 h-4 rounded-full bg-white transition-transform ${enabled ? 'translate-x-5' : ''}`} />
- </button>
+ <ToggleSwitch
+ enabled={enabled}
+ onChange={() => setEnabled(!enabled)}
+ size="sm"
+ ariaLabel={enabled ? 'Disable MortalLoom sync' : 'Enable MortalLoom sync'}
+ />
<span className="basis-full sm:basis-auto text-xs text-gray-500">
When enabled, Goals and Meatspace views surface MortalLoom data.
</span>
diff --git a/client/src/components/universe/EntryThumbSlot.jsx b/client/src/components/universe/EntryThumbSlot.jsx
index 76f1cc4224..c8025c763c 100644
--- a/client/src/components/universe/EntryThumbSlot.jsx
+++ b/client/src/components/universe/EntryThumbSlot.jsx
@@ -36,23 +36,26 @@ export default function EntryThumbSlot({
canRender = true,
alt = 'Render',
// `'lg'` renders the empty-state box at 64x96 with a bigger Sparkles
- // affordance (reserved for slots that ride a wider card). Defaults to the
- // compact 48x80 (w-12 h-20) portrait footprint shared with variation +
- // canon avatar rows — matched to the 2:3 aspect of typical 1024x1536
- // universe renders so the slot doesn't crop the subject.
+ // affordance (reserved for slots that ride a wider card). `'xl'` is the
+ // 160x240 hero footprint used by the base-style probe on the universe page.
+ // Defaults to the compact 48x80 (w-12 h-20) portrait footprint shared with
+ // variation + canon avatar rows — matched to the 2:3 aspect of typical
+ // 1024x1536 universe renders so the slot doesn't crop the subject.
size = 'sm',
}) {
if (inFlightJobId) {
// `xs` (48x80) matches the empty + completed states below so all three
// states share a footprint and the row doesn't jump mid-render. `'lg'`
- // upgrades the pending box to `sm` (64x64) when the slot is configured
- // for the larger size — note `MediaJobThumb` doesn't have a portrait
- // 64x96 variant, so the larger slot's pending state is square.
+ // upgrades the pending box to `sm` (64x64); `'xl'` uses `lg` (128x128).
+ // `MediaJobThumb` doesn't have portrait variants past `xs`, so the
+ // larger pending states are square — one-time jitter when the render
+ // finishes and the portrait completed-thumb takes over.
+ const pendingSize = size === 'xl' ? 'lg' : size === 'lg' ? 'sm' : 'xs';
return (
<MediaJobThumb
jobId={inFlightJobId}
label={alt}
- size={size === 'lg' ? 'sm' : 'xs'}
+ size={pendingSize}
onPreview={onPreview}
onFilename={onComplete}
/>
@@ -71,15 +74,16 @@ export default function EntryThumbSlot({
fallbackRefs={refs}
isPrimary={!!primaryImageRef && primaryImageRef === chosen}
onClick={onPreview}
+ size={size}
/>
);
}
// Empty state — placeholder box with render button. Portrait footprint
- // (48x80 / 64x96) matches the 2:3 aspect of typical universe renders so
- // the row reserves the same vertical space as WalkBackThumb's completed
- // image, and the pending MediaJobThumb (xs / sm), eliminating row jitter
- // across the three states.
- const dim = size === 'lg' ? 'w-16 h-24' : 'w-12 h-20';
+ // (48x80 / 64x96 / 160x240) matches the 2:3 aspect of typical universe
+ // renders so the row reserves the same vertical space as WalkBackThumb's
+ // completed image, eliminating row jitter across the three states.
+ const dim = size === 'xl' ? 'w-40 h-60' : size === 'lg' ? 'w-16 h-24' : 'w-12 h-20';
+ const iconSize = size === 'xl' ? 32 : size === 'lg' ? 18 : 14;
return (
<button
type="button"
@@ -88,7 +92,7 @@ export default function EntryThumbSlot({
title={canRender ? 'Render image for this item' : 'Save the universe first to enable render'}
className={`${dim} shrink-0 flex items-center justify-center rounded border border-dashed border-port-border bg-port-bg/40 text-gray-500 hover:border-port-accent/50 hover:text-port-accent hover:bg-port-accent/5 disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:border-port-border disabled:hover:text-gray-500 disabled:hover:bg-port-bg/40 transition-colors`}
>
- <Sparkles size={size === 'lg' ? 18 : 14} />
+ <Sparkles size={iconSize} />
</button>
);
}
@@ -98,7 +102,7 @@ export default function EntryThumbSlot({
// (stale gallery file → walk back through prior renders → collapse). Mirrors
// `EntryCardThumbnail` in `EntryCard.jsx`; intentionally kept in sync — visual
// drift would defeat the point of a shared slot.
-function WalkBackThumb({ filename, alt, onClick, isPrimary = false, fallbackRefs = null }) {
+function WalkBackThumb({ filename, alt, onClick, isPrimary = false, fallbackRefs = null, size = 'sm' }) {
const candidates = [];
if (filename) candidates.push(filename);
if (Array.isArray(fallbackRefs)) {
@@ -112,10 +116,11 @@ function WalkBackThumb({ filename, alt, onClick, isPrimary = false, fallbackRefs
const candidateKey = candidates.join('|');
const [idx, setIdx] = useState(0);
useEffect(() => { setIdx(0); }, [candidateKey]);
+ const dim = size === 'xl' ? 'w-40 h-60' : size === 'lg' ? 'w-16 h-24' : 'w-12 h-20';
if (!candidates.length || idx >= candidates.length) {
// All candidates failed to load — collapse to empty (no render button
// here; the user can re-render from the action column).
- return <div className="w-12 h-20 shrink-0 rounded border border-port-border bg-port-bg/40" />;
+ return <div className={`${dim} shrink-0 rounded border border-port-border bg-port-bg/40`} />;
}
const currentFilename = candidates[idx];
const img = (
@@ -128,7 +133,7 @@ function WalkBackThumb({ filename, alt, onClick, isPrimary = false, fallbackRefs
/>
);
const frame = (
- <div className={`relative w-12 h-20 shrink-0 rounded overflow-hidden border ${
+ <div className={`relative ${dim} shrink-0 rounded overflow-hidden border ${
isPrimary ? 'border-port-accent' : 'border-port-border'
}`}>
{img}
diff --git a/client/src/components/universe/StyleProbeImage.jsx b/client/src/components/universe/StyleProbeImage.jsx
index b5b8b3c0de..8d5045614f 100644
--- a/client/src/components/universe/StyleProbeImage.jsx
+++ b/client/src/components/universe/StyleProbeImage.jsx
@@ -30,7 +30,7 @@ export function hasStyleForProbe(universe) {
return Boolean(prompt.trim());
}
-export default function StyleProbeImage({ universe, onUniverseChange, canRender = true }) {
+export default function StyleProbeImage({ universe, onUniverseChange, canRender = true, onPreview = null }) {
const [imageCfg, setImageCfg] = useState(PIPELINE_IMAGE_DEFAULTS);
const [jobId, setJobId] = useState(null);
// MediaJobThumb's onFilename effect can fire more than once — process each
@@ -79,9 +79,10 @@ export default function StyleProbeImage({ universe, onUniverseChange, canRender
inFlightJobId={jobId}
onRender={render}
onComplete={onComplete}
+ onPreview={onPreview}
canRender={canRender && Boolean(universe?.id) && styleReady}
alt="Base style"
- size="lg"
+ size="xl"
/>
<div className="text-xs text-gray-500 max-w-sm">
<div className="text-gray-300 font-medium mb-0.5">Base style image</div>
diff --git a/client/src/pages/DataManager.jsx b/client/src/pages/DataManager.jsx
index dbac1c104b..8dcbfc8a6f 100644
--- a/client/src/pages/DataManager.jsx
+++ b/client/src/pages/DataManager.jsx
@@ -3,6 +3,115 @@ import { HardDrive, RefreshCw, Archive, Trash2, ChevronDown, ChevronRight, Folde
import * as api from '../services/api';
import { formatBytes } from '../utils/formatters';
import BrailleSpinner from '../components/BrailleSpinner';
+import toast from '../components/ui/Toast';
+import socket from '../services/socket';
+import { useAsyncAction } from '../hooks/useAsyncAction';
+
+// Plural labels for tombstone record kinds — shared between the in-page
+// TombstoneGcSection toast and `scripts/gc-tombstones-now.js` (the CLI
+// echoes the same wording). The dedupe in the rendering call sites handles
+// the series/issue cohort coupling.
+const TOMBSTONE_KIND_PLURAL = { universe: 'universes', series: 'series', issue: 'issues', mediaCollection: 'media collections' };
+
+// Manual "GC tombstones now" trigger. The 60s orchestrator sweep keeps its
+// 24h grace — this button passes graceMs:0 so a user who just mass-deleted
+// doesn't wait a day for the bytes to leave disk. The button disables only
+// when every cohort is refused (snapshot-mode peer with no per-record sub
+// in both `universe` and `pipeline`): partial progress is still useful.
+function TombstoneGcSection() {
+ const [refused, setRefused] = useState(null); // null = still loading
+
+ // Subscribe to peer-state changes so toggling a snapshot-mode peer's
+ // sync category (or disabling it) re-evaluates the refusal status
+ // without a page reload — otherwise the button stays stuck disabled
+ // even after the user has resolved the underlying refusal condition.
+ //
+ // `instances:peers:updated` fires from `updatePeer` BEFORE the async
+ // `autoSubscribePeerToAllRecords` backfill creates per-record subs, so an
+ // immediate fetch sees the pre-backfill state. Schedule a follow-up fetch
+ // after a short delay to capture the post-backfill subs; debounce so a
+ // rapid burst of peer updates collapses to one delayed fetch.
+ useEffect(() => {
+ let cancelled = false;
+ let backfillTimer = null;
+ const fetchStatus = () => {
+ api.getTombstoneSweepStatus({ silent: true })
+ .then((r) => { if (!cancelled && Array.isArray(r?.refused)) setRefused(r.refused); })
+ .catch(() => { if (!cancelled) setRefused((prev) => prev ?? []); });
+ };
+ const refreshAfterPeerChange = () => {
+ fetchStatus();
+ if (backfillTimer) clearTimeout(backfillTimer);
+ backfillTimer = setTimeout(() => {
+ backfillTimer = null;
+ if (!cancelled) fetchStatus();
+ }, 1500);
+ };
+ fetchStatus();
+ socket.on('instances:peers:updated', refreshAfterPeerChange);
+ return () => {
+ cancelled = true;
+ if (backfillTimer) clearTimeout(backfillTimer);
+ socket.off('instances:peers:updated', refreshAfterPeerChange);
+ };
+ }, []);
+
+ const [runSweep, sweeping] = useAsyncAction(async () => {
+ const result = await api.sweepTombstonesNow({ graceMs: 0 }, { silent: true });
+ if (!result) return null;
+ const { universes = 0, series = 0, issues = 0, collections = 0, refused: refusedKinds = [] } = result;
+ const totalPruned = universes + series + issues + collections;
+ if (totalPruned > 0) {
+ const parts = [];
+ if (universes) parts.push(`${universes} universe${universes === 1 ? '' : 's'}`);
+ if (series) parts.push(`${series} series`);
+ if (issues) parts.push(`${issues} issue${issues === 1 ? '' : 's'}`);
+ if (collections) parts.push(`${collections} collection${collections === 1 ? '' : 's'}`);
+ toast.success(`Pruned ${parts.join(' / ')}`);
+ } else if (refusedKinds.length === 0) {
+ toast('No tombstones eligible for pruning');
+ }
+ if (refusedKinds.length > 0) {
+ const refusedLabel = [...new Set(refusedKinds.map((k) => TOMBSTONE_KIND_PLURAL[k] ?? k))].join(', ');
+ toast.warning(`Refused: ${refusedLabel} — a snapshot-mode peer has no per-record subscription for this kind. Resolve to enable pruning.`);
+ }
+ setRefused(refusedKinds);
+ return result;
+ }, { errorMessage: 'Tombstone sweep failed' });
+
+ // Every cohort refused iff `universe` (its own cohort), `series` (the
+ // pipeline cohort representative — issues always travel with series), AND
+ // `mediaCollection` (its own cohort) are all in the refused set.
+ const allRefused = refused != null
+ && refused.includes('universe')
+ && refused.includes('series')
+ && refused.includes('mediaCollection');
+ const disabled = sweeping || refused == null || allRefused;
+ const title = allRefused
+ ? 'Every kind has an enabled snapshot-mode peer with no per-record subscription — pruning would risk resurrection. Subscribe the peer or disable it to enable GC.'
+ : 'Prune tombstones acked by every subscribed peer (skips the 24h grace).';
+
+ return (
+ <div className="bg-port-card border border-port-border rounded-xl p-4 flex items-center justify-between gap-3">
+ <div className="flex items-center gap-2 text-sm text-gray-300">
+ <Trash2 size={14} className="text-gray-500" />
+ <span className="text-gray-400 uppercase tracking-wider text-xs font-medium">Tombstone GC</span>
+ <span className="text-gray-500 text-xs">
+ Run on demand instead of waiting for the 24h orchestrator sweep.
+ </span>
+ </div>
+ <button
+ onClick={runSweep}
+ disabled={disabled}
+ title={title}
+ className="bg-port-accent hover:bg-port-accent/80 disabled:opacity-40 disabled:cursor-not-allowed text-white px-3 py-1.5 rounded text-xs font-medium transition-colors flex items-center gap-1.5"
+ >
+ <Trash2 size={12} />
+ {sweeping ? 'Pruning…' : 'GC tombstones now'}
+ </button>
+ </div>
+ );
+}
function SizeBar({ size, maxSize }) {
const pct = maxSize > 0 ? Math.max(1, (size / maxSize) * 100) : 0;
@@ -281,6 +390,11 @@ export default function DataManager() {
</div>
</div>
+ {/* Tombstone GC */}
+ <div className="mb-4">
+ <TombstoneGcSection />
+ </div>
+
{/* Category list */}
<div className="space-y-2">
{overview?.categories?.map(cat => (
diff --git a/client/src/pages/Instances.jsx b/client/src/pages/Instances.jsx
index 6e1f99ac84..53711f3a58 100644
--- a/client/src/pages/Instances.jsx
+++ b/client/src/pages/Instances.jsx
@@ -15,21 +15,14 @@ import socket from '../services/socket';
import {
getInstances, updateSelfInstance, addPeer, updatePeer,
removePeer, connectPeer, probePeer, getTailnetInfo, provisionTailnetCert,
+ getNetworkExposure,
listPeerSubscriptions,
- getTombstoneSweepStatus, sweepTombstonesNow,
} from '../services/api';
import PeerAppsList from '../components/instances/PeerAppsList';
import PeerAgentsSection from '../components/instances/PeerAgentsSection';
import { SchemaGapBadge } from '../components/instances/SchemaGapBadge';
import { timeAgo } from '../utils/formatters';
import { useLocalStorageBool } from '../hooks/useLocalStorageBool';
-import { useAsyncAction } from '../hooks/useAsyncAction';
-
-// Plural labels for tombstone record kinds — shared between the in-page
-// TombstoneGcSection toast and `scripts/gc-tombstones-now.js` (the CLI
-// echoes the same wording). The dedupe in the rendering call sites handles
-// the series/issue cohort coupling.
-const TOMBSTONE_KIND_PLURAL = { universe: 'universes', series: 'series', issue: 'issues', mediaCollection: 'media collections' };
const STATUS_COLORS = {
online: 'text-port-success',
@@ -92,7 +85,7 @@ function HealthSummary({ health, version }) {
);
}
-function TailnetHelpBanner({ tailnetInfo }) {
+function TailnetHelpBanner({ tailnetInfo, networkExposure }) {
const [collapsed, setCollapsed] = useLocalStorageBool('portos-tailnet-help-collapsed', false);
const [provisioning, setProvisioning] = useState(false);
const [provisionResult, setProvisionResult] = useState(null);
@@ -118,12 +111,50 @@ function TailnetHelpBanner({ tailnetInfo }) {
const ToneIcon = status.tone === 'ok' ? CheckCircle2 : AlertCircle;
const toneClass = status.tone === 'ok' ? 'text-port-success' : 'text-port-warning';
+ const trustedHttpsHost = networkExposure?.httpsEnabled && networkExposure?.cert?.mode === 'tailscale'
+ ? networkExposure.cert.tailscaleHost || tailnetInfo?.self || null
+ : null;
+ const trustedHttpsPort = networkExposure?.bind?.port || 5555;
+ const trustedHttpsUrl = trustedHttpsHost ? `https://${trustedHttpsHost}:${trustedHttpsPort}` : null;
// Only offer the one-click provision button when Tailscale is actually
// detected and we have a MagicDNS hostname for this instance — otherwise
// the API call will fail with the same "enable MagicDNS first" guidance.
const canProvision = !!tailnetInfo?.self;
+ if (trustedHttpsHost) {
+ return (
+ <div className="bg-port-card border border-port-border rounded-xl px-4 py-3">
+ <div className="flex items-center gap-3 flex-wrap">
+ <Lock size={16} className="text-port-success shrink-0" />
+ <div className="flex-1 min-w-[220px]">
+ <div className="flex items-center gap-2 flex-wrap">
+ <span className="text-sm font-medium text-white">Tailnet DNS &amp; trusted HTTPS</span>
+ <Pill tone="success" size="xs" bordered={false} icon={CheckCircle2}>
+ Running on Tailscale HTTPS
+ </Pill>
+ </div>
+ <p className="text-xs text-gray-400 mt-1">
+ Currently running on HTTPS with Tailscale DNS.
+ </p>
+ </div>
+ {trustedHttpsUrl && (
+ <a
+ href={trustedHttpsUrl}
+ target="_blank"
+ rel="noreferrer"
+ className="inline-flex items-center gap-1.5 text-xs text-port-accent hover:text-port-accent/80 font-mono"
+ title={`Open ${trustedHttpsUrl}`}
+ >
+ {trustedHttpsHost}
+ <ArrowUpRight size={12} />
+ </a>
+ )}
+ </div>
+ </div>
+ );
+ }
+
return (
<div className="bg-port-card border border-port-border rounded-xl">
<button
@@ -969,111 +1000,12 @@ function PeerCard({ peer, onRefresh, syncStatus, tailnetInfo }) {
);
}
-// Manual "GC tombstones now" trigger. The 60s orchestrator sweep keeps its
-// 24h grace — this button passes graceMs:0 so a user who just mass-deleted
-// doesn't wait a day for the bytes to leave disk. The button disables only
-// when every cohort is refused (snapshot-mode peer with no per-record sub
-// in both `universe` and `pipeline`): partial progress is still useful.
-function TombstoneGcSection() {
- const [refused, setRefused] = useState(null); // null = still loading
-
- // Subscribe to peer-state changes so toggling a snapshot-mode peer's
- // sync category (or disabling it) re-evaluates the refusal status
- // without a page reload — otherwise the button stays stuck disabled
- // even after the user has resolved the underlying refusal condition.
- //
- // `instances:peers:updated` fires from `updatePeer` BEFORE the async
- // `autoSubscribePeerToAllRecords` backfill creates per-record subs, so an
- // immediate fetch sees the pre-backfill state. Schedule a follow-up fetch
- // after a short delay to capture the post-backfill subs; debounce so a
- // rapid burst of peer updates collapses to one delayed fetch.
- useEffect(() => {
- let cancelled = false;
- let backfillTimer = null;
- const fetchStatus = () => {
- getTombstoneSweepStatus({ silent: true })
- .then((r) => { if (!cancelled && Array.isArray(r?.refused)) setRefused(r.refused); })
- .catch(() => { if (!cancelled) setRefused((prev) => prev ?? []); });
- };
- const refreshAfterPeerChange = () => {
- fetchStatus();
- if (backfillTimer) clearTimeout(backfillTimer);
- backfillTimer = setTimeout(() => {
- backfillTimer = null;
- if (!cancelled) fetchStatus();
- }, 1500);
- };
- fetchStatus();
- socket.on('instances:peers:updated', refreshAfterPeerChange);
- return () => {
- cancelled = true;
- if (backfillTimer) clearTimeout(backfillTimer);
- socket.off('instances:peers:updated', refreshAfterPeerChange);
- };
- }, []);
-
- const [runSweep, sweeping] = useAsyncAction(async () => {
- const result = await sweepTombstonesNow({ graceMs: 0 }, { silent: true });
- if (!result) return null;
- const { universes = 0, series = 0, issues = 0, collections = 0, refused: refusedKinds = [] } = result;
- const totalPruned = universes + series + issues + collections;
- if (totalPruned > 0) {
- const parts = [];
- if (universes) parts.push(`${universes} universe${universes === 1 ? '' : 's'}`);
- if (series) parts.push(`${series} series`);
- if (issues) parts.push(`${issues} issue${issues === 1 ? '' : 's'}`);
- if (collections) parts.push(`${collections} collection${collections === 1 ? '' : 's'}`);
- toast.success(`Pruned ${parts.join(' / ')}`);
- } else if (refusedKinds.length === 0) {
- toast('No tombstones eligible for pruning');
- }
- if (refusedKinds.length > 0) {
- const refusedLabel = [...new Set(refusedKinds.map((k) => TOMBSTONE_KIND_PLURAL[k] ?? k))].join(', ');
- toast.warning(`Refused: ${refusedLabel} — a snapshot-mode peer has no per-record subscription for this kind. Resolve to enable pruning.`);
- }
- setRefused(refusedKinds);
- return result;
- }, { errorMessage: 'Tombstone sweep failed' });
-
- // Every cohort refused iff `universe` (its own cohort), `series` (the
- // pipeline cohort representative — issues always travel with series), AND
- // `mediaCollection` (its own cohort) are all in the refused set.
- const allRefused = refused != null
- && refused.includes('universe')
- && refused.includes('series')
- && refused.includes('mediaCollection');
- const disabled = sweeping || refused == null || allRefused;
- const title = allRefused
- ? 'Every kind has an enabled snapshot-mode peer with no per-record subscription — pruning would risk resurrection. Subscribe the peer or disable it to enable GC.'
- : 'Prune tombstones acked by every subscribed peer (skips the 24h grace).';
-
- return (
- <div className="bg-port-card border border-port-border rounded-xl p-4 flex items-center justify-between gap-3">
- <div className="flex items-center gap-2 text-sm text-gray-300">
- <Trash2 size={14} className="text-gray-500" />
- <span className="text-gray-400 uppercase tracking-wider text-xs font-medium">Tombstone GC</span>
- <span className="text-gray-500 text-xs">
- Run on demand instead of waiting for the 24h orchestrator sweep.
- </span>
- </div>
- <button
- onClick={runSweep}
- disabled={disabled}
- title={title}
- className="bg-port-accent hover:bg-port-accent/80 disabled:opacity-40 disabled:cursor-not-allowed text-white px-3 py-1.5 rounded text-xs font-medium transition-colors flex items-center gap-1.5"
- >
- <Trash2 size={12} />
- {sweeping ? 'Pruning…' : 'GC tombstones now'}
- </button>
- </div>
- );
-}
-
export default function Instances() {
const [self, setSelf] = useState(null);
const [peers, setPeers] = useState([]);
const [syncStatus, setSyncStatus] = useState(null);
const [tailnetInfo, setTailnetInfo] = useState(null);
+ const [networkExposure, setNetworkExposure] = useState(null);
const [loading, setLoading] = useState(true);
const fetchData = useCallback(async () => {
@@ -1083,17 +1015,18 @@ export default function Instances() {
setPeers(data.peers);
setSyncStatus(data.syncStatus ?? null);
}
- setLoading(false);
}, []);
useEffect(() => {
- // Kick off both reads in parallel — the tailnet map is independent of
- // peer state, and fetching it sequentially added ~100-500ms to first paint
- // on machines where `tailscale status --json` is slow to respond.
+ // Kick off these reads in parallel — the tailnet map and exposure snapshot
+ // are independent of peer state, and fetching them sequentially added
+ // ~100-500ms to first paint on machines where `tailscale status --json`
+ // is slow to respond.
Promise.all([
fetchData(),
- getTailnetInfo().then(setTailnetInfo).catch(() => setTailnetInfo(null))
- ]);
+ getTailnetInfo().then(setTailnetInfo).catch(() => setTailnetInfo(null)),
+ getNetworkExposure({ silent: true }).then(setNetworkExposure).catch(() => setNetworkExposure(null))
+ ]).finally(() => setLoading(false));
socket.emit('instances:subscribe');
const handlePeersUpdated = (updatedPeers) => {
@@ -1128,15 +1061,13 @@ export default function Instances() {
<span className="text-sm text-gray-500">PortOS Federation</span>
</div>
- <TailnetHelpBanner tailnetInfo={tailnetInfo} />
+ <TailnetHelpBanner tailnetInfo={tailnetInfo} networkExposure={networkExposure} />
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
<SelfCard self={self} onUpdate={fetchData} syncStatus={syncStatus} tailnetInfo={tailnetInfo} />
<AddPeerForm onAdd={fetchData} />
</div>
- <TombstoneGcSection />
-
{peers.length > 0 && (
<div>
<h2 className="text-sm font-medium text-gray-400 uppercase tracking-wider mb-3">
diff --git a/client/src/pages/UniverseBuilder.jsx b/client/src/pages/UniverseBuilder.jsx
index 6cda4b2b6b..066a25d892 100644
--- a/client/src/pages/UniverseBuilder.jsx
+++ b/client/src/pages/UniverseBuilder.jsx
@@ -713,6 +713,10 @@ export default function UniverseBuilder() {
const refs = Array.isArray(s?.imageRefs) ? s.imageRefs : [];
for (const f of refs) pushFilename(f, `Composite · ${s.label}`);
}
+ // Base style probe renders — same `image:<filename>` namespace so the
+ // lightbox finds them and reuses the gallery sidecar metadata.
+ const styleRefs = Array.isArray(draft?.styleImageRefs) ? draft.styleImageRefs : [];
+ for (const f of styleRefs) pushFilename(f, 'Base style');
// Canon refs — characters / places / objects. Hydrate from the gallery
// sidecar so the modal shows the ACTUAL render prompt (the same one the
// History page sees), not just the character description. The descriptor
@@ -1845,6 +1849,7 @@ export default function UniverseBuilder() {
totalVariations={totalVariations}
categoryKeyCount={categoryKeys.length}
totalSheets={totalSheets}
+ onPreview={openPreviewByFilename}
/>
)}
@@ -2942,6 +2947,7 @@ function BibleTab({
handleExpand, expanding, saving,
refine,
totalVariations, categoryKeyCount, totalSheets,
+ onPreview,
}) {
const { providers, providerModels, providerLabel, activeProviderId } = llm;
const {
@@ -3137,6 +3143,7 @@ function BibleTab({
<StyleProbeImage
universe={draft}
onUniverseChange={(updated) => updateDraft({ styleImageRefs: updated?.styleImageRefs || [] })}
+ onPreview={onPreview}
/>
</div>
</section>