feat(search): 22291 select area when location chosen#1194
Conversation
WalkthroughA search result geometry highlighting feature is introduced. New atoms and constants manage highlighted geometries and layer settings. The Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant SearchBar
participant searchHighlightedGeometryAtom
participant MapLayer (Highlight)
participant SearchHighlightRenderer
User->>SearchBar: Hover over location result
SearchBar->>searchHighlightedGeometryAtom: setHighlightedGeometry(item.geometry)
searchHighlightedGeometryAtom->>MapLayer (Highlight): Notify of geometry change
MapLayer (Highlight)->>SearchHighlightRenderer: Render new highlighted geometry
User->>SearchBar: Mouse leaves result or menu closes
SearchBar->>searchHighlightedGeometryAtom: setHighlightedGeometry(empty)
searchHighlightedGeometryAtom->>MapLayer (Highlight): Notify of geometry change
MapLayer (Highlight)->>SearchHighlightRenderer: Clear highlight
User->>SearchBar: Click location result
SearchBar->>itemSelectAction: select item
itemSelectAction->>searchHighlightedGeometryAtom: setHighlightedGeometry(empty)
itemSelectAction->>focusedGeometryAtom: Set focused geometry (if present)
itemSelectAction->>focusOnGeometry: Focus map on geometry
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Bundle size diff
|
|
Preview environments for this PR:
These previews are automatically updated with each commit. Note: After a new deployment, it may take a few minutes for the changes to propagate and for caches to update. During this time, you might experience temporary loading issues or see an older version of the app. If the app fails to load, please wait a few minutes and try again. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1194 +/- ##
==========================================
+ Coverage 11.57% 11.98% +0.41%
==========================================
Files 720 728 +8
Lines 29639 29911 +272
Branches 1374 1402 +28
==========================================
+ Hits 3431 3586 +155
- Misses 25648 25766 +118
+ Partials 560 559 -1
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Bundle ReportChanges will increase total bundle size by 21.04kB (0.4%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: konturio/disaster-ninja-fe-esmAssets Changed:
Files in
|
There was a problem hiding this comment.
Actionable comments posted: 3
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (8)
src/features/search/atoms/highlightedGeometry.ts(1 hunks)src/features/search/componets/SearchBar/SearchBar.tsx(6 hunks)src/features/search/constants.ts(1 hunks)src/features/search/index.tsx(2 hunks)src/features/search/initSearchHighlightLayer.ts(1 hunks)src/features/search/readme.md(1 hunks)src/features/search/renderers/SearchHighlightRenderer.ts(1 hunks)src/features/search/searchLocationAtoms.ts(2 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: konturio/disaster-ninja-fe#0
File: AGENTS.md:0-0
Timestamp: 2025-07-24T13:49:18.225Z
Learning: Reference Fibery ticket in the PR description and headline.
src/features/search/readme.md (1)
Learnt from: CR
PR: konturio/disaster-ninja-fe#0
File: AGENTS.md:0-0
Timestamp: 2025-07-24T13:49:18.225Z
Learning: Applies to **/README.md : Every feature needs to have comprehensive up-to-date documentation in readme near it.
🧬 Code Graph Analysis (4)
src/features/search/renderers/SearchHighlightRenderer.ts (1)
src/features/boundary_selector/renderers/BoundarySelectorRenderer.ts (1)
BoundarySelectorRenderer(10-70)
src/features/search/atoms/highlightedGeometry.ts (1)
src/utils/geoJSON/helpers.ts (2)
FeatureCollection(4-10)Feature(12-26)
src/features/search/searchLocationAtoms.ts (2)
src/core/focused_geometry/model.ts (1)
focusedGeometryAtom(7-46)src/core/shared_state/currentMapPosition.ts (1)
focusOnGeometry(73-93)
src/features/search/index.tsx (1)
src/features/search/initSearchHighlightLayer.ts (1)
initSearchHighlightLayer(14-32)
🪛 markdownlint-cli2 (0.17.2)
src/features/search/readme.md
7-7: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
8-8: Lists should be surrounded by blank lines
(MD032, blanks-around-lists)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: deploy
- GitHub Check: test
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (14)
src/features/search/constants.ts (1)
1-3: LGTM! Consider making color configurable.The constants are well-named and follow conventions. The hardcoded black color works for the current requirement but consider making it theme-aware or configurable in the future for better accessibility.
src/features/search/atoms/highlightedGeometry.ts (1)
1-10: LGTM! Well-structured reactive atom.The atom is properly configured with appropriate GeoJSON types and sensible initialization. The union type provides flexibility for different geometry formats.
src/features/search/index.tsx (1)
10-10: LGTM! Import added correctly.src/features/search/renderers/SearchHighlightRenderer.ts (1)
1-3: LGTM! Clean inheritance pattern.The empty extension provides semantic separation while reusing proven functionality from
BoundarySelectorRenderer. This design allows for future search-specific customizations if needed.src/features/search/initSearchHighlightLayer.ts (2)
12-16: LGTM: Proper singleton pattern implementation.The initialization guard correctly prevents duplicate layer registration, which is essential for map layer management.
22-31: LGTM: Layer registration with proper configuration.The layer registration follows the established pattern with appropriate constants, renderer, and configuration. The use of template literals for source ID generation is consistent.
src/features/search/searchLocationAtoms.ts (2)
11-15: LGTM: Proper imports for geometry focusing functionality.The imports correctly bring in the required functions for both updating focused geometry state and camera positioning.
35-41: LGTM: Well-structured geometry focusing logic.The conditional check prevents errors when geometry is missing, and the dual operation approach is appropriate:
setFocusedGeometryupdates application state and triggers metricsfocusOnGeometryhandles camera positioningThe 'custom' source type properly categorizes user-selected search results.
src/features/search/componets/SearchBar/SearchBar.tsx (6)
4-4: LGTM: Added useEffect import for cleanup functionality.
19-21: LGTM: Proper imports for highlighting functionality.The imports correctly bring in the highlighted geometry atom and GeoJSON Feature type needed for the highlighting feature.
38-41: LGTM: Consistent action hook usage.The
useActionpattern follows the established codebase conventions for accessing atoms and actions.
53-57: LGTM: Proper cleanup on component unmount.The cleanup effect correctly clears highlighted geometry when the component unmounts, preventing stale highlights from persisting.
103-110: LGTM: Proper hover highlighting for location items.The mouse event handlers correctly:
- Check for geometry existence before highlighting
- Set geometry on mouseEnter and clear on mouseLeave
- Use proper GeoJSON FeatureCollection structure for clearing
128-137: Confirmation: MCDA item hover behavior is intentionalThe empty
FeatureCollectionin bothonMouseEnterandonMouseLeaveensures that MCDA “create analysis” items—which don’t have any associated geometry—clear any existing highlights. No changes are required if this matches the intended UX.• File: src/features/search/componets/SearchBar/SearchBar.tsx (lines 128–137)
• Handlers:onMouseEnter: () => setHighlightedGeometry({ type: 'FeatureCollection', features: [], }), onMouseLeave: () => setHighlightedGeometry({ type: 'FeatureCollection', features: [], }),
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
src/features/search/tests/highlightedAtom.test.ts(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: konturio/disaster-ninja-fe#0
File: AGENTS.md:0-0
Timestamp: 2025-07-24T13:49:18.225Z
Learning: Reference Fibery ticket in the PR description and headline.
src/features/search/tests/highlightedAtom.test.ts (2)
Learnt from: amurKontur
PR: #727
File: e2e/page-objects/helperBase.ts:0-0
Timestamp: 2024-06-10T19:32:46.895Z
Learning: The closeAtlasBanner method in the HelperBase class is covered by existing tests in e2e/popupPopulation.spec.ts, e2e/login.spec.ts, e2e/location.spec.ts, and e2e/auth.setup.ts.
Learnt from: amurKontur
PR: #727
File: playwright.config.ts:59-66
Timestamp: 2024-06-10T19:32:46.895Z
Learning: The webkit project configuration in playwright.config.ts is covered by tests that do not match the testIgnore patterns /WithUser/ and location.spec.ts.
🧬 Code Graph Analysis (1)
src/features/search/tests/highlightedAtom.test.ts (4)
src/core/store/store.ts (1)
store(7-7)e2e/fixtures/test-options.ts (1)
test(10-27)src/features/search/atoms/highlightedGeometry.ts (1)
searchHighlightedGeometryAtom(4-10)src/utils/geoJSON/helpers.ts (1)
Feature(12-26)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: deploy
- GitHub Check: test
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (2)
src/features/search/tests/highlightedAtom.test.ts (2)
1-4: LGTM!The imports are well-structured and include all necessary dependencies for testing the atom functionality.
6-8: LGTM!The store setup correctly creates an isolated test environment using Reatom's v3 context, which is the proper approach for unit testing atoms.
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
src/features/search/readme.md (1)
1-12: Fix markdown formatting and grammar issues.The documentation content is comprehensive and accurately describes the search feature functionality. However, there are formatting issues that should be addressed for better readability.
Apply this diff to fix the formatting issues:
# Search feature + This feature provides a search bar to find locations or MCDA analysis suggestions. Selected locations become the focused area on the map. -While hovering over location results the geometry is highlighted on the map with a black outline. +While hovering over location results, the geometry is highlighted on the map with a black outline. ## Main parts + -- `SearchBar` - UI component with dropdown results. -- `searchLocationAtoms.ts` - handles locations fetching and selection. -- `searchAtoms.ts` - aggregates MCDA and location results. -- `atoms/highlightedGeometry.ts` - stores geometry highlighted on hover. -- `initSearchHighlightLayer` - registers temporary map layer for hovered geometries. +- `SearchBar` – UI component with dropdown results. +- `searchLocationAtoms.ts` – handles locations fetching and selection. +- `searchAtoms.ts` – aggregates MCDA and location results. +- `atoms/highlightedGeometry.ts` – stores geometry highlighted on hover. +- `initSearchHighlightLayer` – registers temporary map layer for hovered geometries. +
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (4)
src/features/search/constants.ts(1 hunks)src/features/search/index.tsx(2 hunks)src/features/search/initSearchHighlightLayer.ts(1 hunks)src/features/search/readme.md(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: konturio/disaster-ninja-fe#0
File: AGENTS.md:0-0
Timestamp: 2025-07-24T13:49:18.225Z
Learning: Reference Fibery ticket in the PR description and headline.
src/features/search/readme.md (2)
Learnt from: CR
PR: konturio/disaster-ninja-fe#0
File: AGENTS.md:0-0
Timestamp: 2025-07-24T13:49:18.225Z
Learning: Applies to **/README.md : Every feature needs to have comprehensive up-to-date documentation in readme near it.
Learnt from: amurKontur
PR: #718
File: src/core/localization/extractLinkAndLabelFromMarkdown.ts:26-28
Timestamp: 2024-06-10T19:32:46.895Z
Learning: The extractLinkAndLabels function in src/core/localization/extractLinkAndLabelFromMarkdown.ts assumes the text node is always the first child of the link node, and this implementation is confirmed to be acceptable by user amurKontur.
🧬 Code Graph Analysis (2)
src/features/search/index.tsx (1)
src/features/search/initSearchHighlightLayer.ts (1)
initSearchHighlightLayer(13-70)
src/features/search/initSearchHighlightLayer.ts (5)
src/core/store/store.ts (1)
store(7-7)src/features/search/constants.ts (2)
SEARCH_HIGHLIGHT_LAYER_ID(1-1)SEARCH_HIGHLIGHT_COLOR(2-2)src/features/search/renderers/SearchHighlightRenderer.ts (1)
SearchHighlightRenderer(3-3)src/core/logical_layers/types/logicalLayer.ts (1)
LogicalLayerState(10-28)src/features/search/atoms/highlightedGeometry.ts (1)
searchHighlightedGeometryAtom(4-10)
🪛 LanguageTool
src/features/search/readme.md
[grammar] ~1-~1: Use correct spacing
Context: # Search feature This feature provides a search bar to fi...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~5-~5: Use a comma after introductory words or phrases
Context: ...n the map. While hovering over location results the geometry is highlighted on the map ...
(QB_NEW_EN_OTHER_ERROR_IDS_19)
[grammar] ~5-~5: Use correct spacing
Context: ... is highlighted on the map with a black outline. ## Main parts - SearchBar - UI component ...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~7-~7: Use hyphens correctly
Context: ... the map with a black outline. ## Main parts - SearchBar - UI component with dropdown results. - ...
(QB_NEW_EN_OTHER_ERROR_IDS_29)
[grammar] ~9-~9: There might be a problem here.
Context: ...down results. - searchLocationAtoms.ts - handles locations fetching and selection. - `searchAtoms....
(QB_NEW_EN_MERGED_MATCH)
[grammar] ~10-~10: Use correct spacing
Context: ...tching and selection. - searchAtoms.ts - aggregates MCDA and location results. -...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~11-~11: Use correct spacing
Context: ...esults. - atoms/highlightedGeometry.ts - stores geometry highlighted on hover. -...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~12-~12: Use correct spacing
Context: ...d on hover. - initSearchHighlightLayer - registers temporary map layer for hover...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
🪛 markdownlint-cli2 (0.17.2)
src/features/search/readme.md
7-7: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
8-8: Lists should be surrounded by blank lines
(MD032, blanks-around-lists)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: test
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (3)
src/features/search/constants.ts (1)
1-2: LGTM! Well-structured constants.The constants are appropriately named and centralized, following good practices for configuration management. The black color aligns with the documented behavior of highlighting geometries with a black outline.
src/features/search/index.tsx (1)
22-27: LGTM! Proper lifecycle management implemented.The useEffect correctly initializes the search highlight layer on mount and properly cleans it up on unmount by capturing and invoking the returned cleanup function. This addresses the previous review concern about missing cleanup logic.
src/features/search/initSearchHighlightLayer.ts (1)
13-70: LGTM! Well-implemented singleton pattern with proper lifecycle management.The implementation correctly handles:
- Singleton initialization to prevent duplicate layers
- Proper error handling when map is unavailable
- Reactive subscription to geometry changes with cleanup
- Complete renderer lifecycle management
The previous review concern about subscription cleanup has been properly addressed.
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
src/features/search/initSearchHighlightLayer.ts(1 hunks)src/features/search/tests/highlightedAtom.test.ts(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: konturio/disaster-ninja-fe#0
File: AGENTS.md:0-0
Timestamp: 2025-07-24T13:49:18.225Z
Learning: Reference Fibery ticket in the PR description and headline.
src/features/search/tests/highlightedAtom.test.ts (4)
Learnt from: amurKontur
PR: #727
File: e2e/page-objects/helperBase.ts:0-0
Timestamp: 2024-06-10T19:32:46.895Z
Learning: The closeAtlasBanner method in the HelperBase class is covered by existing tests in e2e/popupPopulation.spec.ts, e2e/login.spec.ts, e2e/location.spec.ts, and e2e/auth.setup.ts.
Learnt from: amurKontur
PR: #727
File: playwright.config.ts:59-66
Timestamp: 2024-06-10T19:32:46.895Z
Learning: The webkit project configuration in playwright.config.ts is covered by tests that do not match the testIgnore patterns /WithUser/ and location.spec.ts.
Learnt from: CR
PR: konturio/disaster-ninja-fe#0
File: AGENTS.md:0-0
Timestamp: 2025-07-24T13:49:18.225Z
Learning: Code test coverage is measured by codecov. Write useful tests to increase it and check key requirements to hold.
Learnt from: amurKontur
PR: #727
File: e2e/page-objects/helperBase.ts:52-65
Timestamp: 2024-06-10T19:32:46.895Z
Learning: The getTextsFromAllLocators method in e2e/page-objects/helperBase.ts is used within the test logic in e2e/page-objects/mapPage.ts, confirming its coverage by tests.
🧬 Code Graph Analysis (2)
src/features/search/initSearchHighlightLayer.ts (6)
src/core/store/store.ts (1)
store(7-7)src/features/search/constants.ts (2)
SEARCH_HIGHLIGHT_LAYER_ID(1-1)SEARCH_HIGHLIGHT_COLOR(2-2)src/features/search/renderers/SearchHighlightRenderer.ts (1)
SearchHighlightRenderer(3-3)src/core/logical_layers/types/logicalLayer.ts (1)
LogicalLayerState(10-28)src/features/search/atoms/highlightedGeometry.ts (1)
searchHighlightedGeometryAtom(4-10)src/utils/geoJSON/helpers.ts (2)
FeatureCollection(4-10)Feature(12-26)
src/features/search/tests/highlightedAtom.test.ts (4)
src/core/store/store.ts (1)
store(7-7)e2e/fixtures/test-options.ts (1)
test(10-27)src/features/search/atoms/highlightedGeometry.ts (1)
searchHighlightedGeometryAtom(4-10)src/utils/geoJSON/helpers.ts (2)
Feature(12-26)FeatureCollection(4-10)
🔇 Additional comments (3)
src/features/search/tests/highlightedAtom.test.ts (1)
10-99: Excellent test coverage addressing previous feedback.The test suite now comprehensively covers all the scenarios mentioned in the previous review, including different geometry types (Point, Polygon, LineString), FeatureCollections with multiple features, empty collections, and null values. This provides robust verification of the atom's behavior across all supported input scenarios.
src/features/search/initSearchHighlightLayer.ts (2)
51-71: Well-implemented subscription management and cleanup.The subscription to
searchHighlightedGeometryAtomnow properly captures the unsubscribe function and includes it in the cleanup mechanism. This addresses the memory leak concern from previous reviews by ensuring the subscription is properly torn down when the layer is destroyed.
14-19: Good singleton pattern implementation with proper guard conditions.The function correctly prevents multiple initializations and handles the case where no map is available. The early return of an existing cleanup function maintains the singleton behavior effectively.
There was a problem hiding this comment.
Not sure if the black highlighting is needed because you will rarely see it on the map. And if you show black line after selection, you need to show the legend. It's inconsistent with the admin boundary selector which does not show the black contour after selection.
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (4)
src/features/search/componets/SearchBar/SearchBar.tsx(6 hunks)src/features/search/constants.ts(1 hunks)src/features/search/searchAtoms.ts(2 hunks)src/features/search/tests/searchAtoms.test.ts(1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
PR: konturio/disaster-ninja-fe#0
File: AGENTS.md:0-0
Timestamp: 2025-07-24T13:49:18.225Z
Learning: Reference Fibery ticket in the PR description and headline.
📚 Learning: the `closeatlasbanner` method in the `helperbase` class is covered by existing tests in `e2e/popuppo...
Learnt from: amurKontur
PR: konturio/disaster-ninja-fe#727
File: e2e/page-objects/helperBase.ts:0-0
Timestamp: 2024-06-10T19:32:46.895Z
Learning: The `closeAtlasBanner` method in the `HelperBase` class is covered by existing tests in `e2e/popupPopulation.spec.ts`, `e2e/login.spec.ts`, `e2e/location.spec.ts`, and `e2e/auth.setup.ts`.
Applied to files:
src/features/search/tests/searchAtoms.test.ts
📚 Learning: the `gettextsfromalllocators` method in `e2e/page-objects/helperbase.ts` is used within the test log...
Learnt from: amurKontur
PR: konturio/disaster-ninja-fe#727
File: e2e/page-objects/helperBase.ts:52-65
Timestamp: 2024-06-10T19:32:46.895Z
Learning: The `getTextsFromAllLocators` method in `e2e/page-objects/helperBase.ts` is used within the test logic in `e2e/page-objects/mapPage.ts`, confirming its coverage by tests.
Applied to files:
src/features/search/tests/searchAtoms.test.ts
📚 Learning: the `webkit` project configuration in `playwright.config.ts` is covered by tests that do not match t...
Learnt from: amurKontur
PR: konturio/disaster-ninja-fe#727
File: playwright.config.ts:59-66
Timestamp: 2024-06-10T19:32:46.895Z
Learning: The `webkit` project configuration in `playwright.config.ts` is covered by tests that do not match the `testIgnore` patterns `/WithUser/` and `location.spec.ts`.
Applied to files:
src/features/search/tests/searchAtoms.test.ts
🧬 Code Graph Analysis (4)
src/features/search/constants.ts (1)
src/utils/geoJSON/helpers.ts (1)
FeatureCollection(4-10)
src/features/search/searchAtoms.ts (2)
src/features/search/atoms/highlightedGeometry.ts (1)
searchHighlightedGeometryAtom(4-10)src/features/search/constants.ts (1)
EMPTY_HIGHLIGHT(5-8)
src/features/search/tests/searchAtoms.test.ts (3)
src/core/store/store.ts (1)
store(7-7)src/features/search/atoms/highlightedGeometry.ts (1)
searchHighlightedGeometryAtom(4-10)src/features/search/searchAtoms.ts (1)
itemSelectAction(62-69)
src/features/search/componets/SearchBar/SearchBar.tsx (4)
src/features/search/searchAtoms.ts (4)
itemSelectAction(62-69)resetSearchAction(71-74)AggregatedSearchItem(21-26)aggregatedSearchAtom(28-52)src/features/search/atoms/highlightedGeometry.ts (1)
searchHighlightedGeometryAtom(4-10)src/features/search/constants.ts (1)
EMPTY_HIGHLIGHT(5-8)src/utils/geoJSON/helpers.ts (1)
Feature(12-26)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: comment
- GitHub Check: test
🔇 Additional comments (10)
src/features/search/searchAtoms.ts (2)
15-16: Good integration of highlight clearing imports.The imports are appropriately added to support the new highlighting functionality.
68-68: Proper cleanup of highlights on item selection.Clearing the highlighted geometry when an item is selected provides good UX by ensuring stale highlights don't persist after selection.
src/features/search/tests/searchAtoms.test.ts (2)
2-15: Comprehensive mocking setup for isolated testing.The mock setup properly isolates the unit under test by mocking external dependencies including metrics and related search atoms.
24-40: Well-structured test for highlight clearing behavior.The test properly verifies that
itemSelectActionclears the highlighted geometry state. The test data is realistic and the assertion is clear and focused.src/features/search/componets/SearchBar/SearchBar.tsx (6)
4-4: Good addition of required imports for highlighting functionality.The imports properly support the new highlighting feature with useEffect for lifecycle management and the necessary atoms and constants.
Also applies to: 19-21
42-42: Proper action setup for geometry highlighting.The
setHighlightedGeometryaction is correctly set up using theuseActionhook.
55-59: Good cleanup on component unmount.The useEffect properly clears highlighted geometry when the component unmounts, preventing potential memory leaks or stale state.
105-109: Effective hover highlighting for location items.The mouse event handlers properly highlight geometry on hover and clear it on leave, providing good visual feedback to users.
127-130: Appropriate handling for MCDA items.Since MCDA items don't have geometry to highlight, clearing the highlight on both mouse enter and leave is the correct approach.
170-172: Proper cleanup when menu closes.Clearing highlights when the menu closes ensures a clean state and prevents stale highlights from persisting.
|
@alesiahil fixed, please take another look |
This reverts commit 16eee94.

Summary
Fibery ticket: 22291
https://chatgpt.com/codex/tasks/task_b_688a6fe48090832691cc10f832b5b872
Summary by CodeRabbit
New Features
Documentation