mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-12-04 09:28:56 +00:00
Move the scheduler CRUD endpoints, modals, styles, sidebar tasks list, and task row into the _scheduler plugin and drop the core tasks components. The sidebar hosts plugin sections through a neutral sidebar-extensions point inside the extensions-section container instead of a tasks-specific one, so other plugins can contribute sections there too. The scheduler and datepicker styles load through the plugin page-head extension instead of core index.html preloads, and the shared flatpickr preload stays in core. Repoint the header scheduler entry at the plugin modal path and update the api and plugins DOX indexes. Pin indicators follow the relocated task row and the pin test reads it from the plugin. The chats store and core chat behavior adopt the plugin task store idiom, and the ws client surface test expects the plugin store accessor. The modals and css DOX drop their core scheduler ownership and the scheduler plugin DOX indexes its sidebar and page-head extensions. The plugin manifest becomes always enabled with a broader description so the Tasks UI stays core behavior, and the scheduler editor test follows the moved endpoint and store paths. Validation: pytest plugins/_pin_to_top/tests/test_pins.py tests/test_sidebar_row_actions.py tests/test_webui_extension_surfaces.py tests/test_ws_client_api_surface.py tests/test_webui_startup_assets.py::test_only_the_icon_guard_stylesheet_blocks_application_paint tests/test_chat_working_animation.py tests/test_scheduler_editor.py
61 lines
2.2 KiB
Python
61 lines
2.2 KiB
Python
from pathlib import Path
|
|
|
|
|
|
PROJECT_ROOT = Path(__file__).resolve().parents[1]
|
|
|
|
|
|
def test_running_chat_bubble_morphs_and_rotates_on_a_1500ms_cycle() -> None:
|
|
chats_list = (
|
|
PROJECT_ROOT / "webui/components/sidebar/chats/chats-list.html"
|
|
).read_text(encoding="utf-8")
|
|
|
|
assert ".chats-list-container .project-color-ball.heartbeat" in chats_list
|
|
assert (
|
|
"animation: chat-working-bubble 1500ms ease-in-out infinite;" in chats_list
|
|
)
|
|
assert "@keyframes chat-working-bubble" in chats_list
|
|
assert "border-radius: 0;" in chats_list
|
|
assert "transform: rotate(45deg) scale(0.9);" in chats_list
|
|
assert "transform: rotate(405deg) scale(0.9);" in chats_list
|
|
assert "transform: rotate(405deg) scale(1);" in chats_list
|
|
|
|
|
|
def test_chat_and_task_rows_reclaim_left_space_without_shifting_headers() -> None:
|
|
chats_list = (
|
|
PROJECT_ROOT / "webui/components/sidebar/chats/chats-list.html"
|
|
).read_text(encoding="utf-8")
|
|
left_sidebar = (
|
|
PROJECT_ROOT / "webui/components/sidebar/left-sidebar.html"
|
|
).read_text(encoding="utf-8")
|
|
|
|
assert "margin-inline-start: calc(0px - var(--spacing-md));" not in chats_list
|
|
assert left_sidebar.count(
|
|
"margin-inline-start: calc(0px - var(--spacing-sm));"
|
|
) == 2
|
|
assert left_sidebar.count("width: calc(100% + var(--spacing-sm));") == 2
|
|
assert (
|
|
"#chats-section .section-header-row,\n"
|
|
" #extensions-section .section-header {\n"
|
|
" margin-inline-start: var(--spacing-sm);"
|
|
) in left_sidebar
|
|
assert "flex: 1 1 auto;" in chats_list
|
|
assert "min-width: 0;" in chats_list
|
|
assert "padding: var(--spacing-xs);" in chats_list
|
|
|
|
|
|
def test_only_visible_chat_actions_take_width() -> None:
|
|
chats_list = (
|
|
PROJECT_ROOT / "webui/components/sidebar/chats/chats-list.html"
|
|
).read_text(encoding="utf-8")
|
|
|
|
assert ".device-pointer .chat-container .chat-list-action-btn" in chats_list
|
|
assert (
|
|
".device-touch .chat-container:not(.chat-selected) .chat-list-action-btn"
|
|
in chats_list
|
|
)
|
|
assert ".device-pointer .chat-container:hover .chat-list-action-btn" in chats_list
|
|
assert (
|
|
".device-touch .chat-container.chat-selected .chat-list-action-btn"
|
|
in chats_list
|
|
)
|