Skip to content

Self-improving AI Employees for everyone

chore(maps): delete the superseded MapSelector

trohitgeeb93aecde86
diff --git a/CLAUDE.md b/CLAUDE.md
index 00988b18..e1d931b1 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -612,7 +612,7 @@ authoring model.
AI model nodes route through `SquareNode` via `Dashboard.tsx`'s `COMPONENT_BY_KIND['model']` lookup. Per-provider visual data (icon, color, displayName) comes from the backend `NodeSpec` declared in `server/nodes/model/<provider>_chat_model/__init__.py`. The pre-Wave-11 per-provider wrappers (`BaseChatModelNode`, `OpenAIChatModelNode`, `ClaudeChatModelNode`, `GeminiChatModelNode`, `ModelNode`) were deleted -- nothing imported them after the migration.
### Specialized UI
-- `src/components/ui/MapSelector.tsx` - Interactive location picker
+- `src/components/maps/GoogleMapsPicker.tsx` - Interactive location picker (click / drag marker); wrapped by `maps/MapsPreviewPanel.tsx` and rendered through `parameterPanel/MapsSection.tsx` for `gmaps_create`. Uses Google's default map styling.
- `src/components/output/OutputPanel.tsx` - Execution result display (the active renderer; the legacy `ui/OutputDisplayPanel.tsx` was deleted)
- `src/components/ui/ComponentPalette.tsx` - Searchable component library with emoji icons and dracula-themed category colors. Categories: Workflow, Triggers, AI Agents, AI Models, AI Skills, AI Abilities, AI Tools, Google Maps, Social Media Platforms (merged WhatsApp + Social), Android, Chat, Code Executors
- `src/components/ui/ComponentItem.tsx` - Draggable node items with hover effects and icon rendering
diff --git a/client/src/components/ui/MapSelector.tsx b/client/src/components/ui/MapSelector.tsx
deleted file mode 100644
index b6a01333..00000000
--- a/client/src/components/ui/MapSelector.tsx
+++ /dev/null
@@ -1,315 +0,0 @@
-import React, { useState, useCallback, useEffect, useRef } from 'react';
-import { loadGoogleMaps } from '../../utils/googleMapsLoader';
-import { useAppTheme } from '../../hooks/useAppTheme';
-import { useTheme } from '../../contexts/ThemeContext';
-
-// Google Maps API Key from environment variable
-const GOOGLE_MAPS_API_KEY = (import.meta as any).env?.VITE_GOOGLE_MAPS_API_KEY || 'YOUR_API_KEY_HERE';
-
-interface MapSelectorProps {
- initialLatitude?: number;
- initialLongitude?: number;
- onLocationSelect: (latitude: number, longitude: number) => void;
- onClose: () => void;
- apiKey?: string;
-}
-
-// Dark mode styles for Google Maps (Dracula-inspired)
-const darkMapStyles: google.maps.MapTypeStyle[] = [
- { elementType: 'geometry', stylers: [{ color: '#242f3e' }] },
- { elementType: 'labels.text.stroke', stylers: [{ color: '#242f3e' }] },
- { elementType: 'labels.text.fill', stylers: [{ color: '#746855' }] },
- { featureType: 'administrative.locality', elementType: 'labels.text.fill', stylers: [{ color: '#d59563' }] },
- { featureType: 'poi', elementType: 'labels.text.fill', stylers: [{ color: '#d59563' }] },
- { featureType: 'poi.park', elementType: 'geometry', stylers: [{ color: '#263c3f' }] },
- { featureType: 'poi.park', elementType: 'labels.text.fill', stylers: [{ color: '#6b9a76' }] },
- { featureType: 'road', elementType: 'geometry', stylers: [{ color: '#38414e' }] },
- { featureType: 'road', elementType: 'geometry.stroke', stylers: [{ color: '#212a37' }] },
- { featureType: 'road', elementType: 'labels.text.fill', stylers: [{ color: '#9ca5b3' }] },
- { featureType: 'road.highway', elementType: 'geometry', stylers: [{ color: '#746855' }] },
- { featureType: 'road.highway', elementType: 'geometry.stroke', stylers: [{ color: '#1f2835' }] },
- { featureType: 'road.highway', elementType: 'labels.text.fill', stylers: [{ color: '#f3d19c' }] },
- { featureType: 'transit', elementType: 'geometry', stylers: [{ color: '#2f3948' }] },
- { featureType: 'transit.station', elementType: 'labels.text.fill', stylers: [{ color: '#d59563' }] },
- { featureType: 'water', elementType: 'geometry', stylers: [{ color: '#17263c' }] },
- { featureType: 'water', elementType: 'labels.text.fill', stylers: [{ color: '#515c6d' }] },
- { featureType: 'water', elementType: 'labels.text.stroke', stylers: [{ color: '#17263c' }] }
-];
-
-// Google Maps Component for Location Selection
-const GoogleMapsLocationPicker: React.FC<{
- lat: number;
- lng: number;
- onLocationClick: (lat: number, lng: number) => void;
- apiKey?: string;
- isDarkMode: boolean;
- theme: ReturnType<typeof useAppTheme>;
-}> = ({ lat, lng, onLocationClick, apiKey, isDarkMode, theme }) => {
- const mapRef = useRef<HTMLDivElement>(null);
- const mapInstanceRef = useRef<google.maps.Map | null>(null);
- const markerRef = useRef<google.maps.Marker | null>(null);
-
- useEffect(() => {
- if (!mapRef.current || !apiKey || apiKey === 'YOUR_API_KEY_HERE') return;
-
- // Load Google Maps API using centralized loader
- const loadAndInitialize = async () => {
- try {
- await loadGoogleMaps({
- apiKey,
- libraries: ['geometry']
- });
- initializeMap();
- } catch (error) {
- console.error('Failed to load Google Maps API:', error);
- }
- };
-
- loadAndInitialize();
-
- function initializeMap() {
- if (!mapRef.current) return;
-
- const mapOptions: google.maps.MapOptions = {
- center: { lat, lng },
- zoom: 15,
- mapTypeId: google.maps.MapTypeId.ROADMAP,
- clickableIcons: false,
- disableDefaultUI: false,
- zoomControl: true,
- mapTypeControl: true,
- streetViewControl: true,
- fullscreenControl: true,
- // Apply dark mode styles when in dark mode
- styles: isDarkMode ? darkMapStyles : undefined
- };
-
- mapInstanceRef.current = new google.maps.Map(mapRef.current, mapOptions);
-
- // Create marker
- markerRef.current = new google.maps.Marker({
- position: { lat, lng },
- map: mapInstanceRef.current,
- draggable: true,
- title: 'Selected Location - Click or drag to change'
- });
-
- // Add click listeners
- mapInstanceRef.current.addListener('click', (e: google.maps.MapMouseEvent) => {
- if (e.latLng) {
- const newLat = e.latLng.lat();
- const newLng = e.latLng.lng();
- onLocationClick(newLat, newLng);
- }
- });
-
- // Add marker drag listener
- markerRef.current.addListener('dragend', (e: google.maps.MapMouseEvent) => {
- if (e.latLng) {
- const newLat = e.latLng.lat();
- const newLng = e.latLng.lng();
- onLocationClick(newLat, newLng);
- }
- });
- }
- // eslint-disable-next-line react-hooks/exhaustive-deps -- lat/lng/onLocationClick re-init the map; tracked separately by the position-update effect below.
- }, [apiKey, isDarkMode]);
-
- // Update marker position when coordinates change
- useEffect(() => {
- if (markerRef.current && mapInstanceRef.current) {
- const newPosition = { lat, lng };
- markerRef.current.setPosition(newPosition);
- mapInstanceRef.current.setCenter(newPosition);
- }
- }, [lat, lng]);
-
- if (!apiKey || apiKey === 'YOUR_API_KEY_HERE') {
- return (
- <div style={{
- height: '100%',
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'center',
- backgroundColor: theme.colors.backgroundAlt,
- color: theme.colors.textSecondary,
- fontSize: theme.fontSize.sm,
- textAlign: 'center',
- padding: theme.spacing.lg
- }}>
- Google Maps API key required for map display
- </div>
- );
- }
-
- return (
- <div
- ref={mapRef}
- style={{
- height: '100%',
- width: '100%'
- }}
- />
- );
-};
-
-const MapSelector: React.FC<MapSelectorProps> = ({
- initialLatitude = 37.7749,
- initialLongitude = -122.4194,
- onLocationSelect,
- onClose,
- apiKey = GOOGLE_MAPS_API_KEY
-}) => {
- const theme = useAppTheme();
- const { isDarkMode } = useTheme();
- const [selectedPosition, setSelectedPosition] = useState<[number, number]>([
- initialLatitude,
- initialLongitude
- ]);
-
- const handleMapClick = useCallback((lat: number, lng: number) => {
- setSelectedPosition([lat, lng]);
- onLocationSelect(lat, lng);
- }, [onLocationSelect]);
-
- return (
- <>
- {/* Backdrop */}
- <div
- style={{
- position: 'fixed',
- top: 0,
- left: 0,
- right: 0,
- bottom: 0,
- backgroundColor: 'rgba(0, 0, 0, 0.5)',
- zIndex: 2000,
- pointerEvents: 'none',
- }}
- />
-
- {/* Close Button */}
- <button
- onClick={(e) => {
- e.preventDefault();
- e.stopPropagation();
- onClose();
- }}
- onMouseEnter={(e) => {
- e.currentTarget.style.backgroundColor = theme.colors.error;
- e.currentTarget.style.transform = 'scale(1.1)';
- }}
- onMouseLeave={(e) => {
- e.currentTarget.style.backgroundColor = theme.colors.actionStop;
- e.currentTarget.style.transform = 'scale(1)';
- }}
- style={{
- position: 'fixed',
- top: 'calc(50% - 40vh + 10px)',
- right: '60px',
- width: '44px',
- height: '44px',
- borderRadius: '50%',
- backgroundColor: theme.colors.actionStop,
- color: 'white',
- border: 'none',
- fontSize: '20px',
- fontWeight: 'bold',
- cursor: 'pointer',
- boxShadow: `0 6px 16px ${theme.colors.actionStop}60`,
- zIndex: 2002,
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'center',
- transition: 'all 0.2s ease',
- }}
- title="Close Map Selector"
- >
- ✕
- </button>
-
- {/* Map Window */}
- <div
- style={{
- position: 'fixed',
- top: '50%',
- left: '490px',
- right: '50px',
- transform: 'translateY(-50%)',
- height: '80vh',
- backgroundColor: theme.colors.backgroundPanel,
- borderRadius: theme.borderRadius.lg,
- boxShadow: theme.colors.shadowNode,
- display: 'flex',
- flexDirection: 'column',
- overflow: 'hidden',
- zIndex: 2001,
- border: `1px solid ${theme.colors.border}`,
- }}
- >
- {/* Header */}
- <div style={{
- padding: theme.spacing.md,
- borderBottom: `1px solid ${theme.colors.border}`,
- backgroundColor: theme.colors.backgroundAlt,
- }}>
- <h3 style={{
- margin: 0,
- fontSize: theme.fontSize.lg,
- fontWeight: theme.fontWeight.semibold,
- color: theme.colors.text
- }}>
- Select Location
- </h3>
- <p style={{
- margin: `${theme.spacing.xs} 0 0 0`,
- fontSize: theme.fontSize.sm,
- color: theme.colors.textSecondary
- }}>
- Click on the map or drag the marker to select coordinates
- </p>
- </div>
-
- {/* Coordinates Display */}
- <div style={{
- padding: theme.spacing.sm,
- backgroundColor: theme.colors.background,
- borderBottom: `1px solid ${theme.colors.border}`,
- display: 'flex',
- justifyContent: 'space-between',
- alignItems: 'center'
- }}>
- <div style={{
- fontSize: theme.fontSize.sm,
- fontFamily: 'monospace',
- color: theme.colors.text,
- fontWeight: theme.fontWeight.medium
- }}>
- {selectedPosition[0].toFixed(6)}, {selectedPosition[1].toFixed(6)}
- </div>
- <div style={{
- fontSize: theme.fontSize.xs,
- color: theme.colors.textSecondary,
- fontStyle: 'italic'
- }}>
- Google Maps
- </div>
- </div>
-
- {/* Map */}
- <div style={{ flex: 1, position: 'relative' }}>
- <GoogleMapsLocationPicker
- lat={selectedPosition[0]}
- lng={selectedPosition[1]}
- onLocationClick={handleMapClick}
- apiKey={apiKey}
- isDarkMode={isDarkMode}
- theme={theme}
- />
- </div>
- </div>
- </>
- );
-};
-
-export default MapSelector;
\ No newline at end of file
diff --git a/client/src/styles/theme.ts b/client/src/styles/theme.ts
index 76914b77..e4d9546e 100644
--- a/client/src/styles/theme.ts
+++ b/client/src/styles/theme.ts
@@ -9,8 +9,7 @@
// dark / light family — see `theme_system.md` for the contract.
// - `dracula` / `solarized` raw palette constants stay for cases a
// Tailwind class can't express: SVG `fill=`, React Flow JS edge
-// styles, prismjs token CSS strings, MapSelector / GoogleMaps SDK
-// JS-side colors.
+// styles, prismjs token CSS strings, GoogleMaps SDK JS-side colors.
// - `spacing` / `fontSize` / `fontWeight` / `nodeSize` / `iconSize` /
// `buttonSize` / `layout` / `transitions` / `constants` stay too —
// these are not color tokens; they back the canvas-animation engine
diff --git a/docs-internal/frontend_architecture.md b/docs-internal/frontend_architecture.md
index 7df562e2..ac58d594 100644
--- a/docs-internal/frontend_architecture.md
+++ b/docs-internal/frontend_architecture.md
@@ -630,4 +630,4 @@ This architecture is the post-migration state. Pre-migration was antd + `styled-
**`useAppTheme()` powers the canvas + maps surface across all 12 themes.** The hook returns a `theme` object with the legacy `Colors` shape (`theme.colors.X`, `theme.isDarkMode`) so existing call sites don't change. Under non-light/dark themes it merges a per-theme overlay (primary, focus, action palette, edge stroke / selection / executing / completed / error) on top of the chosen base pack (`lightColors` for utopian-bright themes, `darkColors` for dystopian / dark themes). Adding a new theme overlay is a single entry in the `THEME_OVERRIDES` map in [hooks/useAppTheme.ts](../client/src/hooks/useAppTheme.ts).
-Read sites: every canvas node component (`AIAgentNode`, `SquareNode`, `TriggerNode`, `StartNode`, `ToolkitNode`, `TeamMonitorNode`, `GenericNode`), `EdgeConditionEditor`, and the Maps surface (`MapSelector`, `GoogleMapsPicker`, `MapsPreviewPanel`) — they interpolate per-definition `nodeColor` and JS-side hex values that Tailwind classes can't express. Every other surface uses Tailwind + the token tiers above and retints automatically through the per-theme `[data-theme="..."]` block.
+Read sites: every canvas node component (`AIAgentNode`, `SquareNode`, `TriggerNode`, `StartNode`, `ToolkitNode`, `TeamMonitorNode`, `GenericNode`), `EdgeConditionEditor`, and the Maps surface (`GoogleMapsPicker`, `MapsPreviewPanel`) — they interpolate per-definition `nodeColor` and JS-side hex values that Tailwind classes can't express. Every other surface uses Tailwind + the token tiers above and retints automatically through the per-theme `[data-theme="..."]` block.
diff --git a/docs-internal/theme_system.md b/docs-internal/theme_system.md
index a1d7b7d7..bcf58aa1 100644
--- a/docs-internal/theme_system.md
+++ b/docs-internal/theme_system.md
@@ -217,7 +217,9 @@ Result by theme (display font / tracking / case):
2. **Whole-store Zustand destructure.** Always `useAppStore((s) => s.x)`, never `{ x } = useAppStore()`.
3. **Ad-hoc opacity arithmetic on role/surface tokens.** Don't inline alpha (`bg-bg-app/10`, `bg-node-agent/30`, `bg-action-run/25`). Tailwind v4 *can* now color-mix `/opacity` on hex tokens, but the discipline is to reference a NAMED token: add/define a `-soft` / `-hover` / `-border` variant, or a `--tint-*` step in base.css, and use it by name.
4. **Hardcoded colours.** No `bg-white`, `bg-black`, `text-gray-500`, `style={{ backgroundColor: '#fff' }}`. Use tokens.
-5. **`useAppTheme()` in new files.** Allowed only for surfaces that need JS-side hex values Tailwind can't express: canvas node components (`AIAgentNode`, `SquareNode`, `TriggerNode`, `StartNode`, `ToolkitNode`, `TeamMonitorNode`, `GenericNode`), `EdgeConditionEditor`, and the Google Maps SDK consumers (`MapSelector`, `GoogleMapsPicker`, `MapsPreviewPanel`). Every other surface uses Tailwind + tokens. New themes contribute to `useAppTheme` via a `THEME_OVERRIDES` entry, never by importing `lightColors` / `darkColors` directly.
+5. **`useAppTheme()` in new files.** Allowed only for surfaces that need JS-side hex values Tailwind can't express: canvas node components (`AIAgentNode`, `SquareNode`, `TriggerNode`, `StartNode`, `ToolkitNode`, `TeamMonitorNode`, `GenericNode`), `EdgeConditionEditor`, and the Google Maps SDK consumers (`GoogleMapsPicker`, `MapsPreviewPanel`) — note the map
+tiles themselves are deliberately left to Google's own styling; `useAppTheme` here covers only
+the surrounding chrome. Every other surface uses Tailwind + tokens. New themes contribute to `useAppTheme` via a `THEME_OVERRIDES` entry, never by importing `lightColors` / `darkColors` directly.
6. **Hand-rolled modal backdrops.** Use `<Modal>` from `client/src/components/ui/Modal.tsx`.
7. **Hand-rolled colored buttons.** Use `<ActionButton intent="...">`.
8. **Static fallback theme palettes in TS.** Themes live in CSS (`client/src/themes/<name>.css`), not TS exports. `client/src/styles/theme.ts` ships only the two `lightColors` / `darkColors` base packs that `useAppTheme` overlays on top of — it is not a place to add a third / fourth / Nth palette.