* chore(merge): resolve conflicts, fix mockWs error, and apply refactor standards
* Potential fix for pull request finding 'CodeQL / Incomplete URL substring sanitization'
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
* Potential fix for pull request finding 'CodeQL / Incomplete URL substring sanitization'
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
* Potential fix for pull request finding 'CodeQL / Incomplete URL substring sanitization'
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
* fix(ci): Stabilize github actions and resolve test failures
- fix(tests): update WsClient mock to use standard function for Vitest constructor compatibility
- fix(db): correct PrismaClient import path to use generated output directory
- fix(e2e): add predev database boot step to playwright CI workflow
- chore: sync pnpm-lock.yaml after merge conflict resolution
* refactor(plugins): decouple GeoJSON plugin and implement data bus lifecycle
- feat(sdk): [Minor] Added dynamicPluginCreate, dynamicPluginRemove, and pluginUnregistered to DataBusEvents.
- feat(core): [Minor] Implemented unregisterPlugin in PluginManager.ts for automated IndexedDB caching cleanup and polling teardown.
- feat(core): [Minor] Added removeLayer to layersSlice.ts to support safe removal of plugin states.
- refactor(plugins): [Patch] Refactored useGeoJsonImport.ts and ImportedLayerList.tsx to decouple from direct manager imports, utilizing DataBus for lifecycle events.
- refactor(core): [Patch] Added pluginUnregistered listener to DataBusSubscriber.tsx to handle state and cache cleanup synchronously via event.
* fix(types): resolve PluginManager type errors
* refactor(core): decouple PluginManager and fix rendering invariants
- refactor(core): Replace Zustand mutations in PluginManager with DataBus events (Patch)
- refactor(sdk): Add layerLoadingChanged, pluginError, pluginUnregistered to DataBusEvents (Patch)
- refactor(ui): Subscribe to new DataBus events in DataBusSubscriber (Patch)
- fix(plugins): Remove size from BaseAviationPlugin to fix model rendering clipping (Patch)
- fix(plugins): Migrate BaseIncidentPlugin from size to iconScale to fix billboard clipping (Patch)
* chore: resolve lockfile conflict
* fix: restore BottomPanelManager in AppShell and fix vitest config
* fix(layout): restore bottom panel positioning and transition styling
This commit corrects the missing bottom panel issue by resolving CSS aggregation errors and fixing transition logic. The version is bumped to 2.15.5.
---------
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
WorldWideView's Vitest setup is already wired and CI already runs
\`pnpm test\` on every PR. What's missing is tests for the systems
that actually break: the plugin lifecycle plumbing (data bus, cache,
polling) and the camera adapter aggregator that the UI hits on every
layer toggle.
This PR adds a focused first batch — 12 tests across 4 files — covering
the most common failure modes we've actually seen in practice. The
intent is to land the patterns alongside the tests so the next
contributor (human or agent) can copy the shape rather than improvise.
## What's tested
| File | Coverage | Tests |
| ---- | -------- | ----- |
| src/core/data/DataBus.test.ts | emit/subscribe round-trip, unsubscribe correctness, handler-failure isolation | 3 |
| src/core/data/CacheLayer.test.ts | memory-tier get/set, TTL expiry + eviction | 2 |
| src/core/data/PollingManager.test.ts | immediate-run on start(), interval scheduling, stop() cancels | 3 |
| src/app/api/camera/adapters/registry.test.ts | resolveSources for "all" / null / "none" / mixed-with-unknowns | 4 |
Each test answers one question: what regression does it catch that
we'd otherwise find by user bug report?
## Config change
vitest.config.ts now includes \`src/app/**/*.{test,spec}.*\` so API-route
tests under \`src/app/api\` are picked up by \`pnpm test\`. Previously only
\`src/lib\`, \`src/core\`, \`src/plugins\`, and \`packages\` were scanned —
api-route handlers had no test home.
## Docs
\`docs/testing.md\` gets four new sections:
- **Patterns** — plain-function, stateful-singleton, mock-with-vi.mock,
fake-timers — with a callout for the \`runOnlyPendingTimersAsync\`
double-counting gotcha we hit while writing PollingManager tests.
- **What NOT to Test (Yet)** — Cesium-heavy components, live DB
round-trips, dynamic plugin imports.
- **Philosophy** — small focused suite > large expensive one, test
pure logic, add a test when you fix a bug.
Original overview/test-types/run-commands sections are unchanged.
## Verification
Locally (Node 22 + pnpm 9.15.4):
\`\`\`
Test Files 17 passed (17)
Tests 127 passed (127)
\`\`\`
Existing 115 tests still pass; new 12 land cleanly.
## What's next (not in this PR)
The list of load-bearing systems still without coverage:
- PluginManager (the central plugin lifecycle orchestrator)
- The new plugin-backend supervisor + proxy (PR #100)
- The agent bus (PR #79)
- Plugin marketplace install/uninstall round-trip
- React component tests for LayerPanel and DataBusSubscriber
Worth a follow-up batch once the patterns from this PR are familiar.
Co-authored-by: Sapphire <sapphire@tiktokcoach>
- frustumGeometry.ts: pure math module with haversine projection for
4 corner points of the camera view pyramid
- FrustumRenderer.ts: Cesium Entity polyline management (4 side edges)
- useFrustumRendering.ts: React hook bridging renderer with viewer
- GlobeView.tsx: wire frustum hook into rendering pipeline
- cameraMapper.ts: default camera altitude to 8m above ground
- vitest.config.ts: include plugin tests in vitest glob
- 12 unit tests passing for geometry + cardinal direction parsing
- Architecture supports future ground-surface projection