Reduce answer review scroll redraws

This commit is contained in:
hz
2026-07-30 05:01:18 -05:00
parent 9402a5d6de
commit 6b2d8b6f81
2 changed files with 26 additions and 1 deletions
+15
View File
@@ -22,6 +22,7 @@ func _initialize() -> void:
_test_feedback_context_excludes_study_content()
_test_feedback_form_validation()
_test_revisitable_navigation_prefers_unanswered_questions()
_test_timer_text_avoids_redundant_frame_updates()
_test_submit_styles_keep_stable_geometry()
_test_core_timer_counts_up_and_remains_visible()
await _test_player_runtime_construction()
@@ -355,6 +356,20 @@ func _test_revisitable_navigation_prefers_unanswered_questions() -> void:
session.current_index = prior_index
func _test_timer_text_avoids_redundant_frame_updates() -> void:
var player = load("res://scripts/ui/question_player.gd").new()
player.timer_label = Label.new()
player._set_timer_display(65)
_assert(player.timer_label.text == "01:05", "timer should render a changed second")
player.timer_label.text = "unchanged"
player._set_timer_display(65)
_assert(player.timer_label.text == "unchanged", "timer should not rewrite its label every frame")
player._set_timer_display(66)
_assert(player.timer_label.text == "01:06", "timer should render the next changed second")
player.timer_label.free()
player.free()
func _test_player_runtime_construction() -> void:
var host := Control.new()
root.add_child(host)