Sync text zoom preference through the account instead of local settings
Local user://settings.cfg meant zoom level didn't follow a student across devices/browsers. Question bank and CCS text scale now live on the user's study profile in Mongo (QuestionTextScale/CcsTextScale), synced through a new PUT /api/profile/me/text-scale endpoint and the existing preferences GET/cache already used for study preferences. Both question_player.gd and ccs_service.gd read the synced value at startup and react to AccountProfileService.profile_changed so a value pulled down after login (or changed from another session) applies without a restart. Backend validates the 0.85-1.35 range and updates only the field(s) provided via a targeted $set, so it can't clobber the other scale or the unrelated study-profile preferences.
This commit is contained in:
@@ -52,7 +52,10 @@ func _run() -> void:
|
||||
|
||||
var clerk_font_size: int = player.search.get_theme_font_size("font_size")
|
||||
var chart_font_size: int = player.summary.get_theme_font_size("normal_font_size")
|
||||
var prior_profile_api_url: String = ProjectSettings.get_setting("step3/profile_api_url", "")
|
||||
ProjectSettings.set_setting("step3/profile_api_url", "http://127.0.0.1:1")
|
||||
player._zoom(ccs_service.TEXT_SCALE_STEP)
|
||||
ProjectSettings.set_setting("step3/profile_api_url", prior_profile_api_url)
|
||||
_assert(player.summary.get_theme_font_size("normal_font_size") > chart_font_size, "text zoom should enlarge clinical chart text")
|
||||
_assert(player.search.get_theme_font_size("font_size") == clerk_font_size, "text zoom should not resize Order Clerk controls")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user