Continuing work removing legacy functions and implementing UI changes
Build Library / Build Library (push) Failing after 3m58s

This commit is contained in:
2025-11-10 15:17:07 -05:00
parent a498a94199
commit d9cbce6175
10 changed files with 188 additions and 159 deletions
+8 -25
View File
@@ -1,41 +1,24 @@
# otp_workflow_screen.py
from typing import List
from textual.app import ComposeResult
from textual.screen import Screen
from models.agent import Agent
from widgets.multiagentselector import MultiAgentSelector
from widgets.OTP_generate import OTPGenerator
class OTPWorkflowScreen(Screen):
"""Screen that handles the OTP generation workflow."""
"""Screen that handles the OTP generation workflow without agent selection."""
def __init__(self, all_agents: List[Agent]):
def __init__(self, selected_agents: List[Agent]):
super().__init__()
self.all_agents = all_agents
self.selected_devices = None
self.selected_agents = selected_agents
def compose(self) -> ComposeResult:
"""Start with the multi-agent selector."""
yield MultiAgentSelector(self.all_agents)
def on_multi_agent_selector_agents_selected(
self, message: MultiAgentSelector.AgentsSelected
) -> None:
"""Handle selected agents - switch to OTP generator."""
self.selected_devices = message.selected_agents
# Remove the MultiAgentSelector
selector = self.query_one(MultiAgentSelector)
selector.remove()
# Mount the OTPGenerator with the selected Agent objects
# No need to pass API - it will access self.app.api directly
self.mount(OTPGenerator(self.selected_devices))
"""Directly show the OTP generator for the selected agents."""
yield OTPGenerator(self.selected_agents)
def on_otp_generator_otp_info(self, message: OTPGenerator.OTPInfo) -> None:
"""Handle OTP generation request - call the actual OTP generation function."""
# This will be handled by the main app, but we can also do it here
# For now, just pass it up to the app level
pass
"""Handle OTP generation request - pass it up to the app level if needed."""