Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
fe1c48e
cp1-context-menu
Arbyhisenaj Jan 14, 2026
cbdfbb5
cp2-consolidating members and markers
Arbyhisenaj Jan 14, 2026
bd36727
cp3-icon-change
Arbyhisenaj Jan 14, 2026
6505021
linear changes
Arbyhisenaj Jan 15, 2026
6746385
better categories data viz
Arbyhisenaj Jan 15, 2026
f756155
centered areainfo
Arbyhisenaj Jan 15, 2026
4ba8773
empty state + delete layer item alert dialogue component
Arbyhisenaj Jan 15, 2026
565ced9
legend upgrade
Arbyhisenaj Jan 15, 2026
d36e62c
lint fixes
Arbyhisenaj Jan 15, 2026
b477574
Update src/app/map/[id]/components/Legend.tsx
joaquimds Jan 15, 2026
fe0f0f2
Update src/components/DeleteConfirmationDialog.tsx
joaquimds Jan 15, 2026
7ba1278
move bivariate button plus other fixes
Arbyhisenaj Jan 15, 2026
0882d15
Merge branch 'layers-panel/jan26-updates-shorterm' of https://github.…
Arbyhisenaj Jan 15, 2026
239e9cd
Merge branch 'main' into feat/layers-panel-one
joaquimds Jan 15, 2026
5f7fa16
Merge branch 'main' into feat/layers-panel-one
joaquimds Jan 15, 2026
275e118
Update src/app/map/[id]/components/controls/VisualisationPanel/Steppe…
joaquimds Jan 15, 2026
9b1e7d8
Update src/app/map/[id]/components/controls/VisualisationPanel/Visual…
joaquimds Jan 15, 2026
f68e8e1
Update src/app/map/[id]/components/controls/VisualisationPanel/Steppe…
joaquimds Jan 15, 2026
d9511a9
Update src/app/map/[id]/components/controls/VisualisationPanel/Visual…
joaquimds Jan 15, 2026
fe25082
stepped colours performance fix and rounded numbers
Arbyhisenaj Jan 15, 2026
c167f7d
Merge branch 'layers-panel/jan26-updates-shorterm' of https://github.…
Arbyhisenaj Jan 15, 2026
c6135c9
column 1 & 2 fix
Arbyhisenaj Jan 15, 2026
0c978e2
Merge branch 'feat/layers-panel-one' into layers-panel/jan26-updates-…
joaquimds Jan 16, 2026
17a647a
fix: various choropleth bugs
joaquimds Jan 16, 2026
47aadac
Merge branch 'layers-panel/jan26-updates-shorterm' of github.com:comm…
joaquimds Jan 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"jotai": "^2.16.0",
"kysely": "^0.27.6",
"lucide": "^0.544.0",
"lucide-react": "^0.484.0",
"lucide-react": "^0.562.0",
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

The lucide-react package is being updated from version 0.484.0 to 0.562.0. This is a significant jump that may introduce breaking changes or new icons (like VectorSquareIcon which is being used in this PR). Ensure that all icon imports are compatible with the new version and check the lucide-react changelog for any breaking changes.

