SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.
TypeScript apmapplication-monitoringdistributed-tracinggogood-first-issuejaegerloglogsmetricsmonitoringnextjsobservabilityopen-sourceopentelemetryprometheusreactreactjsself-hostedtracingtypescript
feat(FE:TraceGanttChart): scroll to selected row on page load (#213)
NIDHI TANDONbeb15e0a5ffb
diff --git a/frontend/src/modules/Traces/TraceGanttChart/TraceGanttChart.tsx b/frontend/src/modules/Traces/TraceGanttChart/TraceGanttChart.tsxindex 7197a9cd04..b79bc11938 100644--- a/frontend/src/modules/Traces/TraceGanttChart/TraceGanttChart.tsx+++ b/frontend/src/modules/Traces/TraceGanttChart/TraceGanttChart.tsx@@ -57,7 +57,7 @@ const TraceGanttChart = ({}setTabsContainerWidth(tabsContainer?.offsetWidth);}- // handleScroll(selectedSpan?.id);+ handleScroll(selectedSpan?.id);}, [sortedTreeData, treeData, clickedSpan]);useEffect(() => {@@ -229,7 +229,7 @@ const TraceGanttChart = ({};const handleResetFocus = () => {- let rows = document.querySelectorAll("#collapsable table tbody tr");+ const rows = document.querySelectorAll("#collapsable table tbody tr");Array.from(rows).map((row) => {row.classList.remove("hide");});@@ -237,16 +237,13 @@ const TraceGanttChart = ({resetZoom(true);};- const handleScroll = (id) => {- let rows = document.querySelectorAll("#collapsable table tbody tr");- const table = document.querySelectorAll("#collapsable table");- Array.from(rows).map((row) => {- let attribKey = row.getAttribute("data-row-key");- if (id === attribKey) {- let scrollValue = row.offsetTop;- table[1].scrollTop = scrollValue;- }- });+ const handleScroll = (id: string): void => {+ if (!isEmpty(id)) {+ const selectedRow = document.querySelectorAll<HTMLElement>(+ `[data-row-key='${id}']`,+ );+ selectedRow?.[0]?.scrollIntoView();+ }};const rowSelection = {