mirror of
https://github.com/BigBodyCobain/Shadowbroker.git
synced 2026-12-05 00:53:37 +01:00
After the browser tab sat hidden overnight, every airborne aircraft was drawn
smeared thousands of miles along its last heading (e.g. over open ocean) for
about a minute after waking, until fresh data arrived.
Polling pauses while the tab is hidden, but the interpolation clock keeps
counting from the last data refresh. Since 5ae1e5b the dead-reckoning cap
(interpolatePosition's maxDt, documented as "Cap interpolation time to prevent
runaway drift when data is stale") was overridden with
UNBOUNDED_INTERP_SECONDS = Infinity, so 8 hours stale moved a 500 kt flight
~3,300 nm.
Restore a cap via a shared MAX_INTERP_SECONDS = 180 used by flights, ships and
satellites (useInterpolation) and the worker-side interpolation
(applyDynamicLayerInterp). Live data refreshes every ~15s, so normal animation
is unaffected; stale markers now advance at most ~25 nm, then snap to fresh data.
Also widens a source-slice window in maplibreDecomposition.test.ts that had
zero slack (onClose ended exactly at char 500 with LF; failed on CRLF checkouts).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ShadowBroker Frontend
Next.js 16 dashboard with MapLibre GL and Framer Motion.
Development
npm install
npm run dev # http://localhost:3000
API URL Configuration
The browser calls relative /api/* paths. The catch-all route handler at
src/app/api/[...path]/route.ts proxies those requests to the backend using
the server-side BACKEND_URL environment variable at request time.
This keeps the backend URL out of the client bundle and lets Docker or other deployments change the backend target without rebuilding the frontend.
Common Scenarios
| Scenario | Action needed |
|---|---|
Local dev (localhost:3000 + backend on 127.0.0.1:8000) |
None. The proxy defaults to http://127.0.0.1:8000. |
| Docker Compose | None. docker-compose.yml sets BACKEND_URL=http://backend:8000. |
| Backend on a different host or port | Set BACKEND_URL before starting the Next.js server/container. |
| Reverse proxy in front of the frontend | Point external clients at the frontend; keep BACKEND_URL set to the backend address reachable from the Next.js server. |
Setting BACKEND_URL
# Shell (Linux/macOS)
BACKEND_URL=http://myserver:8000 npm run dev
# PowerShell (Windows)
$env:BACKEND_URL="http://myserver:8000"; npm run dev
# Docker Compose
# Edit the frontend service environment or add a compose override:
# BACKEND_URL=http://myserver:8000
Theming
Dark mode is the default. A light/dark toggle is available in the left panel
toolbar. Theme preference is persisted in localStorage as sb-theme and
applied via the data-theme attribute on <html>. CSS variables in
globals.css define all structural colors for both themes.