Skip to content

feat(cesium): situation scenes with milsymbol, station fleet and heat worker - #73

Merged
Jerry-CodeHub merged 3 commits into
masterfrom
feat/cesium-situation-scenes
Oct 19, 2026
Merged

Jerry-CodeHub merged 3 commits into
masterfrom
feat/cesium-situation-scenes

Conversation

@parker-super

Copy link
Copy Markdown
Collaborator

Replaces #72, which was merged into refactor/top-nav-shell instead of master (its base was never retargeted after #71 landed). Same three commits (d5293bb, 0503be2, fe2244c); #71 is already on master, so the diff is #72's changes only.

CI note: check failed on #72 — src/components/CesiumViewer/lifecycle.test.tsx hits Cannot find module 'Cesium' on case-sensitive Linux (cesium-navigation-es6's UMD build calls require("Cesium")). Not fixed on this branch yet, so expect the same failure here.

What

  • Situation rebuilt on a deterministic maritime/air model (situationModel.ts: core/warning/watch zones, six formation templates, 61 tracks, offline zone enter/exit events streamed live): MIL-STD-2525C symbols via milsymbol, shared affiliation palette, keyframe camera tour; TimeDeck binds all six scenes to viewer.clock (play/pause, speed, scrub)
  • GeoHash: synthetic 8000-station fleet (34 provincial clusters, fixed seed); Heatmap: field computed in a Web Worker, rendered as an ImageData LUT with d3-contour isolines, main-thread fallback if the worker fails to load; Trajectory: Apache-2.0 glTF patrol aircraft with billboard fallback
  • Basemap chain without an ion token: graded ("night") OSM → pixel-checked cartocdn upgrade → AMap last fallback; failures observed per current provider with network- and HTTP-level signals de-duplicated into one threshold; banner only when all three fail. CSP: *.basemaps.cartocdn.com in img-src/connect-src across all four deployment copies
  • Six pages rewritten on the shared SceneStage/onReady lifecycle; /map/cesium becomes an in-page scene shell (Segmented + Outlet, third menu level dissolved); deps: milsymbol 3.0.4, mgrs 2.2.0

Review context

Reviewed by a multi-dimension agent pass + adversarial verification, then a fix round (recorded as the "Review fixes (2026-10-19)" CHANGELOG section): 41/45 findings fixed here, including GeoHash's dead click-flyTo (stale onReady closure), Direction targets vanishing past 1200 s (now analytic CallbackPositionProperty), stretched milsymbol canvases and invalid SIDC affiliations, the AMap fallback being unobservable, and the false failure banner when carto had taken over. Known follow-ups (not blocking): first-paint race where a late successful layer swap doesn't clear the banner, no 429/5xx tolerance in the basemap e2e all-200 assertion, one "East Sea" wording in en-US/pages.ts, no direct unit test for the two-viewer fetch-patch refcount.

Budget

publicMB 4 → 4.5: public measured 3.82 MB with the 586 KB glTF, over the old 3.8 MB headroom line; rationale recorded in size-budget.json.

Tests

  • New unit tests: symbols (SIDC validity + real canvas dimensions), fieldModel (row orientation contract, cos(lat) distance vs haversine), situationModel (enter/exit pairing, determinism), stationFleet (weight proportionality, tiny counts), routeNav, palette/GroupNav/a11y; lifecycle.test.tsx covers the provider host filter and HTTP-level provider errors
  • e2e: basemap failure branch also blocks *.autonavi.com; fixtures whitelist cartocdn console noise

… worker

- Situation rebuilt on a deterministic maritime/air model (zones, six
  formation templates, 61 tracks, offline zone events streamed live):
  MIL-STD-2525C symbols via milsymbol, shared affiliation palette,
  keyframe camera tour; TimeDeck binds all six scenes to viewer.clock
- GeoHash gains a synthetic 8000-station fleet (34 provincial clusters,
  fixed seed); Heatmap computes the field in a Web Worker and renders
  an ImageData LUT with d3-contour isolines; Trajectory flies an
  Apache-2.0 glTF patrol aircraft with a billboard fallback
- basemap chain without an ion token: graded ("night") OSM default,
  pixel-checked probe upgrades to CartoDB Dark Matter, AMap raster as
  the last fallback; failures observed per current provider with
  network- and HTTP-level signals de-duplicated into one threshold
- six pages rewritten on the shared SceneStage/onReady lifecycle;
  /map/cesium becomes an in-page scene shell (Segmented + Outlet);
  deps: milsymbol 3.0.4, mgrs 2.2.0
- add https://*.basemaps.cartocdn.com to img-src and connect-src in
  config/csp.ts (single source) and the nginx, vercel and
  Cloudflare-style _headers copies, which the consistency test
  compares directive by directive
- sync the provenance comments to the token-less basemap chain:
  graded OSM -> carto probe upgrade -> AMap fallback, so the nginx
  copy no longer claims "only HTTPS OSM without a token"
- e2e: the basemap failure test also blocks *.autonavi.com (the AMap
  fallback answered 200 with permissive CORS, so the failure banner
  never appeared and the test timed out); fixtures' third-party
  console whitelist includes basemaps.cartocdn.com
