Skip to content

feat(arm): add abstract-resource-map#191

Open
kguzek wants to merge 1 commit intomainfrom
feat/resource-map
Open

feat(arm): add abstract-resource-map#191
kguzek wants to merge 1 commit intomainfrom
feat/resource-map

Conversation

@kguzek
Copy link
Copy Markdown
Member

@kguzek kguzek commented Nov 16, 2025

zmienimy panele zarządzania obiektami na mapę która wyświetla wszystkie zasoby w osobnych warstwach

  • Ola/Szymek chcą żeby móc mieć też opcję wyświetlania w liście
  • Możnaby też dodać mapę jako alternatywny sposób inputu w samym formularzu

https://shadcn-map.vercel.app

czeka na #96

@kguzek kguzek self-assigned this Nov 16, 2025
Copilot AI review requested due to automatic review settings November 16, 2025 16:01
@kguzek kguzek added the enhancement New feature or request label Nov 16, 2025
@kguzek kguzek changed the title feat(arc): add shadcn map feat(arc): add abstract-resource-map Nov 16, 2025
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 /map with 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.

@kguzek kguzek force-pushed the feat/resource-map branch 3 times, most recently from 2d0169c to 90df30c Compare December 8, 2025 22:46
@kguzek kguzek force-pushed the feat/resource-map branch 4 times, most recently from c3ee3cc to 1ea2f72 Compare December 29, 2025 20:55
@kguzek kguzek changed the title feat(arc): add abstract-resource-map feat(arm): add abstract-resource-map Dec 29, 2025
@kguzek kguzek force-pushed the feat/resource-map branch 5 times, most recently from b221b9f to ea52128 Compare February 23, 2026 17:32
Copilot AI review requested due to automatic review settings February 24, 2026 00:01
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot AI review requested due to automatic review settings February 24, 2026 00:26
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  • showLabellessLayer looks like a misspelling ("label" vs "labelless"). Since this is part of the component’s public props API, consider renaming it to something like showLabelLessLayer / showLabellessLayer for clarity and consistency.
export function AbstractResourceMap({
  showLabellessLayer = false,
}: {
  showLabellessLayer?: boolean;
}) {

src/components/ui/map.tsx:506

  • MapMarker calls renderToString(icon) on every render to build the divIcon HTML. This can become expensive if markers re-render frequently. Consider memoizing the rendered HTML / divIcon (e.g. with useMemo based on icon/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.

Copilot AI review requested due to automatic review settings March 1, 2026 14:41
@kguzek kguzek force-pushed the feat/resource-map branch from 0c9a76d to bf145c5 Compare March 1, 2026 14:41
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines 81 to 96
@@ -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",
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
@kguzek kguzek force-pushed the feat/resource-map branch from bf145c5 to af40183 Compare March 1, 2026 17:45
Copilot AI review requested due to automatic review settings March 1, 2026 20:18
@kguzek kguzek force-pushed the feat/resource-map branch from af40183 to 46bcc51 Compare March 1, 2026 20:18
@kguzek kguzek force-pushed the feat/resource-map branch from 46bcc51 to 3a3740c Compare March 1, 2026 20:21
@kguzek
Copy link
Copy Markdown
Member Author

kguzek commented Mar 1, 2026

problem blokujący: licensja projektu react-leaflet (Hippocratic v2.1) jest niekompatybilna z licencją AGPLv3 tego projektu

PaulLeCam/react-leaflet#698

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  • handleLayerGroupToggle korzysta z activeLayerGroups z domknięcia. Żeby nie gubić aktualizacji przy szybkich zmianach, użyj funkcjonalnej formy setActiveLayerGroups(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 ??
        '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>, &copy; <a href="https://carto.com/attributions">CARTO</a>');

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kguzek kguzek force-pushed the feat/resource-map branch from 3a3740c to 8b48937 Compare March 25, 2026 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size/XXL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants