Skip to content

fix(stac): label asset formats in search results - #1975

Merged
giswqs merged 2 commits into
mainfrom
fix/issue-1971-stac-asset-format-labels
Aug 17, 2026
Merged

fix(stac): label asset formats in search results#1975
giswqs merged 2 commits into
mainfrom
fix/issue-1971-stac-asset-format-labels

Conversation

@giswqs

@giswqs giswqs commented Aug 17, 2026

Copy link
Copy Markdown
Member

Summary

  • label STAC asset options with COG, GeoJSON, PMTiles, or Parquet format names
  • mark unsupported and unknown asset formats as not addable before selection
  • add browser coverage for supported, unsupported, and unknown assets

Testing

  • npx playwright test e2e/stac-api-panel.spec.ts
  • pre-commit run --files packages/plugins/src/plugins/maplibre-stac.ts e2e/stac-api-panel.spec.ts
  • verified the Planetary Computer us-census collection in light and dark themes

Fixes #1971

Summary by CodeRabbit

  • New Features
    • Asset selectors now display detected formats, including COG, GeoJSON, PMTiles, and Parquet.
    • Assets that cannot be visualized are clearly marked as unavailable for adding.
    • Parquet assets are recognized from their media type or URL.
    • STAC search results preserve and display configured asset information.
  • Localization
    • Added translated format and availability labels across supported languages.
  • Bug Fixes
    • Improved static catalog child-link formatting for more consistent navigation.

Copilot AI lite review requested due to automatic review settings August 17, 2026 12:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f9bc0a9d-8312-4183-ae3e-d10521ed1fd9

📥 Commits

Reviewing files that changed from the base of the PR and between 47a2f58 and 4d247e6.

📒 Files selected for processing (24)
  • apps/geolibre-desktop/src/components/layout/TopToolbar.tsx
  • apps/geolibre-desktop/src/i18n/locales/ar.json
  • apps/geolibre-desktop/src/i18n/locales/de.json
  • apps/geolibre-desktop/src/i18n/locales/en.json
  • apps/geolibre-desktop/src/i18n/locales/es.json
  • apps/geolibre-desktop/src/i18n/locales/fa.json
  • apps/geolibre-desktop/src/i18n/locales/fr.json
  • apps/geolibre-desktop/src/i18n/locales/hi.json
  • apps/geolibre-desktop/src/i18n/locales/id.json
  • apps/geolibre-desktop/src/i18n/locales/it.json
  • apps/geolibre-desktop/src/i18n/locales/ja.json
  • apps/geolibre-desktop/src/i18n/locales/ka.json
  • apps/geolibre-desktop/src/i18n/locales/ko.json
  • apps/geolibre-desktop/src/i18n/locales/nl.json
  • apps/geolibre-desktop/src/i18n/locales/pt.json
  • apps/geolibre-desktop/src/i18n/locales/ru.json
  • apps/geolibre-desktop/src/i18n/locales/th.json
  • apps/geolibre-desktop/src/i18n/locales/tr.json
  • apps/geolibre-desktop/src/i18n/locales/vi.json
  • apps/geolibre-desktop/src/i18n/locales/zh.json
  • packages/plugins/src/index.ts
  • packages/plugins/src/plugins/maplibre-stac.ts
  • packages/plugins/src/plugins/stac-api.ts
  • tests/stac-api.test.ts

Included review availability: Your plan includes up to 8 reviews per rolling hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

The STAC API now detects Parquet display formats separately from visualizable formats. The STAC asset selector shows localized format labels and addability status. Fixtures and tests cover supported, Parquet, and unknown assets.

Changes

STAC asset labels

