Repository navigation
feat(cesium): situation scenes with milsymbol, station fleet and heat worker - #72
Merged
Jerry-CodeHub merged 3 commits intoOct 19, 2026
Merged
Conversation
… 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"
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
Jerry-CodeHub
requested changes
Oct 19, 2026
Jerry-CodeHub
left a comment
Owner
There was a problem hiding this comment.
- 【阻塞】CI
check失败:src/components/CesiumViewer/lifecycle.test.tsx报Cannot find module 'Cesium'。原因是CesiumViewer/index.tsx新增了顶层import CesiumNavigation from 'cesium-navigation-es6',vitest 解析的是这个包的main(UMD 构建),里面写的是require("Cesium")(大写 C)。macOS 文件系统不区分大小写,能解析到cesium;Linux CI 不行。master 上只有Situation.tsx引用这个包,而且没有测试加载Situation.tsx,所以以前一直没暴露。修法任选其一:在lifecycle.test.tsx里vi.mock('cesium-navigation-es6', () => ({ default: class { destroy() {} } })),或者在vitest.config.ts的 alias 里加Cesium: 'cesium'。另外,由于 check 失败,build 和 e2e 被跳过,这个 PR 在 CI 上还没真正跑过构建和 e2e。 - 【中】OSM 探针违反 OSM 瓦片使用政策:
probeTileSane用的是fetch(url, { cache: 'no-store' })。按 Fetch 规范,这种缓存模式下浏览器会自动加上Cache-Control: no-cache和Pragma: no-cache请求头,而 OSMF Tile Usage Policy 明确禁止发送 no-cache 头。并且每创建一个 viewer 就会探测一次 OSM(只有判定不可达后才写缓存)。公开演示站因此有被限流或封禁的风险。建议 OSM 和高德探针改用默认缓存模式;carto 的像素校验已经有 sessionStorage 缓存,不需要 no-store。 - 【中】ion 链路的 HTTP 层错误监听实际不生效:有 token 时,Viewer 的默认底图来自
ImageryLayer.fromWorldImagery(),它的 provider 是异步创建的。effect 执行时imageryLayers.get(0).imageryProvider还是undefined,所以watchProviderErrors什么也没挂上。token 失效或额度耗尽(endpoint 返回 401/403)属于 provider 创建失败,只会触发ImageryLayer.errorEvent,而这次改动恰好删掉了对它的监听。结果是「ion 失败 3 次后回落 OSM」覆盖不到 ion 最常见的故障:地球上只剩底色,既不回落也不显示横幅。建议等 layer 的readyEvent触发后再挂 provider 的错误监听,并把layer.errorEvent直接视为需要换层。 - 【中】
cesium:osm:dead判定一次就在整个会话里生效:OSM 探针只要超时一次(5 秒,弱网或首屏抢带宽时很容易发生),就会写入 sessionStorage。之后本会话的所有场景都直接走高德瓦片(GCJ-02,和 WGS-84 业务图层偏差几百米),点「重试底图」也不会重新探测 OSM。建议给这个判定加 TTL,或者连续失败两次才写入;用户点重试时清掉这个缓存。 - 【低】
docs/demo/demo-script.md里的_.basemaps.cartocdn.com、_.autonavi.com是 Prettier 把成对的*当成强调语法改写成了_,渲染出来是斜体,通配符也没了。建议用反引号包住:*.basemaps.cartocdn.com。 - 【nit】
stageEl.dataset.cesiumSwaps = debug.swaps.join(',') || undefined在没有换层时会写入字符串"undefined"。另外,这几处 dataset 诊断镜像注释写的是 dev 用途,但生产环境也会写。
第 1 条修复后 CI 才能继续跑;第 2–4 条建议在本 PR 内一并处理。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
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 toviewer.clock(play/pause, speed, scrub)*.basemaps.cartocdn.comin img-src/connect-src across all four deployment copies/map/cesiumbecomes an in-page scene shell (Segmented + Outlet, third menu level dissolved); deps:milsymbol3.0.4,mgrs2.2.0Review 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
onReadyclosure), Direction targets vanishing past 1200 s (now analyticCallbackPositionProperty), 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 inen-US/pages.ts, no direct unit test for the two-viewer fetch-patch refcount.Budget
publicMB4 → 4.5: public measured 3.82 MB with the 586 KB glTF, over the old 3.8 MB headroom line; rationale recorded insize-budget.json.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.tsxcovers the provider host filter and HTTP-level provider errors*.autonavi.com; fixtures whitelist cartocdn console noise