feat(mood): capture the five values without lengthening the quick check-in

- the five faces are untouched: pick one, save, done in a tap
- a closed section below them opens onto five sliders; picking a face
  suggests a pleasantness value and moving that slider takes the
  suggestion over, while the face selection stays where it is
- an untouched slider writes nothing, and clearing one takes the answer
  back rather than leaving a middle value behind
- the list's edit dialog shows and changes the same five, so nothing is
  written on one screen and invisible on the other
- correcting an entry no longer re-derives pleasantness when the label
  did not move, which used to overwrite a hand-set value on any edit
- factor ratings are no longer offered on a new entry and nothing was
  deleted: existing ratings still render, edit and feed the crosstab
- six locales, and the dimension table's keys are declared dynamic
This commit is contained in:
Marc-André Bombeck committed 2026-08-08 01:24:04 +02:00
1 parent 7eaede257e
commit 97582dedc0
13 files changed
+530 -67

No files matched your search

+7 -2
View File
@@ -128,8 +128,13 @@ export const PUT = apiHandler(
updateData.score = getScoreForMood(data.mood);
// v1.37 — pleasantness follows the label the same way `score` does, so
// an entry corrected from "okay" to "bad" cannot keep yesterday's A1.
// An explicit `a1` in the same request overrides it below.
updateData.moodA1 = deriveA1(data.mood);
// Only when the label actually moved, though: the edit dialog sends the
// whole entry back on every save, and re-deriving on an unchanged label
// would overwrite a value the person set by hand every time they
// corrected the timestamp. An explicit `a1` below overrides either way.
if (data.mood !== existing.mood) {
updateData.moodA1 = deriveA1(data.mood);
}
}
// v1.37 — level-A values are per-field on this path: omitted keeps the
// stored value, an explicit number replaces it, an explicit null clears