Skip to content

fix: Dashboard map respects Map Pin Style setting (#3364)#3381

Merged
Yeraze merged 1 commit into
mainfrom
fix/3364-dashboard-map-pin-style
Jun 8, 2026
Merged

fix: Dashboard map respects Map Pin Style setting (#3364)#3381
Yeraze merged 1 commit into
mainfrom
fix/3364-dashboard-map-pin-style

Conversation

@Yeraze

@Yeraze Yeraze commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Summary

The Dashboard ("Unified") map ignored the Map Pin Style setting and always rendered nodes as the default MeshMonitor pins, regardless of what the user selected (e.g. "Official Meshtastic circles"). This was inconsistent with every other live map view. The Dashboard map now reads the configured pin style and forwards it, so node markers honor the setting like NodesTab and the Map Analysis workspace already do.

Changes

  • src/components/Dashboard/DashboardMap.tsx: import useSettings, read mapPinStyle, and pass pinStyle: mapPinStyle into the createNodeIcon(...) marker call (it previously omitted pinStyle, defaulting to 'meshmonitor').
  • src/components/Dashboard/DashboardMap.test.tsx: add useSettings to the SettingsContext mock and add a regression test asserting the configured pin style is forwarded to createNodeIcon.

Issues Resolved

Fixes #3364

Documentation Updates

No documentation changes needed — this restores already-documented Map Pin Style behavior on the Dashboard map.

Testing

  • Unit tests pass (6154 tests, 0 failures)
  • TypeScript compiles cleanly
  • Manually verified in the dev container: switching Map Pin Style to "Official Meshtastic circles" now updates the Dashboard map markers
  • Reviewer: set Settings → Map Pin Style to a non-pin style, open the Dashboard, confirm markers match the selected style

🤖 Generated with Claude Code

The Dashboard/Unified Map called createNodeIcon() without a pinStyle,
so it always fell back to the default 'meshmonitor' pin markers and
ignored the user's configured Map Pin Style. Read mapPinStyle from
useSettings() and forward it, matching NodesTab and MapAnalysis.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

Claude encountered an error —— View job


I'll analyze this and get back to you.

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

Claude finished @Yeraze's task —— View job


Code Review Complete

Reviewing PR #3381 for code quality, potential bugs, performance, security, and test coverage.

Todo List:

  • Read and analyze changed files
  • Review implementation quality and best practices
  • Check for potential bugs or issues
  • Evaluate performance considerations
  • Assess security concerns
  • Review test coverage adequacy
  • Provide comprehensive feedback

Review Summary

This is a high-quality, focused fix that properly addresses the inconsistency in Map Pin Style settings across different map views. The implementation is solid and follows the existing codebase patterns well.

✅ Positive Aspects

  1. Minimal, targeted change: Only touches what's necessary to fix the specific issue
  2. Consistent with existing patterns: The fix mirrors exactly how other components (e.g., NodesTab.tsx:1584) already handle pinStyle: mapPinStyle
  3. Excellent test coverage: Includes a regression test that specifically validates the pin style is forwarded correctly
  4. Type safety: Leverages existing TypeScript interfaces with no type issues
  5. Performance neutral: No performance impact - just passing an existing setting through

🔍 Technical Analysis

Code Quality & Best Practices

  • Clean imports: Properly imports useSettings from the established context
  • Consistent parameter passing: Uses the same pattern as other map components for pinStyle
  • Follows component conventions: Maintains the established structure of the createNodeIcon call

Implementation Details

The fix is implemented correctly at DashboardMap.tsx:306:

const icon = createNodeIcon({
  // ... existing params
  pinStyle: mapPinStyle,  // ✅ This was missing before
});

This matches the pattern in NodesTab.tsx:1587 and other map components.

Test Coverage

The regression test at DashboardMap.test.tsx:197-207 is well-designed:

🚫 No Issues Found

  • No bugs detected: Implementation is straightforward and follows established patterns
  • No security concerns: Simple UI setting propagation with no attack vectors
  • No performance issues: Zero performance impact
  • No type safety issues: Uses existing well-typed interfaces

📋 Minor Observations

  1. Mock consistency: The test properly mocks useSettings to return { mapPinStyle: 'official' }, which aligns with how other components are tested
  2. Edge case coverage: The existing test suite already covers various node filtering scenarios, so this change integrates well
  3. Documentation: The PR description accurately describes both the problem and the solution

🎯 Final Assessment

This is an exemplary small fix that:

  • Addresses the root cause precisely
  • Maintains code quality standards
  • Includes appropriate test coverage
  • Has zero negative side effects
  • Follows established codebase patterns

Recommendation: ✅ Approve - This change is ready to merge.

@Yeraze Yeraze merged commit 35fbcc9 into main Jun 8, 2026
19 of 20 checks passed
@Yeraze Yeraze deleted the fix/3364-dashboard-map-pin-style branch June 8, 2026 17:22
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: Unified Map ignores Map Pin Style setting, always shows pins

1 participant