mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-08-23 15:25:28 +00:00
Introduce a WebUI extension manifest and rewrite the asset bundler/server to support caller-supplied entry sets, extension-injected entries, and negotiated gzip. Key changes: add get_webui_extension_manifest() to helpers/extension, refactor Stop logic into stop_context() and reuse it from the connector `/stop` command, and add a new `/rename` slash command for chat naming. ui_bundler now accepts entry_urls, includes enabled extension entry files, raises the embedded text file size limit to 512 KiB, computes per-entry-set cache keys, and returns a bundle version based on the bundle signature. ui_server applies Starlette GZip middleware, adds routes (/, /index.html, /ui/index, /safe), serves splash/safe documents, injects the serialized webui_extension_manifest into the rendered index, and streamlines the /ui/asset-bundle endpoint with ETag and gzip handling. Also add multiple WebUI assets and fonts, new/updated plugin command YAML and Python command handlers, and corresponding tests covering bundling, commands, chat naming, and WebUI behaviors. Documentation (.dox.md) updated to reflect the new runtime contracts and guidance.
4 KiB
4 KiB
WebUI CSS DOX
Purpose
- Own shared stylesheet modules for the WebUI.
- Keep shared visual primitives stable across components and pages.
Ownership
- Each CSS file owns a named surface or primitive family such as buttons, messages, modals, notifications, scheduler, settings, surfaces, tables, or toast.
loading-indicators.cssowns reusable loading visuals;messages.cssowns chat-history paging placement, the context-switch splash surface, and lazy message-preview states in addition to message presentation.- Component-specific styles should usually stay inside the component HTML unless they are intentionally shared.
modals.cssowns the shared stacked modal shell, backdrop, scroll area, footer slot, modal button classes, floating/no-backdrop modal behavior, and shared modal section primitives.surfaces.cssowns surface modal switchers, action rails, draggable header affordances, focus-button state, and right-canvas surface primitives.index.cssdefines global theme variables such as--color-*,--spacing-*,--font-size-*, and--transition-speed.
Local Contracts
- Use existing CSS variables and naming patterns before introducing new global tokens.
- Avoid broad selectors that unexpectedly restyle plugin UI or unrelated components.
- Keep layout rules responsive and verify text does not overflow fixed controls.
- Shared modal buttons use
btn btn-okfor positive actions andbtn btn-cancelfor dismissive or negative actions. - Shared compact text actions use
.text-button; component-local styles may adjust layout or sizing but must not be the only definition of the primitive. - Modal footer action order is positive action first, dismissive or negative action second.
- Modal footers use
.modal-footerplusdata-modal-footer; do not redefine.btn,.modal-footer,.modal-inner, or.modal-scrollinside components. - Shared modal sizing keeps
.modal-innercentered withwidth: 90%,max-width: 960px, andmax-height: 90vh. - Tall modal bodies must scroll inside
.modal-scroll; pinned footer content must stay outside that scroll area. .modal-floatingmust keep the full-screen shell pointer-transparent while.modal-innerremains pointer-active.- Use
.modal-no-backdroponly for backdrop suppression without click-through floating behavior. - Shared modal layers must stay above the mobile right-canvas rail while confirmation dialogs remain above normal modals.
- Generic
.loadingplaceholders and their shimmer pseudo-elements remain invisible for the default 500ms loading delay. - Shared message collapsing targets
.message-collapse-content; user-message attachments must remain outside that target so expanding text never changes attachment visibility. - The virtualized chat history disables native scroll anchoring and replay fade-in motion; the message-window renderer owns anchor restoration during atomic page swaps.
- The persistent right panel transitions its background symmetrically between Welcome and chat in 200ms; the Welcome container remains transparent so it cannot hide the return transition.
- Do not add decorative one-note palette changes that conflict with existing WebUI design.
Work Guidance
- Keep shared CSS small and scoped to clear class families.
- Coordinate class renames with all component and plugin references.
- Prefer improving an existing primitive over creating a near-duplicate style family.
- Use component-local styles for unique layouts and shared CSS for repeated primitives such as modal sections, toolbars, buttons, tables, notifications, and surfaces.
- Preserve modal sizing and scrolling expectations: centered
.modal-inner, constrained viewport height, body scroll inside.modal-scroll, and footer outside the scroll area.
Verification
- Manually inspect affected WebUI screens at desktop and mobile widths for shared CSS changes.
- Run visual or frontend tests if the touched style has coverage.
- For modal CSS, test a tall modal, a footer modal, a stacked modal, and a floating modal.
Child DOX Index
No child DOX files.