Repository navigation
feat: add close button to the draw panel - #515
Conversation
📝 WalkthroughWalkthroughAdds a memoized CustomMapDrawPanel factory that wraps the existing MapDrawPanel, conditionally hides it based on Changes
Sequence Diagram(s)sequenceDiagram
participant Injector as KeplerInjector
participant Factory as CustomMapDrawPanelFactory
participant Panel as MapDrawPanel (wrapped)
participant AppState as MapControls State
participant User as User
Injector->>Factory: register replacement (MapDrawPanelFactory → CustomMapDrawPanelFactory)
Factory->>Panel: instantiate wrapped component with props
Panel->>AppState: read `mapControls.mapDraw.show` and `mapControls.mapDraw.active`
alt draw control hidden
Panel-->>User: render nothing (null)
else draw control visible
Panel-->>User: render MapDrawPanel UI
alt draw active
User->>Panel: click Close button
Panel->>Panel: preventDefault & stopPropagation
Panel->>AppState: call `onToggleMapControl('mapDraw')`
AppState-->>Panel: updated `mapControls` triggers re-render
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/kepler/src/components/CustomMapDrawPanel.tsx`:
- Around line 44-56: The close Button is icon-only and lacks an accessible name;
update the Button element in CustomMapDrawPanel (the Button wrapping XIcon) to
include an explicit accessible name such as aria-label="Close" (or a localized
string) and mark the decorative XIcon as aria-hidden="true" so screen readers
announce the button purpose; keep the existing onClick handler
(onToggleMenuPanel) intact.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 46b5a87a-a05e-4065-8c91-f0dbde702f26
📒 Files selected for processing (2)
packages/kepler/src/components/CustomMapDrawPanel.tsxpackages/kepler/src/components/KeplerInjector.tsx
There was a problem hiding this comment.
Pull request overview
Adds a custom override of Kepler’s map draw panel to include a close affordance, integrated via the existing Kepler injector recipe system.
Changes:
- Register a
MapDrawPanelFactoryoverride in the Kepler injector. - Introduce
CustomMapDrawPanelFactorythat wraps the upstream draw panel and conditionally renders a close (X) button.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/kepler/src/components/KeplerInjector.tsx | Wires MapDrawPanelFactory to a custom replacement factory in defaultRecipes. |
| packages/kepler/src/components/CustomMapDrawPanel.tsx | Wraps the upstream draw panel and adds a close button when the draw control is active. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Add close button to the draw panel

Summary by CodeRabbit