diff --git a/webui.py b/webui.py index 5023302..f566287 100644 --- a/webui.py +++ b/webui.py @@ -540,8 +540,7 @@ async def run_with_stream( max_input_tokens=max_input_tokens ) # Add HTML content at the start of the result array - html_content = f"

Using browser...

" - yield [html_content] + list(result) + yield [gr.update(visible=False)] + list(result) else: try: # Run the browser agent in the background @@ -593,7 +592,7 @@ async def run_with_stream( if _global_agent and _global_agent.state.stopped: yield [ - html_content, + gr.HTML(value=html_content, visible=True), final_result, errors, model_actions, @@ -607,7 +606,7 @@ async def run_with_stream( break else: yield [ - html_content, + gr.HTML(value=html_content, visible=True), final_result, errors, model_actions, @@ -634,7 +633,7 @@ async def run_with_stream( errors = f"Agent error: {str(e)}" yield [ - html_content, + gr.HTML(value=html_content, visible=True), final_result, errors, model_actions, @@ -649,7 +648,9 @@ async def run_with_stream( except Exception as e: import traceback yield [ - f"

Waiting for browser session...

", + gr.HTML( + value=f"

Waiting for browser session...

", + visible=True), "", f"Error: {str(e)}\n{traceback.format_exc()}", "", @@ -947,6 +948,7 @@ def create_ui(config, theme_name="Ocean"): browser_view = gr.HTML( value="

Waiting for browser session...

", label="Live Browser View", + visible=False ) gr.Markdown("### Results") @@ -1070,13 +1072,13 @@ def create_ui(config, theme_name="Ocean"): with gr.TabItem("📁 UI Configuration", id=8): config_file_input = gr.File( - label="Load Config File", + label="Load UI Settings from Config File", file_types=[".pkl"], interactive=True ) with gr.Row(): - load_config_button = gr.Button("Load Existing Config From File", variant="primary") - save_config_button = gr.Button("Save Current Config", variant="primary") + load_config_button = gr.Button("Load Config", variant="primary") + save_config_button = gr.Button("Save UI Settings", variant="primary") config_status = gr.Textbox( label="Status",