fix(news): list Local newest first

Local ranked its reports by severity first. A country's own news now
carries no severity, so in a conflict area GDELT's reports (severity 1
and up) could crowd every one of its stories out of the 40 listed.
Local is now newest first; severity still shows by colour.

Also: readTitle reads Conflicts headlines only, the economy category's
comment and the attribution popover name World News API's category,
and KNOWN-ISSUES names Core's ids for World News API's categories.
This commit is contained in:
Denis Groshev committed 2026-11-06 00:45:33 +01:00
1 parent 82057cbb51
commit 427463cc45
7 files changed
+21 -19

No files matched your search

+1 -1
View File
@@ -29,7 +29,7 @@ export const CATEGORY_ORDER = Object.freeze([
'disaster',
'protest',
'political',
// Rules only, for the Local section's national news.
// Business and trade: the rules' reading, or World News API's business.
'economy',
]);
+9 -4
View File
@@ -103,13 +103,18 @@ const WORLD_NEWS_CATEGORY = { politics: 'political', business: 'economy' };
const list = (value) =>
value ? new Set(value.split(',').filter(Boolean)) : null;
/** The rules' reading of a headline: category, relevance and severity. */
function readTitle(title, { dedicated }) {
/** The rules' reading of a Conflicts headline: category, relevance, severity. */
function readTitle(title) {
const read = categorizeText({ title });
const { category } = read;
return {
category,
relevance: relevanceOf({ category, tags: read.tags, title, dedicated }),
relevance: relevanceOf({
category,
tags: read.tags,
title,
dedicated: true,
}),
severity: severityByRules({ category, tags: read.tags, title }),
};
}
@@ -146,7 +151,7 @@ export function liveuamapReport(item) {
kind: 'liveuamap',
side: 'unknown',
// A conflict map: everything it posts is at least related.
...readTitle(item.title, { dedicated: true }),
...readTitle(item.title),
severityBy: 'rules',
publishedAt: item.publishedAt,
geo: {