Skip to content

[FEATURE] Convert Community page to filterable card grid#403

Merged
John McCall (lowlydba) merged 8 commits into
mainfrom
lowlydba/community-page-cards
May 28, 2026
Merged

[FEATURE] Convert Community page to filterable card grid#403
John McCall (lowlydba) merged 8 commits into
mainfrom
lowlydba/community-page-cards

Conversation

@lowlydba

@lowlydba John McCall (lowlydba) commented May 27, 2026

Copy link
Copy Markdown
Contributor

The Community page previously displayed projects as a plain HTML table, which limited visual appeal and discoverability. This PR converts it to a card-based, filterable grid layout inspired by https://docusaurus.community/plugindirectory.

Closes #402

What changed

Card grid layout

  • Replaced the <table> with a responsive CSS Grid (auto-fill, minmax(280px, 1fr))
  • Each card shows an image header, title link, creator, release date, and clickable tag badges
  • Cards lift slightly on hover for interactivity

Images

  • JSON entries accept an optional "image" field
  • A new build-time script (scripts/fetch-og-images.mjs) fetches og:image metadata for entries without an explicit image, validates each URL via HEAD request (content-type: image/*), and writes results to community/og-image-cache.json (committed so CI never hits external URLs)
  • Cards without any image show a branded placeholder gradient (Overture navy -> blue -> teal, 45% opacity)
  • onError on <img> hides broken images gracefully at runtime

Filtering and sorting

  • Existing tag filter logic preserved; filter pills now colored per group using brand tokens (Theme=navy, Tool=teal, Type=lime)
  • New "Newest first / Oldest first" sort toggle parses "Month YYYY" release strings; composes with active tag filters

Brand palette

  • Added full Overture Maps brand color palette as CSS custom properties (--om-primary-*, --om-secondary-*, --om-accent-*, etc.) in custom.css for reuse across the site

Preview

image

Notes

  • Run npm run fetch-og after adding new entries to populate og:image cache
  • The cache only re-fetches URLs not already present; re-validates existing non-empty entries each run
  • 17 of 40 existing entries have verified og:images in the committed cache

- Replace table layout with responsive CSS Grid card layout
- Cards support optional image field; fall back to cached og:image
- Add scripts/fetch-og-images.mjs to fetch and validate og:image at
  build time (HEAD request confirms content-type: image/*); results
  committed to community/og-image-cache.json
- Placeholder gradient (brand colors, 45% opacity) for imageless cards
- Filter pills colored per group: Theme=navy, Tool=teal, Type=lime
- Add date sort control (newest/oldest first)
- Add Overture Maps brand palette as CSS custom properties in custom.css
- Update CommunityTable tests for card-based DOM (testid, no table rows)
- Fix active+hovered pill contrast (brightness filter, explicit bg restore)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Signed-off-by: John McCall <john@overturemaps.org>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Signed-off-by: John McCall <john@overturemaps.org>

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.

Pull request overview

This PR modernizes the Community page by replacing the projects table with a responsive, filterable card grid and adds supporting styling and tooling (brand palette CSS variables + an og:image cache fetcher script) to improve discoverability and visuals.

Changes:

  • Replaced the table-based Community listing with a card grid layout, including card-level tag interactions and a newest/oldest sort toggle.
  • Added Overture Maps brand palette CSS custom properties and updated component CSS to support pill coloring and card styling.
  • Added a Node script to fetch/validate og:image URLs into a committed JSON cache, plus an npm script to run it.

Reviewed changes

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

Show a summary per file
File Description
src/css/custom.css Adds Overture Maps brand palette CSS variables for reuse across the site.
src/components/CommunityTable.module.css Implements the new filter/sort UI styling and the card grid/card presentation.
src/components/CommunityTable.jsx Switches rendering from a table to a card grid; adds image selection + sorting logic.
src/components/__tests__/CommunityTable.test.jsx Updates tests for the card UI and introduces coverage for the sort toggle.
scripts/fetch-og-images.mjs Adds a build-time helper to fetch and validate og:image URLs into a local cache file.
package.json Adds npm run fetch-og to run the og:image cache script.
community/og-image-cache.json Adds the committed og:image URL cache consumed by the Community page.

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

Comment thread src/components/CommunityTable.jsx
Comment thread src/components/CommunityTable.jsx Outdated
Comment thread src/components/CommunityTable.module.css Outdated
Comment thread src/components/__tests__/CommunityTable.test.jsx
@github-actions

github-actions Bot commented May 27, 2026

Copy link
Copy Markdown

🗺️ OMF Docs previews are live!

🆕 Auto-gen schema site (beta) https://staging.overturemaps.org/docs/pr/403/index.html
🗂️ Auto-gen schema ref main@25aca92
🌍 Repo schema site https://staging.overturemaps.org/docs/pr/403-no-autogen/index.html
🕐 Updated May 27, 2026 23:00 UTC
📝 Commit e227248

Auto-gen schema site is now available. This is an early preview of a future workflow where we will automatically generate and publish reference docs for the Overture Maps Format schema.

The auto-gen schema site may contain incomplete or inaccurate information as we are still refining the generation process, so please compare against the repo schema site and refer to the official Overture documentation for authoritative information.

Note

♻️ This preview updates automatically with each push to this PR.

… mutation

Replaces onError DOM manipulation with useState(imageError) so React
controls visibility. Fixes potential SSG hydration mismatches and
phantom keyboard tab stops on hidden anchor elements.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Signed-off-by: John McCall <john@overturemaps.org>
- README: 'repo' -> 'repository' (NATURAL_LANGUAGE lint)
- CommunityTable: parse 'Month YYYY' explicitly for Safari-safe sorting
- CommunityTable: replace focusable aria-hidden placeholder <a> with <div>
- CommunityTable.module.css: dark text on lime active pills (WCAG contrast)
- Tests: assert actual card order on oldest-first sort, not just count

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Signed-off-by: John McCall <john@overturemaps.org>
Tags on cards now inherit the same color token (navy/teal/lime) as
their corresponding filter-bar pill group, using a TAG_COLOR_CLASS
lookup map derived from TAG_GROUPS.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Signed-off-by: John McCall <john@overturemaps.org>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Signed-off-by: John McCall <john@overturemaps.org>
… pills

Lime was too light for readable text at small sizes. Green-teal is a
brand secondary color, distinct from navy/teal-dark, and passes WCAG AA
with white text — no dark-text overrides needed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Signed-off-by: John McCall <john@overturemaps.org>
…l distinction

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Signed-off-by: John McCall <john@overturemaps.org>

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.

Cool! Big improvement!

@lowlydba John McCall (lowlydba) merged commit 6880bde into main May 28, 2026
19 checks passed
@lowlydba John McCall (lowlydba) deleted the lowlydba/community-page-cards branch May 28, 2026 13:27
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.

Community page a la Docusaurus

4 participants