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:
@@ -3339,29 +3339,12 @@ func _build_followup_header(content: VBoxContainer, state: Dictionary, expanded:
|
|||||||
row.add_theme_constant_override("separation", 10)
|
row.add_theme_constant_override("separation", 10)
|
||||||
content.add_child(row)
|
content.add_child(row)
|
||||||
|
|
||||||
var status := Label.new()
|
# The choice button above this panel already shows the letter badge, choice
|
||||||
status.text = "✓" if is_main_correct else "x"
|
# text, and percentage, so the header only needs a spacer plus the collapse
|
||||||
status.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
# toggle - repeating "Review: B. ..." and a status icon here was redundant.
|
||||||
status.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
|
var spacer := Control.new()
|
||||||
status.custom_minimum_size = Vector2(30, 30)
|
spacer.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||||
status.add_theme_stylebox_override("normal", Brand.icon_circle_box(dark, accent, 15, true))
|
row.add_child(spacer)
|
||||||
_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)
|
|
||||||
|
|
||||||
var percentage := _get_choice_selection_percentage(str(state.get("choice_id", "")))
|
var percentage := _get_choice_selection_percentage(str(state.get("choice_id", "")))
|
||||||
if percentage >= 0:
|
if percentage >= 0:
|
||||||
@@ -3375,6 +3358,7 @@ func _build_followup_header(content: VBoxContainer, state: Dictionary, expanded:
|
|||||||
|
|
||||||
if interactive:
|
if interactive:
|
||||||
var toggle := Button.new()
|
var toggle := Button.new()
|
||||||
|
toggle.name = "FollowupToggle"
|
||||||
toggle.flat = true
|
toggle.flat = true
|
||||||
toggle.tooltip_text = "Collapse review" if expanded else "Expand review"
|
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")
|
toggle.icon = preload("res://assets/icons/lucide/chevron-down.svg") if expanded else preload("res://assets/icons/lucide/chevron-right.svg")
|
||||||
|
|||||||
@@ -196,8 +196,8 @@ func _test_collapsed_followup_review_expands() -> void:
|
|||||||
"teaching_point": "Review the finding.", "resolved": true, "collapsed": true
|
"teaching_point": "Review the finding.", "resolved": true, "collapsed": true
|
||||||
}
|
}
|
||||||
player._render_followup_state("B")
|
player._render_followup_state("B")
|
||||||
var review_button := content.find_child("FollowupSummary", true, false) as Button
|
var review_button := content.find_child("FollowupToggle", true, false) as Button
|
||||||
_assert(review_button != null, "collapsed follow-up should render a review button")
|
_assert(review_button != null, "collapsed follow-up should render a toggle button")
|
||||||
if review_button != null:
|
if review_button != null:
|
||||||
review_button.pressed.emit()
|
review_button.pressed.emit()
|
||||||
_assert(not bool(player.followup_states["B"].get("collapsed", true)), "review button should expand the resolved follow-up")
|
_assert(not bool(player.followup_states["B"].get("collapsed", true)), "review button should expand the resolved follow-up")
|
||||||
|
|||||||
Reference in New Issue
Block a user