| Command | Purpose |
|---|---|
npm run dev |
Vite dev server (default http://localhost:5173). |
npm run lint |
ESLint on src/**/*.ts(x) and tests/**/*.ts. |
npm run test |
Vitest unit tests. |
npm run build |
tsc + Vite SPA build only (vite.config.ts → dist/). |
npm run build:lib |
tsc + npm package build (vite.lib.config.ts → dist-lib/); used by prepublishOnly and embedders. |
npm run test:e2e |
Playwright (requires fixture MCAP; see below). |
Committed sources live under test-fixtures/ (layouts, minimal HDF5/BVH, H264/JPEG bytes). Playwright copies or generates runtime files into public/examples/ (gitignored) via:
npm run gen:e2e:fixturesThis runs automatically as pretest:e2e before npm run test:e2e.
Generated file (public/examples/) |
Purpose |
|---|---|
test_5s.mcap |
Basic MCAP playback, dockview, transport |
test_pose.mcap |
PoseStamped sidebar topics |
test_3cam.mcap |
Three-camera image grid layout |
test_h264.mcap |
H.264 CompressedImage decode |
test_minimal.hdf5 |
ALOHA-schema HDF5 (~7 KB) |
test_minimal.bvh |
Minimal BVH skeleton |
test_multi_base.mcap |
Multi-source merge: "base recording" (camera + /joint_states, 0-5s) |
test_multi_incremental.mcap |
Multi-source merge: separately-authored file adding one topic, 3-7s |
test_multi_filtered.mcap |
Multi-source merge: derived from test_multi_base.mcap via the real mcap filter CLI — optional, see below |
test_multi.bag |
Multi-source merge: ROS1 bag for mcap+bag mixed-format tests (copied from the committed test-fixtures/media/minimal-multi.bag) |
Vitest layout round-trip tests import JSON directly from test-fixtures/layouts/.
Two fixtures depend on a tool that isn't an npm package. Their generator scripts detect absence and skip (exit 0, no output file) rather than failing the whole gen:e2e:fixtures run; Playwright specs that need one of these files check for it and test.skip() themselves when it's missing.
mcapCLI (Rust rewrite,mcap --version≥ 0.1) — a local-only debugging tool, needed only to (re)generatetest_multi_filtered.mcapviamcap filter. Install withbrew install mcapor download a binary from https://github.com/foxglove/mcap/releases?q=mcap-cli. CI does not install it:test_multi_filtered.mcapand the one Playwright spec that depends on it simply skip there; everything else runs normally.rosbagsPython package — needed only to regenerate the committedtest-fixtures/media/minimal-multi.bagsource (e.g. after changing its schema inscripts/gen-test-bag.py);npm run gen:e2e:fixturesjust copies that committed file intopublic/examples/test_multi.bag, so CI and most contributors never need to install it. If you do:pip install rosbags.
For sample deep links (?url=sample://…), set VITE_SAMPLE_DATASETS_MANIFEST_URL in .env to a reachable JSON manifest (see src/services/sampleDatasets.ts).
For remote lists in the browser during dev, prefer same-origin URLs, e.g.
http://localhost:5173/?url=/examples/test_5s.mcap
so Vite serves static files and Range requests correctly.
| Scenario | Action | Goal (suggested) |
|---|---|---|
| ~1GB MCAP | Open via ?url= until first frame is usable |
Note seconds; watch main-thread long tasks |
| Multi-panel playback | 3+ panels, 2× speed for 60s | No severe jank; memory stable |
| Remote Range | Large file over HTTP Range | Time to first useful frame / draggable scrubber |
npm run lint,npm run test,npm run build(SPA),npm run build:lib(when validating the npm bundle),npm run test:e2e(with fixtures).- CI: see
.github/workflows/ci.yml(Node version should matchpackage.jsonengines).
Prefer main-thread rendering and subscription tuning before MCAP-parse WASM. Consider a WASM PoC only if worker traces show deserialize dominating, main-thread R3F cost is already low, and message latency still needs improvement.
Prerequisites
npm installand (first time)npx playwright install.npm run gen:e2e:fixtures(also runs automatically beforetest:e2e).npm run dev→http://localhost:5173.
Playwright
npm run test:e2eManual checks (e.g. Chrome DevTools MCP)
- Open
http://localhost:5173/?url=/examples/test_5s.mcap
Confirm Dockview loads; no fatal console errors. - Sidebar shows Topics / Data / Tags (or localized equivalents).
- Switch to Data if multiple sources are present; the successfully loaded row is highlighted.
- Open
/, upload or drag a local.mcap; confirm load succeeds.
Full E2E coverage requires npm run gen:e2e:fixtures so public/examples/ is populated; no files outside the repo are needed.
Loading multiple recording files together (any mix of .mcap/.bag/.db3/.hdf5/.bvh) merges them into one session: topics from every file are concatenated in file order, and the playback range becomes the union of each file's time range. See tests/multi-sources.spec.ts for the automated coverage (multi-mcap merge, mcap+bag mixed formats, merging into an already-active session, Data tab grouping).
Manual checks
npm run gen:e2e:fixtures, thennpm run dev.- Drag
public/examples/test_multi_base.mcaponto the welcome screen; confirm it loads with 2 topics (/camera/front/image_raw/compressed,/joint_states) and a 0-5s range. - Drag
public/examples/test_multi_incremental.mcapin on top of the already-loaded session; confirm the topic list grows to 3 topics and the playback range extends to 0-7s (the union), without switching away to a separate "Data" entry. - Open the new topic's "more" menu (
⋯in the sidebar Topics tab); confirm it shows a "Source: …" line naming both files once a topic name happens to be shared, or the single owning file otherwise. - Optional, with the real
mcapCLI installed and a large real-world recording on hand: split it into two files by topic/time range withmcap filter in.mcap -o a.mcap -y /some/topic(and a complementary-nregex for the rest), then load both together and confirm the merged topic count/time range matchmcap infoon the original file.