AI-Assisted Block Diagram Flow¶
User asks the AI for a block diagram (e.g. default Ka band satellite transmitter); the AI returns a tool call; the frontend runs the design and auto-opens the Transmitter Power Flow modal (ChainOverview) only. The schematic and other views are not opened.
End-to-end flow¶
sequenceDiagram
participant User
participant GeminiSidebar
participant Backend
participant Context
participant ChainBlockDiagram
User->>GeminiSidebar: Ask for block diagram
GeminiSidebar->>Backend: POST message
Backend->>GeminiSidebar: reply plus tool_calls generate_block_diagram
GeminiSidebar->>GeminiSidebar: handleToolCalls build params update Phase I
GeminiSidebar->>GeminiSidebar: designTransmitterChain then goToPhase 2
GeminiSidebar->>Context: requestOpenBlockDiagram
Context->>ChainBlockDiagram: openBlockDiagramTrigger incremented
ChainBlockDiagram->>ChainBlockDiagram: useEffect set block diagram modal open only
Note over ChainBlockDiagram: Transmitter Power Flow modal (ChainOverview) opens. Schematic not opened.
Auto-open mechanism¶
A context holds openBlockDiagramTrigger (number) and requestOpenBlockDiagram(). After the design runs and the user is navigated to Phase II, GeminiSidebar calls requestOpenBlockDiagram(), which increments the trigger. ChainBlockDiagram subscribes to that trigger; when it increases and selectedChain exists, it opens the Transmitter Power Flow modal (ChainOverview — the blue Power Flow button, NOT the green Block Diagram one). The RF Schematic and other views are not opened.
flowchart LR
BlockDiagramContext[BlockDiagramOpenContext]
GeminiSidebar[GeminiSidebar]
ChainBlockDiagram[ChainBlockDiagram]
BlockDiagramContext --> GeminiSidebar
BlockDiagramContext --> ChainBlockDiagram
GeminiSidebar -->|requestOpenBlockDiagram| BlockDiagramContext
ChainBlockDiagram -->|trigger and selectedChain| ChainBlockDiagram
Where it lives in the tree¶
RfModuleWithProject→PhaseProvider→RfModuleProvider→BlockDiagramOpenContext.Providerwraps sidebar and main content.GeminiSidebarand the Phase II content (includingChainBlockDiagram) are consumers of the context.- Only the Transmitter Power Flow modal (ChainOverview) is opened; the schematic and other views are not opened.
Implementation checklist¶
| Layer | Action |
|---|---|
| Backend | Add generate_block_diagram tool; add it to the tools array in chat_gemini.py. |
| Frontend | Add BlockDiagramOpenContext (trigger + requestOpenBlockDiagram); mount provider in RfModuleWithProject. |
| Frontend | In GeminiSidebar, handle generate_block_diagram in handleToolCalls: build params, update Phase I, run design, goToPhase(2), then requestOpenBlockDiagram(). |
| Frontend | In ChainBlockDiagram, subscribe to the trigger; in a useEffect, when trigger increases and selectedChain exists, open the Transmitter Power Flow modal (ChainOverview) only. Do not open the RF Schematic, Mermaid, or any other view. |
Backend tool reference¶
Tool name: generate_block_diagram. Optional param: application_type (e.g. satcom_ka_band_consumer).