fix(web): armature edit-mode bones survive save and the coverage spec runs
The coverage spec could not start: the armature workbench renders only in the web workbench (?ui=web), the diagnostic-panel filter hid it there, and the spec's own WebEngineClient waited on the editor's exclusive native-files Web Lock. Give the client an ephemeral mode (marked by worker name, no OPFS store and no lock) and let the fixture load in web mode without the native overlay. Bone authoring in Edit mode was also discarded on save: the engine wrote object bones while the save flush rebuilds them from the edit-bone list (ED_editors_flush_edits -> ED_armature_from_edit). Mirror each edit into the edit bones and refresh arm_roll from the bone matrix so roll survives the round trip. armature-editor-coverage-ui-production: 6 passed (dev server, Chromium). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -64,6 +64,10 @@ export interface WebEngineClientOptions {
|
||||
nativeServices?: boolean;
|
||||
timeoutMs?: number;
|
||||
workerFactory?: () => Worker;
|
||||
/** false = run this instance without the shared OPFS native-files store and
|
||||
* its exclusive `web-blender:native-files:/browser` lock (headless tooling and
|
||||
* command-level tests); the editor window keeps the store. Default true. */
|
||||
nativeFiles?: boolean;
|
||||
onWorkerFault?: (fault: WorkerFault) => void;
|
||||
onNativeExitRequest?: (client: WebEngineClient) => void;
|
||||
onNativeRecoveryWarning?: (message: string) => void;
|
||||
@@ -72,8 +76,11 @@ export interface WebEngineClientOptions {
|
||||
}
|
||||
|
||||
import { attachPageComputeRelay } from "./gpu-compute-relay";
|
||||
const defaultWorkerFactory = () => {
|
||||
const worker = new Worker(new URL("../workers/web-engine.worker.ts", import.meta.url), { type: "module" });
|
||||
/* The worker name is the only channel available before its first command, so an
|
||||
* instance that must not touch the shared native-files store is marked here. */
|
||||
const EPHEMERAL_WORKER_NAME = "web-engine-ephemeral";
|
||||
const defaultWorkerFactory = (nativeFiles = true) => {
|
||||
const worker = new Worker(new URL("../workers/web-engine.worker.ts", import.meta.url), { type: "module", name: nativeFiles ? "web-engine" : EPHEMERAL_WORKER_NAME });
|
||||
attachPageComputeRelay(worker); return worker;
|
||||
};
|
||||
|
||||
@@ -322,7 +329,7 @@ export class WebEngineClient {
|
||||
this.onAudioError = options.onAudioError ?? (message => console.error(message));
|
||||
this.nativeServices=options.nativeServices!==false;
|
||||
this.timeoutMs = options.timeoutMs ?? 30_000;
|
||||
this.workerFactory = options.workerFactory ?? defaultWorkerFactory;
|
||||
this.workerFactory = options.workerFactory ?? (() => defaultWorkerFactory(options.nativeFiles !== false));
|
||||
this.onWorkerFault = options.onWorkerFault;
|
||||
this.onNativeExitRequest = options.onNativeExitRequest;
|
||||
this.onNativeRecoveryWarning = options.onNativeRecoveryWarning ?? (message => console.warn(message));
|
||||
|
||||
Reference in New Issue
Block a user