Skip to content

Comments

fix: minor visualisation panel tweaks, default boundaries to WMC24 when panel opened#328

Merged
joaquimds merged 2 commits intomainfrom
feat/visualisation-panel-ux-tweaks
Feb 19, 2026
Merged

fix: minor visualisation panel tweaks, default boundaries to WMC24 when panel opened#328
joaquimds merged 2 commits intomainfrom
feat/visualisation-panel-ux-tweaks

Conversation

@joaquimds
Copy link
Member

No description provided.

Copy link
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 tweaks the map visualisation UI by (a) updating select styling in the visualisation panel, (b) adjusting hover-info table rendering, and (c) auto-defaulting locality boundaries to WMC24 when the visualisation panel is opened.

Changes:

  • Default areaSetGroupCode to WMC24 when opening the boundaries/visualisation panel (via useChoropleth).
  • Apply shared “select looks like button” classes to several SelectTriggers in VisualisationPanel.
  • Only render primary-value headers/cells in AreasList when a non-empty primaryLabel exists.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/app/map/[id]/hooks/useChoropleth.ts Wrapes setBoundariesPanelOpen to also set a default boundary group on open.
src/app/map/[id]/components/controls/VisualisationPanel/VisualisationPanel.tsx Adds shared Tailwind classes to make selects visually match buttons.
src/app/map/[id]/components/BoundaryHoverInfo/AreasList.tsx Adjusts conditional rendering of primary label/value columns in the hover info table.
Comments suppressed due to low confidence (1)

src/app/map/[id]/components/BoundaryHoverInfo/AreasList.tsx:55

  • The table header is now gated on multipleAreas && primaryLabel. When primaryLabel is an empty string (e.g., before areaStats has loaded) but secondaryLabel is set, the secondary values column will render without any header label. Consider rendering the header when either label is present (and conditionally rendering each TableHead based on its label).
      {multipleAreas && primaryLabel && (
        <TableHeader className="pointer-events-auto">
          <TableRow className="border-none hover:bg-transparent uppercase font-mono">
            <TableHead className="py-2 px-3 text-left h-8" />
            <TableHead className="py-2 px-3 text-muted-foreground text-xs text-left h-8">
              {primaryLabel}
            </TableHead>
            {secondaryLabel && (
              <TableHead className="py-2 px-3 text-muted-foreground text-xs text-left h-8">
                {secondaryLabel}
              </TableHead>
            )}
          </TableRow>
        </TableHeader>

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

Comment on lines 51 to 59
const setBoundariesPanelOpen = useCallback(
(open: boolean) => {
if (open && !viewConfig.areaSetGroupCode) {
updateViewConfig({ areaSetGroupCode: AreaSetGroupCode.WMC24 });
}
_setBoundariesPanelOpen(open);
},
[_setBoundariesPanelOpen, updateViewConfig, viewConfig.areaSetGroupCode],
);
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

setBoundariesPanelOpen(true) now updates areaSetGroupCode whenever it’s falsy. Since the map view default (and an explicit user choice via “No locality”) is null, opening the panel will always force WMC24 and makes it impossible to persist a null boundary selection across opens. Consider distinguishing between “unset” and “explicitly none” (e.g., only default when areaSetGroupCode is undefined, or gate this behavior behind an explicit user action / map type).

Copilot uses AI. Check for mistakes.
Copy link
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 4 out of 4 changed files in this pull request and generated 1 comment.


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


const setBoundariesPanelOpen = useCallback(
(open: boolean) => {
if (open && viewConfig.areaSetGroupCode === undefined) {
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

The condition checks for undefined, but areaSetGroupCode can be both null and undefined in the codebase. When a user explicitly sets boundaries to "None" (via useBoundariesControl.tsx line 66, MapStyleSelector.tsx line 183, or VisualisationPanel.tsx line 259), the value becomes null. This means opening the boundaries panel after setting it to "None" won't trigger the default WMC24 assignment. Consider checking for both null and undefined using a falsy check like !viewConfig.areaSetGroupCode or explicitly checking for both values.

Suggested change
if (open && viewConfig.areaSetGroupCode === undefined) {
if (open && viewConfig.areaSetGroupCode == null) {

Copilot uses AI. Check for mistakes.
@joaquimds joaquimds merged commit b876ac6 into main Feb 19, 2026
7 checks passed
@joaquimds joaquimds deleted the feat/visualisation-panel-ux-tweaks branch February 19, 2026 14:17
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.

1 participant