@frontend/lib/filter-utils.ts:64-149 @frontend/lib/filter-utils.ts:64-149 each of these three functions is basically a custom helper for construcitng a url that's specific to each trace filter component. this should just be one function to build the filter url, simple. make that update
Let me read the full file to understand the context and then consolidate these functions.
Let me check how these functions are used in the components.
Let me also see the exact usages in the page component.
Now I understand the usage. I'll consolidate these into one simple buildFilterUrl function with an optional pathname parameter, removing createFilterModeUrl and toggleFilter.
Now let me update the page component to use the simplified function.
Let me verify the sidebar still works correctly with the changes.
The sidebar logic looks fine - it correctly manages when tool_call is in the filters. Let me check for any linter errors.
Those lint errors are pre-existing (the id as any casts). Let me verify the final state of the filter-utils file.
Done. I consolidated the three functions into one buildFilterUrl function:
Changes:
buildFilterUrl, toggleFilter, and createFilterModeUrl into a single buildFilterUrlpathname parameter - returns full path when provided, otherwise just the query stringtoolType handling - only includes tool types in URL when tool_call filter is activepage.tsx (it's ~6 lines, clearer to read inline)Usage now:
buildFilterUrl(filters, toolTypes, searchParams)buildFilterUrl(filters, toolTypes, searchParams, pathname)buildFilterUrl([mode], [], searchParams, pathname)The file went from 149 lines → 100 lines.