Add synced user notes

This commit is contained in:
hz
2026-07-18 22:22:29 -05:00
parent a232e18c46
commit d0bb271b14
22 changed files with 930 additions and 2 deletions
+20 -1
View File
@@ -12,6 +12,7 @@ var sound_toggle: CheckButton
var theme_button: Button
var feedback_button: Button
var feedback_dialog: Control
var notes_dialog: Control
var session_expiry_dialog: Control
var theme_service
var current_screen_name := ""
@@ -283,9 +284,18 @@ func _build_ui() -> void:
screens_container.add_child(settings)
screens["settings"] = settings
var notes := preload("res://scripts/ui/notes_screen.gd").new()
notes.name = "NotesScreen"
notes.main = self
screens_container.add_child(notes)
screens["notes"] = notes
feedback_dialog = preload("res://scripts/ui/app_feedback_dialog.gd").new()
feedback_dialog.name = "AppFeedbackDialog"
add_child(feedback_dialog)
notes_dialog = preload("res://scripts/ui/notes_dialog.gd").new()
notes_dialog.name = "NotesDialog"
add_child(notes_dialog)
session_expiry_dialog = preload("res://scripts/ui/session_expiry_dialog.gd").new()
session_expiry_dialog.name = "SessionExpiryDialog"
session_expiry_dialog.logout_requested.connect(_logout)
@@ -348,7 +358,7 @@ func _populate_navigation(container: VBoxContainer, include_brand: bool) -> void
_add_nav_button(container, "flashcards", "Flashcards", "copy", false)
_add_nav_button(container, "study_plan", "Study Plan", "calendar-days", true)
_add_nav_button(container, "bookmarks", "Bookmarks", "bookmark", false)
_add_nav_button(container, "notes", "Notes", "notebook-pen", false)
_add_nav_button(container, "notes", "Notes", "notebook-pen", true)
var spacer := Control.new()
spacer.size_flags_vertical = Control.SIZE_EXPAND_FILL
@@ -391,6 +401,7 @@ func _on_navigation_pressed(key: String) -> void:
"performance": show_screen("profile")
"study_plan": show_screen("map")
"settings": show_screen("settings")
"notes": show_screen("notes")
"logout": _logout()
@@ -648,6 +659,14 @@ func open_feedback_dialog() -> void:
feedback_dialog.show_dialog(FeedbackService.build_context(current_screen_name, get_viewport_rect().size))
func open_notes_dialog() -> void:
if not AuthState.is_logged_in or notes_dialog == null:
return
if current_screen_name != "player" or BlockSessionService.session_kind == "simulation":
return
notes_dialog.show_dialog()
func _on_theme_changed(is_dark_mode: bool) -> void:
Style.refresh_tree(self, not is_dark_mode)
_refresh_theme_button()