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(image-gen): carry watermarkRemoved through normalizeImage
Adam Eivy561d35a7eae4
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex fbc8cd1b3e..acedccfa65 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -10,6 +10,7 @@## Fixed+- **De-watermarked images now label correctly in the gallery lightbox** — after removing the visible Gemini / Nano-Banana ✦ sparkle, the resulting variant was meant to read "Watermark removed from …" in the lightbox lineage row and group as "Watermark removed". But the `watermarkRemoved` flag the server stamps on the variant was dropped during image normalization, so through the real gallery path (Image Gen, History, Collections) the variant fell through to the generic "Cleaned from …" label instead. The flag now survives normalization, so the honest lineage label and variant grouping fire as intended.- **Database page works on Windows** — the Database page's Start/Fix/Status actions invoke the `db.sh` manager through bash; on Windows the script's native path (`H:\…\db.sh`) was passed with backslashes, which bash collapsed into a bogus path (exit 127, "No such file or directory"), so the page reported the Docker database as stopped even while it was running. The path is now normalized to forward slashes, which Git Bash accepts on Windows. A second Windows-only failure in the per-backend export path (spawning `mkdir -p`, which isn't a real executable on Windows) was also fixed by using Node's filesystem API instead. Mac/Linux behavior is unchanged.- **Database page works on Windows (follow-up: use Git Bash, not WSL)** — even after the path was forward-slashed, Start/Fix/Status still failed with exit 127 on machines that have **both** Git Bash and WSL installed: the server (launched by PM2) resolved a bare `bash` to WSL's `C:\Windows\System32\bash.exe`, which mounts drives at `/mnt/h/…` and genuinely cannot see a `H:/…` drive path — and would run `db.sh` against Linux tools even if it could. PortOS now resolves the interpreter explicitly, preferring **Git Bash** (the correct Windows interpreter), with a `PORTOS_BASH` override for non-standard installs. Mac/Linux behavior is unchanged (bare `bash`).diff --git a/client/src/components/media/normalize.js b/client/src/components/media/normalize.jsindex a4481596a4..a5e4bd33dc 100644--- a/client/src/components/media/normalize.js+++ b/client/src/components/media/normalize.js@@ -85,6 +85,12 @@ export function normalizeImage(i) {// PSNR); surfaced in the lightbox lineage row, so it must be lifted here too.regenPixelDeltaPct: typeof i.regenPixelDeltaPct === 'number' ? i.regenPixelDeltaPct : null,regenPsnr: typeof i.regenPsnr === 'number' ? i.regenPsnr : null,+ // Visible Gemini/Nano-Banana corner-watermark removal — stamped by+ // /api/image-gen/:filename/remove-watermark. The discriminator+ // computeImageVariantGroup + describeCleanedLineage use to label a+ // `cleanedFrom` sibling "Watermark removed" rather than "Cleaned", so it+ // MUST survive normalization (same contract as `regenerated` above).+ watermarkRemoved: i.watermarkRemoved === true,raw: i,};}diff --git a/client/src/components/media/normalize.test.js b/client/src/components/media/normalize.test.jsindex ccae260afc..c52ff8900b 100644--- a/client/src/components/media/normalize.test.js+++ b/client/src/components/media/normalize.test.js@@ -161,6 +161,24 @@ describe('normalizeImage - regen lineage (issue #912)', () => {});});+describe('normalizeImage - visible watermark-removal lineage', () => {+ it('carries watermarkRemoved through normalization', () => {+ // The server stamps watermarkRemoved on the _nowatermark sidecar; both+ // describeCleanedLineage (lightbox) and computeImageVariantGroup read it+ // off the NORMALIZED item to label the sibling "Watermark removed" rather+ // than falling through to "Cleaned". Without the passthrough the label+ // never fires through the real gallery path (ImageGen/History/Collections+ // all map images through normalizeImage before the lightbox).+ const n = normalizeImage({ filename: 'r_nowatermark.png', cleanedFrom: 'src.png', watermarkRemoved: true });+ expect(n.watermarkRemoved).toBe(true);+ expect(n.cleanedFrom).toBe('src.png');+ });++ it('defaults watermarkRemoved off for a normal image', () => {+ expect(normalizeImage({ filename: 'a.png' }).watermarkRemoved).toBe(false);+ });+});+describe('normalize loraNames - snake_case sidecar coverage', () => {// MediaCard chips/search read `item.loraNames`; these must surface for// sidecars written in any of the four supported field shapes so the UI