Fix login/calculator theme bugs, gate flashcard button, hide system label pre-answer

- Steam-linked login no longer writes literal "<null>" into the email field
  (and no longer locks it read-only) when the verified identity has no email
- Login screen releases focus on app focus-out so the username caret stops
  blinking while the window is inactive
- Calculator display text stays legible in light mode; the LCD-style panel
  background is always dark, so its text should not follow the app theme
- Question player: gate the "save as flashcard" toolbar button behind
  Brand.is_uat_environment(), matching the nav item, so it's hidden in prod
- Hide the discipline/system label while a question is unanswered so it
  can't hint at the answer; reveal it once the explanation is shown
- Top-align question content instead of vertically centering it, with a
  20px top margin, so it sits closer to the progress indicator
This commit is contained in:
hz
2026-07-27 00:43:18 -05:00
parent 23d573e221
commit 9f836c8765
3 changed files with 18 additions and 12 deletions
+7 -9
View File
@@ -467,6 +467,7 @@ func _ready() -> void:
content_margin.size_flags_vertical = Control.SIZE_EXPAND_FILL
content_margin.add_theme_constant_override("margin_left", 4)
content_margin.add_theme_constant_override("margin_right", 12)
content_margin.add_theme_constant_override("margin_top", 20)
question_scroll.add_child(content_margin)
question_content = VBoxContainer.new()
@@ -1305,7 +1306,7 @@ func _load_question() -> void:
if category_text.is_empty():
category_text = str(question.get("system", "")).strip_edges()
category_label.text = category_text
category_label.visible = not category_text.is_empty()
category_label.visible = false
_refresh_labs_button()
presented_choices = question.get("presented_choices", question.get("choices", [])).duplicate(true)
@@ -1716,6 +1717,7 @@ func _show_explanation() -> void:
explanation_plain_text = str(question.get("explanation", ""))
_render_explanation()
explanation_label.visible = true
category_label.visible = not category_label.text.strip_edges().is_empty()
_update_question_elo_label(true)
_refresh_nav_palette()
_update_content_vertical_alignment()
@@ -1740,6 +1742,8 @@ func _clear_answer_review() -> void:
explanation_label.visible = false
if correct_review_panel != null:
correct_review_panel.visible = false
if category_label != null:
category_label.visible = false
_clear_container_children(teaching_cards)
_clear_container_children(review_followups_content)
review_followup_states.clear()
@@ -1751,13 +1755,7 @@ func _clear_answer_review() -> void:
func _update_content_vertical_alignment() -> void:
if question_content == null:
return
# Before an answer is submitted the stem+choices block is usually shorter than the
# available panel height; center it so it doesn't sit pinned to the top with a slab
# of empty space below. Once the answer review content appears, go back to top
# alignment so the growing explanation/follow-up sections read top-down and scroll
# naturally instead of being centered mid-panel.
var answered := correct_review_panel != null and correct_review_panel.visible
question_content.alignment = BoxContainer.ALIGNMENT_BEGIN if answered else BoxContainer.ALIGNMENT_CENTER
question_content.alignment = BoxContainer.ALIGNMENT_BEGIN
func _clear_container_children(container: Control) -> void:
@@ -2279,7 +2277,7 @@ func _refresh_toolbar_state() -> void:
if notes_button != null:
notes_button.visible = BlockSessionService.session_kind not in ["simulation", "dynamic"]
if flashcard_button != null:
flashcard_button.visible = BlockSessionService.session_kind not in ["simulation", "dynamic"]
flashcard_button.visible = Brand.is_uat_environment() and BlockSessionService.session_kind not in ["simulation", "dynamic"]
flashcard_button.disabled = current_answer.is_empty()
if bookmark_button != null:
bookmark_button.visible = BlockSessionService.session_kind not in ["simulation", "dynamic"]