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

fix(media): unify gen-page render cards with Media History layout

Adam Eivyf25e92cf8229
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 294726e053..cd95c5e1a2 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -49,3 +49,5 @@ A page-level run dock now slides up from the bottom of the Writers Room while im
- App icon detection: ship `data.sample/apps.json` with PortOS's icon path pre-set to `client/public/portos-logo.png`, and harden `detectAppIcon()` to skip SVGs that embed external `<image href="…">` (the icon endpoint serves SVG with `default-src 'none'` CSP, so those embeds are blocked and the icon renders blank). Detector now also checks `apple-touch-icon.png` and `icon-{192,512}.png` so PWAs without a usable favicon still resolve to a high-res raster. Hit "Detect Icon" once on existing installs to repick.
- App icons now auto-recover when the stored `appIconPath` is an unusable external-image SVG: the icon route and the config-refresh route both validate SVG usability at serve time and trigger redetection if the cached path won't render under the route's CSP. Existing installs (e.g. PortOS itself, which had stored `client/public/favicon.svg` before the detector skipped it) heal on the next icon fetch instead of staying blank until manual re-detect.
- App icon thumbnails now render as iOS-style squircles in the Apps page rows and the dashboard `AppTile` grid: the wrapper's corner radius bumped from `rounded` (4px ≈ 12.5%) to `rounded-[22%]` (the iOS app-icon proportion), and the fetched icon image now fills the full 32×32 tile via a new `fillContainer` mode on `AppIcon` — previously the 18×18 image sat top-left of the wrapper so only the top-left corner showed the squircle clip.
+- Image / Video Gen "Recent renders" cards now render at the same width as Media History (5 columns at `lg` instead of 6), so the same `MediaCard` component shows its full prompt/metadata/action row without cramming.
+- Remix from Media History now actually populates the Image Gen form: `MediaHistory.handleRemix` passes `negativePrompt`, `guidance`, and `quantize` in addition to the existing fields (and skips the `(no prompt)` placeholder), and Image Gen reads all of them from the URL on mount, then strips the params so a hot-reload or back-nav doesn't re-clobber subsequent edits.
diff --git a/client/src/pages/ImageGen.jsx b/client/src/pages/ImageGen.jsx
index 6c8eadc5a7..2e54cc4aa1 100644
--- a/client/src/pages/ImageGen.jsx
+++ b/client/src/pages/ImageGen.jsx
@@ -259,6 +259,31 @@ export default function ImageGen() {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [searchParams]);
+ // Remix payload from Media History (?prompt=…&modelId=…&seed=…). Populate
+ // form state once on mount, then strip the params so a hot-reload or back-
+ // nav doesn't re-clobber edits the user has made since.
+ useEffect(() => {
+ const remixKeys = ['prompt', 'negativePrompt', 'modelId', 'width', 'height', 'seed', 'steps', 'guidance', 'quantize'];
+ const present = remixKeys.filter((k) => searchParams.get(k) != null);
+ if (present.length === 0) return;
+ const get = (k) => searchParams.get(k);
+ if (get('prompt')) setPrompt(get('prompt'));
+ if (get('negativePrompt')) setNegativePrompt(get('negativePrompt'));
+ if (get('modelId')) setModelId(get('modelId'));
+ if (get('width')) setWidth(Number(get('width')));
+ if (get('height')) setHeight(Number(get('height')));
+ if (get('seed') != null) setSeed(get('seed'));
+ if (get('steps')) setSteps(get('steps'));
+ if (get('guidance')) setGuidance(get('guidance'));
+ if (get('quantize')) setQuantize(get('quantize'));
+ setSearchParams((prev) => {
+ const n = new URLSearchParams(prev);
+ remixKeys.forEach((k) => n.delete(k));
+ return n;
+ }, { replace: true });
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, []);
+
// Strip EXIF orientation by re-encoding the image with rotation baked into
// the pixels. Browsers honor EXIF when rendering <img>, so the upload
// thumbnail looks right — but mflux/PIL reads raw pixels and ignores EXIF,
@@ -1061,7 +1086,7 @@ export default function ImageGen() {
<Link to="/media/history" className="text-xs text-port-accent hover:underline">View all →</Link>
)}
</div>
- <div className="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-3">
+ <div className="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-3">
{visibleGallery.slice(0, 6).map((img) => {
const item = normalizeImage(img);
return (
@@ -1091,7 +1116,7 @@ export default function ImageGen() {
<span className="text-xs text-gray-500">{showHidden ? '▾' : '▸'}</span>
</button>
{showHidden && (
- <div className="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-3">
+ <div className="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-3">
{hiddenGallery.map((img) => {
const item = normalizeImage(img);
return (
diff --git a/client/src/pages/MediaHistory.jsx b/client/src/pages/MediaHistory.jsx
index 98861aae33..373560da09 100644
--- a/client/src/pages/MediaHistory.jsx
+++ b/client/src/pages/MediaHistory.jsx
@@ -104,12 +104,15 @@ export default function MediaHistory() {
const handleRemix = (item) => {
const params = new URLSearchParams();
- if (item.prompt) params.set('prompt', item.prompt);
+ if (item.prompt && item.prompt !== '(no prompt)') params.set('prompt', item.prompt);
+ if (item.negativePrompt) params.set('negativePrompt', item.negativePrompt);
if (item.modelId) params.set('modelId', item.modelId);
if (item.width) params.set('width', String(item.width));
if (item.height) params.set('height', String(item.height));
if (item.seed != null) params.set('seed', String(item.seed));
if (item.steps) params.set('steps', String(item.steps));
+ if (item.guidance != null) params.set('guidance', String(item.guidance));
+ if (item.quantize) params.set('quantize', String(item.quantize));
navigate(`/media/image?${params}`);
};
diff --git a/client/src/pages/VideoGen.jsx b/client/src/pages/VideoGen.jsx
index 51feb70a9f..7d8f3be8d4 100644
--- a/client/src/pages/VideoGen.jsx
+++ b/client/src/pages/VideoGen.jsx
@@ -1272,7 +1272,7 @@ export default function VideoGen() {
<Link to="/media/history" className="text-xs text-port-accent hover:underline">View all →</Link>
)}
</div>
- <div className="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-3">
+ <div className="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-3">
{visibleHistory.slice(0, 6).map((v) => {
const item = normalizeVideo(v);
return (
@@ -1302,7 +1302,7 @@ export default function VideoGen() {
<span className="text-xs text-gray-500">{showHidden ? '▾' : '▸'}</span>
</button>
{showHidden && (
- <div className="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-3">
+ <div className="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-3">
{hiddenHistory.map((v) => {
const item = normalizeVideo(v);
return (