Skip to content

Improving data visualisation options by making selects more accessible#388

Open
Arbyhisenaj wants to merge 2 commits intomainfrom
ux/Data-visualisation-upgrade
Open

Improving data visualisation options by making selects more accessible#388
Arbyhisenaj wants to merge 2 commits intomainfrom
ux/Data-visualisation-upgrade

Conversation

@Arbyhisenaj
Copy link
Member

Screenshot 2026-03-24 at 16 41 56

Description

Motivation and Context

How Can It Be Tested?

How Will This Be Deployed?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I've checked the spec (e.g. Figma file) and documented any divergences.
  • My code follows the code style of this project.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I've updated the documentation accordingly.
  • Replace unused checkboxes with bullet points.

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 refactors the map “data visualisation” controls to make selection UIs more accessible and consistent by moving key selections into the legend and enhancing the shared Combobox trigger styling.

Changes:

  • Extend Combobox to support trigger styling/size so it can visually align with Select.
  • Move data source + column selection into Legend, and simplify VisualisationPanel to focus on style settings.
  • Simplify boundaries legend wrapper components and adjust settings entry point in BoundariesControl.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/shadcn/ui/combobox.tsx Adds trigger customisation (triggerClassName, size) to support smaller/Select-like triggers.
src/app/(private)/map/[id]/components/controls/VisualisationPanel/VisualisationPanel.tsx Removes data source/primary column selection from the panel; keeps style controls and secondary column/aggregation.
src/app/(private)/map/[id]/components/controls/BoundariesControl/LegendControl.tsx Simplifies wrapper to render Legend directly.
src/app/(private)/map/[id]/components/controls/BoundariesControl/BoundariesControl.tsx Shows settings icon only when a data source exists; always renders legend content when expanded.
src/app/(private)/map/[id]/components/Legend.tsx Rebuilds legend to include data source + column selection UI, bivariate toggle, and boundaries selection.
src/app/(private)/map/[id]/components/DataSourceSelectButton.tsx Exports DataSourceSelectModal for reuse from Legend.

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

Comment on lines 25 to 35
interface ComboboxProps {
options: ComboboxOption[];
value: string;
onValueChange: (value: string) => void;
placeholder?: string;
searchPlaceholder?: string;
emptyMessage?: string;
/** Merged onto the trigger button (e.g. typography to match Select) */
triggerClassName?: string;
size?: React.ComponentProps<typeof Button>["size"];
}
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

Combobox is used with <Label htmlFor=...> elsewhere, but it doesn’t currently expose an id (or aria-labelledby) that gets forwarded to the trigger <Button>. This means labels can’t be programmatically associated with the combobox trigger for screen readers. Consider adding an optional id prop (and/or ariaLabel/ariaLabelledby) to ComboboxProps and forwarding it onto the trigger button.

Copilot uses AI. Check for mistakes.
Comment on lines +268 to +274
htmlFor="choropleth-column-2-select"
className="text-sm text-muted-foreground font-normal"
>
Column 2
</Label>
<div className="flex items-center gap-2">
<Combobox
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

Label uses htmlFor="choropleth-column-2-select", but the Combobox trigger does not receive that id (Combobox doesn’t accept/forward it). As a result, the label isn’t associated with the control for assistive tech. Either add an id/aria-labelledby to Combobox and pass it here, or replace htmlFor usage with an explicit aria-label/aria-labelledby on the combobox trigger.

Suggested change
htmlFor="choropleth-column-2-select"
className="text-sm text-muted-foreground font-normal"
>
Column 2
</Label>
<div className="flex items-center gap-2">
<Combobox
id="choropleth-column-2-label"
className="text-sm text-muted-foreground font-normal"
>
Column 2
</Label>
<div className="flex items-center gap-2">
<Combobox
aria-labelledby="choropleth-column-2-label"

Copilot uses AI. Check for mistakes.
}}
>
<X className="h-3 w-3 mr-1" />
Remove bivariate visualization
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

The user-facing text uses American spelling “visualization”, but this area of the app consistently uses “visualisation” (e.g. layer label “Data visualisation”). Please change this string to “visualisation” for consistency.

Suggested change
Remove bivariate visualization
Remove bivariate visualisation

Copilot uses AI. Check for mistakes.
? "Remove second column"
: bivariatePickerOpen
? "Cancel second column"
: "Add second column for bivariate visualization"
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

The aria-label text uses American spelling “visualization”, but elsewhere in this UI the project uses “visualisation” (e.g. “Data visualisation”). Please change this string to “visualisation” for consistency.

Suggested change
: "Add second column for bivariate visualization"
: "Add second column for bivariate visualisation"

Copilot uses AI. Check for mistakes.
@joaquimds joaquimds force-pushed the ux/Data-visualisation-upgrade branch from a254031 to 4e57c1a Compare March 24, 2026 22:16
@joaquimds
Copy link
Member

@Arbyhisenaj It's good, but it removes the column description popover and column metadata edit button:

Screenshot 2026-03-24 at 23 18 43

Which isn't the best design, but it's a feature we can't remove as it's required by AB Charitable Trust.

Also smaller comments:

  • I don't think the button to make a bivariate visualisation is clear. This is something that's come up a few times in user tests - it has to be really obvious to the user how to do this. I honestly think the best thing is to always show the Column 2 dropdown.
  • Relatedly, we should remove the Column 2 dropdown from the style panel if there's no data configuration there
  • And maybe change the cog icon to open the style panel to a paintbrush or something

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.

3 participants