From 7b667a45cb75de5a5a2fa812ad81b94022973517 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 29 Aug 2026 15:05:47 +0000 Subject: [PATCH] =?UTF-8?q?Website:=20jours=20d'abord,=20hint=20entre=20pa?= =?UTF-8?q?renth=C3=A8ses=20=E2=80=94=20=C2=AB=20Du=20lundi=20au=20samedi?= =?UTF-8?q?=20(Vacances=20scolaires)=20=C2=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Le libellé de période met les jours en tête et le nom du hint entre parenthèses, et le hint vacances par défaut perd son suffixe « (lun-sam) », redondant maintenant que les jours sont épelés. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01K46F5NwLZgpri9Nrw395rD --- CHANGELOG.md | 15 ++++++++------- website/src/day-types.ts | 12 +++++++----- website/src/hints.ts | 2 +- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e3222a..b460251 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,9 +3,11 @@ ## Upcoming release - Demo: period labels now group the per-day-of-week entries of a hint and - condense consecutive weekdays into a range, e.g. « Vacances scolaires - (lun-sam) : du lundi au samedi + samedis » instead of one « … — lundis » - entry per weekday. Applies to the period cards and the calendar legend. + condense consecutive weekdays into a range, days first and hint name in + parentheses: « Du lundi au samedi (Vacances scolaires) + samedis » instead + of one « … — lundis » entry per weekday. Applies to the period cards and + the calendar legend. The built-in school-vacation hint drops its + « (lun-sam) » suffix, redundant now that the labels spell the days out. - Demo: new « Sous le capot » section under the results with two collapsible, syntax-highlighted (Prism) snippets: the exact `findCalendarPeriods` call of @@ -15,10 +17,9 @@ with a copy button. - Demo: the built-in school-vacation hint now covers Monday to Saturday - instead of Monday to Friday, and is renamed « Vacances scolaires - (lun-sam) ». Saturdays inside a vacation period therefore get their own - per-day-of-week group, matching what the calendar grid already - highlighted (every vacation day except Sundays). + instead of Monday to Friday. Saturdays inside a vacation period therefore + get their own per-day-of-week group, matching what the calendar grid + already highlighted (every vacation day except Sundays). - Demo: the calendar grid now underlines school-vacation days (Sundays excluded) and marks public holidays with an asterisk next to the day diff --git a/website/src/day-types.ts b/website/src/day-types.ts index 93aecaf..4018902 100644 --- a/website/src/day-types.ts +++ b/website/src/day-types.ts @@ -24,9 +24,10 @@ export function frLabel(label: string): string { } // Libellé d'une période : les labels « Hint — Mondays + Hint — Tuesdays + … » -// issus de la politique per-day-of-week sont regroupés par hint, et les jours -// consécutifs condensés en « du lundi au samedi ». Semaine à la française, -// lundi en tête. +// issus de la politique per-day-of-week sont regroupés par hint — les jours +// d'abord, le nom du hint entre parenthèses : « Du lundi au samedi (Vacances +// scolaires) » — et les jours consécutifs condensés en « du … au … ». +// Semaine à la française, lundi en tête. const WEEKDAYS_EN = ['Mondays', 'Tuesdays', 'Wednesdays', 'Thursdays', 'Fridays', 'Saturdays', 'Sundays'] const WEEKDAYS_FR = ['lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi', 'dimanche'] @@ -69,13 +70,14 @@ export function periodLabel(labels: string[]): string { } group.weekdays.push(weekday) } - return groups + const label = groups .map(g => { if (g.weekdays.length === 0) return g.prefix const days = frWeekdays(g.weekdays) - return g.prefix === null ? days : `${g.prefix} : ${days}` + return g.prefix === null ? days : `${days} (${g.prefix})` }) .join(' + ') + return label.charAt(0).toUpperCase() + label.slice(1) } // Palette stable ; quand elle boucle, le motif change — 12 × 4 = 48 styles diff --git a/website/src/hints.ts b/website/src/hints.ts index 2044821..5f93eed 100644 --- a/website/src/hints.ts +++ b/website/src/hints.ts @@ -148,7 +148,7 @@ export interface HintConfig { export const DEFAULT_HINT_CONFIGS: HintConfig[] = [ { id: 'holidays', source: 'holidays', name: 'Jours fériés', policy: 'match-all', enabled: true, daysText: '' }, - { id: 'school-vacations', source: 'school-vacations', name: 'Vacances scolaires (lun-sam)', policy: 'per-day-of-week', enabled: true, daysText: '' }, + { id: 'school-vacations', source: 'school-vacations', name: 'Vacances scolaires', policy: 'per-day-of-week', enabled: true, daysText: '' }, ] const DATE_RE = /^\d{4}-\d{2}-\d{2}$/