@odigos/ui-kit 0.0.91 → 0.0.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.92](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.91...ui-kit-v0.0.92) (2025-08-25)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **trace-view:** more visual fixes ([#347](https://github.com/odigos-io/ui-kit/issues/347)) ([defa80c](https://github.com/odigos-io/ui-kit/commit/defa80c9f45a668a365d6b8754ace78444b8ab42))
|
|
9
|
+
|
|
3
10
|
## [0.0.91](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.90...ui-kit-v0.0.91) (2025-08-24)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { type Metrics } from '@/types';
|
|
3
3
|
interface DataFlowProps {
|
|
4
|
-
heightToRemove:
|
|
4
|
+
heightToRemove: number;
|
|
5
5
|
metrics: Metrics;
|
|
6
6
|
}
|
|
7
7
|
declare const DataFlow: React.FC<DataFlowProps>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { type ServiceMapSources } from '@/types';
|
|
3
3
|
interface ServiceMapProps {
|
|
4
|
-
heightToRemove:
|
|
4
|
+
heightToRemove: number;
|
|
5
5
|
serviceMap: ServiceMapSources;
|
|
6
6
|
}
|
|
7
7
|
declare const ServiceMap: React.FC<ServiceMapProps>;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { type FC } from 'react';
|
|
2
2
|
import type { Trace } from '@/types';
|
|
3
|
-
import { CSSProperties } from 'styled-components';
|
|
4
3
|
interface TraceViewProps {
|
|
5
|
-
heightToRemove:
|
|
4
|
+
heightToRemove: number;
|
|
6
5
|
traces: Trace[];
|
|
7
6
|
}
|
|
8
7
|
declare const TraceView: FC<TraceViewProps>;
|
|
@@ -14,10 +14,20 @@ interface SpanProps {
|
|
|
14
14
|
withToggle?: boolean;
|
|
15
15
|
onToggleOpen?: () => void;
|
|
16
16
|
}
|
|
17
|
+
interface RecursiveSpansProps {
|
|
18
|
+
spans: TraceSpan[];
|
|
19
|
+
logs: TraceLog[];
|
|
20
|
+
depth: number;
|
|
21
|
+
indexInMatrix: number;
|
|
22
|
+
maxDuration: number;
|
|
23
|
+
minStartTime: number;
|
|
24
|
+
maxEndTime: number;
|
|
25
|
+
openSpanIdsState: {
|
|
26
|
+
value: string[];
|
|
27
|
+
set: React.Dispatch<React.SetStateAction<string[]>>;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
17
30
|
export declare const LEFT_MAX_WIDTH = 370;
|
|
18
31
|
declare const Span: FC<SpanProps>;
|
|
19
|
-
declare const
|
|
20
|
-
|
|
21
|
-
set: React.Dispatch<React.SetStateAction<string[]>>;
|
|
22
|
-
}) => React.JSX.Element[];
|
|
23
|
-
export { Span, type SpanProps, renderSpans };
|
|
32
|
+
declare const RecursiveSpans: FC<RecursiveSpansProps>;
|
|
33
|
+
export { Span, type SpanProps, RecursiveSpans };
|
package/lib/containers.js
CHANGED
|
@@ -1614,7 +1614,7 @@ const buildDestinationNodes = ({ loading, entities, positions, unfilteredCount,
|
|
|
1614
1614
|
|
|
1615
1615
|
const Container$h = styled.div `
|
|
1616
1616
|
width: 100%;
|
|
1617
|
-
height: ${({ $heightToRemove }) => `calc(100vh - ${$heightToRemove})`};
|
|
1617
|
+
height: ${({ $heightToRemove }) => `calc(100vh - ${$heightToRemove}px)`};
|
|
1618
1618
|
position: relative;
|
|
1619
1619
|
`;
|
|
1620
1620
|
const DataFlow = ({ heightToRemove, metrics }) => {
|
|
@@ -3821,7 +3821,7 @@ const buildMapNodes = ({ sources, serviceMap, containerHeight, containerWidth })
|
|
|
3821
3821
|
|
|
3822
3822
|
const Container$7 = styled.div `
|
|
3823
3823
|
width: 100%;
|
|
3824
|
-
height: ${({ $heightToRemove }) => `calc(100vh - ${$heightToRemove})`};
|
|
3824
|
+
height: ${({ $heightToRemove }) => `calc(100vh - ${$heightToRemove}px)`};
|
|
3825
3825
|
position: relative;
|
|
3826
3826
|
`;
|
|
3827
3827
|
const userSource = {
|
|
@@ -5239,7 +5239,6 @@ const Left = styled(FlexRow) `
|
|
|
5239
5239
|
padding: 12px;
|
|
5240
5240
|
padding-left: ${({ $depth }) => $depth * 12 || 12}px;
|
|
5241
5241
|
width: calc(${LEFT_MAX_WIDTH}px - ${({ $depth }) => $depth * 12}px);
|
|
5242
|
-
overflow: auto;
|
|
5243
5242
|
`;
|
|
5244
5243
|
const Right = styled(FlexRow) `
|
|
5245
5244
|
position: absolute;
|
|
@@ -5266,12 +5265,12 @@ const DurationText = styled(Text) `
|
|
|
5266
5265
|
const Span = ({ span, depth, indexInMatrix, maxDuration, minStartTime, maxEndTime, withErrors, errorTooltip, isOpen, withToggle, onToggleOpen }) => {
|
|
5267
5266
|
const theme = Theme.useTheme();
|
|
5268
5267
|
const textMaxWidth = LEFT_MAX_WIDTH -
|
|
5268
|
+
// 12px times depth is the left padding, 12px is the right padding
|
|
5269
|
+
12 * depth -
|
|
5269
5270
|
// 24px is the width of the toggle icon, 4px is the gap between the toggle icon and the text
|
|
5270
|
-
(
|
|
5271
|
+
(24 - 4) -
|
|
5271
5272
|
// 16px is the width of the error icon, 4px is the gap between the text and the error icon
|
|
5272
|
-
(withErrors ? 16 - 4 : 0)
|
|
5273
|
-
// 12px times depth is the left padding, 12px is the right padding
|
|
5274
|
-
12 * depth;
|
|
5273
|
+
(withErrors ? 16 - 4 : 0);
|
|
5275
5274
|
const withErrorIcon = withErrors && (depth === 1 || span.logs.length > 0);
|
|
5276
5275
|
return (React.createElement(Container$1, { className: 'span-container', "$withErrors": withErrors },
|
|
5277
5276
|
React.createElement(Left, { "$depth": depth, className: 'span-left' },
|
|
@@ -5284,13 +5283,14 @@ const Span = ({ span, depth, indexInMatrix, maxDuration, minStartTime, maxEndTim
|
|
|
5284
5283
|
withErrors &&
|
|
5285
5284
|
(withErrorIcon ? (React.createElement(Tooltip, { ...errorTooltip },
|
|
5286
5285
|
React.createElement(ErrorTriangleIcon, { fill: theme.text.error }))) : (React.createElement("div", { style: { position: 'relative' } },
|
|
5287
|
-
React.createElement("div", { style: { position: 'absolute', top: '-
|
|
5288
|
-
React.createElement(Divider, { type: StatusType.Error, orientation: 'vertical', thickness: 1, length: '
|
|
5286
|
+
React.createElement("div", { style: { position: 'absolute', top: '-24px', right: '8px' } },
|
|
5287
|
+
React.createElement(Divider, { type: StatusType.Error, orientation: 'vertical', thickness: 1, length: '48px', margin: '0', opacity: 0.5 })))))),
|
|
5289
5288
|
React.createElement(Right, { className: 'span-right' },
|
|
5290
5289
|
React.createElement(DurationBar, { "$indexInMatrix": indexInMatrix, "$duration": span.duration, "$maxDuration": maxDuration, "$startTime": span.startTime, "$minStartTime": minStartTime, "$maxEndTime": maxEndTime },
|
|
5291
5290
|
React.createElement(DurationText, null, formatDuration(span.duration))))));
|
|
5292
5291
|
};
|
|
5293
|
-
const
|
|
5292
|
+
const RecursiveSpans = ({ spans, logs, depth, indexInMatrix, maxDuration, minStartTime, maxEndTime, openSpanIdsState }) => {
|
|
5293
|
+
const theme = Theme.useTheme();
|
|
5294
5294
|
return spans.map((span, i) => {
|
|
5295
5295
|
const id = span.spanID;
|
|
5296
5296
|
const isOpen = openSpanIdsState.value.includes(id);
|
|
@@ -5299,7 +5299,7 @@ const renderSpans = (spans, logs, depth, indexInMatrix, maxDuration, minStartTim
|
|
|
5299
5299
|
const withErrors = allLogs.length > 0;
|
|
5300
5300
|
const errorTitle = withErrors ? (allLogs.length > 1 ? `(${allLogs.length}) errors` : allLogs[0].fields.find((field) => field.key === 'exception.message')?.value) : undefined;
|
|
5301
5301
|
const errorMessage = withErrors ? (allLogs.length > 1 ? undefined : allLogs[0].fields.find((field) => field.key === 'exception.stacktrace')?.value) : undefined;
|
|
5302
|
-
return (React.createElement(
|
|
5302
|
+
return (React.createElement("div", { key: `span-${id}`, style: { borderBottom: depth === 1 ? `1px dotted ${theme.colors.border}` : 'none' } },
|
|
5303
5303
|
React.createElement(Span, { span: span, depth: depth, indexInMatrix: indexInMatrix + i + depth, maxDuration: maxDuration, minStartTime: minStartTime, maxEndTime: maxEndTime, withErrors: withErrors, errorTooltip: {
|
|
5304
5304
|
titleIcon: ErrorTriangleIcon,
|
|
5305
5305
|
title: errorTitle,
|
|
@@ -5310,7 +5310,7 @@ const renderSpans = (spans, logs, depth, indexInMatrix, maxDuration, minStartTim
|
|
|
5310
5310
|
return prev.filter((st) => st != id);
|
|
5311
5311
|
return [...prev, id, ...getRecursiveValues(span, 'spans', 'spanID')];
|
|
5312
5312
|
}) }),
|
|
5313
|
-
isOpen && hasChildSpans ?
|
|
5313
|
+
isOpen && hasChildSpans ? (React.createElement(RecursiveSpans, { spans: span.spans || [], logs: allLogs, depth: depth + 1, indexInMatrix: indexInMatrix + i, maxDuration: maxDuration, minStartTime: minStartTime, maxEndTime: maxEndTime, openSpanIdsState: openSpanIdsState })) : null));
|
|
5314
5314
|
});
|
|
5315
5315
|
};
|
|
5316
5316
|
|
|
@@ -5318,7 +5318,7 @@ const Container = styled.div `
|
|
|
5318
5318
|
width: 100%;
|
|
5319
5319
|
`;
|
|
5320
5320
|
const ContainSpans = styled.div `
|
|
5321
|
-
max-height: ${({ $heightToRemove }) => `calc(100vh - ${$heightToRemove} + 2px)`};
|
|
5321
|
+
max-height: ${({ $heightToRemove }) => `calc(100vh - ${$heightToRemove}px + 2px)`};
|
|
5322
5322
|
overflow: auto;
|
|
5323
5323
|
|
|
5324
5324
|
display: flex;
|
|
@@ -5336,8 +5336,9 @@ const ContainTitle = styled.div `
|
|
|
5336
5336
|
const NUM_OF_DURATION_DIVIDERS = 5;
|
|
5337
5337
|
const DurationDivider = styled.div `
|
|
5338
5338
|
width: 1px;
|
|
5339
|
-
height: ${({ $heightToRemove }) => `calc(100vh - ${$heightToRemove} + 2px)`};
|
|
5340
|
-
|
|
5339
|
+
height: ${({ $heightToRemove }) => `calc(100vh - ${$heightToRemove}px + 2px)`};
|
|
5340
|
+
background: ${({ theme }) => `linear-gradient(to bottom, ${theme.colors.border}, transparent)`};
|
|
5341
|
+
|
|
5341
5342
|
position: fixed;
|
|
5342
5343
|
left: calc(${LEFT_MAX_WIDTH + 18}px + ((100% - ${LEFT_MAX_WIDTH}px) / ${NUM_OF_DURATION_DIVIDERS}) * ${({ index }) => index});
|
|
5343
5344
|
z-index: -1;
|
|
@@ -5371,10 +5372,10 @@ const TraceView = ({ heightToRemove, traces }) => {
|
|
|
5371
5372
|
const minStartTime = spans.reduce((min, span) => Math.min(min, span.startTime), Number.MAX_SAFE_INTEGER);
|
|
5372
5373
|
// is equal CSS left: 100%;
|
|
5373
5374
|
const maxEndTime = spans.reduce((max, span) => Math.max(max, span.startTime + span.duration), 0);
|
|
5374
|
-
return
|
|
5375
|
-
|
|
5376
|
-
|
|
5377
|
-
|
|
5375
|
+
return (React.createElement(RecursiveSpans, { key: `recursive-spans-${trace.traceID}`, spans: spans, logs: [], depth: 1, indexInMatrix: i, maxDuration: maxDuration, minStartTime: minStartTime, maxEndTime: maxEndTime, openSpanIdsState: {
|
|
5376
|
+
value: openSpanIds,
|
|
5377
|
+
set: setOpenSpanIds,
|
|
5378
|
+
} }));
|
|
5378
5379
|
}),
|
|
5379
5380
|
new Array(NUM_OF_DURATION_DIVIDERS).fill(null).map((_, i) => (React.createElement(DurationDivider, { key: `${i}-divider`, "$heightToRemove": heightToRemove, index: i },
|
|
5380
5381
|
React.createElement(DurationTitle, null, formatDuration((maxDuration / NUM_OF_DURATION_DIVIDERS) * i))))))) : (React.createElement(CenterThis, { "$height": '50vh' },
|