Skip to content

feat: revise the Funding page - #223

Open
uniqueg wants to merge 5 commits into
devfrom
issue-214-funding-page
Open

uniqueg wants to merge 5 commits into
devfrom
issue-214-funding-page

Conversation

@uniqueg

@uniqueg uniqueg commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Closes #214

Summary

Revises the Funding page as the review of 2026-11-18 asks (#209).

  • Stats: "Total grants", "ELIXIR grants", "GSoC projects", in that order and in sentence case.
  • Filters: one "ELIXIR" filter instead of "ELIXIR Services", "ELIXIR Platform Tasks" and "ELIXIR Implementation Studies", next to "Google Summer of Code". The order of the filters is fixed in PROGRAMMES (src/lib/funding.ts), which also holds each programme's logo.
  • Sort: by end date (newest first), then start date (oldest first), then name (ascending, alphanumerical): sortGrants in src/lib/funding.ts.
  • Listing: each card shows the programme's logo (ELIXIR's public/elixir.png; the GSoC mark as public/gsoc.svg, taken unchanged from the logo on summerofcode.withgoogle.com) and only "ELIXIR" or "Google Summer of Code" as its title. The "Grant" and "GSoC" badges are gone. ELIXIR grants show their detailed type as a subtitle, e.g. "ELIXIR Commissioned Service: Technology" or "ELIXIR Strategic Implementation Study"; GSoC grants show none.
  • Docs: the README describes the funding data format (programme, grant type, dates, sort order, how to add a programme).