- size budget: publicMB 4 -> 4.5 with the measured 3.82 MB public
  total and rationale recorded (the 586 KB Apache-2.0 glTF pushed it
  over the old 3.8 MB headroom line); gate script comment updated
- CHANGELOG: record the Cesium situational-scenes batch and the
  2026-10-19 review-fix round; demo-script troubleshooting describes
  the three-level basemap chain instead of "check OSM"
@coderabbitai

coderabbitai Bot commented Oct 19, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 31 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cfd5e8ab-441a-48dc-b7b7-c20ed57becd5
📥 Commits

Reviewing files that changed from the base of the PR and between 9a0827a and fe2244c.

⛔ Files ignored due to path filters: 1
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing: 44
  • CHANGELOG.md
  • config/csp.ts
  • config/routes.ts
  • docs/demo/demo-script.md
  • e2e/cesium-basemap.spec.ts
  • e2e/fixtures.ts
  • nginx/security-headers.conf
  • package.json
  • public/_headers
  • public/assets/models/README.md
  • public/assets/models/aircraft.glb
  • scripts/check-bundle-size.mjs
  • size-budget.json
  • src/components/CesiumViewer/CameraDirector.ts
  • src/components/CesiumViewer/TimeDeck.tsx
  • src/components/CesiumViewer/cesium.css
  • src/components/CesiumViewer/effects.ts
  • src/components/CesiumViewer/index.tsx
  • src/components/CesiumViewer/lifecycle.test.tsx
  • src/components/CesiumViewer/palette.ts
  • src/components/CesiumViewer/symbols.test.ts
  • src/components/CesiumViewer/symbols.ts
  • src/components/CesiumViewer/tileFailures.ts
  • src/locales/en-US/map.ts
  • src/locales/zh-CN/map.ts
  • src/pages/Map/Cesium/BoxSelect.tsx
  • src/pages/Map/Cesium/Direction.tsx
  • src/pages/Map/Cesium/GeoHash.tsx
  • src/pages/Map/Cesium/Heatmap.tsx
  • src/pages/Map/Cesium/Layout.tsx
  • src/pages/Map/Cesium/Situation.tsx
  • src/pages/Map/Cesium/Trajectory.tsx
  • src/pages/Map/Cesium/capabilityModel.test.ts
  • src/pages/Map/Cesium/capabilityModel.ts
  • src/pages/Map/Cesium/fieldModel.test.ts
  • src/pages/Map/Cesium/fieldModel.ts
  • src/pages/Map/Cesium/heatRender.ts
  • src/pages/Map/Cesium/heatWorker.ts
  • src/pages/Map/Cesium/patrolModel.ts
  • src/pages/Map/Cesium/situationModel.test.ts
  • src/pages/Map/Cesium/situationModel.ts
  • src/pages/Map/Cesium/stationFleet.test.ts
  • src/pages/Map/Cesium/stationFleet.ts
  • vercel.json
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Jerry-CodeHub Jerry-CodeHub left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

本 PR 替代误合进 refactor/top-nav-shell 的 #72,内容完全相同(同样 3 个提交、45 个文件,+5001/−1130)。我在 #72 的 review 里提的 6 条意见都还没处理,下面只列状态,细节见那条 review。

  1. 【阻塞 CI】check 仍然失败:lifecycle.test.tsx 报 Cannot find module 'Cesium'(cesium-navigation-es6 的 UMD 构建写的是 require("Cesium"),Linux 区分大小写),还没修。因此 build 和 e2e 一直被跳过,这批改动在 Linux 上还没跑过构建和 e2e。另外,即使修好这一条,Coverage gate 里 capabilityModel.test.ts 也会超时(见 #74 的 review),要等那边修好才会全绿。
  2. 【中】 OSM 探针用 cache: 'no-store',浏览器会自动发送 no-cache 请求头,违反 OSM 瓦片使用政策:未处理。
  3. 【中】 ion 链路的 HTTP 层错误监听不生效(provider 异步创建),token 失效时既不回落 OSM 也不显示横幅:未处理。
  4. 【中】 cesium:osm:dead 只要判定一次,整个会话都直接走高德瓦片,重试也不会重新探测 OSM:未处理。
  5. 【低】 docs/demo/demo-script.md 里的 _.basemaps.cartocdn.com 是 Prettier 把通配符改写成了 _:未处理。
  6. 【nit】 dataset.cesiumSwaps 在没有换层时会写入字符串 "undefined":未处理。

补充一点:#71 已经上线,master 上六个 Cesium 页的描述文案写的是本 PR 的功能。本 PR 合入之前,线上页面和描述对不上。

@Jerry-CodeHub Jerry-CodeHub left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

批准。#72 review 里的意见后续跟进。

@Jerry-CodeHub
Jerry-CodeHub merged commit 34b0cef into master Oct 19, 2026
5 of 8 checks passed
@parker-super
parker-super deleted the feat/cesium-situation-scenes branch October 19, 2026 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants