Skip to content

feat(ui): add collapsible layer groups and base-layer previews - #224

Merged
pjeweb merged 4 commits into
mainfrom
feat/ui-layer-switcher-previews
Aug 27, 2026
Merged

feat(ui): add collapsible layer groups and base-layer previews#224
pjeweb merged 4 commits into
mainfrom
feat/ui-layer-switcher-previews

Conversation

@pjeweb

@pjeweb pjeweb commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add opt-in collapsibleGroups on the layer switcher with visible/total counts.
  • Allow optional base-layer preview thumbnails on split base-layer entries.

@changeset-bot

changeset-bot Bot commented Aug 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 22442d1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@mapsight/ui Minor
@mapsight/core Patch
@mapsight/count-aggregator-ui Major
@mapsight/showcase Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pjeweb
pjeweb force-pushed the feat/ui-layer-switcher-previews branch from 63bd253 to d2a9689 Compare August 27, 2026 20:16
@pjeweb
pjeweb requested a lite review from Copilot August 27, 2026 20:19

Copilot AI left a comment

Copy link
Copy Markdown

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 adds opt-in UI capabilities to the layer switcher: collapsible overlay groups (with visible/total counts) and optional preview thumbnails on split base-layer entries, backed by new config and metadata fields.

Changes:

  • Add collapsibleGroups option to the UI layer switcher and implement collapsible overlay groups (split base-layers mode) with visible/total counts.
  • Add optional layerSwitcherPreviewUrl layer metadata and plumb it through to switcher entries for base-layer preview thumbnails.
  • Add new SCSS for the collapsible group toggle/chevron and preview thumbnail elements.

Reviewed changes

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

Show a summary per file
File Description
packages/ui/src/scss/blocks/_layer-switcher.scss Adds styles for entry previews and collapsible group toggles/chevrons.
packages/ui/src/js/types.ts Extends layer switcher config state with collapsibleGroups.
packages/ui/src/js/index.ts Sets default collapsibleGroups: false in create options and expands selection behavior comments.
packages/ui/src/js/components/switcher/SwitcherEntry.tsx Adds previewUrl rendering and --with-preview modifier support.
packages/ui/src/js/components/layer-switcher/SplitBaseLayerSwitcher.tsx Implements collapsible overlay groups (split mode) and visible/total counts.
packages/ui/src/js/components/layer-switcher/LayerSwitcherEntry.ts Plumbs layerSwitcherPreviewUrl metadata into SwitcherEntry as previewUrl.
packages/ui/src/js/components/layer-switcher/LayerSwitcherContainer.tsx Exposes collapsibleGroups prop and passes it to the split switcher.
packages/ui/src/js/components/layer-switcher/index.ts Wires collapsibleGroups from config into the container props.
packages/core/src/js/lib/map/schema.ts Adds layerSwitcherPreviewUrl to the layer metadata schema.
.changeset/ui-layer-switcher-collapsible-previews.md Declares version bumps for @mapsight/ui (minor) and @mapsight/core (patch).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/ui/src/scss/blocks/_layer-switcher.scss
Comment thread packages/ui/src/scss/blocks/_layer-switcher.scss

Copilot AI left a comment

Copy link
Copy Markdown

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 10 out of 10 changed files in this pull request and generated no new comments.

Suppressed comments (1)

packages/ui/src/js/components/layer-switcher/SplitBaseLayerSwitcher.tsx:88

  • translate("ui.layer-switcher.expandGroup") / translate("ui.layer-switcher.collapseGroup") are referenced here, but those keys are not present in the current i18n catalogs (e.g. packages/ui/src/js/helpers/i18n/en.ts and de.ts). This will likely render the raw key string in the UI. Add these translations (and any other supported locales) or change the code to use existing keys.
	const countLabel = `${visibleCount}/${total}`;
	const toggleLabel = collapsed
		? translate("ui.layer-switcher.expandGroup")
		: translate("ui.layer-switcher.collapseGroup");

@pjeweb
pjeweb merged commit 08f8e3f into main Aug 27, 2026
22 checks passed
@pjeweb
pjeweb deleted the feat/ui-layer-switcher-previews branch August 27, 2026 20:54
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