Close the gap between the flashcards study screen and the mockup

Add real session-history navigation (Previous/Next/Shuffle), compact
side panels, and a segmented progress row to match the mockup layout.
Flashcards now opens straight into Study, with library management
moved into the Options menu ("Manage Flashcards") and Export hidden
from the UI (Import stays). Shuffle is backed by a real, due-before-new
randomized pick on the backend, not a decorative toggle.
This commit is contained in:
hz
2026-07-22 00:43:52 -05:00
parent 70aa425fde
commit 09b670d5d4
21 changed files with 555 additions and 70 deletions
-25
View File
@@ -17,7 +17,6 @@ var deck_selector: OptionButton
var deck_ids: Array = []
var new_deck_button: Button
var study_button: Button
var export_button: Button
var import_button: Button
var search_input: LineEdit
var type_filter: OptionButton
@@ -41,7 +40,6 @@ var editor_tags_input: LineEdit
var editor_hint_label: Label
var editor_error_label: Label
var export_menu: PanelContainer
var import_menu: PanelContainer
var dropdown_backdrop: Control
@@ -100,7 +98,6 @@ func _ready() -> void:
FlashcardService.notes_loaded.connect(_on_notes_loaded)
FlashcardService.note_saved.connect(_on_note_saved)
FlashcardService.request_failed.connect(_on_request_failed)
FlashcardService.export_ready.connect(_on_export_ready)
FlashcardService.import_preview_ready.connect(_on_import_preview_ready)
FlashcardService.import_committed.connect(_on_import_committed)
UIThemeService.theme_changed.connect(func(_dark: bool): _refresh_status())
@@ -228,20 +225,6 @@ func _build_toolbar() -> void:
FlashcardService.pick_import_file("json")],
])
export_button = Button.new()
export_button.text = "Export"
export_button.custom_minimum_size = Vector2(0, 44)
export_button.pressed.connect(func(): _toggle_dropdown(export_menu, export_button))
row.add_child(export_button)
export_menu = _build_dropdown([
["Export CSV", func():
status_label.text = "Preparing export..."
FlashcardService.export_csv()],
["Export JSON", func():
status_label.text = "Preparing export..."
FlashcardService.export_json()],
])
func _style_primary_button(button: Button) -> void:
var normal := StyleBoxFlat.new()
@@ -301,8 +284,6 @@ func _toggle_dropdown(menu: PanelContainer, anchor: Control) -> void:
func _close_dropdowns() -> void:
if export_menu != null:
export_menu.visible = false
if import_menu != null:
import_menu.visible = false
if dropdown_backdrop != null:
@@ -684,10 +665,6 @@ func _start_study() -> void:
main.show_screen("flashcards_study", _selected_deck_id())
func _on_export_ready(location: String) -> void:
status_label.text = "Exported to %s." % location
# ---------- Import preview / commit ----------
func _build_import_overlay() -> void:
@@ -813,8 +790,6 @@ func _refresh_status() -> void:
editor_deck_label.add_theme_color_override("font_color", Brand.muted_color(dark))
if import_panel != null:
import_panel.add_theme_stylebox_override("panel", Brand.panel_box(dark))
if export_menu != null:
export_menu.add_theme_stylebox_override("panel", Brand.panel_box(dark))
if import_menu != null:
import_menu.add_theme_stylebox_override("panel", Brand.panel_box(dark))
if list_card != null: