Skip to content

feat: remove unused inspector config components; restore inspector bar color select#402

Merged
joaquimds merged 3 commits intomainfrom
feat/inspector-config-bar-color
Apr 1, 2026
Merged

feat: remove unused inspector config components; restore inspector bar color select#402
joaquimds merged 3 commits intomainfrom
feat/inspector-config-bar-color

Conversation

@joaquimds
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown
Contributor

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

barColor: e.target.value || undefined,
})
}
>
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
>
>
<option value="">Default bar color</option>

Copilot uses AI. Check for mistakes.
@joaquimds joaquimds force-pushed the feat/inspector-config-bar-color branch from fca5cf0 to 689b6af Compare April 1, 2026 12:01
@joaquimds joaquimds requested a review from Copilot April 1, 2026 12:01
Copy link
Copy Markdown
Contributor

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

Comment on lines +181 to +186
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]) {
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
joaquimds and others added 2 commits April 1, 2026 14:13
…mponents/InspectorConfigSection.tsx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@joaquimds joaquimds merged commit 592f533 into main Apr 1, 2026
1 check failed
@joaquimds joaquimds deleted the feat/inspector-config-bar-color branch April 1, 2026 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants