From 7b0688b37e3d330b52b481a7d1c5950fa2910668 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sun, 14 Jun 2026 10:14:02 +0200 Subject: [PATCH] feat(mood): curate default tag catalog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Deactivate the redundant default tags happy, excited, hydrated ("Wasser getrunken") and music; re-activate overtime in the work category (0126 had retired it); add a new default work tag praise ("Lob" / "Praise", Lucide ThumbsUp) with i18n across all six locales. factor_sleep_quality stays a RATED factor: its removal was premised on a dedicated sleep-quality slider that does not exist in the capture surface, so dropping it would lose the signal with no replacement. Reference-data only — is_active flips plus an idempotent keyed upsert, no schema change, no per-user data touched; historical tag links keep resolving their labels. --- messages/de.json | 3 +- messages/en.json | 3 +- messages/es.json | 3 +- messages/fr.json | 3 +- messages/it.json | 3 +- messages/pl.json | 3 +- .../migration.sql | 41 +++++++++++++++++++ 7 files changed, 53 insertions(+), 6 deletions(-) create mode 100644 prisma/migrations/0155_v11613_mood_tag_curation/migration.sql diff --git a/messages/de.json b/messages/de.json index 125069d45..94442b3f6 100644 --- a/messages/de.json +++ b/messages/de.json @@ -654,7 +654,8 @@ "factorStress": "Stress", "factorConflict": "Konflikt", "factorFamily": "Familie", - "factorSadness": "Traurigkeit" + "factorSadness": "Traurigkeit", + "praise": "Lob" }, "filterBySource": "Nach Quelle filtern", "sourceManual": "Manuell", diff --git a/messages/en.json b/messages/en.json index b1fc9b123..febabae4b 100644 --- a/messages/en.json +++ b/messages/en.json @@ -654,7 +654,8 @@ "factorStress": "stress", "factorConflict": "conflict", "factorFamily": "family", - "factorSadness": "sadness" + "factorSadness": "sadness", + "praise": "praise" }, "filterBySource": "Filter by source", "sourceManual": "Manual", diff --git a/messages/es.json b/messages/es.json index fe35ca751..bad70d032 100644 --- a/messages/es.json +++ b/messages/es.json @@ -654,7 +654,8 @@ "factorStress": "estrés", "factorConflict": "conflicto", "factorFamily": "familia", - "factorSadness": "tristeza" + "factorSadness": "tristeza", + "praise": "elogio" }, "filterBySource": "Filtrar por fuente", "sourceManual": "Manual", diff --git a/messages/fr.json b/messages/fr.json index c7b9df470..5efaddac7 100644 --- a/messages/fr.json +++ b/messages/fr.json @@ -654,7 +654,8 @@ "factorStress": "stress", "factorConflict": "conflit", "factorFamily": "famille", - "factorSadness": "tristesse" + "factorSadness": "tristesse", + "praise": "compliment" }, "filterBySource": "Filtrer par source", "sourceManual": "Manuel", diff --git a/messages/it.json b/messages/it.json index ff1b9d097..7c064c30f 100644 --- a/messages/it.json +++ b/messages/it.json @@ -654,7 +654,8 @@ "factorStress": "stress", "factorConflict": "conflitto", "factorFamily": "famiglia", - "factorSadness": "tristezza" + "factorSadness": "tristezza", + "praise": "elogio" }, "filterBySource": "Filtra per fonte", "sourceManual": "Manuale", diff --git a/messages/pl.json b/messages/pl.json index 73ccf0242..bb5cab1b5 100644 --- a/messages/pl.json +++ b/messages/pl.json @@ -654,7 +654,8 @@ "factorStress": "stres", "factorConflict": "konflikt", "factorFamily": "rodzina", - "factorSadness": "smutek" + "factorSadness": "smutek", + "praise": "pochwała" }, "filterBySource": "Filtruj według źródła", "sourceManual": "Ręcznie", diff --git a/prisma/migrations/0155_v11613_mood_tag_curation/migration.sql b/prisma/migrations/0155_v11613_mood_tag_curation/migration.sql new file mode 100644 index 000000000..4a0333909 --- /dev/null +++ b/prisma/migrations/0155_v11613_mood_tag_curation/migration.sql @@ -0,0 +1,41 @@ +-- v1.16.13 — operator mood-tag catalog curation. +-- +-- Reference-data only on top of 0101 / 0118 / 0119 / 0126. No schema +-- change, no per-user data touched, no destructive delete — every change +-- is an `is_active` flip or an idempotent upsert keyed by `key`, so a +-- re-run is a no-op and historical `mood_entry_tag_links` rows keep +-- resolving their labels (the insights read joins the catalog row by id +-- and does NOT filter `is_active`). +-- +-- Operator walked the capture sheet and asked for: +-- - deactivate the redundant default tags `happy`, `excited`, +-- `hydrated` ("Wasser getrunken") and `music`; +-- - keep `overtime` active — 0126 had deactivated it as a low-signal +-- day-type tag, but the operator wants it back in the work picker; +-- - add a new default tag `praise` ("Lob" / "Praise") under the work +-- category, Lucide `ThumbsUp` (already in the iOS Lucide→SF table). +-- +-- factor_sleep_quality is deliberately LEFT untouched: the curation note +-- premised its removal on a dedicated sleep-quality slider elsewhere, but +-- no such slider exists in the capture surface. It stays one of the three +-- surviving RATED factors (work / sleep quality / sadness) seeded by 0126. + +-- ─── Deactivate the four redundant default tags ────────────────────── +UPDATE "mood_tags" +SET "is_active" = false +WHERE "key" IN ('happy', 'excited', 'hydrated', 'music'); + +-- ─── Re-activate overtime in the work category ─────────────────────── +UPDATE "mood_tags" +SET "is_active" = true +WHERE "key" = 'overtime'; + +-- ─── New default tag: praise (work) ────────────────────────────────── +-- Sort after the existing work tags (productive 0, overtime 1, day_off 2, +-- travel 3, sick_day 4). ThumbsUp keeps the iOS render native (no app +-- update needed). Idempotent upsert by `key`, mirroring 0101 / 0118. +INSERT INTO "mood_tags" ("id", "category_id", "key", "label_key", "icon", "sort_order", "is_active") +VALUES ('mt_praise', 'mtc_work', 'praise', 'mood.tag.praise', 'ThumbsUp', 5, true) +ON CONFLICT ("key") DO UPDATE SET + "category_id" = EXCLUDED."category_id", "label_key" = EXCLUDED."label_key", "icon" = EXCLUDED."icon", + "sort_order" = EXCLUDED."sort_order", "is_active" = EXCLUDED."is_active";