Faster first load; demo date tags stay current

First load:
- Draw the Overview as soon as the data arrives instead of on its next
  2-second timer tick (about 2.5 s to 0.6 s on a typical connection).
- Start on DOMContentLoaded instead of window.onload.
- Load the ~900 KB PDF library only when someone exports a PDF.
- Fetch the startup files side by side, and build the docs search index
  after the dashboard has drawn (unless the visit starts on /docs).
- Show a loading placeholder on the Overview until the data arrives.

Demo: the date-batch tags sit on fixed working-day offsets from today.
The seed records them in Demo-Dates.json and the worker relabels them when
the day changes, so a long-running container never looks stale.
This commit is contained in:
Johan Sandoval committed 2026-10-07 20:22:09 +00:00
1 parent 5e8dea8027
commit 9731368687
8 files changed
+105 -21

No files matched your search

+3 -8
View File
@@ -51,14 +51,9 @@ for ($m = 0; $m -lt 3; $m++) {
$manual += "$src, $dst"
}
# --- 2. Date-batch tags (recent and upcoming working days) ---
function Get-Workday([datetime]$from, [int]$offset) {
$d = $from.Date; $step = [math]::Sign($offset); $left = [math]::Abs($offset)
while ($left -gt 0) { $d = $d.AddDays($step); if ($d.DayOfWeek -ne 'Saturday' -and $d.DayOfWeek -ne 'Sunday') { $left-- } }
return $d
}
$today = Get-Date
$dateTags = @(-4, -3, -2, -1, 0, 1) | ForEach-Object { (Get-Workday $today $_).ToString("M/d") }
# --- 2. Date-batch tags (recent and upcoming working days; the worker keeps them current) ---
$dateTags = Get-DemoDateTags
[System.IO.File]::WriteAllText((Join-Path $dataDir "Demo-Dates.json"), (@{ Tags = $dateTags } | ConvertTo-Json), [System.Text.Encoding]::UTF8)
$tags = [ordered]@{}
foreach ($t in $dateTags) { $tags[$t] = [System.Collections.Generic.List[string]]::new() }