Layer / File(s) Summary
Asset format detection
packages/plugins/src/plugins/stac-api.ts, packages/plugins/src/index.ts, tests/stac-api.test.ts
assetDisplayFormat detects Parquet by media type or file extension. assetFormat excludes Parquet from visualizable formats. The helper and type are re-exported and tested.
Asset selector labeling
packages/plugins/src/plugins/maplibre-stac.ts, apps/geolibre-desktop/src/components/layout/TopToolbar.tsx, apps/geolibre-desktop/src/i18n/locales/*
The selector displays detected format labels and marks non-visualizable assets as not addable. Localized labels cover COG, GeoJSON, PMTiles, Parquet, unknown formats, and non-addable assets.
Asset fixture and E2E coverage
e2e/stac-api-panel.spec.ts
Fixtures propagate optional asset metadata into generated search items. The end-to-end test checks format identification and addability for COG, GeoJSON, PMTiles, Parquet, and unknown assets.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 4d247

This change labels supported STAC asset formats and prevents unsupported or unknown formats from being added; no actionable merge-blocking risk remains after normal checks and review.

Poem

A rabbit hops through STAC with cheer,
COG and Parquet labels appear.
Unknown assets show their state,
Addable choices are now clear and straight.
The dropdown guides each little ear.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: labeling STAC asset formats in search results.
Linked Issues check ✅ Passed The changes satisfy issue #1971 by labeling asset formats and marking non-addable assets before selection.
Out of Scope Changes check ✅ Passed The localization, format detection, and test changes directly support the linked issue objectives.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/issue-1971-stac-asset-format-labels

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

apps/geolibre-desktop/src/components/layout/TopToolbar.tsx

typescript-eslint does not support TS 7.0.
Please see https://devblogs.microsoft.com/typescript/announcing-typescript-7-0/#running-side-by-side-with-typescript-6.0 to run typescript-eslint using the TS 6 API.
See also typescript-eslint/typescript-eslint#10940 for tracking typescript-eslint's support for TS >=7.1

Oops! Something went wrong! :(

ESLint: 10.8.1

Error: typescript-eslint does not support TS 7.0.
at Object. (/node_modules/typescript-eslint/dist/index.js:52:11)
at Module._compile (node:internal/modules/cjs/loader:1830:14)
at Object..js (node:internal/modules/cjs/loader:1961:10)
at Module.load (node:internal/modules/cjs/loader:1553:32)
at Module._load (node:internal/modules/cjs/loader:1355:12)
at wrapModuleLoad (node:internal/modules/cjs/loader:255:19)
at loadCJSModuleWithModuleLoad (node:internal/modules/esm/translators:326:3)
at ModuleWrap. (node:internal/modules/esm/translators:231:7)
at ModuleJob.run (node:internal/modules/esm/module_job:437:25)
at async node:internal/modules/esm/loader:639:26

packages/plugins/src/index.ts

ESLint skipped: the matched ESLint configuration already failed (config-incompatibility).

packages/plugins/src/plugins/maplibre-stac.ts

ESLint skipped: the matched ESLint configuration already failed (config-incompatibility).

  • 2 others

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

🔍 Cloudflare PR preview

Item Value
Site https://4679ead4.geolibre-preview.pages.dev
Demo app https://4679ead4.geolibre-preview.pages.dev/demo/
Commit 4d247e6

Comment thread packages/plugins/src/plugins/maplibre-stac.ts
Comment thread packages/plugins/src/plugins/maplibre-stac.ts Outdated
@github-actions

Copy link
Copy Markdown
Contributor

Code review

Bugs: None found. assetFormatLabel's switch is exhaustive over StacAssetFormat | null, the Parquet fallback detection (media type substring + extension regex) correctly matches the new e2e test's application/vnd.apache.parquet and .parquet cases, and assetOptionLabel's "(not addable)" suffix correctly mirrors isVisualizableAsset, consistent with the pre-existing Add-button disable logic.

Security: None found. No new untrusted input handling — asset type/href were already consumed elsewhere in this file (e.g. assetFormat, visualizeAsset) with the same assumptions.

Performance: None found. The added logic is O(1) string/regex work per asset in an already-small results list.

Quality:

  • Low confidence: the new ad hoc Parquet media-type/extension sniffing in assetFormatLabel duplicates the VISUALIZABLE_FORMATS/assetFormat rule pattern instead of extending that shared abstraction — not a functional issue today since Parquet is never addable, but a future drift risk if Parquet support is ever added to visualizeAsset.

CLAUDE.md:

  • Medium-high confidence: the new format labels ("COG", "GeoJSON", "PMTiles", "Parquet", "Unknown format", "(not addable)") are hardcoded English strings rather than routed through the StacLabels/setStacLabels mechanism this file already uses for every other panel string and that TopToolbar.tsx wires to apps/geolibre-desktop/src/i18n/locales/*.json. This is inconsistent with the file's own established i18n pattern and with CLAUDE.md's "Use t() for new user-facing strings" guidance — these labels will always render in English regardless of locale.

Both inline comments were posted on packages/plugins/src/plugins/maplibre-stac.ts. The e2e test additions look solid and match the implementation's behavior.

@github-actions

github-actions Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

🔍 GitHub Pages PR preview

Item Value
Site https://opengeos.org/pages-preview/GeoLibre/pr-1975/
Demo app https://opengeos.org/pages-preview/GeoLibre/pr-1975/demo/
Commit 4d247e6

Note

GitHub Pages built this preview successfully, but its serving edge returned HTTP 403 when checked. The links may still be propagating.

- Route asset format and addability labels through the STAC localization API and translate every shipped locale.
- Centralize supported and display-only format detection so Parquet cannot drift from the shared resolver.
@github-actions

Copy link
Copy Markdown
Contributor

Good — el() uses textContent, so no XSS risk from asset titles/keys containing HTML. This confirms the whole flow is safe.

Everything checks out: the format detection logic, exhaustive switch handling, translations across all 19 locales, and e2e/unit test coverage are all consistent and correct. I found no bugs, security issues, or CLAUDE.md violations worth flagging — only one very minor style nit not worth an inline comment (the new assetFormatLabel switch relies on implicit TS exhaustiveness rather than the explicit never-check pattern used in the neighboring visualizeAsset switch, so a future format addition would fail differently — a compile error either way, so it's not a real risk).

No inline comments were posted since no concrete issues were found.

Code review

Bugs: None found. The new assetDisplayFormat/assetFormat split correctly routes parquet to "not addable" (via assetFormat returning null for it) while still labeling it distinctly from unknown formats; verified against the new unit and e2e test expectations.

Security: None found. Asset titles/keys are rendered via el()'s textContent, not innerHTML, so no injection risk from catalog-supplied strings (confidence: high).

Performance: None found. Changes are simple string/lookup logic with no added loops over large data.

Quality: Minor/optional — assetFormatLabel (packages/plugins/src/plugins/maplibre-stac.ts) relies on implicit TypeScript exhaustiveness checking for its switch, unlike the neighboring visualizeAsset switch which uses an explicit never-check with an explanatory comment for the same purpose; not a functional issue since a missed case would still fail to compile, just a small stylistic inconsistency (confidence: low).

CLAUDE.md: Translation keys were added consistently across all 19 locale files with matching key sets, and en.json (the source of truth driving i18next.d.ts types) was updated, so no missing-translation or type-safety issues.

@giswqs
giswqs merged commit 0473263 into main Aug 17, 2026
25 checks passed
@giswqs
giswqs deleted the fix/issue-1971-stac-asset-format-labels branch August 17, 2026 13:41
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.

[Feature]: STAC Plugin, add asset type label to asset dropdown

2 participants