Add loading window functionality with HTML and update application controller

This commit is contained in:
2026-06-04 03:07:40 +02:00
parent 0ea4c6e01b
commit 5da609cce4
4 changed files with 68 additions and 8 deletions
+15 -3
View File
@@ -35,6 +35,10 @@ class MockWindow implements ApplicationWindow {
this.events.push(`${this.name}:load:${url}`);
}
async loadFile(filePath: string): Promise<void> {
this.events.push(`${this.name}:loadFile:${filePath}`);
}
restore(): void {
this.events.push(`${this.name}:restore`);
this.minimized = false;
@@ -87,6 +91,7 @@ test("ApplicationController preserves startup ordering and schedules updates aft
nodecgBaseUrl: "http://127.0.0.1:9090",
mainDashboardUrl: "http://localhost:9090/bundles/scoreko-dev/dashboard/main.html?standalone=true",
loadingDashboardUrl: "http://localhost:9090/bundles/scoreko-dev/dashboard/loading/main.html?standalone=true",
staticLoadingHtmlPath: "/app/static/loading.html",
};
const controller = createApplicationController({
@@ -129,11 +134,13 @@ test("ApplicationController preserves startup ordering and schedules updates aft
assert.equal(controller.getState(), "ready");
assert.deepEqual(events, [
"set-app-user-model-id",
"prepare-runtime",
"create-manager",
"create-main",
"create-loading",
`loading:loadFile:${paths.staticLoadingHtmlPath}`,
"loading:show",
"sleep:50",
"prepare-runtime",
"create-manager",
"start-nodecg",
"wait-nodecg",
`loading:load:${paths.loadingDashboardUrl}`,
@@ -158,6 +165,7 @@ test("ApplicationController directly launches packaged app after runtime install
nodecgBaseUrl: "http://127.0.0.1:9090",
mainDashboardUrl: "http://localhost:9090/main",
loadingDashboardUrl: "http://localhost:9090/loading",
staticLoadingHtmlPath: "/app/static/loading.html",
},
deps: {
createLoadingWindow: () => {
@@ -189,10 +197,12 @@ test("ApplicationController directly launches packaged app after runtime install
assert.equal(controller.getState(), "ready");
assert.deepEqual(events, [
"create-manager",
"create-main",
"create-loading",
"loading:loadFile:/app/static/loading.html",
"loading:show",
"sleep:50",
"create-manager",
"start-nodecg",
"wait-nodecg",
"loading:load:http://localhost:9090/loading",
@@ -217,6 +227,7 @@ test("ApplicationController activation before readiness routes through launch",
nodecgBaseUrl: "http://127.0.0.1:9090",
mainDashboardUrl: "http://localhost:9090/main",
loadingDashboardUrl: "http://localhost:9090/loading",
staticLoadingHtmlPath: "/app/static/loading.html",
},
deps: {
createLoadingWindow: () => new MockWindow("loading", events),
@@ -257,6 +268,7 @@ test("ApplicationController shutdown is idempotent", async () => {
nodecgBaseUrl: "http://127.0.0.1:9090",
mainDashboardUrl: "http://localhost:9090/main",
loadingDashboardUrl: "http://localhost:9090/loading",
staticLoadingHtmlPath: "/app/static/loading.html",
},
deps: {
createLoadingWindow: () => new MockWindow("loading", events),