feat(ui): integrate fleet equipment and expanded workspace layouts

Compose expanded workspaces and fleet equipment through shared product controls. Integrate device surfaces and preserve the documented UI grammar.
This commit is contained in:
DCCONSTRUCTIONS
2026-10-29 09:10:02 +03:00
parent 755a124bd8
commit f4cdf3744a
14 changed files with 142 additions and 84 deletions
@@ -3,7 +3,7 @@ import React, {createElement} from 'react';
import {renderToStaticMarkup} from 'react-dom/server';
import {readFileSync} from 'node:fs';
import {before, after, test} from 'node:test';
import {createServer} from 'vite';
import {createServer} from './support/vite-server.mjs';
let server, resolve, awaitsCapture, Guard, Provider, Device, Host;
before(async () => {
@@ -104,3 +104,32 @@ test('composition owns explicit profile propagation; server polling cannot resto
assert.match(source('workspaces/missions/MissionPlannerWorkspace.tsx'),/openView\('local-device','planning'\)/);
assert.match(source('workspaces/missions/MissionPlannerWorkspace.tsx'),/if\(await live.select\(project.id\)\)openView/);
});
test('global planning poll requests compact status and still updates capture ownership', async () => {
const effects = [], writes = [], requests = [];
const originalFetch = globalThis.fetch;
const status = {schema_version:'missioncore.planning-live-status/v1', state:'waiting', query_session_id:null};
const cleanups = [];
try {
globalThis.fetch = async url => {
requests.push(url);
return new Response(JSON.stringify(url.endsWith('/status') ? status : {items:[]}));
};
withHooks({
useState:initial=>[typeof initial==='function'?initial():initial,value=>writes.push(value)],
useRef:value=>({current:value}), useCallback:fn=>fn, useEffect:fn=>effects.push(fn),
}, () => Provider({children:null}));
for (const effect of effects) cleanups.push(effect());
await new Promise(resolve=>setImmediate(resolve));
assert.ok(requests.includes('/api/v1/mission-planner/live-tests/status'));
assert.ok(!requests.some(url=>url.endsWith('/active')));
const received=writes.find(value=>value?.schema_version===status.schema_version);
assert.ok(received);
assert.equal(awaitsCapture(received),true);
assert.equal(awaitsCapture({...received,state:'completed'}),false);
} finally {
for (const cleanup of cleanups) cleanup?.();
globalThis.fetch=originalFetch;
}
});