Skip to content

Commit

Permalink
[OPIK-373] Truncate images in the traces/spans table (only display th…
Browse files Browse the repository at this point in the history
…em in the sidebar) (#600)
  • Loading branch information
ferc authored Nov 11, 2024
1 parent 4eea627 commit 023e88c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
13 changes: 12 additions & 1 deletion apps/opik-frontend/src/api/traces/useSpansList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ type UseSpansListParams = {
search?: string;
page: number;
size: number;
truncate?: boolean;
};

export type UseSpansListResponse = {
Expand All @@ -21,7 +22,16 @@ export type UseSpansListResponse = {

const getSpansList = async (
{ signal }: QueryFunctionContext,
{ projectId, traceId, type, filters, search, size, page }: UseSpansListParams,
{
projectId,
traceId,
type,
filters,
search,
size,
page,
truncate,
}: UseSpansListParams,
) => {
const { data } = await api.get(SPANS_REST_ENDPOINT, {
signal,
Expand All @@ -32,6 +42,7 @@ const getSpansList = async (
...processFilters(filters, generateSearchByIDFilters(search)),
size,
page,
truncate,
},
});

Expand Down
4 changes: 3 additions & 1 deletion apps/opik-frontend/src/api/traces/useTracesList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ type UseTracesListParams = {
search?: string;
page: number;
size: number;
truncate?: boolean;
};

export type UseTracesListResponse = {
Expand All @@ -19,7 +20,7 @@ export type UseTracesListResponse = {

const getTracesList = async (
{ signal }: QueryFunctionContext,
{ projectId, filters, search, size, page }: UseTracesListParams,
{ projectId, filters, search, size, page, truncate }: UseTracesListParams,
) => {
const { data } = await api.get<UseTracesListResponse>(TRACES_REST_ENDPOINT, {
signal,
Expand All @@ -28,6 +29,7 @@ const getTracesList = async (
...processFilters(filters, generateSearchByIDFilters(search)),
size,
page,
truncate,
},
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export const TracesSpansTab: React.FC<TracesSpansTabProps> = ({
page: page as number,
size: size as number,
search: search as string,
truncate: true,
},
{
placeholderData: keepPreviousData,
Expand Down
1 change: 1 addition & 0 deletions apps/opik-frontend/src/hooks/useTracesOrSpansList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type UseTracesOrSpansListParams = {
search?: string;
page: number;
size: number;
truncate?: boolean;
};

type UseTracesOrSpansListResponse = {
Expand Down

0 comments on commit 023e88c

Please sign in to comment.