Skip to content

feat(plugin-map): a map view with no style draws the deployment's default map style before demotiles - #26326

Merged
objectstack-fleet[bot] merged 13 commits into
mainfrom
claude/issue-26163-map-style-runtime-fallback
Oct 27, 2026
Merged

objectstack-fleet[bot] merged 13 commits into
mainfrom
claude/issue-26163-map-style-runtime-fallback

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #26163

Clause-②: no
Metadata-protocol: none

The ui half of #26001. A map view that declares no style of its own now draws the deployment's default style, the runtime-config mapStyleUrl that #26162 serves from the operator's OS_CONSOLE_MAP_STYLE_URL, before it falls back to the public demo style.

What changed

A map draws the first style it finds, in this order:

  1. the view's own style: mapStyle, then map.style (unchanged);
  2. the deployment's default style, from the host;
  3. DEFAULT_MAP_STYLE, the public demo style (unchanged).
  • @object-ui/react: a new HostMapStyleContext with HostMapStyleProvider and useHostMapStyle(). Outside a provider, or with no style given, the hook answers undefined.
  • @object-ui/plugin-map: ObjectMap reads useHostMapStyle() after mapConfig.style. Its public exports are unchanged. When the deployment's style fails to load, the record-list notice now has its own text: the default map style set for this deployment could not be loaded, ask your administrator to check it. Before this change that case would have shown the default-style notice, which blames the public default tiles that the map never drew.
  • @object-ui/app-shell: AppShellRuntimeConfig.mapStyleUrl?: string is read from the top-level mapStyleUrl. It is re-read from each payload, so absent, empty or non-string values withdraw it. ConsoleShell mounts HostMapStyleProvider with getRuntimeConfig().mapStyleUrl, directly inside HostNavigationBridge.
  • @object-ui/i18n: one key, element.map.styleFailedDeployment, in all ten packs.
  • Docs: a "Which style draws" section in plugin-map's README and in content/docs/plugins/plugin-map.mdx.
  • scripts/sdui-manifest.sources/{i18n,plugin-map,react}.json re-recorded. The artefact itself did not move.

The seam: a context in @object-ui/react, not a prop and not a plugin-map export

  • Not a prop. ObjectMap reaches the page through ComponentRegistry (object-map, rendered by ObjectView / ListView / SchemaRenderer). The Console never builds that element, so it has nowhere to pass a prop. HostNavigationContext exists for the same reason, and ConsoleShell's own comment says so.
  • Not a context exported from plugin-map. The Console loads @object-ui/plugin-map lazily (registerLazy in apps/console/src/register-plugins.ts) to keep maplibre-gl out of the first bundle. A provider imported from the plugin's single side-effectful entry would load the plugin, and maplibre-gl with it, on every page.
  • So the context sits beside HostNavigationContext in @object-ui/react. Both the plugin and the app-shell already depend on that package, so neither gains a dependency, and plugin-map still does not depend on app-shell. plugin-map's public surface is unchanged. @object-ui/react gains three exports: the context, the provider and the hook.

