// OPENBOX DOCS

Frontend modules

Inventory of the 60 static/ JS modules, entry wiring, and the search worker contract.

The web UI ships as index.html plus 60 ES modules in static/ (58 domain modules plus app.js and worker.search.js), served from /static/* with cache headers. app.js is the entry point; every other main-thread module imports shared state and helpers from state.js / util.js.

Module inventory

ModuleResponsibility
activity.jsActivity Center (durable operations, jobs, SSE progress)
app.jsEntry/boot: wires all domain modules into the shell
arcaderoom.jsController-friendly Arcade Room and kiosk canvas surface
battery.jsBig Box battery indicator (browser API first, then the GET /api/v2/native/battery route, which reads sysfs, pmset, or GetSystemPowerStatus)
bigbox.jsBig Box kiosk UI (stage/hybrid/coverflow, gamepad and pointer input, screensaver)
clips.jsRecord That clip gallery and reel actions
compat.jsCompatibility report dialog (GET /api/v2/compat/report) (2.0)
constellation.jsLibrary relationship graph
defs.jsSettings > Emulators: check, install, and roll back the signed definition pack
details.jsPopped-out game details window: URL detection, geometry memory, and opening
dialogs.jsDialog manager (focus trap, Escape to close)
dna.jsGame DNA smart-search toggle, results panel, and why-chips
emulators.jsShared emulator-settings form helpers
events.jsThe tab's single server-sent event stream (/api/v2/events) with backoff retry
gamepad.jsUnified gamepad rAF poll loop shared by every controller surface
health.jsLibrary health score card, breakdown dialog, and fix queue
help.jsHelp & shortcuts dialog with start, glossary, and shortcut tabs
household.jsHousehold members, challenges, shares, and leaderboard UI
i18n.jsInternationalization (t(key, params), data-i18n attributes, locale loading)
imports.jsImport dialogs (storefronts, ROM folders, arcade DATs, wizards)
insights.jsPlay Insights dashboard (heatmap, streaks, rankings; lazy-loaded)
library.jsLibrary grid rendering, cover grouping, search worker client
library_storage.jsMove library preview/apply and integrity-report UI (/api/v2/library/*) (2.0)
mastery.jsMastery completion dashboard
media.jsMedia audit, gallery, bulk downloads, and media queue
metadata.jsArtwork & details dialog and batch auto-match
migrate.jsFirst-launch migration readiness gate (/api/v2/setup/migration/*) (2.0)
model3d.jsCSS-only 3D cover models (box, jewel, cassette) and rotation
moments.jsMoments capture, timeline, and resume-from-moment UI
mood.jsAdaptive cover theming
navigation.jsKeyboard and gamepad navigation for grid and list views
netplay.jsRetroArch netplay lobby browser
osk.jsBig Box on-screen keyboard
palette.jsCtrl/Cmd-K command palette and shortcut help
party.jsGame Night queue, wheel, and round controls
picker.js"What should I play?" recommendation picker
plugin_form.jsJSON-Schema subset renderer for plugin settings forms
pointer_nav.jsPointer, wheel, trackball, and spinner navigation for Big Box
pure.jsDOM-free helpers exercised directly by node --test
reader.jsDocument/manual reader
recap.jsSession recap card and post-session actions
router.jsHash router for library view state (ADR 0021)
sessions.jsSessions, play-history, and save-management UI
settings.jsSettings UI
setup.jsLibrary Setup Center workflow (preview/commit imports)
sfx.jsTheme sidecar music and navigation sounds
state.jsAppState, api client, session token, search index (filteredGames, trigram helpers)
storefront.jsStorefront manager (Gameyfin install/download, owned-vs-installed)
timeline.jsHistory timeline view
timemachine.jsJournal timeline, as-of view, and revert preview UI
util.jsShared helpers ($, escapeHtml, controller map, trigram utilities)
deals.jsDeal Radar watchlist, manual entries, price history, and watch toggles (3.0)
itinerary.jsBacklog Itinerary plan, replan, estimate, and status views (3.0)
machines.jsShared job/session state literals mirroring the Rust state-machine table (3.0)
playerlog.jsPlayer's Log, Time Capsules, and Milestone Cards (3.0)
savevault.jsSave Vault snapshot list, diff, restore, and delete (3.0)
trail.jsAchievement Trail velocity, ETA, next-up, and refresh views (3.0)
whatsnew.jsWhat's New panel and local tips
worker.search.jsOff-main-thread trigram search worker (see contract below)
wrapped.jsPrintable Year in Games report

Search worker contract (worker.search.js)

Trigram expansion runs off the main thread with identical logic to the main-thread index (util.js / state.js indexTerms) so results match either path.

  • Worker script: static/worker.search.js, spawned by library.js via new Worker('./static/worker.search.js').
  • Request: postMessage {id, type, ...} where type is search ({query, games}), expand (trigram expansion), or warm.
  • Response: postMessage {id, type: 'search', results, count} (or {id, type: 'expand', trigrams}, {id, type: 'warm', ok: true}); unknown types and exceptions return {id, error}.
  • Fallback: when Worker is unavailable, library.js uses the main-thread filteredGames() / index path directly — same results, main-thread cost.