feat(profiles): add training planning preferences to user profile
Deploy Development / deploy (push) Successful in 40s
Test Suite / pytest-backend (push) Successful in 35s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 11s
Test Suite / playwright-tests (push) Successful in 56s
Deploy Development / deploy (push) Successful in 40s
Test Suite / pytest-backend (push) Successful in 35s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 11s
Test Suite / playwright-tests (push) Successful in 56s
- Introduced `training_planning_prefs` field in the ProfileUpdate model to store user-specific UI options for training planning. - Updated the backend to handle the new preferences during profile updates, ensuring proper validation and storage. - Enhanced the frontend to allow users to select their preferred display mode for training modules in the Account Settings page. - Updated version to 0.8.98 and adjusted database schema version accordingly, reflecting the new feature integration. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
05042ee9ec
commit
f4f5642c21
7 files changed
+140
-20
No files matched your search
@@ -1,11 +1,26 @@
|
||||
/**
|
||||
* Darstellung „Herkunft Trainingsmodul“ in Abschnitten (Planungs-Editor).
|
||||
*
|
||||
* - compact_tag_legend (Standard): wenig Höhe — farbige Leiste am Eintrag,
|
||||
* kleiner Modul-Tag in der Zeile, Legende pro Abschnitt unten (Farbe ⇄ Modul).
|
||||
* - full_outline_headers: früheres Verhalten mit großem Kopf-Bereich inkl.
|
||||
* Auflistung der Übungen (viel Platz, maximale Orientierung ohne Scroll).
|
||||
* Der Modus kommt aus dem Profil (`training_planning_prefs.module_display_mode`).
|
||||
* Standard: kompakt (Tags + Legende). Voll: großer Kopf mit Auflistung der Übungen.
|
||||
*
|
||||
* Zum Zurückschalten: Wert hier auf `'full_outline_headers'` setzen oder Datei reverten.
|
||||
* Früher: Umschalter nur in dieser Datei. Jetzt: unter Einstellungen speichern;
|
||||
* hier nur Konstanten und Resolver.
|
||||
*/
|
||||
export const PLANNING_MODULE_UX_MODE = 'compact_tag_legend'
|
||||
export const PLANNING_MODULE_DISPLAY_MODES = /** @type {const} */ ({
|
||||
COMPACT_TAG_LEGEND: 'compact_tag_legend',
|
||||
FULL_OUTLINE_HEADERS: 'full_outline_headers',
|
||||
})
|
||||
|
||||
/** @param {string | undefined | null} pref */
|
||||
export function resolvePlanningModuleDisplayMode(pref) {
|
||||
if (pref === PLANNING_MODULE_DISPLAY_MODES.FULL_OUTLINE_HEADERS) {
|
||||
return PLANNING_MODULE_DISPLAY_MODES.FULL_OUTLINE_HEADERS
|
||||
}
|
||||
return PLANNING_MODULE_DISPLAY_MODES.COMPACT_TAG_LEGEND
|
||||
}
|
||||
|
||||
/** @param {string | undefined | null} pref */
|
||||
export function isCompactTagLegendMode(pref) {
|
||||
return resolvePlanningModuleDisplayMode(pref) === PLANNING_MODULE_DISPLAY_MODES.COMPACT_TAG_LEGEND
|
||||
}
|
||||
Reference in new issue
Block a user