Skip to content

fix(map): resolve triple .find() redundancy and support dynamic themes#90

Closed
Ayush-delta wants to merge 1 commit into
data-umbrella:mainfrom
Ayush-delta:fix/eventmap-tech-debt
Closed

fix(map): resolve triple .find() redundancy and support dynamic themes#90
Ayush-delta wants to merge 1 commit into
data-umbrella:mainfrom
Ayush-delta:fix/eventmap-tech-debt

Conversation

@Ayush-delta
Copy link
Copy Markdown
Contributor

Pull Request description

  • This PR resolves multiple interconnected technical debt and UX bugs located within EventMap.jsx to significantly improve reliability, performance, and UI responsiveness:
  1. Performant Centering: Resolved a redundant array search which iterated .find three consecutive times to pull the map's initial [lat, lng] baseline point.
  2. Synchronized Tile Theme: EventMap was not previously aware of App.jsx's light/dark mode preference. It now receives the theme prop and seamlessly switches base_maps.cartocdn requests between dark_all and light_all.
  3. Harmonized Popup Styling Tokens: Swept away manually hardcoded HEX colors (feat: debounce search input to improve performance #111, #333, #555, #7c5cfc) inside the map's inline Popup elements in favor of established design-system variables (var(--text-primary), var(--accent-primary)); directly allowing the light theme to correctly colorize map nodes.

How to test these changes

• * run $ npm run dev
• open the web browser to http://localhost:5173/du-event-board/
• Toggle the light/dark mode icon switcher at the top of the header. The map tile layer should instantly switch base patterns from dark to light.
• Select the "Map" layout, then click on any localized event on the map during "light" mode. It will correctly yield inverted pop-up information boxes instead of static dark overlays.

Pull Request checklists

This PR is a:

  • bug-fix
  • new feature
  • maintenance

About this PR:

  • it includes tests.
  • the tests are executed on CI.
  • pre-commit hooks were executed locally.
  • this PR requires a project documentation update.

Author's checklist:

  • I have reviewed the changes and it contains no misspelling.
  • The code is well commented, especially in the parts that contain more
    complexity.
  • New and old tests passed locally.

Additional information
Here is a view of the newly synchronized Light Theme map tiles rendering properly, with unified CSS variables enforcing crisp readability against the Popup nodes:
changed map

@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 27, 2026

Deploy Preview for dueventboard ready!

Name Link
🔨 Latest commit 86ece74
🔍 Latest deploy log https://app.netlify.com/projects/dueventboard/deploys/69c66e9c46a63f00083eaa04
😎 Deploy Preview https://deploy-preview-90--dueventboard.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@Ayush-delta
Copy link
Copy Markdown
Contributor Author

@yuvimittal , I’ve opened this PR resolve triple .find() redundancy and support dynamic themes.

Would appreciate it if you could take a look when you have time. Thanks!

@sanvishukla
Copy link
Copy Markdown
Contributor

@Ayush-delta, Hi I have already worked on correcting the theme in the map view in PR #63.

@Ayush-delta Ayush-delta deleted the fix/eventmap-tech-debt branch March 27, 2026 14:26
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.

2 participants