From fd372532b5c5d2cf5688ae77fdbe4bf002f562bf Mon Sep 17 00:00:00 2001 From: hz Date: Thu, 16 Jul 2026 23:28:19 -0500 Subject: [PATCH] Fix remaining web study mode artifacts --- scripts/ui/main.gd | 15 ++++++++++----- scripts/ui/study_selector.gd | 32 ++------------------------------ tests/web_responsive_test.gd | 6 ++++++ 3 files changed, 18 insertions(+), 35 deletions(-) diff --git a/scripts/ui/main.gd b/scripts/ui/main.gd index 11b365b..4945ad8 100644 --- a/scripts/ui/main.gd +++ b/scripts/ui/main.gd @@ -193,6 +193,8 @@ func _build_ui() -> void: theme_button.custom_minimum_size = Vector2(44, 44) theme_button.size_flags_horizontal = Control.SIZE_SHRINK_CENTER theme_button.size_flags_vertical = Control.SIZE_SHRINK_CENTER + theme_button.alignment = HORIZONTAL_ALIGNMENT_CENTER + theme_button.icon_alignment = HORIZONTAL_ALIGNMENT_CENTER theme_button.focus_mode = Control.FOCUS_NONE theme_button.pressed.connect(theme_service.toggle_theme) _style_shell_theme_button(theme_button) @@ -600,16 +602,19 @@ func _style_shell_theme_button(button: Button) -> void: normal.bg_color = Color("111b30") if dark else Brand.LIGHT_SURFACE normal.border_color = Color("33415d") if dark else Brand.LIGHT_BORDER normal.set_border_width_all(1) - normal.set_corner_radius_all(24) - normal.content_margin_left = 10 - normal.content_margin_right = 10 - normal.content_margin_top = 10 - normal.content_margin_bottom = 10 + normal.set_corner_radius_all(22) + normal.content_margin_left = 0 + normal.content_margin_right = 0 + normal.content_margin_top = 0 + normal.content_margin_bottom = 0 var hover := normal.duplicate() as StyleBoxFlat hover.border_color = Brand.AMBER + var focus := StyleBoxEmpty.new() button.add_theme_stylebox_override("normal", normal) button.add_theme_stylebox_override("hover", hover) button.add_theme_stylebox_override("pressed", hover) + button.add_theme_stylebox_override("focus", focus) + button.add_theme_constant_override("h_separation", 0) button.add_theme_color_override("font_color", Brand.AMBER) button.add_theme_color_override("font_hover_color", Brand.AMBER) diff --git a/scripts/ui/study_selector.gd b/scripts/ui/study_selector.gd index d26a9c9..727f195 100644 --- a/scripts/ui/study_selector.gd +++ b/scripts/ui/study_selector.gd @@ -185,7 +185,7 @@ func _build_mode_view() -> void: "Coming Soon", "Coming Soon", "Endless practice with AI-generated questions\ntailored to your performance.", - "medmind", + "activity", false, Brand.PURPLE) @@ -202,35 +202,6 @@ func _build_mode_view() -> void: ccs_status_label = ccs_card.status ccs_button.pressed.connect(_select_ccs) - var spacer := Control.new() - spacer.size_flags_vertical = Control.SIZE_EXPAND_FILL - mode_view.add_child(spacer) - - var simulation_note := HBoxContainer.new() - simulation_note.add_theme_constant_override("separation", 8) - mode_view.add_child(simulation_note) - var info := Label.new() - info.text = "i" - info.add_theme_font_size_override("font_size", 17) - info.add_theme_color_override("font_color", Brand.SLATE) - simulation_note.add_child(info) - var note := RichTextLabel.new() - note.bbcode_enabled = true - note.fit_content = true - note.scroll_active = false - note.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART - note.size_flags_horizontal = Control.SIZE_EXPAND_FILL - note.custom_minimum_size.x = 0 - note.text = "Full-length, 12-block simulation is available in the [url=exams][color=#7c3aed]Exams[/color][/url] section." - note.add_theme_font_override("normal_font", Brand.font) - note.add_theme_font_size_override("normal_font_size", 15) - note.add_theme_color_override("default_color", Brand.SLATE) - note.set_meta("medmind_role", "muted_rich") - themed_controls.append(note) - note.meta_clicked.connect(func(_meta: Variant): main.show_screen("simulation_history")) - simulation_note.add_child(note) - - func _add_mode_card( title_text: String, subtitle_text: String, @@ -277,6 +248,7 @@ func _add_mode_card( themed_controls.append(icon_panel) header.add_child(icon_panel) var icon := TextureRect.new() + icon.name = "%sIcon" % title_text.replace(" ", "") icon.mouse_filter = Control.MOUSE_FILTER_IGNORE icon.texture = preload("res://assets/branding/medmind-icon.png") if icon_name == "medmind" else load("res://assets/icons/lucide/%s.svg" % icon_name) icon.material = Brand.logo_cutout_material() if icon_name == "medmind" else null diff --git a/tests/web_responsive_test.gd b/tests/web_responsive_test.gd index 86224d1..f47326b 100644 --- a/tests/web_responsive_test.gd +++ b/tests/web_responsive_test.gd @@ -27,6 +27,11 @@ func _run() -> void: _assert(card.custom_minimum_size.x == 0.0, "phone-width cards should release their desktop minimum width") for row in selector.responsive_card_rows: _assert(row.vertical, "phone-width card content should stack instead of clipping") + _assert(selector.mode_view.find_children("*", "RichTextLabel", true, false).is_empty(), "study modes should not render the legacy rich-text simulation note") + var dynamic_icon := selector.mode_view.find_child("DynamicQuestionsIcon", true, false) as TextureRect + _assert(dynamic_icon != null, "dynamic questions should expose its mode icon") + if dynamic_icon != null: + _assert(dynamic_icon.texture.resource_path == "res://assets/icons/lucide/activity.svg", "dynamic questions should use a web-safe vector icon") var main_screen = load("res://scripts/ui/main.gd").new() main_screen.size = host.size @@ -35,6 +40,7 @@ func _run() -> void: main_screen._update_responsive_layout() _assert(main_screen.theme_button.custom_minimum_size == Vector2(44, 44), "the theme toggle should keep a stable square footprint") _assert(main_screen.theme_button.size.x >= 44.0 and main_screen.theme_button.size.y >= 44.0, "the theme toggle should not collapse into an oval") + _assert(main_screen.theme_button.icon_alignment == HORIZONTAL_ALIGNMENT_CENTER, "the theme toggle icon should remain centered") _assert(not main_screen.user_label.visible and not main_screen.account_chevron_button.visible, "nonessential account controls should collapse on phone-width headers") host.queue_free()