mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 10:53:59 +00:00
style: format state subscriptions and their adopted controls
This commit is contained in:
1 parent
45d97376d0
commit
e0652b19f2
12 files changed
+299
-88
No files matched your search
@@ -246,5 +246,7 @@
|
||||
"src/ui/styles/responsive.css",
|
||||
"src/ui/styles/voice-cost.css",
|
||||
"src/ui/styles/cockpit.css",
|
||||
"src/ui/styles/command-dock-compact.css"
|
||||
"src/ui/styles/command-dock-compact.css",
|
||||
"src/app/stateChannel.js",
|
||||
"src/app/stateChannel.test.mjs"
|
||||
]
|
||||
@@ -88,7 +88,9 @@ try {
|
||||
const lookup = window.__godsEyeView.styleManager._locationLookup;
|
||||
window.__qaSearchRequests = [];
|
||||
window.__qaLocationState = [];
|
||||
window.__godsEyeView.styleManager.subscribeLocationSearch((notification) => window.__qaLocationState.push(notification));
|
||||
window.__godsEyeView.styleManager.subscribeLocationSearch((notification) =>
|
||||
window.__qaLocationState.push(notification),
|
||||
);
|
||||
lookup.search = (query, options) =>
|
||||
new Promise((resolve) =>
|
||||
window.__qaSearchRequests.push({ query, options, resolve }),
|
||||
@@ -141,14 +143,22 @@ try {
|
||||
);
|
||||
}),
|
||||
);
|
||||
check('Location subscriptions accept only the current result and retain request identities', await page.evaluate(() => {
|
||||
const seen = window.__qaLocationState;
|
||||
const started = seen.filter(({ change }) => change?.type === 'started');
|
||||
const found = seen.filter(({ change }) => change?.type === 'found');
|
||||
return seen[0].initial && started.length === 2 && found.length === 1 &&
|
||||
found[0].change.requestId === started[1].change.requestId &&
|
||||
found[0].state.destination.label === 'Second landmark, Test city' && Object.isFrozen(found[0].state.destination);
|
||||
}));
|
||||
check(
|
||||
'Location subscriptions accept only the current result and retain request identities',
|
||||
await page.evaluate(() => {
|
||||
const seen = window.__qaLocationState;
|
||||
const started = seen.filter(({ change }) => change?.type === 'started');
|
||||
const found = seen.filter(({ change }) => change?.type === 'found');
|
||||
return (
|
||||
seen[0].initial &&
|
||||
started.length === 2 &&
|
||||
found.length === 1 &&
|
||||
found[0].change.requestId === started[1].change.requestId &&
|
||||
found[0].state.destination.label === 'Second landmark, Test city' &&
|
||||
Object.isFrozen(found[0].state.destination)
|
||||
);
|
||||
}),
|
||||
);
|
||||
check(
|
||||
'cancelled POI expansion stays closed after a frame',
|
||||
await page.evaluate(async (id) => {
|
||||
|
||||
@@ -41,7 +41,9 @@ try {
|
||||
);
|
||||
await page.evaluate(() => {
|
||||
window.__qaSceneState = [];
|
||||
window.__godsEyeView.sceneDirector.subscribe((notification) => window.__qaSceneState.push(notification));
|
||||
window.__godsEyeView.sceneDirector.subscribe((notification) =>
|
||||
window.__qaSceneState.push(notification),
|
||||
);
|
||||
});
|
||||
await page.click('[data-collapse-target="scene-panel"]');
|
||||
await page.click('#scene-new-btn');
|
||||
@@ -307,13 +309,31 @@ try {
|
||||
document.querySelectorAll('#scene-select option').length > 0,
|
||||
),
|
||||
);
|
||||
check('Scene subscriptions include current state and the completed native editing actions', await page.evaluate(() => {
|
||||
const seen = window.__qaSceneState;
|
||||
const types = new Set(seen.map(({ change }) => change?.type));
|
||||
return seen[0].initial && Object.isFrozen(seen[0].state) &&
|
||||
['scene-created', 'shot-captured', 'shot-renamed', 'shot-updated', 'project-exported', 'project-imported', 'shot-deleted', 'scene-deleted', 'run-event'].every((type) => types.has(type)) &&
|
||||
seen.filter(({ change }) => change?.shot).every(({ change }) => Object.isFrozen(change.shot));
|
||||
}));
|
||||
check(
|
||||
'Scene subscriptions include current state and the completed native editing actions',
|
||||
await page.evaluate(() => {
|
||||
const seen = window.__qaSceneState;
|
||||
const types = new Set(seen.map(({ change }) => change?.type));
|
||||
return (
|
||||
seen[0].initial &&
|
||||
Object.isFrozen(seen[0].state) &&
|
||||
[
|
||||
'scene-created',
|
||||
'shot-captured',
|
||||
'shot-renamed',
|
||||
'shot-updated',
|
||||
'project-exported',
|
||||
'project-imported',
|
||||
'shot-deleted',
|
||||
'scene-deleted',
|
||||
'run-event',
|
||||
].every((type) => types.has(type)) &&
|
||||
seen
|
||||
.filter(({ change }) => change?.shot)
|
||||
.every(({ change }) => Object.isFrozen(change.shot))
|
||||
);
|
||||
}),
|
||||
);
|
||||
const teardown = await page.evaluate(async () => {
|
||||
const director = window.__godsEyeView.sceneDirector;
|
||||
const controls = director._controls;
|
||||
@@ -359,7 +379,10 @@ try {
|
||||
'Late import completion cannot replace the disposed project or status',
|
||||
teardown.sameProject && teardown.noLateStatus,
|
||||
);
|
||||
check('Scene subscriptions stop before late imports settle', teardown.stateStopped);
|
||||
check(
|
||||
'Scene subscriptions stop before late imports settle',
|
||||
teardown.stateStopped,
|
||||
);
|
||||
check(
|
||||
'Scene control interaction produces no uncaught browser errors',
|
||||
errors.length === 0,
|
||||
|
||||
@@ -121,7 +121,9 @@ try {
|
||||
feedbackLabel.querySelector('.gev-flap-text')?.firstChild;
|
||||
let stateNotifications = 0;
|
||||
ui.subscribeShareState(() => stateNotifications++, { emitCurrent: false });
|
||||
ui.subscribeLocationSearch(() => stateNotifications++, { emitCurrent: false });
|
||||
ui.subscribeLocationSearch(() => stateNotifications++, {
|
||||
emitCurrent: false,
|
||||
});
|
||||
try {
|
||||
const disposal = ui.dispose();
|
||||
const focusBefore = document.activeElement;
|
||||
@@ -256,7 +258,10 @@ try {
|
||||
'shell teardown cancels deferred work and releases listeners',
|
||||
result.shellWorkReleased,
|
||||
);
|
||||
check('state subscriptions stop synchronously with UI disposal', result.stateStopped);
|
||||
check(
|
||||
'state subscriptions stop synchronously with UI disposal',
|
||||
result.stateStopped,
|
||||
);
|
||||
check('repeated UI disposal is inert', result.idempotent);
|
||||
check(
|
||||
'disposal and subsequent resize produce no uncaught browser errors',
|
||||
|
||||
@@ -153,14 +153,19 @@ try {
|
||||
await page.evaluate(() => {
|
||||
const manager = window.__godsEyeView.styleManager;
|
||||
const states = [];
|
||||
const unsubscribe = manager.subscribeShareState((value) => states.push(value));
|
||||
const unsubscribe = manager.subscribeShareState((value) =>
|
||||
states.push(value),
|
||||
);
|
||||
const result = manager.setBloom({ enabled: true, intensityPct: 98 });
|
||||
unsubscribe();
|
||||
const published = states.at(-1);
|
||||
const snapshot = manager.getVisualState();
|
||||
return (
|
||||
states[0].initial && states.length > 1 && Object.isFrozen(published.state.options) &&
|
||||
published.state.bloomEnabled && published.state.options.bloomIntensity === 98 &&
|
||||
states[0].initial &&
|
||||
states.length > 1 &&
|
||||
Object.isFrozen(published.state.options) &&
|
||||
published.state.bloomEnabled &&
|
||||
published.state.options.bloomIntensity === 98 &&
|
||||
result.ok &&
|
||||
result.bloom.intensityPct === 98 &&
|
||||
snapshot.bloom.intensity === 98 &&
|
||||
|
||||
Reference in new issue
Block a user