From 718dbd612a1c462c421cb50a877c4cadc662f7cd Mon Sep 17 00:00:00 2001 From: Ivan Babrou Date: Thu, 23 Jun 2022 17:33:54 -0700 Subject: [PATCH] Store preferred span name column width in localStorage Different developers tend to look at different kinds of traces, meaning that they often prefer some set width of span name column in trace view. Without this patch, the width is set at 25% and it resets on refresh. With this patch the width is remembered in localStorage and preserved on refresh, making it less necessary to adjust. Signed-off-by: Ivan Babrou --- .../src/components/TracePage/TraceTimelineViewer/duck.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/duck.tsx b/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/duck.tsx index cb31245fc9..2d351a5649 100644 --- a/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/duck.tsx +++ b/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/duck.tsx @@ -52,7 +52,7 @@ export function newInitialState(): TTraceTimeline { detailStates: new Map(), hoverIndentGuideIds: new Set(), shouldScrollToFirstUiFindMatch: false, - spanNameColumnWidth: 0.25, + spanNameColumnWidth: parseFloat(localStorage.getItem('spanNameColumnWidth') || '0.25'), traceID: null, }; } @@ -162,6 +162,7 @@ function setTrace(state: TTraceTimeline, { uiFind, trace }: TTraceUiFindValue) { } function setColumnWidth(state: TTraceTimeline, { width }: TWidthValue): TTraceTimeline { + localStorage.setItem('spanNameColumnWidth', width.toString()); return { ...state, spanNameColumnWidth: width }; }