From 4db5b9d37468f9bb152fc7e14a43e4771c9b6abd Mon Sep 17 00:00:00 2001 From: hz Date: Thu, 23 Jul 2026 01:47:11 -0500 Subject: [PATCH] Drop the redundant status icon and "Review: B..." label from follow-up panels The choice button above the panel already shows the letter badge, choice text, and percentage, so repeating them in the panel header was redundant now that the panel is docked inside the choice's card. Keeps the collapse toggle, now named FollowupToggle since the old FollowupSummary button it lived on is gone. --- scripts/ui/question_player.gd | 30 +++++++----------------------- tests/post_answer_review_test.gd | 4 ++-- 2 files changed, 9 insertions(+), 25 deletions(-) diff --git a/scripts/ui/question_player.gd b/scripts/ui/question_player.gd index 4d4b249..d3e04ae 100644 --- a/scripts/ui/question_player.gd +++ b/scripts/ui/question_player.gd @@ -3339,29 +3339,12 @@ func _build_followup_header(content: VBoxContainer, state: Dictionary, expanded: row.add_theme_constant_override("separation", 10) content.add_child(row) - var status := Label.new() - status.text = "✓" if is_main_correct else "x" - status.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER - status.vertical_alignment = VERTICAL_ALIGNMENT_CENTER - status.custom_minimum_size = Vector2(30, 30) - status.add_theme_stylebox_override("normal", Brand.icon_circle_box(dark, accent, 15, true)) - _set_scaled_label(status, 15, Color.WHITE) - row.add_child(status) - - var summary := Button.new() - summary.name = "FollowupSummary" - summary.flat = true - summary.text = "Review: %s. %s" % [_display_label_for_choice_id(str(state.get("choice_id", ""))), str(state.get("choice_text", ""))] - summary.alignment = HORIZONTAL_ALIGNMENT_LEFT - summary.size_flags_horizontal = Control.SIZE_EXPAND_FILL - summary.disabled = not interactive - _set_scaled_button_font(summary, 15) - summary.add_theme_color_override("font_color", Brand.text_color(dark)) - summary.add_theme_color_override("font_hover_color", accent) - summary.add_theme_color_override("font_disabled_color", Brand.text_color(dark)) - if interactive: - summary.pressed.connect(_toggle_followup_state.bind(str(state.get("choice_id", "")))) - row.add_child(summary) + # The choice button above this panel already shows the letter badge, choice + # text, and percentage, so the header only needs a spacer plus the collapse + # toggle - repeating "Review: B. ..." and a status icon here was redundant. + var spacer := Control.new() + spacer.size_flags_horizontal = Control.SIZE_EXPAND_FILL + row.add_child(spacer) var percentage := _get_choice_selection_percentage(str(state.get("choice_id", ""))) if percentage >= 0: @@ -3375,6 +3358,7 @@ func _build_followup_header(content: VBoxContainer, state: Dictionary, expanded: if interactive: var toggle := Button.new() + toggle.name = "FollowupToggle" toggle.flat = true toggle.tooltip_text = "Collapse review" if expanded else "Expand review" toggle.icon = preload("res://assets/icons/lucide/chevron-down.svg") if expanded else preload("res://assets/icons/lucide/chevron-right.svg") diff --git a/tests/post_answer_review_test.gd b/tests/post_answer_review_test.gd index 4ec4139..8924439 100644 --- a/tests/post_answer_review_test.gd +++ b/tests/post_answer_review_test.gd @@ -196,8 +196,8 @@ func _test_collapsed_followup_review_expands() -> void: "teaching_point": "Review the finding.", "resolved": true, "collapsed": true } player._render_followup_state("B") - var review_button := content.find_child("FollowupSummary", true, false) as Button - _assert(review_button != null, "collapsed follow-up should render a review button") + var review_button := content.find_child("FollowupToggle", true, false) as Button + _assert(review_button != null, "collapsed follow-up should render a toggle button") if review_button != null: review_button.pressed.emit() _assert(not bool(player.followup_states["B"].get("collapsed", true)), "review button should expand the resolved follow-up")