Skip to content

project_launcher

Manages the full project launcher view: project listing, creation, metadata display, technician selection, write-access request, and launching into the plant design main controller.

Structure

project_launcher/
    controller/
        launcher_controller.py            LauncherController - main launcher orchestration
        history_export.py                 Project history download, merge, and HTML export
    view/
        launcher_view.py                  LauncherView - main launcher layout (stacked widget)
        project_card_view.py              LauncherProjectCard - card widget for project list
        technician_selection_widget.py    TechnicianSelectionWidget - self-contained technician picker
        pyui/
            ui_pd_launcher_view.py        Auto-generated from pd_launcher_view.ui
            ui_pd_launcher_project_card.py  Auto-generated from pd_launcher_project_card.ui
        ui/
            pd_launcher_view.ui           Qt Designer file for launcher layout
            pd_launcher_project_card.ui   Qt Designer file for project card
    constants/
        technician_config.py              RESTRICTED_TECHNICIAN_ACCOUNTS

Usage

from src.modules.plant_design.startup_system.bound_subsystems.project_launcher.controller.launcher_controller import (
    LauncherController,
)
from src.modules.plant_design.startup_system.bound_subsystems.project_launcher.view.launcher_view import (
    LauncherView,
)

view = LauncherView()
controller = LauncherController(
    view=view,
    main_stack=main_stack,
    software_label=software_label,
    smart_back_button=smart_back_button,
)

Key Classes

LauncherController

Top-level coordinator. Lists projects via ProjectRepository, displays metadata, handles project creation with ProjectMetadata, and manages write-access requests via RequestWriteDialog + PlantDesignSession. On successful launch, creates PDMainController and navigates to it. Tracks opened projects via RecentProjectsManager. Handles return-from-PD cleanup (session close, stack navigation back).

LauncherView

Main launcher layout with a QStackedWidget containing three pages: project detail view (index 0), project creation form (index 1), and project selection/search list (index 2). Replaces the designer ComboBox placeholder with TechnicianSelectionWidget at runtime.

LauncherProjectCard

Card widget displayed as items in the project list. Shows a folder icon (via IconRegistry), project ID, and project name.

TechnicianSelectionWidget

Self-contained widget for selecting project technicians. Shows available organization members as clickable cards in a horizontal scroll area. Selected technicians appear below with avatar, name, email, and a remove button. Uses get_organization_members_detailed() for member data and filters restricted accounts via RESTRICTED_TECHNICIAN_ACCOUNTS.

history_export (module)

Downloads per-stage history logs from R2, merges them chronologically, and exports to a self-contained HTML document via export_project_history().

Signals

Signal Source Args Description
technicians_changed TechnicianSelectionWidget list[str] Technician selection changed
clicked _TechnicianCard str User card clicked in selector
remove_requested SelectedTechnicianItem str Remove button clicked on selected technician

Stylesheets

External QSS files registered via StylesheetManager:

  • launcher_view.qss - Main launcher layout styling
  • launcher_project_card.qss - Project card styling
  • technician_card.qss - Technician selector and selected item styling

Located in data/.app_data/stylesheets/modules/plant_design/startup_system/project_launcher/.

Dependencies

Sibling Subsystems

  • project_repository - ProjectRepository, ProjectMetadata, R2 key builders
  • pd_session_orchestration - PlantDesignSession, RequestWriteDialog, SessionError
  • recent_projects - RecentProjectsManager

Parent Module

  • pd_runtime_system.orchestration - PDMainController

Shared Services

  • security.login_manager - unified_auth_manager, get_organization_members_detailed
  • rendering.icons - IconRegistry, render_svg, Icons, IconColors
  • rendering.stylesheets - StylesheetManager
  • cloud_com.r2_com - BucketService (history export)
  • prompt_dialogs - show_warning
  • state.app_state - AppState

Legacy (not yet migrated)

  • modules.plant_design.view.pd_core.pd_main_view - PlantDesignMainWidgetView (see TODO.md)