Compare commits

..

No commits in common. "main" and "feat/alpha-mask" have entirely different histories.

11 changed files with 18 additions and 54 deletions

3
.gitignore vendored
View File

@ -39,5 +39,4 @@ out/
# AI
skills-lock.json
.agents
.claude
.gstack/
.claude

View File

@ -1,7 +1,7 @@
{
"name": "@diffusionstudio/cli",
"private": true,
"version": "0.216.0",
"version": "0.215.0",
"license": "MPL-2.0",
"bin": {
"diffusion": "./dist/index.js",

View File

@ -1,7 +1,7 @@
{
"name": "@diffusionstudio/desktop",
"private": true,
"version": "0.216.0",
"version": "0.215.0",
"license": "MPL-2.0",
"repository": {
"type": "git",

View File

@ -8,7 +8,6 @@ import { existsSync } from "node:fs";
import { mkdir, open, rename, unlink } from "node:fs/promises";
import { randomUUID } from "node:crypto";
import type { FileHandle } from "node:fs/promises";
import type { IUpdateInfo } from "update-electron-app";
import { makeUserNotifier, updateElectronApp } from "update-electron-app";
import { tempPathFor } from "./atomic";
import { DapiServer } from "./dapi/server";
@ -112,25 +111,14 @@ function setColorMode(mode: "dark" | "light") {
mainWindow.setTitleBarOverlay({ ...WINDOWS_OVERLAY_COLORS[mode], height: WINDOWS_OVERLAY_HEIGHT });
}
// A downloaded update is offered while the user has the window out; one that
// lands while the app runs in the background waits for the next show, since
// the app rarely quits on its own to apply it.
const notifyUser = makeUserNotifier();
let pendingUpdate: IUpdateInfo | null = null;
function offerUpdate() {
if (!pendingUpdate || !windows.visible()) return;
const info = pendingUpdate;
pendingUpdate = null;
notifyUser(info);
}
if (app.isPackaged && !squirrelLaunch) {
const notifyUser = makeUserNotifier();
updateElectronApp({
repo: "diffusionstudio/editor",
onNotifyUser: function (info) {
pendingUpdate = info;
offerUpdate();
if (windows.visible()) {
notifyUser(info);
}
},
});
}
@ -143,10 +131,7 @@ let lastProject: string | null = null;
const windows = new WindowHost({
create: createWindow,
idleMs: WINDOW_IDLE_MS,
onChange: () => {
tray.refresh();
offerUpdate();
},
onChange: () => tray.refresh(),
});
const tray = new AppTray({

View File

@ -1404,11 +1404,6 @@ export function watchProject(window: BrowserWindow | null, dir: string): void {
const watcher = watch(dir, { recursive: true }, (_event, filename) => {
if (!filename) return;
// macOS's recursive FSEvents watch fires an extra notification for the
// watched folder itself alongside the real one for whatever changed
// inside it — and again once more, asynchronously, after the folder is
// removed and the watcher closed. Neither names an actual project file.
if (filename === basename(dir)) return;
// Project-relative and `/`-separated; installs churn node_modules constantly.
const path = filename.split(sep).join("/");
if (path.startsWith("node_modules/") || path === "node_modules") return;

View File

@ -6,12 +6,10 @@ import { EventEmitter } from "node:events";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
const appEvents = new EventEmitter();
const updaterEvents = new EventEmitter();
const dock = { show: vi.fn(async () => { }), hide: vi.fn() };
vi.mock("electron", () => ({
app: { on: (event: string, listener: () => void) => appEvents.on(event, listener), dock, focus: () => { } },
autoUpdater: { on: (event: string, listener: () => void) => updaterEvents.on(event, listener) },
}));
const { WindowHost } = await import("./window-host");
@ -47,7 +45,6 @@ let host: InstanceType<typeof WindowHost>;
beforeEach(() => {
vi.useFakeTimers();
appEvents.removeAllListeners();
updaterEvents.removeAllListeners();
created = [];
host = new WindowHost({
create: () => {
@ -135,11 +132,4 @@ describe("WindowHost", () => {
expect(created[0]!.isDestroyed()).toBe(true);
expect(host.current()).toBeNull();
});
it("lets the window close when an update quits the app to install", async () => {
await host.show();
updaterEvents.emit("before-quit-for-update");
created[0]!.close();
expect(created[0]!.isDestroyed()).toBe(true);
});
});

View File

@ -12,7 +12,7 @@
// the Dock icon (macOS) follows whether the window is showing, and closing
// the window hides it rather than ending what the renderer is doing.
import { app, autoUpdater } from "electron";
import { app } from "electron";
import type { BrowserWindow } from "electron";
@ -47,11 +47,6 @@ export class WindowHost {
app.on("before-quit", () => {
this.quitting = true;
});
// quitAndInstall closes the windows before `before-quit`; a close turned
// into a hide there would leave the app running and the update unapplied.
autoUpdater.on("before-quit-for-update", () => {
this.quitting = true;
});
}
/** The window, if there is one. */

View File

@ -1,7 +1,7 @@
{
"name": "@diffusionstudio/web",
"private": true,
"version": "0.216.0",
"version": "0.215.0",
"license": "MPL-2.0",
"type": "module",
"scripts": {

12
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "@diffusionstudio/editor",
"version": "0.216.0",
"version": "0.215.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@diffusionstudio/editor",
"version": "0.216.0",
"version": "0.215.0",
"hasInstallScript": true,
"license": "MPL-2.0",
"workspaces": [
@ -19,7 +19,7 @@
},
"apps/cli": {
"name": "@diffusionstudio/cli",
"version": "0.216.0",
"version": "0.215.0",
"license": "MPL-2.0",
"dependencies": {
"@diffusionstudio/dapi": "*",
@ -39,7 +39,7 @@
},
"apps/desktop": {
"name": "@diffusionstudio/desktop",
"version": "0.216.0",
"version": "0.215.0",
"license": "MPL-2.0",
"dependencies": {
"@babel/core": "^7.29.7",
@ -88,7 +88,7 @@
},
"apps/web": {
"name": "@diffusionstudio/web",
"version": "0.216.0",
"version": "0.215.0",
"license": "MPL-2.0",
"dependencies": {
"@diffusionstudio/agent-chat": "*",
@ -14210,7 +14210,7 @@
},
"packages/jsx": {
"name": "@diffusionstudio/jsx",
"version": "0.216.0",
"version": "0.215.0",
"license": "MPL-2.0",
"dependencies": {
"koota": "^0.6.6"

View File

@ -1,6 +1,6 @@
{
"name": "@diffusionstudio/editor",
"version": "0.216.0",
"version": "0.215.0",
"private": true,
"license": "MPL-2.0",
"type": "module",

View File

@ -1,6 +1,6 @@
{
"name": "@diffusionstudio/jsx",
"version": "0.216.0",
"version": "0.215.0",
"description": "Types and authoring API for Diffusion Studio compositions: the JSX element vocabulary and the hooks the editor implements when it mounts a project.",
"license": "MPL-2.0",
"type": "module",