feat(count-aggregator): add AQI badges and wind-direction widgets - #225
Merged
Conversation
🦋 Changeset detectedLatest commit: 1afe932 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
Expose UBA Luftqualitätsindex band helpers, citizen-facing metric variants, and expand smart-city icon aliases for the new station types.
pjeweb
force-pushed
the
feat/count-aggregator-aqi-wind
branch
from
August 27, 2026 20:17
0df3d42 to
d854b1a
Compare
There was a problem hiding this comment.
Pull request overview
Adds air-quality index (UBA LQI) classification helpers to the API package and extends the UI’s smart-city metric widgets to render AQI badges and a wind-direction compass variant, plus expands icon alias coverage for the new station types.
Changes:
- Introduce AQI (UBA LQI) band helpers (band resolution, labels, colors, unit/type predicates) in
@mapsight/count-aggregator-api. - Add UI rendering variants for AQI (badge + band-colored chart) and wind direction (compass widget), including new formatting helpers and styles.
- Expand smart-city icon aliases to cover additional air-quality and water-level station types.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/traffic-style/src/meta.json | Expands smart-city icon aliases for air-quality and water-level station types; refines icon labels. |
| packages/count-aggregator-ui/src/lib/wind-direction.ts | Adds wind-direction normalization, cardinal mapping, and citizen-facing formatting helpers. |
| packages/count-aggregator-ui/src/lib/wind-direction.test.ts | Adds unit tests for wind-direction helpers. |
| packages/count-aggregator-ui/src/lib/format-metric-value.ts | Adds AQI “index” formatting to UBA band labels based on locale. |
| packages/count-aggregator-ui/src/lib/format-metric-value.test.ts | Adds test coverage for AQI index label formatting. |
| packages/count-aggregator-ui/src/index.ts | Re-exports new AQI helpers/types from the API package and new widget variant type. |
| packages/count-aggregator-ui/src/feature-details-metrics/types.ts | Introduces MetricWidgetVariant and wires it into widget config. |
| packages/count-aggregator-ui/src/feature-details-metrics/styles.css | Adds styling for AQI badge and wind-direction compass widget. |
| packages/count-aggregator-ui/src/feature-details-metrics/index.ts | Re-exports MetricWidgetVariant. |
| packages/count-aggregator-ui/src/feature-details-metrics/config/metric-widgets.ts | Adds default configs and variant resolution for AQI, wind direction, and new station types; adjusts unit/variant derivation from station display. |
| packages/count-aggregator-ui/src/feature-details-metrics/config/metric-widgets.test.ts | Extends tests to cover AQI index, wind-direction, and water underground defaults. |
| packages/count-aggregator-ui/src/feature-details-metrics/components/wind-direction-display.tsx | Adds a wind-direction compass component for the wind-direction variant. |
| packages/count-aggregator-ui/src/feature-details-metrics/components/time-series-metric-chart.tsx | Renders wind-direction variant as compass; renders AQI badge and band-colored series; adapts axis formatting for AQI. |
| packages/count-aggregator-ui/src/feature-details-metrics/components/air-quality-index-badge.tsx | Adds AQI badge component that uses band label + color. |
| packages/count-aggregator-api/src/lib/air-quality-index-bands.ts | Adds UBA AQI band model, band resolution, color/label helpers, and unit/type predicates. |
| packages/count-aggregator-api/src/lib/air-quality-index-bands.test.ts | Adds test coverage for AQI band classification and helpers. |
| packages/count-aggregator-api/src/index.ts | Exports new AQI helpers/types from the API package entrypoint. |
| .changeset/smart-city-aqi-wind-polish.md | Declares version bumps and summarizes the feature additions. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Keep the station-type helper aligned with its name so non-AQI *Index metrics are not treated as Luftqualitätsindex widgets.
The visible label already names the direction, so a duplicate aria-label on the compass made screen readers announce every value twice.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@mapsight/count-aggregator-api.