feat(insights): extend layout model to v2 with section ordering

Add an additive, optional `sections` array to the persisted insights
layout alongside the existing per-metric `tiles`, with the same
merge/dedupe/dense-order semantics. v1 blobs resolve forward to a valid
v2 layout with every section default-visible; the iOS `tiles` contract is
unchanged and a PUT may omit either array (defaults fill in).
This commit is contained in:
Marc-André Bombeck committed 2026-06-07 16:36:23 +02:00
1 parent d652b6c4b3
commit f6221623a4
6 files changed
+583 -37

No files matched your search

+79 -16
View File
@@ -4556,7 +4556,34 @@ components:
properties:
version:
type: number
const: 1
const: 2
sections:
maxItems: 50
type: array
items:
type: object
properties:
id:
type: string
enum:
- wellness-scores
- daily-briefing
- vitals
- trends
- period-review
- cycle-summary
- signals
- rhythm-events
visible:
type: boolean
order:
type: integer
minimum: 0
maximum: 99
required:
- id
- visible
- order
tiles:
minItems: 1
maxItems: 50
@@ -4636,13 +4663,17 @@ components:
- order
required:
- version
- tiles
description: "Per-user Insights tile layout: an ordered list of tiles with a visibility flag. `version` is the layout
schema version. Tile ids are a closed enum: the canonical ids are English (matching the routed
`/insights/<slug>` sub-pages). The legacy German ids (blutdruck, puls, sauerstoff, koerpertemperatur, gewicht,
aktive-energie, schlaf, ruhepuls, stimmung, medikamente) remain accepted on input for backward compatibility and
are normalised to their English equivalents before persisting; GET responses always carry the canonical English
ids. The legacy ids are deprecated and will be removed in a future major version."
description: "Per-user Insights layout (v2). `tiles` is the per-metric pill list (ordered, with a visibility flag);
`sections` is the additive v2 list of the overview's big semantic blocks (wellness-scores, daily-briefing,
vitals, trends, period-review, cycle-summary, signals, rhythm-events), each with order + visibility. `version`
is the layout schema version (2). Both arrays are optional on input — a client sending only `tiles` (the pre-v2
contract) still validates, and the server fills missing defaults; a v1 blob with no `sections` resolves forward
with all sections default-visible. Tile ids are a closed enum: the canonical ids are English (matching the
routed `/insights/<slug>` sub-pages). The legacy German tile ids (blutdruck, puls, sauerstoff,
koerpertemperatur, gewicht, aktive-energie, schlaf, ruhepuls, stimmung, medikamente) remain accepted on input
for backward compatibility and are normalised to their English equivalents before persisting; GET responses
always carry the canonical English ids. Section ids are English-only. The legacy tile ids are deprecated and
will be removed in a future major version."
CoachMessageFeedbackRequest:
type: object
properties:
@@ -11444,7 +11475,35 @@ components:
properties:
version:
type: number
const: 1
const: 2
sections:
maxItems: 50
type: array
items:
type: object
properties:
id:
type: string
enum:
- wellness-scores
- daily-briefing
- vitals
- trends
- period-review
- cycle-summary
- signals
- rhythm-events
visible:
type: boolean
order:
type: integer
minimum: 0
maximum: 99
required:
- id
- visible
- order
additionalProperties: false
tiles:
minItems: 1
maxItems: 50
@@ -11525,14 +11584,18 @@ components:
additionalProperties: false
required:
- version
- tiles
additionalProperties: false
description: "Per-user Insights tile layout: an ordered list of tiles with a visibility flag. `version` is the layout
schema version. Tile ids are a closed enum: the canonical ids are English (matching the routed
`/insights/<slug>` sub-pages). The legacy German ids (blutdruck, puls, sauerstoff, koerpertemperatur, gewicht,
aktive-energie, schlaf, ruhepuls, stimmung, medikamente) remain accepted on input for backward compatibility and
are normalised to their English equivalents before persisting; GET responses always carry the canonical English
ids. The legacy ids are deprecated and will be removed in a future major version."
description: "Per-user Insights layout (v2). `tiles` is the per-metric pill list (ordered, with a visibility flag);
`sections` is the additive v2 list of the overview's big semantic blocks (wellness-scores, daily-briefing,
vitals, trends, period-review, cycle-summary, signals, rhythm-events), each with order + visibility. `version`
is the layout schema version (2). Both arrays are optional on input — a client sending only `tiles` (the pre-v2
contract) still validates, and the server fills missing defaults; a v1 blob with no `sections` resolves forward
with all sections default-visible. Tile ids are a closed enum: the canonical ids are English (matching the
routed `/insights/<slug>` sub-pages). The legacy German tile ids (blutdruck, puls, sauerstoff,
koerpertemperatur, gewicht, aktive-energie, schlaf, ruhepuls, stimmung, medikamente) remain accepted on input
for backward compatibility and are normalised to their English equivalents before persisting; GET responses
always carry the canonical English ids. Section ids are English-only. The legacy tile ids are deprecated and
will be removed in a future major version."
Medication:
type: object
properties: