Add a dayTintProvider plugin hook

Lets a plugin colour-code days in the Plan sidebar. trip-segments can
already announce "Kanazawa begins" in the day plan, but it can't make
day 12 look like it belongs to Kanazawa.

dayScheduleProvider can't cover this: it renders a fixed row, and it's
capped at 60 items per provider, so one item per day would tint the
first 60 days of a six-month trip and silently stop. This hook is
bounded by day count instead.

GET /api/day-tints/:tripId returns per-day tones for three regions of a
day card - the number badge (also the mobile day chip), the header row,
and the expanded activity list. `tone` is a shorthand filling every
region a contribution doesn't name; unnamed regions render as they do
today. Tones only, never hex, so the host can pick the alpha per theme
and per region.

One contribution per day, resolved whole: first entry wins within a
provider, first granted provider wins across plugins.
This commit is contained in:
Renzo Beux
2026-07-29 12:05:31 -03:00
committed by Maurice
parent 28ffc814c0
commit c89d2bf3a1
46 changed files with 664 additions and 17 deletions
+3
View File
@@ -328,6 +328,8 @@ const admin: TranslationStrings = {
'Proposer des profils de routage avec lesquels le planificateur calcule les itinéraires des jours (p. ex. routage pour véhicule électrique avec arrêts de recharge)',
'admin.plugins.perm.hook:day-schedule-provider':
'Ajouter des entrées horaires au plan de la journée (arrêts de recharge, marges de sécurité)',
'admin.plugins.perm.hook:day-tint-provider':
'Colorer les jours du plan de la journée (par exemple, à quelle étape du voyage appartient un jour)',
'admin.plugins.perm.geolocation:read':
"Demander votre position en temps réel tant que l'une de ses vues est ouverte (votre navigateur vous demandera d'abord l'autorisation)",
'admin.plugins.perm.hook:pdf-section-provider': "Ajouter des sections de texte à l'export PDF du voyage",
@@ -453,6 +455,7 @@ const admin: TranslationStrings = {
'admin.plugins.cap.mapLayers': 'Dessine sur la carte',
'admin.plugins.cap.routing': 'Propose des itinéraires',
'admin.plugins.cap.daySchedule': 'Ajoute des horaires',
'admin.plugins.cap.dayTint': 'Colore les jours',
'admin.plugins.cap.geolocation': 'Lit votre position',
'admin.plugins.cap.events': 'Réagit à l’activité',
'admin.plugins.cap.requiresAddon': 'Nécessite {addon}',