Files
magpie/internal/gui/assets/notices.js
T
yetone 192d2eda81 gui: About's licenses dialog and Sync's Restore and Upload asks load when opened, so the core is back in its budget (#5720)
TestCoreScriptBudget was red on main since 4436b7d98 (Make first under
Smart, CryptoSarom on X), which added 1,080 bytes to app.js and took the
core's scripts to 1,534,166, 364 over 1,533,802 (its parent was at
1,533,086). The budget is not raised (LESSONS: a budget raised whenever a
change reaches it bounds nothing); code that only runs when a dialog opens
moves out instead:

- Settings > About's Open-source licenses dialog (showNotices) is now
  notices.js, imported when View is pressed.
- Sync's Restore from the server and Upload asks (askRestore, askUpload)
  join Sync's forms in syncfiles.js; syncFile imports it for them when
  pressed, and an import that fails says so in the status line.

app.js is 1,307,923 bytes (was 1,311,541) and the core 1,530,548, 3,254
under its budget. old-webkit's list of lazily loaded files names
notices.js; the budget's comment records this.

Run on mote at this tree (on origin/main ed0ab567c):
- gofmt -l internal/gui: nothing; node --check app.js, notices.js,
  syncfiles.js: ok.
- go test -tags nogui -run TestCoreScriptBudget ./internal/gui: PASS
  (red at ed0ab567c, per #5720).
- go test -tags nogui -timeout 45m ./internal/gui: ok (80.9s).
- node --test, chromium and webkit, every language and width the files
  have: about-notices, old-webkit, i18n-keys, auto-backup, github-sync,
  s3-sync and every sync-*.test.cjs: 210 of 212 pass. sync-auto-restore
  and sync-not-backup press Restore and Upload through the new import;
  about-notices opens the licenses. The 2 reds are red the same way at
  origin/main ed0ab567c in a clean worktree, alone: i18n-keys "a plugin's
  words are its own" (#5332, #5426, #5482) and s3-sync webkit en "picking
  S3 must not scroll the page", 3 of 3 (#3413); both commented there.

Not tried: the real app; the whole GUI suite.
2026-11-09 04:37:47 +08:00

20 lines
775 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// Settings › About's Open-source licenses: THIRD_PARTY_NOTICES, which
// every build carries. app.js imports this when View is pressed
// (showNotices), so it weighs nothing on the core (#5720).
window.noticesSheet = async function () {
let text;
try { text = (await api("notices")).text; } catch (e) { statusErr(e); return; }
const ed = el("div", "editor wide notices");
const head = el("div", "ehead");
head.append(el("b", "", t("Open-source licenses")));
const bar = el("div", "bar");
const ok = el("button", "text primary", t("Done"));
ok.onclick = cancelAsk;
bar.append(el("span", "grow"), ok);
ed.append(head, el("pre", "notices-text", text), bar);
confirmAsk = ed;
openModal(ed);
$("#modal").classList.add("lib");
ok.focus(NO_SCROLL);
}