Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds a comprehensive map feature using Shadcn-inspired components built on top of Leaflet. It introduces a new /map route that displays resources on an interactive map with layer controls, allowing users to visualize objects across different map layers.
Key Changes:
- Integrated Leaflet and react-leaflet libraries for interactive mapping functionality
- Created a comprehensive map component system with drawing tools, layer management, and location controls
- Added new route
/mapwith permissions for users and admins
Reviewed Changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 17 comments.
Show a summary per file
| File | Description |
|---|---|
src/components/ui/map.tsx |
Core map component with full Leaflet integration including markers, layers, drawing tools, and controls |
src/components/ui/button-group.tsx |
New button group component for organizing map control buttons |
src/components/ui/button/variants.ts |
Added input, icon-sm, and icon-lg button variants for map controls |
src/components/ui/dropdown-menu.tsx |
Updated dropdown menu with new icons and styling fixes for layer selection |
src/features/abstract-resource-collection/components/abstract-resource-map.tsx |
Map wrapper component for displaying resource collections |
src/features/abstract-resource-collection/constants.ts |
Added PWR coordinates constant for map centering |
src/features/abstract-resource-collection/index.ts |
Exported new AbstractResourceMap component |
src/app/(private)/map/page.tsx |
Map page component implementation |
src/app/(private)/map/layout.tsx |
Layout wrapper for map route |
src/app/(private)/page.tsx |
Added map navigation button to dashboard |
src/features/authentication/data/route-permissions.ts |
Added /map route permissions |
src/app/globals.css |
Leaflet-specific CSS customizations and theme integration |
package.json |
Added leaflet, leaflet-draw, and react-leaflet dependencies |
components.json |
Added Shadcn map registry configuration |
Comments suppressed due to low confidence (1)
src/components/ui/dropdown-menu.tsx:12
- Unused imports CircleDotDashedIcon, CircleDotIcon, DotIcon.
import {
CheckIcon,
ChevronRightIcon,
CircleDotDashedIcon,
CircleDotIcon,
CircleIcon,
CircleSmallIcon,
DotIcon,
} from "lucide-react";
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f7300bd to
e33baa0
Compare
2d0169c to
90df30c
Compare
c3ee3cc to
1ea2f72
Compare
1ea2f72 to
4c7de70
Compare
b221b9f to
ea52128
Compare
ea52128 to
0c5ffb8
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 15 changed files in this pull request and generated 12 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
0c5ffb8 to
daf3692
Compare
daf3692 to
9763afe
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 15 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (2)
src/features/abstract-resource-map/components/abstract-resource-map.tsx:19
showLabellessLayerlooks like a misspelling ("label" vs "labelless"). Since this is part of the component’s public props API, consider renaming it to something likeshowLabelLessLayer/showLabellessLayerfor clarity and consistency.
export function AbstractResourceMap({
showLabellessLayer = false,
}: {
showLabellessLayer?: boolean;
}) {
src/components/ui/map.tsx:506
MapMarkercallsrenderToString(icon)on every render to build thedivIconHTML. This can become expensive if markers re-render frequently. Consider memoizing the rendered HTML /divIcon(e.g. withuseMemobased onicon/anchor props) so Leaflet icon creation isn’t repeated unnecessarily.
function MapMarker({
icon = <MapPinIcon className="size-6" />,
iconAnchor = [12, 12],
bgPos,
popupAnchor,
tooltipAnchor,
...props
}: Omit<MarkerProps, "icon"> &
Pick<
DivIconOptions,
"iconAnchor" | "bgPos" | "popupAnchor" | "tooltipAnchor"
> & {
icon?: ReactNode;
ref?: Ref<Marker>;
}) {
const { L } = useLeaflet();
if (!L) return null;
return (
<LeafletMarker
icon={L.divIcon({
html: renderToString(icon),
iconAnchor,
...(bgPos ? { bgPos } : {}),
...(popupAnchor ? { popupAnchor } : {}),
...(tooltipAnchor ? { tooltipAnchor } : {}),
})}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9763afe to
0c9a76d
Compare
0c9a76d to
bf145c5
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 15 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -90,6 +92,7 @@ | |||
| "react-dom": "^19.2.3", | |||
| "react-hook-form": "^7.65.0", | |||
| "react-intersection-observer": "^9.16.0", | |||
| "react-leaflet": "^5.0.0", | |||
| "react-medium-image-zoom": "^5.4.0", | |||
There was a problem hiding this comment.
New dependencies react-leaflet / @react-leaflet/core are pulled in; according to the lockfile they use the Hippocratic-2.1 license. Please confirm this license is acceptable for this repository before merging (some orgs treat it as a restricted/non-standard license).
bf145c5 to
af40183
Compare
af40183 to
46bcc51
Compare
46bcc51 to
3a3740c
Compare
|
problem blokujący: licensja projektu react-leaflet (Hippocratic v2.1) jest niekompatybilna z licencją AGPLv3 tego projektu |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 15 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (2)
src/components/ui/map.tsx:414
handleLayerGroupTogglekorzysta zactiveLayerGroupsz domknięcia. Żeby nie gubić aktualizacji przy szybkich zmianach, użyj funkcjonalnej formysetActiveLayerGroups(prev => ...), tak żeby zawsze operować na najświeższym stanie.
setActiveLayerGroups(
checked
? [...activeLayerGroups, name]
: activeLayerGroups.filter((groupName) => groupName !== name),
);
src/components/ui/map.tsx:218
- W domyślnym attribution dla OSM link jest ustawiony na
http://www.openstreetmap.org/.... W aplikacji serwowanej po HTTPS lepiej użyćhttps://...(unika mixed-content ostrzeżeń i jest aktualną formą linku).
const resolvedAttribution =
resolvedTheme === "dark" && darkAttribution
? darkAttribution
: (attribution ??
'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>, © <a href="https://carto.com/attributions">CARTO</a>');
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3a3740c to
8b48937
Compare
zmienimy panele zarządzania obiektami na mapę która wyświetla wszystkie zasoby w osobnych warstwach
https://shadcn-map.vercel.app
czeka na #96