Files
shinkan-jinkendo/frontend/src/config/planningModuleUx.js
T
LarsandClaude Sonnet 4.6 f4f5642c21
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
feat(profiles): add training planning preferences to user profile
- 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>
2026-05-12 22:36:19 +02:00

27 lines
1.0 KiB
JavaScript

/**
* Darstellung „Herkunft Trainingsmodul“ in Abschnitten (Planungs-Editor).
*
* Der Modus kommt aus dem Profil (`training_planning_prefs.module_display_mode`).
* Standard: kompakt (Tags + Legende). Voll: großer Kopf mit Auflistung der Übungen.
*
* Früher: Umschalter nur in dieser Datei. Jetzt: unter Einstellungen speichern;
* hier nur Konstanten und Resolver.
*/
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
}