Part of #79. Found while building the offline bundle.
Problem
Judge tab routes resolve offline; courthouse tab routes do not.
app/Helpers/staticPaths.ts has judgeShellPath(), which pre-renders one shared shell per tab instead of one per judge:
dist/judges/_shell/profile.html
dist/judges/_shell/reviews.html
dist/judges/_shell/rulings.html
dist/judges/_shell/cases.htmlpreview.ts rewrites /judges/:id/reviews onto /judges/_shell/reviews.html, and the components resolve the judge id from location.pathname rather than a build-time param (they have to — stx leaves window.stx._rp unset on a hard reload). So one file serves all 2,740 judges.
Courthouses have no equivalent. They are pre-rendered per id:
dist/court-houses/1/profile.html
dist/court-houses/1/bench.html
dist/court-houses/1/reviews.html
… ×202scripts/build-offline-bundle.ts strips per-entity trees, which is what takes the app from 443 MB to 13 MB — so in the offline bundle every courthouse tab route 404s, while every judge tab route still works.
Why this is worth fixing beyond the app
The asymmetry predates the mobile work and costs the web build too: 808 courthouse pages (143 MB of dist/) exist only because there is no shell, and they contain no per-courthouse content that is not fetched client-side anyway. A shell would cut the web artifact as well as fix the offline gap.
What to do
Mirror the judge approach:
- Add
courtShellPath()toapp/Helpers/staticPaths.tsreturning{ params: { id: '_shell' } } - Point the three courthouse tab views at it via
getStaticPaths - Add
preview.tsSHELL_REWRITESentries capturing the tab, not the id — the judge rules already do this, and getting it backwards was a real bug once (all four tab URLs returned byte-identical responses) - Confirm the courthouse components resolve the id from
location.pathname, as the judge ones do, and not from a build-time param - Re-run
bun run gate— "every dynamic route is pre-rendered or rewritten" and the sitemap checks both cover this
Checks
/court-houses/42/profileresolves in the offline bundle- Hard reload (not just SPA nav) renders the right courthouse
- Gate still 18/18, and the sitemap advertises nothing that 404s
dist/page count and size drop measurably