Repository navigation
Commit 9f16f16
feat(plugin-map): a map view with no style draws the deployment's default map style before demotiles (#26326)
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](https://claude.ai/code/session_01SMps7wq7rBTk53e8KTSEup)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 68901b0 commit 9f16f16
21 files changed
Lines changed: 435 additions & 22 deletions
File tree
- .changeset
- ui
- content/docs/plugins
- packages
- app-shell/src
- console
- __tests__
- i18n/src/locales
- plugin-map
- src
- react/src/context
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
| 161 | + | |
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
174 | 191 | | |
175 | 192 | | |
176 | 193 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| |||
162 | 163 | | |
163 | 164 | | |
164 | 165 | | |
165 | | - | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
166 | 175 | | |
167 | 176 | | |
168 | 177 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
283 | 320 | | |
284 | 321 | | |
285 | 322 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
319 | 319 | | |
320 | 320 | | |
321 | 321 | | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
322 | 336 | | |
323 | 337 | | |
324 | 338 | | |
| |||
441 | 455 | | |
442 | 456 | | |
443 | 457 | | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
444 | 464 | | |
445 | 465 | | |
446 | 466 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5101 | 5101 | | |
5102 | 5102 | | |
5103 | 5103 | | |
| 5104 | + | |
5104 | 5105 | | |
5105 | 5106 | | |
5106 | 5107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4639 | 4639 | | |
4640 | 4640 | | |
4641 | 4641 | | |
| 4642 | + | |
4642 | 4643 | | |
4643 | 4644 | | |
4644 | 4645 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5437 | 5437 | | |
5438 | 5438 | | |
5439 | 5439 | | |
5440 | | - | |
5441 | | - | |
5442 | | - | |
| 5440 | + | |
| 5441 | + | |
| 5442 | + | |
| 5443 | + | |
5443 | 5444 | | |
5444 | 5445 | | |
5445 | 5446 | | |
5446 | 5447 | | |
| 5448 | + | |
5447 | 5449 | | |
5448 | 5450 | | |
5449 | 5451 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4754 | 4754 | | |
4755 | 4755 | | |
4756 | 4756 | | |
| 4757 | + | |
4757 | 4758 | | |
4758 | 4759 | | |
4759 | 4760 | | |
| |||
0 commit comments