Skip to content

Commit f49195c

Browse files
committed
Clean up comments
1 parent 94c00f7 commit f49195c

3 files changed

Lines changed: 6 additions & 22 deletions

File tree

components/fact-checks/FactChecksExplorer.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,6 @@ function matches(story: Story, applied: Selection): boolean {
3232
});
3333
}
3434

35-
/**
36-
* The `/fact-checks` listing. Pagination is **server-driven**: the parent server
37-
* page fetches one DB page (`stories`) plus `page`/`totalPages`, and the
38-
* Pagination bar navigates by `?page=N`, which re-runs the server fetch. The
39-
* corpus is never loaded into the client.
40-
*/
4135
export function FactChecksExplorer({
4236
stories,
4337
page,

lib/data/queries/fact-checks.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
/**
22
* Fact-check listing query. Unlike the home sections (curated content lists),
33
* the `/fact-checks` grid is the full body of published fact-checks, so this
4-
* queries `swp_article` directly. Adapted from
5-
* `pesacheck-pwa-app-router/services/collectionService.queries.js`
6-
* (`GET_COLLECTION_BY_METADATA_QUERY` — same `Debunk`-subject filter + offset
7-
* pagination + `_aggregate` count).
4+
* queries `swp_article` directly.
85
*
96
* It selects the same article fields `GET_CONTENT_LIST_ITEMS` does so `mapStory`
107
* can consume the rows unchanged — including `metadata` (jsonb) for the `Debunk`

lib/data/stories.ts

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ type FactCheckResponse = {
1414
items: RawArticle[];
1515
};
1616

17-
/** One page of the fact-checks listing: the mapped cards + paging metadata. */
1817
export type FactCheckListing = {
1918
stories: Story[];
2019
page: number;
@@ -27,9 +26,10 @@ export type FactCheckListing = {
2726
* team-member profiles on the `team` route — so we scope listings to language
2827
* routes. No column distinguishes a language route from any other collection
2928
* (`team`, `climate-change`, … are all `type: "collection"`), so this set is
30-
* editorial knowledge, not derivable from the schema. Confirmed on staging;
31-
* mirrors the language collections in docs/migration-plan.md. PR4 reuses these
32-
* for the language filter.
29+
* editorial knowledge, not derivable from the schema.
30+
*
31+
* These should ideally not be hard-coded here and should be revisited once
32+
* we have cleaner data on staging.
3333
*/
3434
export const LANGUAGE_ROUTE_SLUGS = [
3535
"english",
@@ -38,10 +38,6 @@ export const LANGUAGE_ROUTE_SLUGS = [
3838
"african-languages",
3939
];
4040

41-
/**
42-
* Fact-checks per listing page. One large feature + one secondary + an 8-card
43-
* grid fill a page (mirrors the Figma layout). Pages are fetched from the DB by offset
44-
*/
4541
export const FACT_CHECKS_PAGE_SIZE = 10;
4642

4743
/** Fetch a content list's language articles, in curated order, as `Story[]`. */
@@ -84,10 +80,7 @@ export function getHeroPreview(): Promise<Story[]> {
8480
* that server-side (see `GET_FACT_CHECK_ARTICLES`), which also excludes the
8581
* other published content sharing these routes (homepage content-blocks,
8682
* editorial test stubs). The filter is route-agnostic, so it keeps working once
87-
* fact-checks are published under topic desks (staging desks are empty;
88-
* everything currently sits on `english`).
89-
*
90-
* `page` is 1-based and clamped to `[1, totalPages]`.
83+
* fact-checks are published under topic desks.
9184
*/
9285
export async function getFactChecks(page = 1): Promise<FactCheckListing> {
9386
const { total, items } = await gql<FactCheckResponse>(

0 commit comments

Comments
 (0)