1.5 KiB
1.5 KiB
AGENTS.md - leanring-buddy (Main App Target)
Source Files
FloatingSessionButton.swift
FloatingSessionButtonManager—@MainActorclass managing theNSPanellifecycleshowFloatingButton()— Creates/shows the panel in top-right of primary screenhideFloatingButton()— Hides panel (keeps it alive for quick re-show)destroyFloatingButton()— Removes panel permanently (session ended)onFloatingButtonClicked— Callback closure, set by ContentView to bring main window to frontfloatingButtonPanel— ExposedNSPanelreference for screenshot exclusion
FloatingButtonView— Private SwiftUI view with gradient circle, scale+glow hover animation, pointer cursor
ContentView.swift
- Receives
FloatingSessionButtonManagervia@EnvironmentObject isMainWindowCurrentlyFocused— Tracks main window focus stateconfigureFloatingButtonManager()— Wires up the click callbackstartObservingMainWindowFocusChanges()— Sets upNSWindownotification observersupdateFloatingButtonVisibility()— Core logic: show if running + not focused, hide otherwisebringMainWindowToFront()— Activates app and orders main window front
ScreenshotManager.swift
floatingButtonWindowToExcludeFromCaptures—NSWindow?reference set by ContentViewcaptureScreen()— Matches the floating window to anSCWindowand excludes it from capture filter
leanring_buddyApp.swift
- Owns
FloatingSessionButtonManageras@StateObject - Injects it into ContentView via
.environmentObject()