diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-08-19 08:51:53 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-08-19 08:51:53 +0200 |
| commit | 9608e49a0956c8228a022454751765404d46daa5 (patch) | |
| tree | b757b090c9d2ce4424840dae52e50750e55da166 | |
| parent | 063d4058346f7dc03eb0aa5ba394b9a872d3f1e3 (diff) | |
| download | colitur-9608e49a0956c8228a022454751765404d46daa5.tar.gz colitur-9608e49a0956c8228a022454751765404d46daa5.zip | |
fix(render): remove rank_label -- it duplicated name verbatim
view.ml's rank_label field was a byte-for-byte copy of the celebration's
name (names_value cel.Celebration.names), not a localized rank label at
all -- the kernel has no per-language rank names to draw one from, so
there was no honest value to put there. Nothing consumed it: no
template in the plan, no test, no other code referenced it.
Removed from both day_value and padding_cell so the two key sets stay
identical (23 keys each, verified). schema/day-v1.json already
described 23 keys and needed no change -- it now matches the emitted
output exactly.
schema/day-v1.json is a published contract: once a phone subscribes or
a site fetches this, removing a field is a breaking /v2/ change. The
time to remove a field that lies about its own contents is before
anyone can depend on it, not after.
| -rw-r--r-- | lib/render/view.ml | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/render/view.ml b/lib/render/view.ml index 9f67705..733aa45 100644 --- a/lib/render/view.ml +++ b/lib/render/view.ml @@ -38,7 +38,7 @@ let padding_cell dow = [ ("iso", str ""); ("dom", str ""); ("dow", str (string_of_int dow)); ("in_month", bool false); ("season", str ""); ("week", str ""); ("slug", str ""); - ("name", T.Obj []); ("rank", str ""); ("rank_label", T.Obj []); + ("name", T.Obj []); ("rank", str ""); ("colour", str ""); ("is_white", bool false); ("is_red", bool false); ("is_green", bool false); ("is_violet", bool false); ("is_rose", bool false); ("is_black", bool false); @@ -61,8 +61,12 @@ let day_value ~vocab (d : ('s, 'r) K.Liturgical_day.t) = ("week", str (match tmp.K.Temporal.week with Some w -> string_of_int w | None -> "")); ("slug", str (K.Slug.to_string cel.K.Celebration.slug)); ("name", names_value cel.K.Celebration.names); + (* [rank] is the kernel's own class string ("class-1"); there is + deliberately no separate localized rank label here -- the kernel + has no per-language rank names to draw one from, and a field + whose contents cannot honestly differ from [name] should not + exist just to exist. Do not re-add one until the kernel can. *) ("rank", str (vocab.K.Vocab.rank_to_string cel.K.Celebration.rank)); - ("rank_label", names_value cel.K.Celebration.names); ("colour", str (K.Colour.to_string colour)); ("is_white", is K.Colour.White); ("is_red", is K.Colour.Red); ("is_green", is K.Colour.Green); ("is_violet", is K.Colour.Violet); |
