Skip to content

fix(map): wire activeStyleJson into MapAnalysis and MeshCore BaseMap consumers - #4376

Merged
Yeraze merged 1 commit into
mainfrom
claude/vibrant-volta-onuajf
Jul 28, 2026
Merged

fix(map): wire activeStyleJson into MapAnalysis and MeshCore BaseMap consumers#4376
Yeraze merged 1 commit into
mainfrom
claude/vibrant-volta-onuajf

Conversation

@Yeraze

@Yeraze Yeraze commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #4374.

#4360 lifted activeStyleJson into SettingsContext and wired it into DashboardMap.tsx/NodesTab.tsx, but two more <BaseMap> consumers were never updated to consume it, so a custom Map Style silently never applied on those two surfaces:

  • src/components/MapAnalysis/MapAnalysisCanvas.tsxactiveStyleJson wasn't destructured from useSettings(), and its <BaseMap> call had no styleJson prop.
  • src/components/MeshCore/MeshCoreMap.tsx — same gap.

Both get the same two-line fix DashboardMap.tsx already received: destructure activeStyleJson and pass styleJson={activeStyleJson ?? undefined} into the <BaseMap> call.

Per the issue, EmbedMap.tsx is intentionally excluded — it has no SettingsProvider in its bundle (documented in an existing comment at EmbedMap.tsx:258-261), so activeStyleJson isn't reachable there the same way; that would need a separate mechanism and is out of scope here.

Test plan

  • npx tsc --noEmit — clean
  • npm run lint:ci — no in-repo FAIL lines
  • Targeted suites: MapAnalysisCanvas.test.tsx + MeshCoreMap.test.tsx — 24/24 passed
  • Full Vitest suite: 10965 passed, 9 failed, 770 skipped. The 9 failures are all in src/server/mqttBrokerManager.test.ts ("zero-hop injection" protobuf encode errors), unrelated to this change — confirmed pre-existing by running the same file against origin/main (this branch is main + this 2-file diff, git diff origin/main --stat shows only the two map files touched).
  • Not browser-validated in this session — no dev container was deployed. Please verify visually that a custom Map Style now applies on the Map Analysis and MeshCore map views before merging.

-- Authored by Roger 🤓


Generated by Claude Code

…consumers

#4360 lifted activeStyleJson into SettingsContext and wired it into
DashboardMap/NodesTab, but MapAnalysisCanvas and MeshCoreMap never
destructured it or passed styleJson to their <BaseMap> calls, so a
custom Map Style silently never applied on those two surfaces.

Closes #4374

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MB93JJ3aT85e6C7cvnGYsk
@github-actions

github-actions Bot commented Jul 28, 2026

Copy link
Copy Markdown

Claude finished @Yeraze's task —— View job


PR Review: fix(map): wire activeStyleJson into MapAnalysis and MeshCore BaseMap consumers

Tasks:

  • Gather context and understand the PR
  • Read changed files and reference implementations
  • Analyze code quality, bugs, performance, security
  • Post review feedback

Summary

This is a clean, minimal, targeted fix. Both changes are correct and follow the established pattern exactly.

MapAnalysisCanvas.tsx

src/components/MapAnalysis/MapAnalysisCanvas.tsx:49activeStyleJson is now properly destructured from useSettings().

src/components/MapAnalysis/MapAnalysisCanvas.tsx:215styleJson={activeStyleJson ?? undefined} is passed to <BaseMap>, matching the pattern in DashboardMap.tsx:631 and NodesTab.tsx:2733.

MeshCoreMap.tsx

src/components/MeshCore/MeshCoreMap.tsx:95activeStyleJson is added to the useSettings() destructure alongside the existing mapTileset, customTilesets, setMapTileset.

src/components/MeshCore/MeshCoreMap.tsx:483styleJson={activeStyleJson ?? undefined} is passed to the <BaseMap>. Correct placement alongside the other tileset props.

Observations

  • Pattern consistency: Both fixes are identical to what DashboardMap.tsx and NodesTab.tsx already do. No deviation.
  • Null-coalescing: The ?? undefined pattern is correct — activeStyleJson is Record<string, unknown> | null in context, and BaseMap expects Record<string, unknown> | undefined. The coercion is necessary and correct.
  • 3D branch (MapAnalysisCanvas): The effectiveViewMode === '3d' branch (Base3DMap, line 183-206) intentionally does not receive styleJson — the 3D basemap resolver (resolve3DBasemap) handles style separately. This is correct; the fix only needed to touch the 2D <BaseMap> path.
  • No scope creep: EmbedMap.tsx is correctly excluded per the documented reasoning (no SettingsProvider in its bundle, lines 258–261 comment). The PR description acknowledges this explicitly.
  • Test coverage: The targeted tests (24/24) and TypeScript clean build confirm the change is sound. The 9 pre-existing mqttBrokerManager failures are unrelated and verified against origin/main.

No Issues Found

The change is correct, minimal, and well-described. No bugs, security concerns, or performance issues introduced. Visual verification on both map surfaces before merging is reasonable given no dev container was available during authoring.


Yeraze commented Jul 28, 2026

Copy link
Copy Markdown
Owner Author

Correction to the PR description's test plan: on a second full run with complete output captured, the local failures are actually 12 test files / 9 tests (my first summary was based on a truncated tail of the first run and only showed mqttBrokerManager.test.ts).

Root cause confirmed: git submodule status shows the protobufs submodule isn't checked out in this session's sandbox (-ba16bfc... prefix = uninitialized), and every failure traces to ENOENT: .../protobufs/meshtastic/mesh.proto. That's a missing-submodule gap in this local environment, not something introduced by this change — CI performs a full clone with submodules, and this PR's own Test Suite (22.x/24.x/25.x) checks will be the authoritative signal. Flagging for the record rather than leaving the earlier, narrower claim uncorrected.

-- Authored by Roger 🤓


Generated by Claude Code

@Yeraze
Yeraze merged commit d538faa into main Jul 28, 2026
15 checks passed
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.

[BUG] Map Style fix (#4360) missed two more BaseMap consumers: Map Analysis and MeshCore maps

2 participants