The marker style popover was too narrow (210px against a ~240px swatch row), had no explicit commit action, and its edits never reached the traces: parameterOverlayEntries yields entries with a field while the overlay builder read entry.dataSetKey, so the style-registry lookup used an undefined key and silently dropped every recorded style. Entries now carry dataSetKey too and the builder tolerates both shapes. The popover widens to 288px, lays Symbol/Size side by side with a full-width Opacity row, and stages edits until an explicit Apply (plus Close and Reset). Regression tests cover the key/dataSetKey path and the parameters-plots docs + CHANGELOG describe the Apply button. Also point package.json repository/issues/homepage at the renamed muSRFlow repository.
51 lines
2.4 KiB
JavaScript
51 lines
2.4 KiB
JavaScript
// Copyright (C) 2026 Zaher Salman
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
const assert = require("assert");
|
|
const fs = require("fs");
|
|
const path = require("path");
|
|
|
|
const repoRoot = path.resolve(__dirname, "..");
|
|
|
|
function testSharedHelpWindowInfrastructure() {
|
|
const main = fs.readFileSync(path.join(repoRoot, "main.js"), "utf8");
|
|
const lib = fs.readFileSync(path.join(repoRoot, "muSRFitlib.js"), "utf8");
|
|
const elec = fs.readFileSync(path.join(repoRoot, "muSRFitelec.js"), "utf8");
|
|
const html = fs.readFileSync(path.join(repoRoot, "index.html"), "utf8");
|
|
const help = fs.readFileSync(path.join(repoRoot, "quick-start.html"), "utf8");
|
|
const deploy = fs.readFileSync(path.join(repoRoot, "scripts", "deploy-web.sh"), "utf8");
|
|
|
|
assert.match(main, /function createAuxiliaryWindow/);
|
|
assert.match(main, /createParameterPlotWindow[\s\S]*createAuxiliaryWindow/);
|
|
assert.match(main, /ipcMain\.on\("openQuickStartWindow"/);
|
|
assert.match(main, /file: "quick-start\.html"/);
|
|
assert.match(elec, /function openElectronAuxiliaryWindow/);
|
|
assert.match(elec, /parameterPlot: "openParameterPlotWindow"/);
|
|
assert.match(elec, /quickStart: "openQuickStartWindow"/);
|
|
assert.match(lib, /openElectronAuxiliaryWindow\("quickStart"/);
|
|
assert.match(lib, /dialog\.show\(\)/);
|
|
assert.doesNotMatch(lib, /quickStartDialog[\s\S]{0,500}showModal/);
|
|
assert.match(html, /class="web-plot-window quick-start-dialog"/);
|
|
assert.match(html, /id="quickStartFrame"/);
|
|
assert.match(help, /id="helpRuns"/);
|
|
assert.match(help, /id="helpParams"/);
|
|
assert.match(help, /quickStartSection/);
|
|
assert.match(help, /class="quick-start-footer"/);
|
|
assert.match(help, /zaher\.salman@psi\.ch/);
|
|
assert.match(help, /https:\/\/musruser\.psi\.ch\/muSRFlow\/docs\//);
|
|
assert.match(help, /id="helpAbout"/);
|
|
assert.match(help, /About muSRFlow/);
|
|
assert.match(help, /id="musrflowVersion"/);
|
|
assert.match(help, /setVersion\(payload && payload\.version\)/);
|
|
assert.match(main, /version: app\.getVersion\(\)/);
|
|
assert.match(main, /shell\.openExternal/);
|
|
assert.match(main, /setWindowOpenHandler/);
|
|
assert.match(deploy, /quick-start\.html/);
|
|
assert.match(deploy, /__MUSRFLOW_VERSION__/);
|
|
assert.match(deploy, /node -p 'require\(process\.argv\[1\]\)\.version'/);
|
|
assert.doesNotMatch(lib, /musrfit-gui|bitbucket\.org\/zaher-salman\/musrfit-gui/);
|
|
}
|
|
|
|
testSharedHelpWindowInfrastructure();
|
|
console.log("help window tests passed");
|