fix(ui,i18n): E30 review round 1 — audit rows in the reader's language, one HU name per thing
- audit log: a job run named from its result data (nested phases too), a skipped run says so, a secret's reset reads as a reset, choices named as Configuration names them, interval / batch / counts localized; the inbox shares the same jobRunText - HU: remux is "Közvetlen közvetítés" (it shared "Közvetlen lejátszás" with direct play); backfill is behúzás, enrich is dúsítás, collection is kollekció, the allow-list is fehérlista; the last "jobnak" / "transzkódolás"; a test holds the options of one choice to distinct names - contract: every skipped / reason word a job returns is named in both languages - person page: the bio wait is timed from the open and a failing ask stops the polling; ClampedText (ui) shared with the collection page, whose short summary lost its dead More - a playlist names season 0 the Specials; the channel re-slot compares in the reader's alphabet; an invite's date is in the admin's language; the language-ordered lists are asked again once a language switch is saved (saveLanguage) - poster grids' column minimum in rem; lint refuses minmax(Npx,…)
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { compareText } from "./collate";
|
||||
|
||||
// The channel manager's list order, and the priority steps its menu offers (E28 S3e3b).
|
||||
|
||||
/** The steps a channel's menu offers (owner, 2026-09-26): fixed levels, so bubbling a channel up
|
||||
@@ -19,23 +21,27 @@ interface Ordered {
|
||||
title?: string | null;
|
||||
}
|
||||
|
||||
/** The server's order (`routes/channels.py`: priority desc, then the title case-folded, a missing
|
||||
* title last). */
|
||||
function before(a: Ordered, b: Ordered): boolean {
|
||||
/** The server's order (`routes/channels.py`: priority desc, then the title in the reader's alphabet —
|
||||
* the ICU collation of `app/collation.py`, which `compareText` shares — a missing title last). */
|
||||
function before(a: Ordered, b: Ordered, lang: string): boolean {
|
||||
if (a.priority !== b.priority) return a.priority > b.priority;
|
||||
if (a.title == null) return false;
|
||||
if (b.title == null) return true;
|
||||
return a.title.toLowerCase() < b.title.toLowerCase();
|
||||
return compareText(a.title, b.title, lang) < 0;
|
||||
}
|
||||
|
||||
/** `rows` with the channel `id` taken out and put back where its priority now places it, every
|
||||
* other row left exactly where it was — the server's order, without a refetch that would reorder
|
||||
* anything the reader did not touch. */
|
||||
export function placeByPriority<T extends Ordered>(rows: readonly T[], id: string): T[] {
|
||||
export function placeByPriority<T extends Ordered>(
|
||||
rows: readonly T[],
|
||||
id: string,
|
||||
lang: string,
|
||||
): T[] {
|
||||
const moved = rows.find((r) => r.id === id);
|
||||
if (!moved) return [...rows];
|
||||
const rest = rows.filter((r) => r !== moved);
|
||||
const at = rest.findIndex((r) => before(moved, r));
|
||||
const at = rest.findIndex((r) => before(moved, r, lang));
|
||||
rest.splice(at < 0 ? rest.length : at, 0, moved);
|
||||
return rest;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user