Conversation
There was a problem hiding this comment.
Pull request overview
This PR cleans up the map inspector settings UI by removing unused drag-and-drop “inspector config” components, and restores/updates bar-colour handling so bar/scale visualisations can use the inspector’s configured panel colour (with support for explicit colours and smart-match).
Changes:
- Delete unused InspectorSettingsModal drag/drop + row components (and related constants).
- Update bar colour resolution logic (
getBarColorForLabel) to fall back to inspector config colour when no explicit bar colour is set. - Reintroduce a bar-colour selector in the superadmin data source inspector config UI.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/app/(private)/map/[id]/components/SortableColumnRow.tsx | Removed unused sortable column settings row component. |
| src/app/(private)/map/[id]/components/InspectorPanel/InspectorSettingsModal/SortableDividerRow.tsx | Removed unused sortable divider row component. |
| src/app/(private)/map/[id]/components/InspectorPanel/InspectorSettingsModal/SortableAvailableRow.tsx | Removed unused sortable available row component. |
| src/app/(private)/map/[id]/components/InspectorPanel/InspectorSettingsModal/DroppableSelectedColumns.tsx | Removed unused “selected columns settings” droppable area. |
| src/app/(private)/map/[id]/components/InspectorPanel/InspectorSettingsModal/DragPreviews.tsx | Removed unused drag overlay preview components. |
| src/app/(private)/map/[id]/components/InspectorPanel/InspectorSettingsModal/constants.ts | Removed unused constants/helpers for InspectorSettingsModal DnD. |
| src/app/(private)/map/[id]/components/InspectorPanel/InspectorSettingsModal/ColumnsSection.tsx | Removed unused InspectorSettingsModal columns section (DnD layout). |
| src/app/(private)/map/[id]/components/InspectorPanel/InspectorSettingsModal/AvailableListWithDividers.tsx | Removed unused available/selected list with dividers component. |
| src/app/(private)/map/[id]/components/InspectorPanel/InspectorSettingsModal/AvailableColumnRow.tsx | Removed unused available column row component. |
| src/app/(private)/map/[id]/components/InspectorPanel/inspectorPanelOptions.tsx | Adjusted bar colour options label and updated bar colour resolution to consider inspector config colour. |
| src/app/(private)/map/[id]/components/InspectorPanel/DataRecordColumns.tsx | Pass inspector config colour into bar/scale renderers via updated getBarColorForLabel API. |
| src/app/(private)/(dashboards)/superadmin/data-sources/[id]/components/InspectorConfigSection.tsx | Restored bar-colour select for percentage columns in superadmin inspector config UI. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...pp/(private)/(dashboards)/superadmin/data-sources/[id]/components/InspectorConfigSection.tsx
Outdated
Show resolved
Hide resolved
| barColor: e.target.value || undefined, | ||
| }) | ||
| } | ||
| > |
There was a problem hiding this comment.
value={inspectorColumn?.barColor ?? ""} doesn’t match any (there’s no option with value ""). When barColor is unset, the select will be in an inconsistent state and the user can’t clear/reset it. Consider defaulting the select value to DEFAULT_BAR_COLOR_VALUE (and mapping that back to undefined if you don’t want to persist "default"), or add an explicit empty option.
| > | |
| > | |
| <option value="">Default bar color</option> |
fca5cf0 to
689b6af
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (barColor === SMART_MATCH_BAR_COLOR_VALUE) { | ||
| return getSmartMatchInfo(columnName, displayName).color; | ||
| } | ||
| // Default / no explicit bar color: use the inspector config color | ||
| if (!barColor || barColor === DEFAULT_BAR_COLOR_VALUE) { | ||
| if (inspectorColor && INSPECTOR_COLOR_HEX_MAP[inspectorColor]) { |
There was a problem hiding this comment.
getBarColorForLabel() passes displayName through to getSmartMatchInfo(). Since displayName is optional, getSmartMatchInfo() can end up concatenating the literal string "undefined" into its match key (breaking smart-match lookups). Adjust getSmartMatchInfo() to coalesce displayName (e.g. to "") before building the combined match string.
...pp/(private)/(dashboards)/superadmin/data-sources/[id]/components/InspectorConfigSection.tsx
Outdated
Show resolved
Hide resolved
…mponents/InspectorConfigSection.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.