gui: fitTop's .side-top guard fits app.js's budget again
6db21d869guarded fitTop's .side-top with an if block and a comment, which put app.js 64 bytes over TestCoreScriptBudget's budget (app.js 1315380 > 1315316, the core 1537098 > 1537034), and I pushed it without running internal/gui's Go tests. The guard is now optional chaining (st?.classList…, which skips the whole call and its arguments when there is no .side-top), and st is declared with fitTop's other elements, so app.js is 14 bytes under the budget it had. The budget is not raised. Run (on mote, through mote-run): - go test -run 'TestCoreScriptBudget|TestMainWindowCorners' ./internal/gui: TestCoreScriptBudget passes (failed at6db21d869). TestMainWindowCorners/macOS_26_SDK is red, the same atd19afb4c9, before either commit: #3949 (macOS 27 on mote). - number-units.test.cjs, chromium and webkit: 6 of 6 pass.
This commit is contained in:
@@ -23590,13 +23590,9 @@ matchMedia("(max-width: 760px), (pointer: coarse) and (max-width: 1024px)").addE
|
||||
// centring and take the room between, and at the narrowest they draw in,
|
||||
// further still when they don't fit (the 560px window at 150%).
|
||||
function fitTop() {
|
||||
const top = $(".top"), nav = $("#nav"), brand = $(".brand"), actions = $(".actions");
|
||||
// the tray panel has no sidebar, so no .side-top
|
||||
const st = $(".side-top");
|
||||
if (st) {
|
||||
st.classList.remove("tight");
|
||||
st.classList.toggle("tight", st.scrollWidth > st.clientWidth);
|
||||
}
|
||||
const top = $(".top"), nav = $("#nav"), brand = $(".brand"), actions = $(".actions"), st = $(".side-top");
|
||||
st?.classList.remove("tight");
|
||||
st?.classList.toggle("tight", st.scrollWidth > st.clientWidth);
|
||||
// a phone's browser: the tabs have a row of their own (app.css), at their size;
|
||||
// and beside the sidebar the header holds only where the reader is and the icons
|
||||
if (phoneWeb() || sideNav()) { top.classList.remove("tight", "cramped", "inrow", "crowded", "packed"); return; }
|
||||
|
||||
Reference in New Issue
Block a user