fix(overlay): the Overlay menu page reloads with the menu, not as a full-screen window (1.89.5)
This commit is contained in:
1 parent
d5f81f4290
commit
39eaad64ed
6 files changed
+30
-7
No files matched your search
@@ -8,6 +8,10 @@ The application version is maintained in `package.json` and displayed in the adm
|
|||||||
|
|
||||||
No changes recorded yet.
|
No changes recorded yet.
|
||||||
|
|
||||||
|
## 1.89.5
|
||||||
|
|
||||||
|
- Fix: after `npm restart` the page reloads itself, and on the Overlay menu page that turned it into a full-screen overlay window without the menu. The menu page is now `?view=overlays`; only a link with `overlayMode` (the stand-alone window and OBS links) opens full screen, so an old `?view=overlay` tab also comes back with the menu.
|
||||||
|
|
||||||
## 1.89.4
|
## 1.89.4
|
||||||
|
|
||||||
- Overlay: a Last lap column that changes at every passing. The OBS TV tower and lower third get it (Show last lap, on by default, part of the OBS link), and in an Open Practice ranked on the best lap the leaderboard shows the last lap where the result only repeated the best lap. Ranked on laps in a row or minutes, the result stays (also in the OBS tower, which used to hide it).
|
- Overlay: a Last lap column that changes at every passing. The OBS TV tower and lower third get it (Show last lap, on by default, part of the OBS link), and in an Open Practice ranked on the best lap the leaderboard shows the last lap where the result only repeated the best lap. Ranked on laps in a row or minutes, the result stays (also in the OBS tower, which used to hide it).
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "rc-racecore",
|
"name": "rc-racecore",
|
||||||
"version": "1.89.4",
|
"version": "1.89.5",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "rc-racecore",
|
"name": "rc-racecore",
|
||||||
"version": "1.89.4",
|
"version": "1.89.5",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"better-sqlite3": "^12.11.1",
|
"better-sqlite3": "^12.11.1",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "rc-racecore",
|
"name": "rc-racecore",
|
||||||
"version": "1.89.4",
|
"version": "1.89.5",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "RC RaceCore live timing and race control with AMMC ingest and SQLite persistence",
|
"description": "RC RaceCore live timing and race control with AMMC ingest and SQLite persistence",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|||||||
+8
-3
@@ -5735,7 +5735,10 @@ const allowedOverlayModes = ["leaderboard", "speaker", "results", "tv", "team",
|
|||||||
const publicOverlayMatch = window.location.pathname.match(/^\/public-overlay(?:\/([a-z0-9_-]+))?\/?$/i);
|
const publicOverlayMatch = window.location.pathname.match(/^\/public-overlay(?:\/([a-z0-9_-]+))?\/?$/i);
|
||||||
const routeOverlayMode = String(publicOverlayMatch?.[1] || "").toLowerCase();
|
const routeOverlayMode = String(publicOverlayMatch?.[1] || "").toLowerCase();
|
||||||
const queryOverlayMode = String(urlParams.get("overlayMode") || "").toLowerCase();
|
const queryOverlayMode = String(urlParams.get("overlayMode") || "").toLowerCase();
|
||||||
const overlayMode = urlParams.get("view") === "overlay" || Boolean(publicOverlayMatch);
|
// A stand-alone overlay window always carries overlayMode (buildOverlayUrl); a bare ?view=overlay
|
||||||
|
// is the Overlay menu page as older versions wrote it, so it opens with the menu.
|
||||||
|
const OVERLAY_MENU_VIEW_PARAM = "overlays";
|
||||||
|
const overlayMode = (urlParams.get("view") === "overlay" && urlParams.has("overlayMode")) || Boolean(publicOverlayMatch);
|
||||||
const overlayViewMode = allowedOverlayModes.includes(routeOverlayMode)
|
const overlayViewMode = allowedOverlayModes.includes(routeOverlayMode)
|
||||||
? routeOverlayMode
|
? routeOverlayMode
|
||||||
: allowedOverlayModes.includes(queryOverlayMode)
|
: allowedOverlayModes.includes(queryOverlayMode)
|
||||||
@@ -5759,7 +5762,9 @@ const raceController = overlayMode ? null : createRaceController({
|
|||||||
const isRaceMaster = () => Boolean(raceController?.isMaster());
|
const isRaceMaster = () => Boolean(raceController?.isMaster());
|
||||||
const state = loadState();
|
const state = loadState();
|
||||||
const sessionReplay = createSessionReplayRuntime();
|
const sessionReplay = createSessionReplayRuntime();
|
||||||
const requestedView = String(urlParams.get("view") || "").toLowerCase();
|
// The Overlay menu page is ?view=overlays: ?view=overlay&overlayMode=… is the stand-alone overlay
|
||||||
|
// window (and OBS links), so a reload after an update must not turn the menu page full screen.
|
||||||
|
const requestedView = ((view) => (view === OVERLAY_MENU_VIEW_PARAM ? "overlay" : view))(String(urlParams.get("view") || "").toLowerCase());
|
||||||
let currentView = overlayMode ? "overlay" : NAV_ITEMS.some((item) => item.id === requestedView) ? requestedView : "dashboard";
|
let currentView = overlayMode ? "overlay" : NAV_ITEMS.some((item) => item.id === requestedView) ? requestedView : "dashboard";
|
||||||
let wsClients = { main: null, split: null, pit_entry: null, pit_exit: null };
|
let wsClients = { main: null, split: null, pit_entry: null, pit_exit: null };
|
||||||
let reconnectTimers = { main: null, split: null, pit_entry: null, pit_exit: null };
|
let reconnectTimers = { main: null, split: null, pit_entry: null, pit_exit: null };
|
||||||
@@ -7311,7 +7316,7 @@ function renderNav() {
|
|||||||
function updateViewUrl(view, driverId = "", classId = "") {
|
function updateViewUrl(view, driverId = "", classId = "") {
|
||||||
if (overlayMode) return;
|
if (overlayMode) return;
|
||||||
const nextUrl = new URL(window.location.href);
|
const nextUrl = new URL(window.location.href);
|
||||||
if (view && view !== "dashboard") nextUrl.searchParams.set("view", view);
|
if (view && view !== "dashboard") nextUrl.searchParams.set("view", view === "overlay" ? OVERLAY_MENU_VIEW_PARAM : view);
|
||||||
else nextUrl.searchParams.delete("view");
|
else nextUrl.searchParams.delete("view");
|
||||||
if (view === "training" && driverId) nextUrl.searchParams.set("driver", driverId);
|
if (view === "training" && driverId) nextUrl.searchParams.set("driver", driverId);
|
||||||
else nextUrl.searchParams.delete("driver");
|
else nextUrl.searchParams.delete("driver");
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ export async function runOverlayDriverLinkSmoke({ evaluate, navigate, savedState
|
|||||||
console.log("PASS a click on a driver in the Overlay opens that driver's training stats");
|
console.log("PASS a click on a driver in the Overlay opens that driver's training stats");
|
||||||
|
|
||||||
// The stand-alone overlay window stays up and opens a new tab.
|
// The stand-alone overlay window stays up and opens a new tab.
|
||||||
await navigate("overlay", "view");
|
await navigate("overlay&overlayMode=leaderboard", "view");
|
||||||
await waitFor(async () => evaluate(`Boolean(${row})`), "the driver row is a link in the overlay window");
|
await waitFor(async () => evaluate(`Boolean(${row})`), "the driver row is a link in the overlay window");
|
||||||
await evaluate(`window.__opened = []; window.open = (url, target) => { window.__opened.push([url, target]); return null; }; ${row}.click()`);
|
await evaluate(`window.__opened = []; window.open = (url, target) => { window.__opened.push([url, target]); return null; }; ${row}.click()`);
|
||||||
const [openedUrl, target] = (await evaluate(`window.__opened`))[0];
|
const [openedUrl, target] = (await evaluate(`window.__opened`))[0];
|
||||||
|
|||||||
@@ -224,6 +224,20 @@ try {
|
|||||||
console.log("PASS decoder diagnostics update without resetting settings draft");
|
console.log("PASS decoder diagnostics update without resetting settings draft");
|
||||||
await runOverlaySmoke({ evaluate });
|
await runOverlaySmoke({ evaluate });
|
||||||
await runOverlayLiveMarksSmoke({ evaluate });
|
await runOverlayLiveMarksSmoke({ evaluate });
|
||||||
|
// The Overlay menu page survives a reload (the page reloads itself after npm restart): it must
|
||||||
|
// come back with the menu, not as a full-screen overlay window.
|
||||||
|
await navigate("dashboard", "dashboardQuickPractice");
|
||||||
|
await evaluate(`[...document.querySelectorAll(".nav-item")].find(el => el.textContent === "Overlay")?.click()`);
|
||||||
|
await waitFor(async () => await evaluate('Boolean(document.getElementById("overlayLaunchObs"))'), "Overlay menu page");
|
||||||
|
const overlayUrl = await evaluate("location.search");
|
||||||
|
if (!/view=overlays\b/.test(overlayUrl)) throw new Error("Overlay menu URL: " + overlayUrl);
|
||||||
|
for (const search of [overlayUrl, "?view=overlay"]) {
|
||||||
|
await send("Page.navigate", { url: base + "/" + search });
|
||||||
|
await waitFor(async () => await evaluate('Boolean(document.getElementById("overlayLaunchObs")) && Boolean(document.querySelector(".nav-item"))'), "menu page after reload of " + search);
|
||||||
|
}
|
||||||
|
await send("Page.navigate", { url: base + "/?view=overlay&overlayMode=leaderboard" });
|
||||||
|
await waitFor(async () => await evaluate('!document.getElementById("overlayLaunchObs") && Boolean(document.querySelector("[data-overlay-competitor], .overlay-shell"))'), "a real overlay window stays full screen");
|
||||||
|
console.log("PASS the Overlay menu page reloads with the menu; an overlay window link stays full screen");
|
||||||
const mobileState = await savedState();
|
const mobileState = await savedState();
|
||||||
const mobileToken = "browser-mobile-profile-token-1234567890";
|
const mobileToken = "browser-mobile-profile-token-1234567890";
|
||||||
mobileState.training ||= {};
|
mobileState.training ||= {};
|
||||||
|
|||||||
Reference in new issue
Block a user