发布

  • [OPIK-5784] [FE] Forward structured search to router.navigate (#6185)

    frostbyte_neo 发布于 2026-04-10 15:41:38 +00:00

    Fix Ollie claiming to apply trace filters while the UI stayed unfiltered.
    The sidebar bridge now accepts Record<string, unknown> for navigate
    search, matching the ollie-assist backend change that sends filter
    arrays as real JSON instead of pre-serialized strings.

    Why the old code was broken: the previous Record<string, string> type
    forced the backend to pre-serialize filters as JSON strings. TanStack
    Router's stringifySearchWith then detected the string was valid JSON
    and double-encoded it (so its own defaultParseSearch could round-trip
    via JSON.parse). But the logs page reads filters via use-query-params'
    JsonParam, which does a single JSON.parse, so the filter array came
    back as a string and setFilters received the wrong type. Manual UI
    code was unaffected because it passes arrays directly, hitting the
    object branch (single stringify).

    Passing objects through unchanged lets TanStack Router take the object
    branch for structured values, which round-trips correctly with
    JsonParam on the read side.

    • types/assistant-sidebar.ts: SidebarEventMap.navigate.search is
      Record<string, unknown> with rationale comment
    • plugins/comet/AssistantSidebar.tsx: BridgeRefs.navigate and
      navigateRef updated; search is passed straight to router.navigate

    Requires companion backend PR: comet-ml/ollie-assist#174

    下载附件