Skip to content

feat: add Tile Selection and Legend visibility toggles to Map Features panel#2945

Merged
Yeraze merged 2 commits intomainfrom
feature/fewer-map-toolbars
May 9, 2026
Merged

feat: add Tile Selection and Legend visibility toggles to Map Features panel#2945
Yeraze merged 2 commits intomainfrom
feature/fewer-map-toolbars

Conversation

@Yeraze
Copy link
Copy Markdown
Owner

@Yeraze Yeraze commented May 9, 2026

Summary

  • Adds two checkboxes to the Map Features panel: Tile Selection and Legend, both default OFF (hidden) on first load.
  • Visibility state persists via localStorage keys meshmonitor-showTileSelector and meshmonitor-showLegend, matching the existing isMapControlsCollapsed pattern.
  • Wraps <MapLegend> and <TilesetSelector> rendering with the new toggles.

Why localStorage

Used localStorage rather than the server map-preferences API to keep this purely UI-only — adding DB columns/migration for two visibility toggles felt out of scope.

Test plan

  • Fresh load: both Tile Selection and Legend hidden by default.
  • Toggling each checkbox shows/hides the corresponding control.
  • Refresh page — toggle states persist.
  • npx tsc --noEmit clean (verified locally).

Yeraze and others added 2 commits May 9, 2026 13:19
Adds meshmon.canadaverse.org to the community Site Gallery, noting
its /analysis page with extended mesh data analytics.

Fixes #2941
…s panel

Both checkboxes default to OFF (hidden) on first load, matching the requested
behavior. State persists via localStorage under 'meshmonitor-showTileSelector'
and 'meshmonitor-showLegend' keys, consistent with how isMapControlsCollapsed
and other UI-only map prefs are stored.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

Claude finished @Yeraze's task —— View job


PR Review Complete ✅

I've completed a thorough review of this pull request. Here's my comprehensive analysis:

Todo List:

  • Read and analyze changed files
  • Review code quality and React patterns
  • Check localStorage implementation
  • Evaluate security and performance considerations
  • Assess test coverage needs
  • Provide comprehensive feedback

Code Review Feedback

Strengths

  1. Consistent Implementation: The implementation follows existing patterns in the codebase perfectly

    • Uses the same localStorage pattern as isMapControlsCollapsed and showPacketMonitor
    • Follows the same React hooks pattern with useState initializer and useEffect for persistence
    • Uses consistent naming convention with meshmonitor- prefix
  2. Good Default Behavior: Both controls default to false (hidden), which is appropriate for a cleaner initial UI experience

  3. Proper Conditional Rendering: Both MapLegend and TilesetSelector are correctly wrapped with conditional rendering

  4. Clean Integration: The checkboxes are logically placed in the Map Features panel alongside other map controls

🔧 Code Quality

Good:

  • Clean, readable React patterns
  • Consistent with existing codebase style
  • No unnecessary complexity

Minor:

  • The localStorage key naming is slightly inconsistent within the same file. Some keys use the meshmonitor- prefix (meshmonitor-showTileSelector) while others don't (showPacketMonitor, isMapControlsCollapsed)

🚫 No Security Concerns

  • localStorage usage is safe for UI preferences
  • No user input validation needed for boolean toggles
  • No sensitive data involved

Performance Considerations

Good:

  • Minimal performance impact - only adds two boolean state variables
  • Conditional rendering prevents unnecessary component mounting when hidden
  • localStorage operations are minimal and only occur on state changes

Note:

  • The MapLegend and TilesetSelector components are now conditionally rendered, which could provide a small performance benefit when hidden

🧪 Test Coverage Assessment

Current State:

  • No existing tests found for NodesTab.tsx component
  • This follows the pattern of other localStorage-based UI preferences in the same file

Recommendations:

  • While not blocking for this PR, consider adding tests for:
    • localStorage persistence behavior
    • Conditional rendering of controls
    • Default state initialization

📝 Documentation

The PR description is clear and explains the rationale for using localStorage over server-side preferences, which is appropriate for these UI-only toggles.

🔍 Minor Suggestions

  1. Consistency: Consider standardizing localStorage keys across the file (either all with meshmonitor- prefix or none). However, this is not critical and could be addressed in a separate cleanup PR.

  2. Accessibility: The current implementation is accessible with proper label/input associations.

  3. Hardcoded Text: The labels "Show Tile Selection" and "Show Legend" are hardcoded. If internationalization is important, consider adding these to translation files.

Overall Assessment

This is a well-implemented, low-risk PR that adds useful functionality without introducing any significant issues. The code follows existing patterns, has minimal performance impact, and provides a good user experience improvement.

Recommendation: ✅ APPROVE

The implementation is solid and ready to merge. The localStorage approach is appropriate for these UI-only preferences, and the code quality matches the existing codebase standards.


@Yeraze Yeraze merged commit d380486 into main May 9, 2026
19 checks passed
@Yeraze Yeraze deleted the feature/fewer-map-toolbars branch May 9, 2026 18:48
Yeraze added a commit that referenced this pull request May 10, 2026
* chore(release): bump version to 4.3.0

Headline feature: Waypoints — per-source storage, map rendering,
and in-place authoring UI for Meshtastic WAYPOINT_APP pins.

Includes since 4.2.3:
- #2936/#2938 feat(waypoints): basic waypoint support
- #2942 feat(waypoints): authoring UI for create/edit/delete
- #2937 fix(auth): bootstrap first OIDC user as admin
- #2935 fix(traceroute): stop cascading IP-style across radio segments
- #2945 feat: Tile Selection / Legend visibility toggles in Map Features
- #2944 fix: correct channel encryption label for unencrypted/shorthand PSKs
- #2946 fix(mobile): mobile browser interface fixes
- #2948 fix: map tileset selection not applying on dashboard
- docs: new Waypoints feature page; 4.3 Highlights nav entry

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* docs: list Waypoints under regular Features instead of 4.3 Highlights

Per Randall: Waypoints should be documented like any other feature, not
called out in the nav as a "🆕 4.3 Highlights" section.

- Drop the "🆕 4.3 Highlights" entry from the top nav and the /features/
  sidebar; restore "🆕" on 4.2 Highlights as the most-recent callout
- Add Waypoints to the regular Features sidebar list (next to Embed Maps)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* docs: drop version-Highlights nav sections, fold entries into Features

Removes the "🆕 4.2 / 4.1 / 4.0 Highlights" callouts from both the top
nav and the /features/ sidebar. Their pages — Analysis & Reports, Map
Analysis, Multi-Source, Per-Source Permissions, Global Settings, Store
& Forward, Geofence Triggers — now live in the regular Features list,
slotted near topically-related entries (Multi-Source / permissions
near Settings; Geofence Triggers next to Automation; Map Analysis next
to Embed Maps; Analysis & Reports next to Analytics; etc.).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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.

1 participant