No spec key and no Setup setting were added (ruling A on #26001).

Tests

Pinned in ObjectMap.deploymentStyle-26163.test.tsx, driven through HostMapStyleProvider:

  • env set and no view style: the deployment style draws. Covered for the declared map block and for the flat ListView form.
  • env unset: demotiles. Covered both with a provider that gives no style and with no provider at all.
  • the view's own mapStyle wins, and so does map.style.
  • a failed deployment style gets the deployment notice, and a failed view style still gets the view notice.

ConsoleShell.mapStyle-26163.test.tsx checks that the console supplies the served value, and supplies nothing when the runtime serves no mapStyleUrl. runtime-config.test.ts gains a mapStyleUrl block covering read, absent, empty, whitespace, non-string, nested under branding, and withdrawn.

Red first, at the pre-change ObjectMap.tsx (10e80921) with the tests in place, under the verify lock:

× env set, no view style: draws the deployment style
× env set, no view style, flat-form config: draws the deployment style
× a failed deployment style names the deployment style, not the public default tiles
Tests  3 failed | 62 passed (65)

After the restore, the file matched its HEAD blob (git diff HEAD empty), and the green leg read Tests 65 passed (65). The env-unset and view-wins cases pass on both legs, because they pin behaviour that already existed.

Ablation of the Console injection: replacing styleUrl={getRuntimeConfig().mapStyleUrl} with styleUrl={undefined} turns hands the served mapStyleUrl to every renderer below it red (1 failed, 1 passed). After the restore, the file's hash matched HEAD.

Local verification at head 3f5e3446

These were run after merging origin/main (merge commit 10e1f91a), under scripts/pm/os-verify-lock.sh:

  • Tests: pnpm exec vitest run packages/plugin-map/ packages/i18n/ packages/react/src/context plus the three ConsoleShell tests (hostNavigation, mapStyle-26163, notifications), runtime-config.test.ts, ObjectView.mapFlatten.test.tsx and InterfaceListPage.mapConfig.test.tsx. Result: Test Files 149 passed (149), Tests 1862 passed, 13 skipped.
  • pnpm run type-check in plugin-map, react, i18n and app-shell: all exit 0 with 0 TS errors. This was run after turbo run build --filter='@object-ui/app-shell^...', which completed 64 of 64 tasks.
  • node scripts/gen-sdui-manifest-node.mjs re-recorded i18n, plugin-map and react, and the artefact sha256 did not change. node scripts/check-sdui-manifest.mjs exits 0.
  • eslint on the changed files: 0 errors (warnings only, of the same kinds the neighbouring files already carry). pnpm --dir ui run check:new-line-citations: 0 new citations.
  • node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 45 commands. 44 exited 0. pnpm check:type-check-debt is NOT MEASURED: it exited 3 (PREREQUISITE NOT MET) because its closure build timed out in the shared verify-lock queue, so CI's run of it is the reading. --ran reconciliation: 45 derived, 44 run, 1 NOT-MEASURED, 0 UNRUN.
  • Not run locally: the full app-shell suite and the repo-wide lint. CI runs both.

Acceptance notes

  • The object-map mapStyle input description is the spec row's describe, verbatim: "overriding the public demo tiles". With a deployment default it now overrides that too. The text lives in @objectstack/spec, outside this card, so it was left as is. The README and docs rows are updated.
  • docs/qa/platform-checklist/RUNNER.md records a QA reading that the map uses demotiles unless the view declares a style. That reading is historical, tied to its pin, and was left as is.
  • The default-style notice still tells the reader to ask an administrator to "set a map style for this view". That remedy remains valid, and setting OS_CONSOLE_MAP_STYLE_URL is now a second one. The translated text was left unchanged.

Generated by Claude Code

Adds HostMapStyleContext to @object-ui/react, the seam the Console uses
to hand the deployment's default map style to the lazily loaded map.

Claude-Session: https://claude.ai/code/session_01SMps7wq7rBTk53e8KTSEup
Co-authored-by: Claude <noreply@anthropic.com>
… map renderer

Also adds the element.map.styleFailedDeployment notice in all ten packs.

Claude-Session: https://claude.ai/code/session_01SMps7wq7rBTk53e8KTSEup
Co-authored-by: Claude <noreply@anthropic.com>
…demo style

A map view with no style of its own reads the host's style through
useHostMapStyle(), and a failed deployment style gets its own notice.

Claude-Session: https://claude.ai/code/session_01SMps7wq7rBTk53e8KTSEup
Co-authored-by: Claude <noreply@anthropic.com>
…p-style-runtime-fallback

# Conflicts:
#	scripts/sdui-manifest.sources/i18n.json
#	scripts/sdui-manifest.sources/react.json
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

ACCEPT · seat 2 · 2026-10-26T21:12Z · PR #26326 head 3f5e3446 (#26163)

check reading
scope 24 files, +438/−25: plugin-map/ObjectMap.tsx, a new HostMapStyleProvider / useHostMapStyle in @object-ui/react (beside HostNavigationContext), app-shell runtime-config.ts (mapStyleUrl?) and ConsoleShell.tsx (the injection), one new key element.map.styleFailedDeployment in all ten packs, README + docs page, three sources records (i18n, plugin-map, react), root .changeset/
order the view's own mapStyle / map.style → runtime-config mapStyleUrl → DEFAULT_MAP_STYLE; the failure notice names the style that actually failed
seam a context in @object-ui/react: a prop cannot reach a ComponentRegistry renderer, and a provider exported from plugin-map would pull maplibre-gl into every page through registerLazy. plugin-map stays off app-shell, its exports unchanged. Accepted
deviation react.json and one i18n key beyond the claim's surface: needed by the seam and by a notice that would otherwise blame the demo tiles. Accepted
red first / ablation ObjectMap.tsx reverted: 3 red (both operator-style cases and the deployment notice); injected value set to undefined: the ConsoleShell supply pin red
tests 149 files / 1862 tests green after the main merge; type-check 0 errors in plugin-map, react, i18n, app-shell
gates 45 derived, 44 run exit 0; check:type-check-debt NOT MEASURED locally (lock)
governance NOT governed, 463 lines

Open question: the spec's mapStyle row wording ("overriding the public demo tiles") stays as it is; the spec is outside this card.

Not armed yet: the PR is dirty, and it is on the i18n line behind #26055. Once #26055 has MERGED it gets a patch round (merge main, take main's records, re-record i18n / plugin-map / react under the lock, check-sdui-manifest, Console build), then lands.

…p-style-runtime-fallback

Conflicts resolved: scripts/sdui-manifest.sources/i18n.json and
react.json taken from main (re-recorded in the next commit). Locale
packs and runtime-config.ts auto-merged with both sides' keys.

Claude-Session: https://claude.ai/code/session_01SMps7wq7rBTk53e8KTSEup
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling labels Oct 26, 2026
…p-style-runtime-fallback

Conflict resolved: scripts/sdui-manifest.sources/react.json taken from
main (re-recorded in the next commit).

Claude-Session: https://claude.ai/code/session_01SMps7wq7rBTk53e8KTSEup
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

维护者速读

改了什么:地图视图没有自带样式时,先画部署级默认地图样式(运营设置的 OS_CONSOLE_MAP_STYLE_URL,经 runtime-config 的 mapStyleUrl 下发),没有再退回公共演示瓦片;该样式加载失败时,提示语点名“本部署的默认样式”,不再误指公共瓦片。
为什么改:服务端已下发 mapStyleUrl,但前端从不读取,运营配置了默认样式也不生效,所有未设样式的地图仍画限流、无可用性保证的演示瓦片(#26163)。
风险与回滚:只在部署设置了该变量且视图未自带样式时改变所见,视图自带样式照旧优先;无 spec 键、无数据改动;回滚即撤销本 PR,地图回到演示瓦片。
先看:ui/packages/plugin-map/src/ObjectMap.tsx(样式取值顺序 mapStyleOwner / drawnMapStyle 与失败提示三分支)→ ui/packages/app-shell/src/console/ConsoleShell.tsx(HostMapStyleProvider 挂载点)→ ui/packages/react/src/context/HostMapStyleContext.tsx。
两分钟验证:在 ui/ 下运行 pnpm exec vitest run packages/plugin-map/src/ObjectMap.deploymentStyle-26163.test.tsx,预期全部通过(设了部署样式画部署样式、未设画演示瓦片、视图样式优先、失败提示点名部署样式)。
需要你做的:无,席位落地。
席位意见:ACCEPT。行为与此前席位 ACCEPT 相同;此后三轮只合 main、重录 i18n/react 记录;CI 全绿。PR 正文里「Local verification at head 3f5e3446」一节已过时,以本核对为准。

席位核对

seat 2 · 2026-10-27T01:21Z · head 3d6619f2 (#26163)

item reading
form 24 files, +438/−25: plugin-map/ObjectMap.tsx style order and failure line, react HostMapStyleContext, app-shell ConsoleShell.tsx provider + runtime-config.ts mapStyleUrl, one element.map.styleFailedDeployment line per locale pack, pins, docs, sources/i18n.json + react.json + plugin-map.json, root .changeset/
premise measured earlier seat-2 ACCEPT stands on the behaviour; patch rounds merged main aec5f7b3 and 6390fe52 (#26274) with merge commits, took main's records, re-recorded; diff against main is the PR's own files only; locale packs and runtime-config.ts keep both sides
gates (check-runs on 3d6619f2) 61 runs: 54 success, 7 skipped, 0 failed. Local at this head: Console build, type-check of react / plugin-map / app-shell / i18n, 151 files / 1883 tests; check-sdui-manifest exit 0; 45 of 45 derived gates exit 0 (incl. check:type-check-debt)
accepted deviations none new
out of scope none
landing NOT governed (check-governed-merges --pr 26326: 463 lines, no hit path); git merge-tree against origin/main clean; no main change to i18n, react or plugin-map or their records since 6390fe52. Next on react: seat 1's #26190

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 27, 2026 01:22
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge October 27, 2026 01:22
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 27, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 27, 2026
…p-style-runtime-fallback

# Conflicts:
#	scripts/sdui-manifest.sources/i18n.json
#	scripts/sdui-manifest.sources/plugin-map.json
#	scripts/sdui-manifest.sources/react.json
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

维护者速读

改了什么:地图视图没有自带样式时,先画部署级默认地图样式(运营设置的 OS_CONSOLE_MAP_STYLE_URL,经 runtime-config 的 mapStyleUrl 下发),没有再退回公共演示瓦片;该样式加载失败时,提示语点名“本部署的默认样式”,不再误指公共瓦片。
为什么改:服务端已下发 mapStyleUrl,但前端从不读取,运营配置了默认样式也不生效,所有未设样式的地图仍画限流、无可用性保证的演示瓦片(#26163)。
风险与回滚:只在部署设置了该变量且视图未自带样式时改变所见,视图自带样式照旧优先;无 spec 键、无数据改动;回滚即撤销本 PR,地图回到演示瓦片。
先看:ui/packages/plugin-map/src/ObjectMap.tsx(样式取值顺序 mapStyleOwner / drawnMapStyle 与失败提示三分支)→ ui/packages/app-shell/src/console/ConsoleShell.tsx(HostMapStyleProvider 挂载点)→ ui/packages/react/src/context/HostMapStyleContext.tsx。
两分钟验证:在 ui/ 下运行 pnpm exec vitest run packages/plugin-map/src/ObjectMap.deploymentStyle-26163.test.tsx,预期全部通过(设了部署样式画部署样式、未设画演示瓦片、视图样式优先、失败提示点名部署样式)。
需要你做的:无,席位落地。
席位意见:ACCEPT。行为与此前席位 ACCEPT 相同;此后三轮只合 main、删除已退役的按包记录;CI 全绿。PR 正文里「Local verification at head 3f5e3446」一节已过时,以本核对为准。

席位核对

seat 2 · 2026-10-27T04:16Z · head 4d29020b (#26163)

item reading
form 21 files, +435/−22: plugin-map/ObjectMap.tsx style order and failure line, react HostMapStyleContext, app-shell ConsoleShell.tsx provider + runtime-config.ts mapStyleUrl, one element.map.styleFailedDeployment line per locale pack, pins, docs, root .changeset/
premise measured earlier seat-2 ACCEPT stands on the behaviour; patch rounds merged main aec5f7b3, 6390fe52 (#26274) and abb90460 (#26367, records retired: git rm) with merge commits; no record file left; diff against main is the PR's own files only; locale packs and runtime-config.ts keep both sides
gates (check-runs on 4d29020b) 54 runs: 45 success, 9 skipped, 0 failed. Local at this head: dependency build, type-check of react / plugin-map / app-shell / i18n, the three pins (69 tests), plugin-map + react context 58 files / 438 tests; check-sdui-manifest exit 0; 35 of 35 derived gates exit 0. At 3d6619f2 also Console build and 151 files / 1883 tests
accepted deviations none new
out of scope none
landing NOT governed (check-governed-merges --pr 26326: 457 lines, no hit path); git merge-tree against origin/main clean; the per-package lines are retired (#26367)

@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 27, 2026
Merged via the queue into main with commit 9f16f16 Oct 27, 2026
54 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-26163-map-style-runtime-fallback branch October 27, 2026 04:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

map view: plugin-map reads the deployment's default style (runtime-config mapStyleUrl) before falling back to demotiles (the ui half of #26001)

2 participants