How 97alexnguyen/p4_submit_tool works
P4 Submit Tool is a Windows desktop client for reviewing Perforce changelists, seeing validation results, running custom project tools, and submitting work. The user-facing flow starts in the React application, which loads P4 data through the API layer and presents changelist operations; the FastAPI sidecar handles Perforce and product services, while the .NET shell hosts the UI and provides native desktop integration. Profiles, settings, validation, and custom tools are distinct supporting capabilities. Some backend and shell connections are shown only where documented or excerpted; uncertain wiring is omitted or marked dashed.
Main entry points: App.jsx App experience · router.py Custom tool endpoints · useP4Data.js P4 data hooks · ToolManager.jsx Custom tool manager
Components 21
Desktop UI
- App experience
p4-submit-tool-cosmic/src/app/App.jsx - P4 data hooks
p4-submit-tool-cosmic/src/hooks/useP4Data.js - Changelist review
p4-submit-tool-cosmic/src/components/changelists - P4 API client
p4-submit-tool-cosmic/src/services/p4Api.js - Custom tool manager
p4-submit-tool-cosmic/src/components/tools/manager/ToolManager.jsx
Perforce workflow
- P4 endpoints
p4-submit-tool-cosmic/backend/app/modules/p4/routes - Perforce service
p4-submit-tool-cosmic/backend/app/modules/p4/services/client.py - Perforce server
Product services
- Validation results
p4-submit-tool-cosmic/backend/app/modules/validation - Project profiles
p4-submit-tool-cosmic/backend/app/modules/profiles - Settings
p4-submit-tool-cosmic/backend/app/modules/settings - Custom tool endpoints
p4-submit-tool-cosmic/backend/app/modules/custom_tools/router.py - Tool execution
p4-submit-tool-cosmic/backend/app/modules/custom_tools/runner.py - Tool configuration
p4-submit-tool-cosmic/backend/app/modules/custom_tools/store.py
Windows shell
- WebView shell
p4-submit-tool-cosmic/desktop/P4SubmitTool.Shell/MainForm.cs - Sidecar process
p4-submit-tool-cosmic/desktop/P4SubmitTool.Shell/BackendProcess.cs - Native tool bridge
p4-submit-tool-cosmic/desktop/P4SubmitTool.Shell/ShellCustomToolsController.cs - Shell diagnostics
p4-submit-tool-cosmic/desktop/P4SubmitTool.Shell/ShellDiagnostics.cs
Sidecar runtime
- FastAPI application
p4-submit-tool-cosmic/backend/app/main.py - HTTP API assembly
p4-submit-tool-cosmic/backend/app/http_api.py
Other components
- Desktop user
Connections 20
- Desktop user → App experience: uses
README.md - App experience → P4 data hooks: loads data
p4-submit-tool-cosmic/src/app/App.jsx - P4 data hooks → P4 API client: requests data
p4-submit-tool-cosmic/src/hooks/useP4Data.js - P4 data hooks → Changelist review: feeds review
- P4 API client → P4 endpoints: calls endpoints
- P4 endpoints → Perforce service: delegates
- Perforce service → Perforce server: reads and mutates
- App experience → Validation results: shows results
- App experience → Project profiles: switches profiles
- App experience → Settings: configures
- Desktop user → Custom tool manager: manages tools
README.md - Custom tool manager → Custom tool endpoints: uses endpoints
- Custom tool manager → P4 API client: opens file picker
p4-submit-tool-cosmic/src/components/tools/manager/ToolManager.jsx - Custom tool endpoints → Tool configuration: persists config
p4-submit-tool-cosmic/backend/app/modules/custom_tools/router.py - Custom tool endpoints → Tool execution: runs tools
p4-submit-tool-cosmic/backend/app/modules/custom_tools/router.py - App experience → WebView shell: hosted by
- WebView shell → Sidecar process: manages sidecar
p4-submit-tool-cosmic/desktop/P4SubmitTool.Shell/MainForm.cs - Native tool bridge → Custom tool endpoints: requests snapshots and runs
p4-submit-tool-cosmic/desktop/P4SubmitTool.Shell/ShellCustomToolsController.cs - Sidecar process → FastAPI application: starts process
- FastAPI application → HTTP API assembly: builds application
p4-submit-tool-cosmic/backend/app/main.py