Data changes (for @keshxvdayal, #216)

Kept to what this issue needs, so that they don't get in the way of the data check in #216:

  • category of the five ELIXIR grants is now ELIXIR (it is the card title and the filter).
  • funder "ELIXIR Commissioned Services: Technology" is now "ELIXIR Commissioned Service: Technology", the singular as in the issue, like the other grant types.

Nothing else in src/data/funding.json changed. No shared component changed.

Old filter links

The filter ids elixir-services, elixir-platform-tasks and elixir-implementation-studies no longer exist; links with them open the page unfiltered (unknown ids are ignored, as for every listing). Nothing on the site links them, and the filters are only a few days old.

Verification

  • npx vitest run: 300 passed (new: src/app/funding/page.test.tsx for stats, filters, sort order and card titles, logos and subtitles; src/lib/funding.test.ts for the sort and the grant type; data tests for funding.json; the Funding filter tests updated to the one ELIXIR filter).
  • npm run lint, npx tsc --noEmit, npx prettier --check: pass.
  • npm run build: passes; /funding is static.
  • Checked the built page (next start) in headless Chromium, light and dark: stats order, the two filters, the sort order, logos on white tiles in both themes, subtitles only on ELIXIR cards. Screenshots could not be attached from the command line; please check the Vercel preview.
  • CI on 000c3ec: all checks pass (CI passed, Sourcery review, CodeQL, Trivy, Codecov).
  • Sourcery: both findings fixed in 000c3ec (programme type checked on load; stats use the shared programme names); threads answered and resolved.

Declined review findings

  • role="article" on the grant cards (Card renders a div): kept. It gives the cards the same role as the <article> cards of the Products and Demo listings, which the tests of those pages also use.
  • A Funding filter test where a second filter narrows the list: with two programmes, selecting both lists everything. The "any selected filter" behaviour is covered by src/lib/filters.test.ts and the Products and Contributors filter tests.
  • Removing the guard for a programme without a logo: kept, so that a missing logo leaves an empty tile instead of breaking the page; the data tests fail for it anyway.
  • A test that formattedDuration matches the dates: out of scope here; the README says to keep them in step, and fix: check funding and contributor data by hand #216 checks the data by hand.

🤖 Generated with Claude Code

uniqueg and others added 4 commits November 21, 2026 20:15
Lists ELIXIR grants under one ELIXIR programme (data category and
filter), titles each card with its programme and logo (ELIXIR, Google
Summer of Code), shows the detailed grant type as a subtitle, drops
the Grant/GSoC badges, sorts grants by end date, start date and name,
and puts the ELIXIR grants stat before the GSoC one, in sentence case.

Adds the Google Summer of Code mark (from the GSoC site's logo) as
public/gsoc.svg.

Refs #214

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs #214

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keeps the programmes and their logos in PROGRAMMES (src/lib/funding.ts),
which sets the order of the filters, so that the order no longer depends
on which grant ends last. Tests check that every programme has its logo
and that every grant has the fields the card shows.

Refs #214

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Asserts the stat values and the literal filter order, checks that every
programme has grants, and documents that a grant type starts with its
programme's name.

Refs #214

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
landing-page Ready Ready Preview Nov 21, 2026 9:33pm UTC

@sourcery-ai

sourcery-ai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Data structures

Update the five ELIXIR grants to use the ELIXIR programme category and correct the commissioned-service funder wording.

  • src/data/funding.json L4-200 (6 small edits)

API

Define the grant and programme types, programme names and logos, plus the shared sorting and grant-type helpers used by the Funding page.

  • src/lib/funding.ts L1-78

UI

Render programme-based funding filters and statistics, and show sorted grant cards with programme logos, titles and optional detailed-type subtitles.

  • src/app/funding/page.tsx L21-43, L201-209, L214-239 (+7 small edits)

Add the Google Summer of Code logo used on programme grant cards.

  • public/gsoc.svg L1

Documentation

Document funding fields, display and sort rules, and the steps for adding a programme.

  • README.md L44-54

Tests

Test Funding page statistics, filter order, card content and sorting, and update filter tests for programme-based filtering.

  • src/app/funding/page.test.tsx L1-64
  • src/app/listing-filters.test.tsx L32-35, L48-59, L69-75 (+2 small edits)

Validate funding data against configured programmes and test the grant sorting, type and unknown-programme checks.

  • src/data/data.test.ts L11-12, L121-153
  • src/lib/funding.test.ts L1-106

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@codecov

codecov Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 50.44%. Comparing base (fce06b5) to head (000c3ec).

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #223      +/-   ##
==========================================
+ Coverage   49.86%   50.44%   +0.58%     
==========================================
  Files          44       45       +1     
  Lines        1105     1118      +13     
  Branches      292      294       +2     
==========================================
+ Hits          551      564      +13     
  Misses        479      479              
  Partials       75       75              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@uniqueg
uniqueg marked this pull request as ready for review November 21, 2026 21:02
@uniqueg
uniqueg requested a review from keshxvdayal as a code owner November 21, 2026 21:02
@sourcery-ai

sourcery-ai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Linked issues

Checked at commit 000c3ec

#214 feat: revise the Funding page · 7 of 7 met

# Requirement Status Notes
1 Move “ELIXIR grants” before “GSoC projects” ✅ Met The stats are rendered in the order Total grants, ELIXIR grants, GSoC projects.
2 Capitalize only the first word of the stats labels ✅ Met The labels use sentence case: “Total grants”, “ELIXIR grants” and “GSoC projects”.
3 Collapse the ELIXIR categories into one “ELIXIR” filter ✅ Met The filter options come from PROGRAMMES, which defines one ELIXIR entry; grants use ELIXIR as their category.
4 Sort by end date newest first, then start date oldest first, then name ascending alphanumerically ✅ Met sortGrants applies those three comparisons, and the page uses the sorted grants.
5 Use the ELIXIR and GSoC logos instead of the colored icons ✅ Met Each card looks up its programme logo from PROGRAMMES and renders it with next/image.
6 Use only the programme names as titles and remove the “Grant” and “GSoC” badges ✅ Met Cards render the category as the programme heading and no longer render either badge.
7 Show the detailed grant type as a subtitle when known, and no subtitle for GSoC ✅ Met grantType omits the subtitle when funder equals category; the listed GSoC records have matching values, while ELIXIR records show their detailed funder type.

@sourcery-ai sourcery-ai Bot 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.

Hey - I've found 2 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="src/lib/funding.ts" line_range="16" />
<code_context>
-  endDate: string;
-  formattedDuration: string;
-  category: string;
-};
-
-const grants = fundingData as FundingItem[];
</code_context>
<issue_to_address>
**Mistyped programmes remain unfilterable**

When a funding record has a category not listed in `PROGRAMMES` and reaches the page, the string type and `as Grant[]` assertion do not constrain a record's category to `PROGRAMMES`. The page builds filters and logo lookups only from that registry, so a record with another category appears without a logo and cannot be selected by a filter.

Constrain categories to the programme names and validate the imported data against that model.

Also at `src/lib/funding.ts:48`.
</issue_to_address>

### Comment 2
<location path="src/app/funding/page.tsx" line_range="63" />
<code_context>
+  // The stats name the two programmes, as the issue for the page asks;
+  // a new programme gets a filter (PROGRAMMES) but no stat of its own
+  const gsocCount = grants.filter(
+    (g) => g.category === 'Google Summer of Code',
   ).length;
-  const elixirCount = grants.filter((g) => g.funder.includes('ELIXIR')).length;
</code_context>
<issue_to_address>
**Programme stats drift from configured names**

When an existing programme's name changes in `PROGRAMMES` and `funding.json`, `gsocCount` and `elixirCount` keep comparing against literal category names, so if a programme is renamed in `PROGRAMMES` and the grant data follows, its stat reports zero even though grants are listed under that programme.

Derive the stat count predicates from shared programme-name constants or `PROGRAMMES` entries instead of repeating the category strings.

Also at `src/app/funding/page.tsx:65`.
</issue_to_address>

Sourcery assessment

Approval pending. 2 findings to address first.

Blocking findings: src/lib/funding.ts:16, src/app/funding/page.tsx:63


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread src/lib/funding.ts Resolved
Comment thread src/app/funding/page.tsx Resolved
Types a grant's category as one of the programmes and checks the data
on load, so that a grant of an unknown programme fails the build
instead of showing without a logo or filter. The stats use the shared
programme names. Addresses Sourcery's review.

Refs #214

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@sourcery-ai sourcery-ai Bot 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.

Sourcery assessment

Approved.

This branch was successfully deployed

1 active deployment
Preview – landing-page — 000c3ec8 Deployed Nov 21, 2026 by vercel[bot]
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.

feat: revise the Funding page

1 participant