Architecture¶
This page summarizes the app architecture to support maintenance and extension.
High-Level Layers¶
ui: PyQt widgets and user interactions.services: M3/SAM3 service integration and backend operations.state: app-level state and settings.models: data entries and hydration helpers.util: logging, async helpers, and utility functions.
Main Runtime Flow¶
- Entry point creates
QApplicationandAppWindow. AppWindowperforms login and service configuration.SearchPanelloads concepts and query results.ImagedMomentTreecoordinates moment/observation selection.ImageViewhandles image rendering, box interactions, and optional SAM3.
Key UI Components¶
AppWindow: shell, menu, status, and wiring.SearchPanel: query modes, controls, pagination.ImagedMomentTree: synchronized tabular browser.DisplayPanel: SAM status/controls and image view.ImageView: graphics scene and localization logic.SettingsDialog: tabbed app configuration.
State Signals¶
AppStateStore signals synchronize user, loading, concept, and result count state across panels.
Async Operations¶
run_async is used for non-blocking service calls, including:
- concept list loading
- image fetch
- video metadata fetch
- SAM3 candidate operations
Permissions and Modes¶
- Normal users edit owned observations.
- Privileged roles can toggle Admin Mode from Options.