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.
This commit is contained in:
hz
2026-07-23 01:47:11 -05:00
parent 2a2ff29389
commit 4db5b9d374
2 changed files with 9 additions and 25 deletions
+7 -23
View File
@@ -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")
+2 -2
View File
@@ -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")