Skip to content

Refactor Web UI into Apps Pattern#91

Merged
martintb merged 3 commits intomainfrom
app_refactor
Mar 1, 2026
Merged

Refactor Web UI into Apps Pattern#91
martintb merged 3 commits intomainfrom
app_refactor

Conversation

@martintb
Copy link
Collaborator

@martintb martintb commented Mar 1, 2026

This pull request introduces a major refactor and enhancement to the Double Agent web application, focusing on modularizing reusable web endpoints, improving frontend robustness, and ensuring correct packaging of static assets. The most significant change is the creation of the AgentWebAppMixin class, which encapsulates all web app routes and static asset definitions for agent drivers, enabling code reuse and simplifying maintenance. Additionally, the frontend JavaScript is improved for better error handling and initialization, and the Python package is updated to include all necessary web assets. Comprehensive tests are added to verify the new backend and caching logic.

Backend refactor and new web app mixin:

  • Introduced AgentWebAppMixin in AFL/double_agent/AgentWebAppMixin.py, providing reusable web endpoints and static asset bindings for agent drivers. This includes HTML rendering, pipeline and input builder endpoints, pipeline operation management, tiled input group configuration, and utility endpoints for the web UI. All web-app-related backend logic is now consolidated in this mixin for maintainability and reusability.

Frontend improvements:

  • Updated main.js (moved to AFL/double_agent/apps/pipeline_builder/js/main.js) to handle backend responses that may include warnings, display these warnings in the UI, and robustly initialize the application by loading core pipeline state and operations in parallel with improved error reporting. [1] [2]

Packaging and static assets:

  • Modified pyproject.toml to ensure all HTML, CSS, JS, and SVG files under AFL/double_agent/apps are included in the package build, guaranteeing that all web assets are available when deployed.

Testing and validation:

  • Added comprehensive tests in tests/test_agentdriver_pipeline_ops.py to verify the caching behavior of pipeline operations, the correctness of static directory mappings, HTML rendering, app link setup, and backend method ownership in the new mixin.

Minor configuration changes:

  • Commented out unused test timing configuration in pyproject.toml for clarity.

@martintb martintb merged commit fad7a67 into main Mar 1, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant