Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ sits at the bottom, then **Add to Home Screen**. iOS 26 defaults to that Compact
layout, which is why the app offers you both. On Android, Chrome has **Install
app** in its menu.

Installed, the whole app is 165 KB of shell and about 112 KB of schedule, gzipped, and
Installed, the whole app is 164 KB of shell and about 113 KB of schedule, gzipped, and
none of it is fetched again to answer a question. Turn the network off, open it,
and it still ranks rooms. That matters because the moment you want it most is the
moment you are in a basement with one bar.
Expand Down
18 changes: 0 additions & 18 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1230,24 +1230,6 @@ <h2 id="gate-h" tabindex="-1"></h2>
<section id="pick" class="pane" hidden></section>
<section id="browse" class="pane" hidden></section>
<section id="about" class="pane" hidden></section>
<!-- REMOVE AFTER ONE RELEASE. #85 deleted the duration chips, and this empty
node is the only thing standing between that deletion and a frozen app
for everyone who already has the site installed.
sw.js serves navigations network-first and everything else cache-first,
so the first load after this deploys pairs the NEW index.html with the
OLD js/app.js still in the shell cache. That app.js calls attachChips()
as the second statement of its DOMContentLoaded listener, and its first
line is $('chips').querySelectorAll('.chip') against getElementById.
Without a node here that is a TypeError, and it lands before
$('back').onclick, popstate, attachSheet() and boot() are wired: the
screen holds "finding campus..." over four disabled buttons with no back
arrow and no error. Re-stamping SHELL_CACHE does not save that load,
because the old worker is the one serving it, and js/pwa.js only
auto-reloads while the page is untouched - which a frozen screen will not
stay. An empty div costs 30 bytes and makes the old code's forEach run
over nothing instead. Once a release has shipped with it, no cached
app.js reaches for #chips any more and this can go. -->
<div id="chips" hidden></div>
<form id="find" hidden>
<input id="find-q" type="search" autocomplete="off" autocorrect="off" spellcheck="false"
enterkeyhint="search" placeholder="Search buildings" aria-label="Search buildings by name or code">
Expand Down
19 changes: 0 additions & 19 deletions scripts/test/screens.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1367,25 +1367,6 @@ test('the duration chips are gone from the page, not merely hidden on it', () =>
assert.doesNotMatch(APP, /paintChips|attachChips/, 'the chip handlers are still here');
});

test('the #chips node left behind for the old shell is empty, and dated', () => {
const html = readFileSync(join(ROOT, 'index.html'), 'utf8');
// sw.js serves navigations network-first and assets cache-first, so the first
// load after this deploys runs the new index.html against the js/app.js still
// in the shell cache. That app.js calls attachChips() before it wires #back,
// popstate, the sheet or boot(), and its first line is
// $('chips').querySelectorAll('.chip') — a TypeError on a missing node, and a
// screen frozen on "finding campus..." with no way out. This node exists only
// so that forEach runs over nothing instead.
const node = html.match(/<div id="chips"[^>]*>([\s\S]*?)<\/div>/);
assert.ok(node, 'the shim the old shell needs is gone; see #85 before removing it');
assert.equal(node[1].trim(), '', 'the shim grew content, which makes it a control again');
assert.match(node[0], /\bhidden\b/, 'the shim is not hidden');
// It is scaffolding with an expiry, not a feature. Once a release has shipped
// carrying it, no cached app.js reaches for #chips and the node can go.
const why = html.slice(Math.max(0, html.indexOf('<div id="chips"') - 1400), html.indexOf('<div id="chips"'));
assert.match(why, /REMOVE AFTER ONE RELEASE/, 'the shim lost the note saying it is temporary');
});

test('the ranked list says which question it is answering', () => {
const paint = bodyOf('paintList');
// In the concatenation, so it cannot be a line that renders somewhere else.
Expand Down
6 changes: 3 additions & 3 deletions sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
// One cache would either re-download the room index on every deploy or pin an
// installed icon to last month's app.js forever.
//
// Measured on 2026-10-12 over the files prepared for the next commit, which is
// Measured on 2026-10-13 over the files prepared for the next commit, which is
// the copy Pages will serve: `gzip -9 -c < <file> | wc -c`.
// Shell 169,259 bytes, data 115,160.
// Shell 168,143 bytes, data 115,554.
// Run it exactly as written, through the pipe. `gzip -9 -c <file>` with the
// name as an argument stores each basename in the gzip FNAME header and reads
// 176 bytes higher across these seventeen files, which is most of a percent of
Expand Down Expand Up @@ -89,7 +89,7 @@
// placeholder is __BUILD_ID__, and a committed sw.js still carrying it means the
// stamp did not run. scripts/test/sw.test.mjs fails on exactly that. Spelled out
// rather than built from CACHE_PREFIX, because the stamper rewrites this line.
const SHELL_CACHE = 'vacant-shell-45985c7';
const SHELL_CACHE = 'vacant-shell-e49c533';
const DATA_CACHE = 'vacant-data-v1';

// CacheStorage is per origin, not per path, and enesyilmazcode.github.io also
Expand Down
Loading