发布

  • [OPIK-4987] [FE][BE] Add assistant sidebar integration (#5865)

    frostbyte_neo 发布于 2026-03-26 14:33:22 +00:00

    • [OPIK-4987] [FE][BE] Add Ollie assistant sidebar integration

    Add iframe-based assistant sidebar with portal containment to prevent
    UI overlaps between the Opik app and the sidebar.

    Portal containment:

    • Add PortalContainerProvider context to redirect all Radix portals
      into the host container div instead of document.body
    • Add collisionBoundary to all Radix floating components (popover,
      dropdown-menu, select, tooltip, hover-card, button-with-dropdown)
      so Floating UI respects the host container boundary
    • Add overflow-hidden + transform containment on host container for
      hard visual clipping of portaled content
    • Add portal container + collisionBoundary to DropdownMenuSubContent

    Sidebar integration:

    • Add AssistantSidebar component with iframe bridge architecture
    • Add ResizableSidePanel for sidebar resize handling
    • Add assistant-sidebar bridge types (host/sidebar event maps)
    • Wire sidebar into v2 PageLayout with feature flag gate
    • Gracefully handle unknown bridge events from newer sidebar versions

    Feature flag:

    • Add ASSISTANT_SIDEBAR_ENABLED to FE feature toggles
    • Add assistantSidebarEnabled to BE ServiceTogglesConfig + config.yml
    • Add AssistantSidebar to PluginsStore for comet plugin system

    Infrastructure:

    • Add nginx proxy rule for /assistant/ path
    • Update helm values with assistant sidebar URL config
    • Update vite dev proxy for assistant routes
    • Update Helm documentation

    • revert: remove assistant sidebar CI/CD deployment changes

    Not needed for initial integration. Will be added when
    the assistant is deployed to production CDN.

    • fix: use React state for assistant sidebar width CSS variable

    The inline style hardcoded --assistant-sidebar-width: 0px, which
    clobbered the runtime DOM mutation on every re-render. Now uses
    useState so the value persists across renders. Removes the unused
    sectionRef.

    • fix: derive bridge context URLs from env vars

    Replace hardcoded /api and /assistant-api with BASE_API_URL
    (from VITE_BASE_API_URL) and ASSISTANT_BACKEND_URL (from
    VITE_ASSISTANT_BACKEND_URL) to support non-root deployments.

    • refactor: use useQuery for assistant manifest fetch

    Replace manual useEffect + fetchManifest with TanStack Query.
    Cooldown/failure side effects handled inside queryFn. Dev mode
    returns a constant without fetching.

    • fix: handle all sidebar bridge emit events

    Add handlers for notification (forwards to useToast),
    sidebar:request-open, and sidebar:request-close (emit
    visibility:changed to sidebar listeners). Events are no
    longer silently dropped in production.

    • fix: emit visibility:changed on sidebar mount/unmount

    The sidebar iframe now receives visibility:changed true when
    the sidebar mounts and false when it unmounts.

    • Update Helm documentation

    • fix: resolve lint errors (prettier, tailwind class order)

    • fix: remove trailing blank line in main.scss (prettier)

    • Suppress no-project-importing-plugins violation for AssistantSidebar

    PageLayout imports AssistantSidebar directly from plugins as a dev-mode
    fallback. Added to known violations — will move fallback loading into
    PluginsStore in next iteration.


    Co-authored-by: CometActions github-actions@comet.com

    下载附件