Copilot uses AI. Check for mistakes.
"mapbox-gl": "^3.10.0",
"minio": "^8.0.5",
"next": "^15.5.7",
Expand Down
53 changes: 16 additions & 37 deletions src/app/(private)/data-sources/[id]/DataSourceDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,11 @@ import { toast } from "sonner";
import DataSourceBadge from "@/components/DataSourceBadge";
import DataSourceRecordTypeIcon from "@/components/DataSourceRecordTypeIcon";
import DefinitionList from "@/components/DefinitionList";
import DeleteConfirmationDialog from "@/components/DeleteConfirmationDialog";
import { Link } from "@/components/Link";
import { DataSourceConfigLabels } from "@/labels";
import { JobStatus } from "@/server/models/DataSource";
import { useTRPC } from "@/services/trpc/react";
import {
AlertDialog,
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
AlertDialogTrigger,
} from "@/shadcn/ui/alert-dialog";
import {
Breadcrumb,
BreadcrumbItem,
Expand Down Expand Up @@ -251,6 +241,7 @@ function DeleteDataSourceButton({
}) {
const router = useRouter();
const trpc = useTRPC();
const [open, setOpen] = useState(false);
const { mutate, isPending } = useMutation(
trpc.dataSource.delete.mutationOptions({
onSuccess: () => {
Expand All @@ -264,31 +255,19 @@ function DeleteDataSourceButton({
);

return (
<AlertDialog>
<AlertDialogTrigger asChild>
<Button variant="destructive">
<Trash2Icon />
Delete data source
</Button>
</AlertDialogTrigger>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>
<AlertDialogDescription>
This action cannot be undone. This will permanently delete your data
source.
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
<AlertDialogAction
disabled={isPending}
onClick={() => mutate({ dataSourceId: dataSource.id })}
>
{isPending ? "Deleting..." : "Continue"}
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
<>
<Button variant="destructive" onClick={() => setOpen(true)}>
<Trash2Icon />
Delete data source
</Button>
<DeleteConfirmationDialog
open={open}
onOpenChange={setOpen}
description="This action cannot be undone. This will permanently delete your data source."
onConfirm={() => mutate({ dataSourceId: dataSource.id })}
isPending={isPending}
confirmButtonText="Continue"
/>
</>
);
}
22 changes: 17 additions & 5 deletions src/app/map/[id]/colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,25 +97,29 @@ export const useColorScheme = ({
areaStats,
scheme,
isReversed,
categoryColors,
}: {
areaStats: CombinedAreaStats | null;
scheme: ColorScheme;
isReversed: boolean;
categoryColors?: Record<string, string>;
}): CategoricColorScheme | NumericColorScheme | null => {
// useMemo to cache calculated scales
return useMemo(() => {
return getColorScheme({ areaStats, scheme, isReversed });
}, [areaStats, scheme, isReversed]);
return getColorScheme({ areaStats, scheme, isReversed, categoryColors });
}, [areaStats, scheme, isReversed, categoryColors]);
};

const getColorScheme = ({
areaStats,
scheme,
isReversed,
categoryColors,
}: {
areaStats: CombinedAreaStats | null;
scheme: ColorScheme;
isReversed: boolean;
categoryColors?: Record<string, string>;
}): CategoricColorScheme | NumericColorScheme | null => {
if (!areaStats || !areaStats.stats.length) {
return null;
Expand All @@ -129,7 +133,8 @@ const getColorScheme = ({
const colorScale = scaleOrdinal(schemeCategory10).domain(distinctValues);
const colorMap: Record<string, string> = {};
distinctValues.forEach((v) => {
colorMap[v] = getCategoricalColor(v, colorScale);
// Use custom color if provided, otherwise use default
colorMap[v] = categoryColors?.[v] ?? getCategoricalColor(v, colorScale);
});
return {
columnType: ColumnType.String,
Expand Down Expand Up @@ -190,11 +195,13 @@ export const useFillColor = ({
scheme,
isReversed,
selectedBivariateBucket,
categoryColors,
}: {
areaStats: CombinedAreaStats | null;
scheme: ColorScheme;
isReversed: boolean;
selectedBivariateBucket: string | null;
categoryColors?: Record<string, string>;
}): DataDrivenPropertyValueSpecification<string> => {
// useMemo to cache calculated fillColor
return useMemo(() => {
Expand All @@ -203,7 +210,12 @@ export const useFillColor = ({
}

const isCount = areaStats?.calculationType === CalculationType.Count;
const colorScheme = getColorScheme({ areaStats, scheme, isReversed });
const colorScheme = getColorScheme({
areaStats,
scheme,
isReversed,
categoryColors,
});
if (!colorScheme) {
return DEFAULT_FILL_COLOR;
}
Expand Down Expand Up @@ -257,7 +269,7 @@ export const useFillColor = ({
: ["feature-state", "value"],
...interpolateColorStops,
];
}, [areaStats, isReversed, scheme, selectedBivariateBucket]);
}, [areaStats, isReversed, scheme, selectedBivariateBucket, categoryColors]);
};

const getBivariateFillColor = (
Expand Down
1 change: 1 addition & 0 deletions src/app/map/[id]/components/AreaInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export default function AreaInfo() {
scheme: viewConfig.colorScheme || ColorScheme.RedBlue,
isReversed: Boolean(viewConfig.reverseColorScheme),
selectedBivariateBucket: null,
categoryColors: viewConfig.categoryColors,
});

// Combine selected areas and hover area, avoiding duplicates
Expand Down
1 change: 1 addition & 0 deletions src/app/map/[id]/components/Choropleth/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export default function Choropleth() {
>
{/* Fill Layer - only show for choropleth */}
<Layer
key={`${sourceId}-fill-${viewConfig.areaDataColumn}-${viewConfig.calculationType}-${viewConfig.colorScheme}`}
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

The Layer key includes categoryColors in its dependencies via viewConfig.categoryColors, but categoryColors is an object/record. Since the key is a string template, changes to categoryColors won't be reflected in the key and the layer won't re-render when category colors change. Consider adding a serialized version of categoryColors to the key or using a different approach to force layer updates when colors change.

Copilot uses AI. Check for mistakes.
id={`${sourceId}-fill`}
beforeId={choroplethTopLayerId}
source={sourceId}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export function useChoroplethAreaStats() {
scheme: viewConfig.colorScheme || ColorScheme.RedBlue,
isReversed: Boolean(viewConfig.reverseColorScheme),
selectedBivariateBucket,
categoryColors: viewConfig.categoryColors,
});

useEffect(() => {
Expand Down
8 changes: 4 additions & 4 deletions src/app/map/[id]/components/LayerTypeIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
CircleIcon,
LayoutDashboardIcon,
MapPinIcon,
SquareIcon,
UsersIcon,
VectorSquareIcon,
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

The VectorSquareIcon may not exist in lucide-react. A similar issue exists here where the code references VectorSquareIcon from lucide-react. Please verify this is a valid icon name in version 0.562.0, or use the correct icon name to avoid runtime errors.

Copilot uses AI. Check for mistakes.
} from "lucide-react";
import { cn } from "@/shadcn/utils";
import { LayerType } from "@/types";
Expand All @@ -21,9 +21,9 @@ export default function LayerTypeIcon({
case LayerType.Member:
return <UsersIcon size={size} />;
case LayerType.Marker:
return <MapPinIcon size={size} />;
return <CircleIcon size={size} />;
case LayerType.Turf:
return <SquareIcon size={size} />;
return <VectorSquareIcon size={size} />;
case LayerType.Boundary:
return <LayoutDashboardIcon size={size} />;
default:
Expand Down
Loading
Loading